Add jquery datepicker dynamically after page load

Question: Upon a button click, I have some jquery that will add some html to the 'body' element.  In that html, I have a datepicker input field which refuses to appear when it should.
I use the ui-datepicker in several other spots in my app, and it works perfectly.
I have tried calling the datepicker when the document loads:
jQuery ->
  $('.my-datepicker-class').each ->
    input = $(this)
    input.datepicker()

and after the click event which adds the new html to the page:
$('.my-button').click ->
  $('body').ipadoverlay
    titleStyle: false
    contentWidth: 500
    topSpc: true
    content: $('#popup-for-' + thing_id).html()
  $('.my-datepicker-class').each ->
    input = $(this)
    input.datepicker()

But the picker refuses to show up.  My guess is that it has to do with when jquery builds and places the datepicker, but I really don't know.
Let me know if you have any ideas or could use more information.
UPDATE
I changed the way I call datepicker() so that it only applies to the element I want the datepicker attached to.
$('.ipadoverlay .date-picker').datepicker()

This eliminates the first issue with the .each =>.
Now it silently fails.  No error or warning.  The datepicker simply does not show up.
I am going to begin digging into jquery.ui.datepicker.js to see if I can figure out whats going on, but if you have any ideas why the datepicker fails to response, please let me know.
UPDATE 2
Ok, I got a step further.  The class 'hasDatepicker' was already attached to the element I want add the datepicker to (which means $('.date-picker').datepicker() was being called somewhere else, while the element was hidden and unused), but the datepicker didn't work.   I fixed this by removing the class from my element, and calling .datepicker() again
$('.ipadoverlay .date-picker').removeClass('hasDatepicker')
$('.ipadoverlay .date-picker').datepicker()

Now the datepicker shows up on click, but selecting a date doesn't do anything...  Help would be much appreciated
Answer: You need to use the fat arrow.  Your use of 'this' loses its context.
jQuery ->
  $('.my-datepicker-class').each => # <-- Fat arrow
    input = $(this)
    input.datepicker()

I'd explain, but coffeescript.org does a better job than I ever could.
Comment: Excellent. Thank you @mattmc3 That certainly got me to the next step!  Now I am getting an error from jquery.ui.datepicker.js:145

`_attachDatepicker: function(target, settings) {
  var nodeName, inline, inst;
  nodeName = target.nodeName.toLowerCase();`

with error: _Uncaught TypeError: Cannot call method 'toLowerCase' of undefined_


Why do high pressure multistage air compressor have different piston diameter sizes?

Question: I meant like this kind of compressor https://www.bauer-kompressoren.de/fileadmin/_processed_/csm_compressor-block-junior2_b92a76a02e.jpg
also would the compressor reach high pressure if the diameter of all the piston have same sizes
Comment: What a beautiful compressor! I see the remembers of the BRD in it. However, please try to formulate in round sentences, it is a professional forum, not only a webchat.
Answer: There is a simple reason and a useful added benefit.

As you compress air of a fixed mass it occupies less volume. If you give it more space again, it will immediatly decompress and the multiple stages become useless. If you give it just enough space to occupy at its current pressure, the air will compress further. You could reduce space by reducing the piston height but this will make it harder if not impossible to use only one motor for all stages and it will result in less compression per stage. You reduce diameter and leave height the same.
A higher pressure with the same diameter will result in a higher force. By decreasing the diameter the exerted force is limited somewhat. Note that this is much less important as it is only possible through the need of #1.

By using different diameters you can drive everything with one motor and have to exert less work. You can further reduce the needed work by cooling down the gas between stages. The compressor in your picture does this also; there are coils between the pistons that will release some heat to the outside. This effect could be improved by cooling the coils or possibly submerging the whole compressor for underwater use.
Also take a look at these articles on the subject:
https://www.quincycompressor.com/products/2-and-3-stage-air-compressors/
https://www.brighthubengineering.com/hvac/63725-effects-of-a-multi-stage-air-compressor/


Honda civic 1.4

Question: My daughter has a w reg Honda civic 1.4. she says there is a rattle from the back when she changes gear & also when dropping engine speed. What could it be? It is Sunday so can't find mechanic.
Comment: What year is the civic and how many miles?
Answer: The description doesn't say a lot, it might be anything. To me it seems like the rattle comes from the exhaust. It might be a sound of the engine (shooting vapors of fuel inside of an exhaust) and it is okay, but also it might be exhaust touching any other part of a car, like floor, rear axle, fuel tank etc. That might happen to older exhausts which might crack and change a shape.
 Get to the back of the car, grab it, and give it a shake. If it is similar sound then you found the issue. If not, I'd like to hear it then.
Comment: Could also be some internal part of the muffler being loose.

Honda civic 1.4


How to reset the built-in Dictionary app for Look Up function?

Question: After I downloaded some custom dictionaries, copy-paste them into ~/Library/Dictionaries folder, and reordered them in Dictionary app's Preferences, some options in the Preferences cannot be selected anymore (the check-sign cannot be selected, it blinks). How to solve this problem?
Comment: Sounds like one of the dictionaries is causing problems. Try removing all the ones you've added and then install them one at a time, checking the options.
Comment: @benwiggy: I'm trying reinstalling the macOS to solve this problem... I don't know where to download those built-in dictionaries.
Comment: Just remove those you've installed manually, reboot and see whether this helps. Reinstalling the OS for this seems to be a rather extreme measure.
Comment: @nohillside: Actually I only added and deleted those custom dictionaries and no touch anything else, and I did try reboot, but the problem remains. I also thought reinstalling the OS a bad idea, but I cannot find the solution for this problem... Anyway, thanks for your comment.
Answer: This is a bug specific to MacBook Pro 16-inch with Catalina 10.15.X (In my case X=2), so reinstall the OS will not help. If you're in the same situation, I can solve this problem for you as follows, which is my conclusion from the Apple Communities thread discussing the same problem:

Remove all folders under /System/Library/AssetsV2/PreinstalledAssetsV2/InstallWithOs/com_apple_MobileAsset_DictionaryServices_dictionaryOSX.
Restart your computer. (In my case the Look Up didn't show some dictionary definition before I restarted my computer.)


Why do I keep getting this error?

Question: I am getting this error message in the logs after installing RNG module for Drupal 8 and trying to submit a completed a event form. The error log contains this error.

Uncaught PHP Exception Drupal\Core\Entity\EntityStorageException: "Value is not a valid entity." at /home/vhosts/***********/public_html/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php line 757, referer: http://**********/node/add/event_1

Any idea on how I can resolve this please?
Answer: I eventually traced back the issue as being caused by the rules module not RNG. Removing the rules enabled me to save the event.

Why do I keep getting this error?


How to tracing script flow

Question: I'm fairly new to Powershell and have written some pretty large scripts ie a script that calls others scripts which have functions nested in other functions.  When I launch this script I sometimes get errors that I don't know where they came from.  Is there an easy way to see where this script terminated so I can troubleshoot the error?
Answer: You can use Set-PsDebug to get PowerShell to output almost every line it runs:
Set-PSDebug -Trace 1;

Only downside is you'll probably end up with a lot of output to wade through...
Comment: This is exactly what I was looking for.  However, I do see the big advantage in figuring out how to properly debug so I will look into that at a later time.
Answer: For debugging to see where your error's are coming from I suggest debugging with the ISE or with PowerGUI.
You can also get a transcript of you script using the Start-Transcript cmdlet which will write all console activity to file. So you can put statements such as Write-Host "Doing XYZ"  and those will show up in the transcript log.
If you catch exceptions with a try catch or use a trap you can write the line number and column of the exception like this:
$ErrorActionPreference = 'Stop'

trap {
  Write-Host "Error on line $($_.InvocationInfo.ScriptLineNumber)"
  exit 1
}

try {
    Get-Item DoesntExist
} catch {
    Write-Host ("Error occurred on line: " + $_.InvocationInfo.ScriptLineNumber)
}

$_.InvocationInfo has other details about were the error is coming from.
By setting $ErrorActionPreference = "Stop" you ensure that any error triggers the trap{} block, which in this case writes out the line the script got to and exits.
Comment: Added more about the `trap{}` handling of errors, since this enables general troubleshooting of any error without needing to put `try{} catch{}` around too many statements.
Answer: Normally the error includes the calling script.
Failing that you could try running the script ofr the Window PowerShell ISE in debug mode. This allows you to use break points and step through code.
Artile on using the ISE for debugging:
ISE debugging
regards
Arcass

How to tracing script flow


Show that xy=100. Given $2\log x^3y=6+3\log y-\log x$.

Question: Given $2\log x^3y=6+3\log y-\log x$, x and y are positive integers. Show that $xy=100$. I have tried until $x^7=10^6 y$. Now, my problem is how to prove $x=y$.
Comment: There must be some mistake - you can go no further than $x^7=10^6y$. The equation will hold for any $(x,y)$ that satisfy this condition.
Answer: The claim is not generally true. As a counterexample, the given equation is solved by $x=10^2$, $y=10^8$:
$2\log\left((10^2)^3\cdot 10^8\right) = 2\log\left(10^6\cdot 10^8\right) = 2\cdot 14 = 28 = 6 + 24 - 2 = 6 + 3\log 10^8 - \log 10^2$
Indeed, this equation should be solved by any $(x,y)$ satisfying your equation $x^7 = 10^6 y$, as long as x and y are positive. This puts $xy = \dfrac{x^8}{10^6}$, which only equals $100$ in the case where $x=10$.
Answer: Given that $x$ and $y$ are supposed to be integers, this is a number theory problem. My guess is that you should write the decomposition of $x$ and $y$ as products of prime numbers, i.e. $x = p_1^{\alpha_1}... p_r^{\alpha_r}$ and $y = q_1^{\beta_1}... q_s^{\beta_s}$, with $r, s \geq 1$, $p_1, p_2, ... p_r$ distinct prime numbers, same for $q_1, ... , q_s$, and exponents $\alpha_1, ... \alpha_r, \beta_1, ... \beta_s \geq 1$.
Once you have done that, see what the equation $x^7 = 10^6 y$ implies.


Powershell Header Record

Question: I have a scenario like below:
I have a .dat file where header field name which is coming as below example:
2_a 2_b 2_c 2_d 2_e - Header
a b c d e - Data
f g h I j - Trailer

Next time
1_a 1_b 1_c 1_d 1_e -Header
c d e f g -data
b d f j k - trailer

So I want to achieve like my header record number is dynamically changing. Is there any way that I can achieve it so that I will just put the value and it will pick that value before that...like if I will input value 3 the header record will become 3_a 3_b like that....
After that my data will come and then trailer...Please suggest me the process as I am new to powershell...
Answer: If you want to create a line like

2_a 2_b 2_c 2_d 2_e

or

1_a 1_b 1_c 1_d 1_e

dynamically, you could use the string format operator, -f, like this
$index = 2
$header = "{0}_a {0}_b {0}_c {0}_d {0}_e" -f $index

this will create the first header and save it to a variable. Change the $index variable to create another string with some other number instead.
See this link for more info on its usage.

Powershell Header Record


How to obtain real irreducible representation matrices for finite point groups?

Question: I would like to generate the irreducible representation matrices in real (not complex) form for any finite point group, in order to use them in a projection operator.
At least I require the diagonal elements (not its sum) of the representations.
does any one have a clue of how to obtain them?, a reference or whatever is welcome.
Thanks in advance.
Comment: By finite point group, do you just mean a finite group?
Comment: No. I mean a sub group of the orthogonal group O(3) that does not move at least one point and that does not contain infinitesimal rotations.
here that wikipedia says: https://en.wikipedia.org/wiki/Point_groups_in_three_dimensions
But maybe the method for getting the real irreducible representations matrices is the same in both cases (finite group or finite point group).  :P
Comment: The cyclic and dihedral groups are not difficult - their real representations all have dimensions $1$ or $2$. Magma can compute matrices for the irreducible rational representations of any finite group. As far as I can see, for the isoloated examples, like $S_4$, $A_5$, $S_4 \times C_2$, $S_5 \times C_2$, the real representations are all rational anyway, so they could all be computed.
Comment: oh, I didn't know about the software Magma until now. I just notice that there is an online calculator http://magma.maths.usyd.edu.au/calc/. I guess it is possible to use it to get the representations. As a example for $A_5$, how will be the input to get the real irreducible representation matrices?
Answer: Here is an example of using Magma to get representations of $A_5$. Unfortunately this is not working in the Magma calculator. I think this is because it is trying to look up some data from a database, and the calcualtor does not have access to this. I will report the problem.
<code>> G := AlternatingGroup(5);
> I := IrreducibleModules(G,Rationals());
> I;
[
    GModule of dimension 1 over Rational Field,
    GModule of dimension 4 over Rational Field,
    GModule of dimension 5 over Rational Field,
    GModule of dimension 6 over Rational Field
]
> r := Representation(I[4]);
> r( G!(2,3)(4,5) );
[-1  0  0  0  0  0]
[ 0  0  0  0  0 -1]
[ 0  0  0  0 -1  0]
[ 0  0  0 -1  0  0]
[ 0  0 -1  0  0  0]
[ 0 -1  0  0  0  0]
> r( G!(2,4,5) );
[ 0  0  0  0  1  0]
[ 0  0  0  1  0  0]
[ 0 -1  0  0  0  0]
[ 0  0 -1  0  0  0]
[ 0  0  0  0  0  1]
[ 1  0  0  0  0  0]
</code>
Comment: wow :O ,that is pretty cool. It is a shame that it can't be reproduced in the online calculator. I'm seeing that the matrix dimension of the example is 6, but if it is irreducible, it should not be at most of dimension 5?, maybe it so because the rational restriction. in that case, I guess it is possible in that program to build the matrices including the irrational numbers and maybe get a lower dimension of the irreducible representations.
Comment: Very thanks by your help. I've just found a paper (little oldie) where the real irreducible representations (IR) matrices for $A_5$ (the icosahedral group) are some how tabulated http://www.sciencedirect.com/science/article/pii/0749603687902126# . However the work to retype those about 1200 matrices (for $I_h$ PG) would be very cumbersome, that's why it would be a better idea to generate them, for any finite PG, at least for the $A_5$, or instead to get the matrices in a file which can be readed with awk or something, (I could obtain that file through the use of Magma if it were free xD).
Answer: At least for icosahedral groups (I, Ih), I found the real matrix representations  documented in the papers:

Pramana – J. Phys., Vol. 79, No. 6, 1365–1373 (DOI:10.1007/s12043-012-0334-1)
J. Chem. Inf. Comput. Sci. 2003, 43, 1763-1770 (DOI:10.1021/ci025614x)
Superlattices and Microstructures,Volume 3, Issue 4,1987, 391-398 (DOI:10.1016/0749-6036(87)90212-6)

3 years ago I did generate the real tables by myself by means of realizing a similarity transformation of the complex tables generators of Altmann and Herzig though. And I just very recently found the 1st and 2nd papers by chance :'D


Saving filtered results from an Excel workbook to a CSV file

Question: I have an Excel workbook with a lot of rows in it. I filter it using the values of one column and then I want to save the filtered results to a CSV file. When I do "Save as..." I get all the rows. I can copy paste the filtered results to another sheet and save from there but I'd rather not. It's Excel 2003 primarily.
Comment: AFAIK, it may not be possible until if we write some macro.
Comment: Install ASAP Utilities and you can do "Remove Hidden Rows" before you save the spreadsheet.
Answer: Use an advanced filter to filter and paste the results as values into a new worksheet in one go which at least saves a step and is probably more reproducable in fewer clicks every time after the first. You can also select only the columns you want and in any order.
Debra's site is probably the best resource for examples on this:
[www.contextures.com][1]
[1]: http:// www.contextures.com
Comment: I get a `You can only copy filtered data to the active sheet` error when trying this with Excel 2007 Advanced Filter 'Copy to another location' option.
Answer: CSV format will not save formatting, formulas or filtering, as you have discovered. You must either, only copy what you want to save to a new sheet and save it as CSV or save to an excel format.
Answer: Use a pivot table. Click on any location in your table, Click Insert, select Pivot Table, then set up the columns you want to keep. You can filter a Pivot table then save as CSV or text (tab delimited). It saves only the filtered pivot table.


Should I walk facing traffic when walking on a bike trail?

Question: When walking on a road, I walk facing traffic.  But when I walked facing traffic (thus on the left) on a bidirectional bike trail (with a yellow dashed dividing line) recently in Madison, Wisconsin, USA, I was yelled at to "keep right" by a cyclist heading toward me from ahead.  Should we walk facing traffic when walking on a bike trail?  There was no dedicated footpath and I think this bike trail is a multi-use trail, but there is no explicit indication of where pedestrians go.
Comment: Wasn't the bike traffic both ways? When coming from behind you riders will either yell "On your left" or "Keep right" to warn you of their approach so you don't divert into their path for some reason.
Comment: I understand better now. You should walk on the right side of the bike trail so with traffic. Slowest traffic is always on the right. [Here is an example](https://www.miamivalleytrails.org/safety-trail-etiquette)
Comment: "yelled at to "keep right"" - I would probably yell back: "your right or my right?"
Comment: @topshot The bike traffic was both ways.  The cyclist yelling at me was coming at me from ahead.  Edited question for clarification.
Comment: I searched this same question, because I just had a similar experience, also in Madison WI. I always stay to the left, just like on the road. It gives me time to see the bike coming and crowd the edge. Most importantly, my dog heels on the left, and knows to stay on the left side of the road. To change for a bike path would be confusing for him, and make it much more likely that he would step into the path of the bicycle. I see other folks with their dogs sticking to the left also. (I was thinking, if I had been on the right side, and started heading back one minute before, the bicyclist who y
Comment: The cyclist was an idiot.  Please feel free to disregard him.  Personally, as a cyclist, I'd much rather pass people who are facing me, so I know they'll see me and won't make some weird sudden movement into the middle of the path at the last moment just as I'm about to pass.
Answer: The usual expectation in the USA for shared use trails is that traffic keeps to the right and passes on the left. There are exceptions, though, which are usually marked on the trail itself or on signs. For example:

In Sacramento, California, and in Rhode Island, the rule is to keep left when walking (as you would on a road, facing traffic) and right when cycling. And some trails ask that all traffic keeps left.
What is more universal, however, is the yielding rule: horses have right of way, then pedestrians, then inline skaters, then cyclists.

In general, the higher traffic the trail experiences, the more likely it is to have specific controls such as trail markings and signs. Low traffic trails might not have any markings or signs.
As mentioned before, usually it's stay to the right, pass on the left, but it's worth checking for any local regulations in your area to see if different expectations hold.
And of course, the yielding rules mean the cyclist is the one who must slow down or even stop, and wait for pedestrians to give enough space to pass.
As a cyclist who uses such trails frequently and has done all over North America, I can say that the cyclist who passed you was most likely just taking out his frustrations on hapless you, who was just in the wrong place (!) at the wrong time.
As a cyclist, I fervently wish pedestrians would:

Be aware of their surroundings. I've lost count of how many times someone was out for a stroll on the trail and completely oblivious to the fact that anyone else was in the same universe. They wander and weave all over the trail without looking, making it unsafe for them and for me. Sticking to one side or the other means you don't walk right into a passing cyclist, or worse.

Move to one side when they hear the bell. Sometimes I encounter groups of pedestrians out for a walk and taking up the entire width of the trail, as if they were alone in a universe shared only between them. Sometimes they don't get out of the way until I'm close enough to smack them and frustrated enough to want to.

Control their dogs better. I've also lost count of how many times people have had their dogs off-leash, or worse, having a leash stretched across the trail where I'm about to cycle right into it. Dogs should stay on the same side of the trail as pedestrians, if they're even allowed at all.
Answer: As a cyclist (in Europe) I've never heard of such an expectation. It doesn't seem to make a lot of sense either -- as a walker your speed is significantly less than cyclists, so no matter which side you walk on about the same number of cyclists will need to veer around you, and there's not really an appreciable difference in how long they have to see you either.
In those circumstances the usual argument for walking to face traffic seems to be the only relevant consideration: It allows you to see traffic that is headed towards your position, and thus do your part to make the encounter smooth.
Really I think the most important point is to stick to some side of the path such that a cyclist coming from behind you can easily plan which side to pass you on.
As for the person shouting at you, I think he was just rude and his real message may have been "keep on whatever side of the path I'm not using at any given time".
You might have a better chance of getting an answer that covers any US-specific expectations by asking at Bicycles.
Comment: I feel that walking you are much slower than bikes, so keep the other side. But when you run and go as fast as many bikes keep the same side. (Dutch, so European, as well.)
Comment: Though, around here I have difficulty thinking of any mixed-use path that had marked lines to separate the directions of cycle traffic _without_ also explicitly setting aside part of the path for pedestrians -- so the problem doesn't really seem to arise in the first place.
Comment: @Willeke, Henning: mixed-use paths in the US typically *do* indicate that all traffic should keep right, at least in my experience, if they indicate anything.  I am unfamiliar with any reasoning behind this, but I would note that if two cyclists are approaching from opposite directions, such that cyclist A (in the lane with pedestrian P) cannot get around the pedestrian without colliding with cyclist B, then A must stop.  If P is walking in the same direction as the cycle traffic, then P can keep walking.  If P is walking against the cycle traffic, then P must also stop.
Answer: Since the question isn't tagged as USA-specific, I found myself wondering about the situation in the UK.  The Highway Code only mentions these paths once in the pedestrian section:

Rule 13
Routes shared with cyclists.  Some cycle tracks run alongside footpaths or pavements, using a segregating feature to separate cyclists from people on foot. Segregated routes may also incorporate short lengths of tactile paving to help visually impaired people stay on the correct side. On the pedestrian side this will comprise a series of flat-topped bars running across the direction of travel (ladder pattern). On the cyclist side the same bars are orientated in the direction of travel (tramline pattern). Not all routes which are shared with cyclists are segregated. Take extra care where this is so (see Rule 62).

So, no requirement of pedestrians, and only general guidance to take extra care on unsegregated cycle tracks.  That said, I for one do not regard use of a headset as being compatible with taking extra care.  Let's see Rule 62, which is in the cycling section:

Rule 62
Cycle Tracks. These are normally located away from the road, but may occasionally be found alongside footpaths or pavements. Cyclists and pedestrians may be segregated or they may share the same space (unsegregated). When using segregated tracks you MUST keep to the side intended for cyclists as the pedestrian side remains a pavement or footpath. Take care when passing pedestrians, especially children, older or disabled people, and allow them plenty of room. Always be prepared to slow down and stop if necessary. Take care near road junctions as you may have difficulty seeing other road users, who might not notice you.

The italics are mine; the bold text is in the original.  So on unsegregated tracks, the onus is principally on the cyclist to avoid any conflict with pedestrians.  In particular, the cyclist has no lawful expectation that (s)he will make unhindered or uninterrupted progress on such a track.  The courteous cyclist will slow down when approaching pedestrians on such a track, to give the pedestrians time to organise themselves to permit the lawful passage of the cyclist.  If approaching from behind, courteous use of the bell is advisable (Rule 66).
Comment: I have seen the tactile paving that you mention.  It is used on the divided path that I mention in my answer.  However, as I said in my answer, no one pays any attention at all.  I am happy to be cautious with pedestrians and young cyclists but I am disappointed that other healthy, adult cyclists care so little.
Comment: @badjohn if the track is segregated, cyclists **must** stay on the cycle side of it (Highway Act 1835 s72).  If that makes it too narrow to pass without slowing to a crawl, the cyclists must do so.  I'm pleased to say that in my experience where I live and cycle (Cambridge), segregated tracks are generally correctly observed.
Comment: The trouble is the difference between "must" and "do".  I guess that in Cambridge you have a greater number of cyclists than here (Warwickshire / Worcestershire) and have developed better behaviour.  If I rigidly stuck to the rules then I would suffer many collisions.  As I mention in my answer, I try but often the others don't yield and it is a choice of pass on the wrong side or crash.
Comment: @badjohn I think you are probably right about Cambridge.  However, I question your assumption that you'd suffer collision if you stuck to the rules, as the rules generally recommend slowing down and/or stopping in conflicted situations.  People charging ahead because they're sure they have the right of way - and I'm not suggesting you're one such - are not, generally, obeying the rules; they're riding/driving as if everyone **else** is obeying the rules, and that's not the same thing.
Comment: I slow down or even stop in these head on cases but often the other does not.  I have not yet been brave enough to hold my position until the last moment.  I have waited long enough that it would be difficult for the other to stop or avoid me.  Some will get annoyed at you for trying to stick to the rules.
Comment: I do likewise, and I think it's the other rider's problem if you, by being careful and obeying the rules, have frustrated their desire to charge onwards without hesitation or deviation.  Stick to your guns!  But here is probably not the place to continue this conversation.
Comment: I updated my answer to mention that my experience does not necessarily reflect the whole country but care is necessary if you are unfamiliar with the behaviour.
Answer: The 'rules' evolved over centuries and were not created with the advent of the automobile. The rule is a simple one; Pedestrians keep left; vehicles keep right except to pass.
the rationale is quite simple. humans do not have eyes in the back of our heads. Thus for safety we should face traffic - ALL vehicular traffic (cars, horses, bicycles, skateboarders, roller blades, etc...). This is because vehicles are traveling at much greater speeds. In many cases, by the time that a pedestrian hears the approaching vehicle from behind, there will be little or no time to react. And unfortunately, it is also a normal reaction for humans when suddenly confronted with a threat to panic. when facing traffic, there is a much lower likelihood of panic given the visual warning of the approaching threat, and the average person will not 'spook'. When a vehicle suddenly is made aware within feet behind a human, said human will likely jump and attempt to 'get out of the way'. In the case of walking on the right, said human will likely jump to the left to avoid the threat, DIRECTLY in the way of the vehicle which, following the rules of the road is also moving to the left.
THUS this rule evolved centuries ago to prevent humans from being hit by horses. This same logic still applies to bikes and cars.
Some states have encoded this commonsense rule into law, in other states, it is just a 'rule.' - SADLY, as we humans become lazier and drive everywhere, we tend to forget common sense rules that are not applied daily, and as 'drivers' of cars, we are used to being on the right. Thus, on the rare occasion that we do walk, we forget what we are supposed to do. Soooooo, remember, KEEP SAFE; Pedestrians left, vehicles keep right (except to pass).
PS, I have a scar up the back of my leg from learning this lesson the 'Hard Way' 25 years go. I was walking on the right, a bike approached me from behind, as he went to pass on the left I 'spooked' and jumped to the left right into his way. We crashed. He yelled at me; "Pedestrian's keep left, vehicles keep right!!! YOU MORON!!!" I limped home, looked it up in my state's driving manual and found that I was wrong, and he was right. Ive never forgotten it.
Answer: When you walk on the left side facing traffic both you and the bicycle have time to avert a crash. When you walk on the right with traffic there is only a couple seconds to crowd to the trail edge. Walking on the left is far safer
Answer: In a 2 lane bike path cyclists should ride in the right lane and pedestrians should walk in the left lane.

Most walkers and joggers wear headsets and can not hear you coming up behind them. So telling them you are going to pass on the left is useless.
Comment: Welcome to TSE, but your answer isn't clear to me: where do cyclists and pedestrians going in the opposite direction go? I would further add that whether faster traffic is on the left or right will depend on whether your locale is left-hand or right-hand drive.
Answer: Here in the UK, it is just anarchy on cycle paths.
In some countries, pedestrians behave similarly to drivers and typically pass each other as cars would on a road.  The UK is not such a country and when you approach another pedestrian you just have to figure how to pass each time.  Passing to the left (as you would in a car) is no more likely than to the right.  It is common to perform a little dance and collisions occasionally occur.  At walking speed, this is generally not serious.
Unfortunately, we seem to behave in the same way on cycle paths.  I would be pleased if other cyclists obeyed the road rules but few do.  I have no expectation of pedestrian behaviour at all.  When I approach another cyclist, I move to the left (UK road style) and hope that they do as well.  Quite often they stay to their right and we end up playing a game of chicken.  It is common to encounter a group of cyclists occupying the entire path who are oblivious to you (especially if you are approaching from behind) and sometimes reluctant to let you past even when they notice you.
Occasionally, there are markings.  E.g. one path I use frequently is divided into two: one side for pedestrians and one for cyclists.  The cyclists side is divided again but these lanes are so narrow that you could not safely stay in them while passing.  No one, neither pedestrians nor cyclists, pays any attention to these markings.
Addition: based on comments to another UK based answer, I will mention that this is my personal experience in Warwickshire and Worcestershire. In some other areas where there is greater cycle use, behaviour may be better.  However, since at least in some areas of the UK, the rules are not observed, I would recommend caution if cycling here for the first time.
Answer: In this COVID 19 year I have been walking and cycling a lot in the Netherlands, as have many others.
A lot of my cycling and walking is done in a nature reserve and most 'roads' there are cycling paths which are also allowed for use by people walking.
I personally keep the left on the cycle paths, facing the traffic, as I feel it is more safe that way.
Others keep to the right, as if they are the main traffic on the path. As a cyclist I do not mind but I feel it is the lesser choice.
What I can not understand is those people who walk each on a side of the road, so they can talk and look each other in the face, forcing others to find the middle of the path to pass them (often not getting the required distance from either of them,) and making it extra hard if cyclists use the road both directions and need to pass each other near or between those walkers. And that kind of people are not bothered by what others have to do or withstand as long as they themselves are not inconvenienced.
Coming to your Madison, Wisconsin problem, do the same as the other people walking do, and if there are no other people walking, keep to the side you feel it is the best, ignoring the things people passing by say, especially when they contradict each other.


Connecting / Soldering a Switch to Breadboard / PCB

Question: I'm pretty new to electronics and I have just found these toggle switches. But I can't figure out how the connectors on the bottom are called in the english language .. :) And also, is there a way to connect those to a standard breadboard (without soldering a wire to it)? And if you were to solder one on a PCB, how would you do it? Through-Hole?
Comment: Can you post a link to its datasheet, or part number and manufacturer? Judging from the screw-thread, and small lug visible abve the washer, it is designed for panel mount. However the datasheet should make that clear.
Comment: There are usually PCB mounting versions of these available. They have pins more suitable for PCB soldering.
Answer: If you are a cheap-skate, you can grind off one side of the lugs leaving a 'pin' that can be thru-hole soldered.
Comment: Or fit in a breadboard. Novel idea. +1
Comment: downvoter: why the downvote? I commonly did this myself to anchor some strangely terminated switches (certainly *not* attachable to any connector I know of) to my prototype boards - also, FWIW, sometimes it's simply better to drill a hole a bit larger than in the usual inch raster, and simply put it and solder the terminations as with any other piece...
Answer: Those are called terminals. They are meant to be used with quick disconnect blade terminal connectors. See the thin ones on the bottom right. Alternatively you solder directly to them, by tinning, and sticking a wire to it with solder.

Switch with similar terminals, paired with quick disconnects:

They are not typically soldered directly to a pcb, as these types of switches are meant to be Panel mounted, not board mounted. They will need a custom pcb mounting hole if you wanted to use a pcb, as they will not fit in a standard 0.1" round hole. If you etch a pcb, or enlarge a hole, you could then solder them as you would any through hole part.
If you really don't want to solder to them, use a quick disconnect terminal plug, or you can use alligator or test clips. Worst case, use wire wrap, but that may not be the most stable or secure connection.
Comment: Those connections are not intended for quick-disconnect. They are intended entirely for soldering.
Comment: @Passerby:  I don't think those switches are meant for use with Faston(tm) or similar terminals - the solder lugs are much too thick.
Comment: @WhatRoughBeast there are multiple sizes of quick disconnects, as pictured, the one on the bottom right with the black wire would fit. I have anti-vandal switches with these thin quick disconnects. Not all switches use typical auto sized blade terminals (blue quick disconnect in picture)
Comment: @PeterBennett see http://www.primochill.com/wp-content/uploads/2014/10/PSW-BMV16-R-W_kit-800x640.jpg
Comment: The terminals under the O.P.'s switch are solder lugs.  Not intended for quick-disconnect therminals.  If we had the datasheet for the O.P.'s switch, it would say something about terminals.  In lieu of *the* datasheet, [here's a switch with similar terminals](http://www.digikey.com/product-detail/en/M2012SS1W01/360-1801-ND/1006880) that mentions "Solder Lug" explicitly.
Answer: That's a panel-mount switch. Designed to be mounted through a hole on a panel, with wires soldered to the terminals.
Answer: That style of termination is often called a 'solder lug' and it is not intended to be used to solder the switch to a PCB.
The sort of toggle switch with PCB-suitable pins looks like this:
But if I had one of your switches and I wanted to plug it into a breadboard I would probably get some stiff solid-core wire and solder a short length onto each lug.
You probably could shoe-horn one of those onto a PCB if you designed the PCB with holes large enough to fit the lugs ...
Answer: What you're showing is a panel-mount switch with solder tabs. You obviously can't plug this into a breadboard, because the tabs are way too big.
If you need to solder a similar switch to the PCB, you would look for part that is designed for PCB mounting, either through hole or surface mount. Something like this:

But even this switch will not go into the breadboard easily. Soldering wires would be the best option.
Answer: They are typically called solder lug terminals and are intended for wires to be soldered to them. They will not fit in a breadboard; if you want to use them with a breadboard, you should solder wires or perhaps header terminals if the pitch lines up.
Although not really intended for it, they could be placed directly in a PCB with the correct holes, but typically you would solder wires to the terminals, and then terminate the wires elsewhere or solder them directly to a board.
Answer: I call the connection points "terminals" or "solder lugs".
I think the only way to use a switch like this with a plastic breadboard is to solder #22 or #24 solid wires to the lugs, then insert the wires in the breadboard.
I would not use a switch like that in a PC board.  You can get the switches with "solder tails" that can be soldered into a PC board (but those solder tails are too big to fit in a breadboard).P
Answer: Those are wire terminals, and as you might guess from the name they are intended to connect to wires, not PCBs. A bare conductor is inserted into the hole, then bent back so as to form a secure mechanical connection. Then the wire is soldered, making an electrical connection.
The connecting lugs are so large that it's difficult to make a PCB layout that will work for them - the holes would be very large and very close to overlapping.


AMA session before an interview

Question: I got an email asking if I was interested in a better role and after replying back yes I got a calendar invite today asking me to attend an Ask Me Anything (AMA) session (in like 10 hours) by the founder where I and other people he was talking to will get a chance to talk to him about his passion and ask any questions we had. I found it a bit strange and politely said I couldn't attend it. After the event he emailed back saying the event went well and asked me why I couldn't make it. I honestly told him I find it a bit strange to do an AMA before an interview. Is it normal to do an AMA (with many potential candidates at once before an interview)?
Comment: @Time4Tea It stands for "Ask Me Anything". If I understand correctly, the idea is that instead of one person doing an interview or a Q&A session on a specific topic, a person allows an audience to ask them any and all questions.
Comment: I fear you might have lost both opportunities. The more face-time with deciders before an interview, the better. While meetings/interviews can be uncomfortable, they are a huge part of getting employed...
Comment: What's an 'AMA session'? Sorry, I'm not familiar with that acronym.
Comment: So this was an "out of the blue" invitation, right?  It wasn't a case where you had sent a resume to a company?  I'm guessing this might be some sort of sales pitch and you did well to avoid it.
Answer: It is strange BUT he offered an opportunity for exposure in a high value setting.  By declining you are implying that you aren't interested in why the founder is passionate about the organization or the direction they see it going.
If you are trying to impress someone and they invite you to listen to something they are passionate about usually it's a decent idea to hear them out.
Comment: Agreed. It was a good opportunity to hear about the origins of the company from the founder himself and where it will be going.
Comment: I agree but since he reached out himself and invited to the AMA himself, shouldn't he be careful with the time of other people? If it was a 1-1 AMA it would have been different but many people asking questions to a founder, seems like making us feel like followers.
Comment: @FahadUddin If you feel that a group session with him is a careless use of your time that's an opinion you are entitled to but obviously he doesn't share that view.  I wonder who's opinion on the matter will have a larger bearing on your promotion?
Comment: @Myles: But he approached me. I wasn't really interested but always like to know about the new opportunities.
Answer: It is not very common but at the same time not very strange. They might be aiming to give candidates as much information as possible and using the session as an informal group interview to gauge candidate interest and also allow candidates feeling uncomfortable with the culture, work etc. to drop out before going through all the following steps.
In your case I would say it worked. You did not attend because doing an AMA before interview was unconventional which made you uncomfortable. Their culture likely promotes innovative thinking with a lot of unconventional approaches. So culture mismatch, avoided.
Answer: I'd consider it part of the interview process.  There's always dumb things you have to do, and things that look dumb that you have to do.   Think of this as one of them, if it helps.  So, you blew off an interview session, and you demonstrated that you really aren't interested in how the company got to be the way it is.  That's probably enough for you to be dropped as a candidate.  Let it be a lesson for the future.
Answer: My company does this as well, but in a different way. We have a formal and informal interview. The formal interview revolves around skills, experience and ability. The informal interview is to determine if the candidate "meshes" well with the team, it's structured very much like an AMA in that you can ask almost anything.
I cannot speak for the AMA you skipped, but the reason we do it is to break the ice with a new candidate. Let them get a sense of the the people they're working with and let's us know what the candidate is comfortable with. It can be an intimidating process, however, it's one of the best ways to really get a sense of a candidate. To see if they can have a voice in a group of people.
Because developers tend to wear many hats at our company, we need our candidates to be comfortable with the idea of talking to people who are and aren't technical. (Our open session has one Technical Lead, One Support Agent and one Junior Developer) We also need candidates who can communicate. Since communication is vital to a small team, it's key to find out if the candidate has those skills.
Answer: I've never been asked this in a one to many setting, sure there's discussions about non work things and a getting to know portion of most interview processes, but the one to many nature and timing of this makes me think it's for selling vacuums door to door instead of something legitimate.  Most CEOs I've met have better things to do than talk to random folks who may or may not join for almost any reason, if they join the interview process it's usually towards the end.

AMA session before an interview


How are whatsapp calls banned even with VPN in countries like UAE

Question: As you may know, some countries are blocking access to whatsapp calls, but users usually overcome that with a VPN service, but today even with that powerful internet anonymity solution, ISPs and telecom operators are blocking whatsapp calls even when using VPN on your phone. The question is, how are ISPs able to detect that traffic, as it's encrypted, and ban such voip services. Any technical details would be great, I actually suspect that, it's not just the ISPs whos blocking it, whatsapp it self is doing it too.
Comment: Also you would need to check if the app is actually *using* the VPN connection.
Comment: Keep in mind VPNs, especially public ones, are typically used by those who wish to attack or abuse a service. As a result it is not uncommon for web/app services in general to block traffic from these sources for that reason.
Comment: I am not in any of  these countries blocking VoIP, but you can do the following: disable location services over GPS and WIFI. Try calling numbers outside these countries.
Answer: Whatsapp uses specific ports including: 5223, 5228, 4244, 5242, 5222. By monitoring packets to these ports, it is very easy for a packet filter to figure out which clients are trying to conduct a Whatsapp session. The problem is made easier because Whatsapp uses TCP, a sequential protocol. Using this protocol makes it even easier to target and interrupt.
If you are using a VPN and the server is outside of the country, then there is no way to block you, other than cutting off the entire connection to the VPN. As of this summer, the government of the United Arab Emirates decided to make VPNs illegal and is now blocking them wholesale. They do this by maintaining lists of known VPN endpoints and then blacklisting them all.
You can evade this restriction by making a custom tunnel out of the country. Be aware that doing so is a felony in the UAE.
Answer: It could be due to a DNS Leak
As this useful website states:

Under certain conditions, even when connected to the anonymity network, the operating system will continue to use its default DNS servers instead of the anonymous DNS servers assigned to your computer by the anonymity network. DNS leaks are a major privacy threat since the anonymity network may be providing a false sense of security while private data is leaking.

Knowing that, if the ISP's DNS Servers are blocking Whatsapp calls and you think you're using your VPN provider's but instead you are really using your ISP's then there would be no point on using a VPN because the ban/blocking is is the ISP's DNS servers which you are using. In this case you would have a DNS Leak and the traffic would still be blocked.
You can test if you are suffering a DNS Leak in the same website I linked before and they offer ways to fix this so take a look at that. It may be useful.
Answer: This is something happen all the time with me in Saudi
firstly I'd like to confirm the local Telecom companies have no authority to access & stop that in your phone .
Secondly: make sure you have tried that correctly.
Connect the whatsApp by your VPN and retry
sometimes you the issue is from VPN itself, the servers is damage or traffic.
try using other VPN it should work.
Comment: Welcome to sec.SE.  Here we discuss reasons behind security behaviors.  OP is asking how it is possible, in technical terms, how to perform such block, not whether and where it exist.  Moreover, you need to heavily expand on the "sometimes" in your answer.  **Why** does it work "sometimes", and why it "sometimes" does not.


decentralized cryto currency without block time

Question: Block time or delay is often a problem in Bitcoin. Then would it be possible to develop a decentralized cryto currency with zero delay/block time? Any reference will be appreciated.
Comment: This doesn't make sense - if the block time were zero, there'd be infinity blocks per second, and you'd need infinity bytes of data transfer and storage per second to keep track of them all.
Comment: I mean that each transaction will form a block. My question is rather whether it is possible to avoid delay or is it inherently impossible in decentralized crypo currency system.
Comment: The problem is that if blocks are created very rapidly, it is likely that many get created simultaneously and don't form a chain.  It gets much harder for the network to settle on a chain, and harder to ensure that all desired blocks are included in it.  Also, if each block needs some proof of work, that takes time to produce, so in that sense delay is inevitable.
Comment: Is it true that the first problem is more like bookkeeping and common with other systems (like Visa)? Then for the second problem, is it ever possible to have any proof of work system (different from bitcoin system) without delay?
Answer: A delay of some kind is unavoidable.
Say you see some transaction, say Alice sending a unit to Bob. Before you can accept that transaction as reliable, you need to be sure that everyone will not eventually agree that Alice sent that unit to Charlie first.
Alice can compose a transaction sending to Bob and a transaction sending that same unit to Charlie. She can send half of the nodes one transaction and half of the nodes the other. It will always take some time for the system to agree on which of those two transactions to execute and to assure itself that there isn't some third transaction, also sending that same unit, that won't be agreed on.
That agreement will necessarily take some time as nodes have to talk to each other. You can avoid it by having a designated master whose word is law, but it's not clear how that could be decentralized. Among other problems, you need to detect the failure of the master and change the master. Which means you need to make sure that others know the master didn't fail -- because just because you think the master is working doesn't mean the master's messages are getting to others.
You also need to protect against the master telling half the nodes to accept the transaction to Charlie and half the nodes to accept the transaction to Bob. If they don't make sure the master is honest, then the system is, again, not decentralized.


What are the differences between Pokémon Sun & Pokémon Moon?

Question: Are there any differences between Pokémon Sun & Moon? Obviously there are changes in the Pokémon you can catch in either version as well as the legendaries, so including those are there also additional changes such as NPC changes, areas you can visit, specific mechanics?
Comment: their difference is like day and night.
Comment: Afaik, Sun and Moon take place 12 hours apart from each other.
Comment: @NamikazeSheena Their difference is like the sun and the moon.
Answer: In terms of gameplay, the difference is that whilst playing Pokémon Sun, the in-game weather will be day, during real life daytime. Playing Moon during the day however will have a night weather effect.
Before you buy one, you should conisder two things:
1. When you are going to be playing the game.
2. Which lighting you prefer, light/dark.
Hope this helps.
Answer: Serebii has a summary of all of the differences between the two versions.

In Pokemon Sun the first totem pokemon you encounter is Gumshoos whilst in Moon you encounter an aloan Raticate.
In Pokemon Sun you have the ability to meet and battle Kiawe whilst in Moon you can meet and battle Mallow.
You can also get different stores in the festival plaza. You can usually get them in both games to begin with but the higher level versions of them are only available in one version.
In the Battle Tree you have the ability to scout trainers. You can only scout Plumeria, Sina and Kiawe in Sun and you can only scout Guzma, Dexio, Malloww.
As far as I know other characters can be scouted in both games.

source
Answer: Apart from the specific pokémon and legendaries, the main difference is the shift in time. The time of the clock would be exactly the same as the in-game time in Pokémon Sun, while it is shifted by 12 hours (i.e., AM would turn to PM and vice versa) in Pokémon Moon.
Apart from that, there are other differences such as the different Totem pokémon and ally pokémon, and a specific pokémon has a different evolution depending on the game.


Share button in SharePoint 2013

Question: I created one test publishing site. In that site I created one manage permission level copying contribute permission and checking 'Manage Permission'. I gave the permission to the user on one library and one folder inside that library that manage permission.
when I as an administrator try to share that folder I see only 'Can View' and 'Can Edit' option while the test user with manage permission can see all permission levels in the site.
Why is that so? Shouldn't the admin see all the options and the user see only edit and view option.
Answer: When users have permission to share a folder in the library, by default, they only can see 'Can View' and 'Can Edit' options.
When users in the site permission page, if they have enough permissions, by default, they can see all permission levels in the site.
Comment: I have a site, a library and a folder. I broke the permission on the folder and gave the user manage permission. on the site and library the user has only read permission. but still while sharing the folder the user is getting all the options.

Share button in SharePoint 2013


A few PgRouting database design questions

Question:
Does someone know how the cost field in PgRouting is calculated?
What are 'source' and 'target' good for? 'osm_source_id' and 'osm_target_id' contain the same information using different numbers.
Is there a good reason to use 'cost' and 'r_cost'? Every cost in my table is smaller than 1. So, 0.00045... could mean both directions and 1.00045 oneway.
When it comes to routing what are 'clazz', 'flags' and the line string good for?
Comment: Are you talking about pgRouting or the way osm2pgrouting loads data? You need r_cost (reverse cost)  for 1 ways etc.  costs are all relative, they mean what you want them to mean.  So you can have big numbers or small numbers. osm2pgrouting is based on road length (note new version measures in meters (old in units of road - degrees)
Comment: I am just trying to figure out what a good database design is for routing. (And still think getting rid of one cost column is possible...) Do you also know something about clazz, flags, the line string and what the source and target column are good for?
Comment: The source and target are node ids of the start and end points of the edges.  When you run pgr_createTopology on an edge table, these get populated and a side line table your_table_vertices_pgr gets created with node ids and corresponding point geometries.
Answer: I guess it's better to answer here than comments on your question:
1) As mentioned source and target are integers that are unique identifiers for starting and ending points of your edge.  So if an edge joins with another they share a point in common and you'll see the id repeated.  This is a very fundamental piece of routing since travel stops are at the source /target nodes. Anyway a lot of functions in pgRouting expect your edge table (or query to have a source and target column)
Just repeating what I wrote in comments:
When you run pgr_createTopology on an edge table, these get populated and a side line table your_table_vertices_pgr gets created with node ids and corresponding point geometries.
2) Linestring is needed for a couple of reasons,
In certain routing, you don't want to have to stop and start at a node.  So the pgRouting functions will find you the path from say node 1 to node 2 alonge edge a, and then your final solution might involve doing linear interpolation along the final edge.
The other purpose for the linestring is if you have a large network, you don't want to have to analyze the whole thing, so using proximity PostGIS functions, you can select with a bounding region the edges you need to inspect.
3) Clazz and flags that is an implementation detail of how osm2po loads data and not something specific about pgRouting.
I think this link might answer your question:
What does the values in column clazz (osm2po) mean?
Comment: Thanks, I didn't know that Linestrings are good for solving that problem. Very interesting and good news. As far as the source and target thing is concerned, there are two columns: source and osm_source_id. And every source is an integer mapped to and osm_source_id. Which is also an integer. So you could use just the original node ids for routing. At least that is what I am going to do...


Academic application - how to address lack of citations?

Question: I am applying for an academic position and have been shortlisted. My one potential major stumbling block is in terms of publications. I have a number of them, but none of them are A grade publications. More worrying though, I have virtually no citations. These publications range in age from 6 months to 4 years ago. How might I address this in the context of an interview?
Comment: What field is this? How narrow a subfield? It might be entirely reasonable.
Comment: What is the level of the position? Is it entry level or mid/ high (lecturer and above)? Teaching Only, Research Only or Both?
Comment: You don't need to address your lack of citation usually. Maybe mentioning that the field is niche would be enough.
Comment: It's a postdoc. Predominantly research. The field is comp sci. The field that I had been working in was medical informatics.
Comment: One way is to publish more papers and make them of more relevance in the eyes of other academics.
Comment: A wise person understands that, within a given field: 1) not every paper gets cited right away, and 2) citations take a long time to accumulate.
Comment: Two comments: (1) I wrote a paper in the early 1970's that started getting seriously cited only in the mid-1990's. (2) Many people, including (as far as I can tell) my department's whole personnel committee, don't consider citation-counting a reasonable way to judge people's research.
Answer: It is important that this is an entry level position, since a lack of publications is not that harmful and may be seen as normal. Lack of citations is entirely out of your control - it may theoretically be improved by publishing in more visible journals, social media networking/ promotion etc, but eventually the majority of academic work is cited the proud number of 0 (zero) times.
On the number and quality of publications, it cannot change in the short-run but you can present it in a more representative or favourable way. You can discuss the quality of your work ("first-rate" work published in "second-rate" journal is a very real situation, either for getting it out more quickly or due to the maladies of refereeing), focus on having a pipeline of research and ongoing paper output (which always matters) and talk about how you plan to improve. Since, for better of for worse, the names and numbers will not impress, you could bring forward what is relevant, innovative and generally a strong point, and what this continuation of publications show about you as a post-doc and researcher. Finally, there is a fine balance between self-awareness, self-promotion and self-defeating.
Answer: You seem to be near the beginning of you academic career. In that case I wouldn't worry about it at all at this point. Certainly it isn't something to mention in application materials, but you are beyond that.
But if you are asked in an interview, the answer that you could fairly give is that is one of the precise reasons that you find the post doc desirable, so that you can get more experience writing, develop collaborative relationships, and earn some of those sweet sweet citations.
Well, fix up the language a bit, I suppose, but something like that. Unless other people in your position have got lots already it shouldn't be an issue. And it may be, also, that your work is a bit esoteric and so citations aren't easily achieved, thought that says little about the actual quality of the work. I'll have to guess, since it isn't my subfield, that medical informatics has a deep future.
You are currently in competition with only a few people. It would seem odd to me that you'd be so closely matched that selection would come down to citation count.
Answer: Just last month I came across a blog post by a Management prof who offers a few really well thought out answers to this question. Granted, this is a different field, but you may find the general approach and some of the ideas valuable.
The post is called "Making your case for impact if you have few citations"
But in general, as other people have said here, if this is your first academic job, don't worry about it too much and have an argument for why your current and future work is likely to generate good research impact.


AlwaysOn Availability Group Listener access

Question: This question is about the correct way of accessing an Availability Group Listener?
Assume I have two AlwaysOn Availability Groups with the following AG's: AG1 and AG2.
I also have 2 listeners called LISTENER1 (on AG1) and LISTENER2 (on AG2).
I have 2 SQL nodes NODE1 and NODE2 and both have 2 SQL instances running: INSTANCE1 and INSTANCE2.
How do I correctly connect to the primary replica of AG1 via the listener?
I know it's not supposed to be NODE1\INSTANCE, but which of the following is correct?
LISTENER1

or
LISTENER1\INSTANCE1

I noticed both work fine and I assume the latter connects to the primary replica of LISTENER1 and than lets SQL Browser do its magic and connects to INSTANCE1 (which - by luck - happens to be correct in this particular setup).
I noticed if I use LISTENER1\INSTANCE2, this works as well, BUT connects to the INSTANCE2 instance of the node which hosts the primary replica of AG1!
The rabbit hole goes even futher: if I install a default instance on both SQL nodes I get yet another behavior: Connecting to LISTENER1, connects me to the default instance.
Is my logic correct (SQL Browser service) or am I just completely wrong here?
FYI: Named instances in this case use dynamic ports and all listeners are hosted on port 1433
Answer: It's better to use LISTENER1\INSTANCE1
because you have two instances and those are not default instance


How to shift a line in a graph regardless of slope?

Question: I want to shift a line right some points, regardless of its slope. For example, a vertical line will shift to the right by having its two y coordinates changed,
[$(x_1, y_1+some number)$ $(x_2, y_2+some number)$], similarly a horizontal line will be shifted down by having its x coordinates changed only. Any lines that are not horizontal or vertical, will also be shifted by having both of their x and y coordinates changed. How can this be done?
Comment: Sounds like you've mixed between "vertical" and "horizontal". In addition, your explanation in parenthesis looks wrong. It should be $(x,y)\rightarrow(x,y+\text{some value})$.
Answer: Decompose your "diagonal" shift into an horizontal shift and a vertical shift. It does the job, doesn't it?
Answer: y=mx+b.
Upward shift: y=mx+b+a (a=upward shift, negative = downward).
Right Shift: y=m(x-c)+b (c=right shift, negative = left shift).
Any Shift: y=m(x-c)+b+a.
Answer: It looks like that you are talking about linear functions. The equation is
$y=mx+b$
If you want to shift the graph $y_0$ units upwards and $x_0$ units to the right then the equation becomes
$y+y_0=m(x-x_0)+b$
For downward shifting and shifting to the left you have to change the signs.
Numerical example
Suppose the initial function is $y=2x+2$. And now we want to shift it $1$ unit upward and $3$ units to the right. The equation becomes
$y+1=2(x-3)+2$
Multiplying out the brackets
$y+1=2x-6+2$
Subtracting 1 on both sides
$y=2x-6+2-1$
$y=2x-5$
Answer: For a more general approach to shifting ANY function (line, parabola, sinusoidal, what have you), we can simply consider shifting any function $f(x)$ horizontally or vertically.
$$f(x) = y$$
If we want to shift the function upwards by $u$, this is the same as adding $u$ to every $y$ value the function produces. We can consider a function $f_2(x)$ such that which is $f(x)$ shifted upwards by $u$.
If $f(x) = y$,
Then $f_2(x) = y + u$.
Subsequently, $f_2(x) = f(x) + u$

Now, let's consider horizontal shifts to the right by $v$. To achieve this, we have to consider what it means to move the function to the right. It means for every $x$, we're going to move its associated $y$ to $x + v$ instead. This is the same as assigning $x$ the $y$ associated with $x - v$. Let's construct a function which does just that and call it $f_3(x)$.
If $f(x) = y$,
Then $f_3(x + v) = y$.
Subsequently, $f_3(x) = f(x - v)$

Now, let's say we wanted to combine these concepts at the same time: we want to move a function upwards by $u$ and to the right by $v$ simultaneously.
$$
f_4(x) = f(x - v) + u
$$

Now, let's apply this to lines.
$$f(x) = mx + b$$
$$f(x - v) + u = mx - mv + b + u$$
The new equation for your line still has slope $m$, but you have a new $y$-intercept $(-mv + b + u)$.


Why won't my gas fireplace start up?

Question: Just recently purchased a house but have not as yet moved to the new locale. Gas fireplace has the functional gas shut-off key and a handheld remote with a fresh battery; however, no click, no flame. The two D-cells are missing beneath the fireplace pit amidst the mechanics. After replacing the batteries -- what might be next?
Comment: Would have gas guy/girl come and check it out.  Might be simple has no gas or a dirty sensor.  If you don't know gas, you can also be on youtube, as in unscheduled rapid house deconstruction.  You also don't know what the previous owners did to it.
Comment: Are you sure the gas is turned on? The previous owners probably had it turned off when they left.
Answer: Have a closer look at the gas valve. Is there a manual control knob for setting off-pilot-on? If so then the remote control system may be an add-on that allows to light the fireplace, but only after you've manually lit the pilot and set the control valve to the on position.
Answer: Agree with Greg Hill that the first thing to try is to use the manual gas control & igniter knob, maybe located under the fireplace logs or under the burner.
Also, I know that propane gas can get "stale" sitting in a pipe all year long (which means it's hard to light), and it takes a while to draw fresh gas into the gas orifice, especially when you're trying to light the flame on the ignitor.  May take a minute or two for fresh gas to come out.  Be patient.
Mine has a knob.  You turn the knob to the pilot position. This allows gas to flow, but at a very low rate. Then if you push the knob in, you hear the igniter sparking (provided the batteries are good).  Like I said, it may take a while to purge the old gas from the line.
If you get the fireplace lit this way, then you can go on to troubleshoot the problem with the remote.
Answer: If you are comfortably with DIY projects, you could confirm that the unit has both electric power and gas. You should absolutely determine the model number and  find a local professional that can maintain this in the future.
Will other gas appliances in the home function?  If so, check the shutoff valve to this appliance to ensure it is in the on position.  If you have any concerns about the integrity of the appliance and the shutoff valve is off, it is time to call a professional to check gas pressures and for the presence of gas leaks.  If other gas appliances work and the shutoff to this appliance is "on" to allow gas into the appliance, you are done confirming that gas "should" be available.
Now it is time to check the electrical power to the appliance. Look for the model number and download the user manual online.  You might find the model number by opening a grate to access below the unit or looking online for devices with a similar appearance/ manufacturer to get the manual.
Once you have the model number and the user manual, there will be a troubleshooting checklist there.  If that shows how to check the voltage and or replace batteries inside the unit, do that.
Ultimately, you should call a professional and tell them the model number.  This will help them show up with the right spare parts, or tell you they won't service that particular model. No point in having someone come to your door for a service fee (typically 150 to 250 dollars) just to say they can't help.

Why won't my gas fireplace start up?


Ubuntu 18.04 fresh installation, Thunderbird inbox "invaded" by large icons (coloured emojis)

Question: From my old HD (Ubuntu 16.04) I copied ~/.thunderbird and other programs to the new disk with Ubuntu 18.04 installed.
All went good.
I tried to install Opera. The installation was unsuccessful, a window asking something was held.
After that Thunderbird Local Folders -> Inbox (only) was invaded by large icons like this screenshot

Flowers, plants, trucks and others.
I restarted but those images are still there.
Opera was successfully installed.
What can I do to remove them?
Comment: is this *persisitent* or only when you open certain emails?  Because those look like Emoji icons
Comment: It is persistent only at Inbox list, not in opened emails
Comment: This is caused by bug [Very large emojis displayed in subject line and in the email list](https://bugs.launchpad.net/ubuntu/+source/thunderbird/+bug/1761844).
Answer: This fixed it for me:
sudo apt-get install fonts-symbola

but turns the icons b/w!
From https://ubuntu-mate.community/t/thunderbird-with-huge-icons-emoticons-mate-18-04/16249/23
Here's a way of getting colored icons:
sudo apt-add-repository ppa:eosrei/fonts
sudo apt-get update
sudo apt-get install fonts-twemoji-svginot

I did not have to uninstall fonts-symbola for this to work but I don't know how Thunderbird decides which to use.
New font info from http://www.omgubuntu.co.uk/2016/08/enable-color-emoji-linux-google-chrome-noto
Comment: remark: the issue goes away, and so does your colored emojis! (they are the right size, but black and white now). Would be nice to be able to keep colored emoji...
Comment: I like black and white - it's less intrusive. So the first line only helped me already. Ideally, I'd find a way to block these things from appearing in subjects completely.
Comment: @Sulliwane thank you for pointing that out - I hadn't noticed! Have edited my original answer to include a color font.
Comment: i like the message: Only Mozilla Firefox/Thunderbird currently support the SVG-in-OpenType
font format required to display these fonts in color. All other
applications will display the included backwards/fallback compatibility
B&W outline glyphs.

More details: https://github.com/eosrei/twemoji-color-font

End Of Life: https://github.com/eosrei/emojione-color-font
 More info: https://launchpad.net/~eosrei/+archive/ubuntu/fonts
Press [ENTER] to continue or Ctrl-c to cancel adding it.
Comment: and I need to say, this that this font hurts my eyes somehow .. need to play around with the settings in thunderbird ..
Answer: While not a long-term solution (but should work until the fix for the bug is deployed), you can install the EditEmailSubject add-on for Thunderbird.  It will allow you to delete offending characters from message subjects.
I find the add-on useful generally so this works for me.
Answer: To fix this I downloaded the

NotoEmoji-Regular.ttf

from here:  https://github.com/googlei18n/noto-emoji/tree/master/fonts
and copied it to

/usr/share/fonts/truetype/noto

(sudo was required)
then restarted Thunderbird and everything was fine.
References: https://support.mozilla.org/en-US/questions/1178430


How to change the name after the @

Question: How can you have a Gmail account or any e mail account with a different name? For example email@example.com instead of email@example.com? I have already tried going to the account settings and tried using Outlook but all of them require their ending after the @ sign. I just want to know how to change that because I am starting my own little company and it looks more professional having my company name instead of Gmail or any other ending.
Comment: The question doesn't show any research effort. Please checkout [ask].
Answer: You need to purchase your own domain name, e.g. anothername.com, from a domain registrar. Once you've done so, you need to find an email/web hosting service that will enable you to set up email addresses at your domain. As far as I know, any web hosting company will provide this feature, even on their cheapest plans. Many of these services provide you with simple webmail options like SquirrelMail, Horde, or Roundcube, as well as POP/IMAP access to your email so you can use a third-party client like Microsoft Outlook or Thunderbird with your email.
You could also pursue more advanced options like setting up your own server or purchasing a dedicated server, although these options may cost considerably more and involve much more work on your part.
If you want to use the Gmail interface for your business email, look into Google Apps. Google Apps also provides access to Google Drive, Docs, etc, in addition to Gmail email accounts @anothername.com.
Answer: Having a custom domain for you email addresses requires that you own a custom domain. You could buy it directly to a domain registrar but you should be prepared to manage it properly. IMHO small business should consider to get the domain from a provider that could help with the domain management tasks.
Regarding Gmail accounts with a custom domain for your business you have to sign up for G Suite Business or G Suite Basic. For further details checkout Gmail for work
It's worth to say that you could use Gmail as your IMAP/POP/SMTP email client. For further details see:

Check email from other accounts with Gmail
Send mail from a different address or alias

How to change the name after the @


Torque and rotational motion

Question: What happens if the torque is perpendicular to the axis of rotation or torque is in the direction of rotation?
Comment: What do you mean by "torque is perpendicular to the axis of the rotation" ? Do you mean force ?
Comment: given a force and a reference point you can define torque, which is $\vec{r} \times \vec{F}$.
Comment: Could you draw a picture of what you mean and attach it here?
Comment: i meant any component of torque perpendicular to the axis or any forces parallel to the axis.
Answer: The change in angular momentum of an object is equal to the integral of torque over time:
$$\Delta \vec{L} = \int \vec{\Gamma}dt$$
Note that I wrote both angular momentum and torque as vectors. When torque is along the axis of rotation, you get either an acceleration or deceleration of the angular motion (depending on the relative direction of each). When torque is at right angles, you get precession, such as happens for example in gyroscopes. When torque is partially aligned, you get a bit of both. This is nicely explained at this link.

Torque and rotational motion


Was the army in Ezekiel 37:10 physical?

Question:
Ezekiel 37:10 So I prophesied as he commanded me, and breath entered them; they came to life and stood up on their feet--a vast army.

Where did they go afterward? Was it just an immaterial vision that disappeared at the end of the vision?
Answer: In understanding Ezekiel's prophecy of the valley of dry bones (Eze 37:1-14) we must decide, in the first instance, whether the prophecy is literal or symbolic.
The prophecy is literal then it has not been fulfilled as no such valley thickly strewn with dry bones over the ground exists.  Further, if the vision is of literal events, then it depicts a very strange resurrection involving restored bodies without breath (v8).  Further, before their resurrection, the dead, dry bones speak and say (V11), "Our bones are dried up, and our hope has perished; we are cut off."
On the other hand, if we understand that the vision is symbolic ["The vision is so entirely figurative" MacLaren's exposition on Eze 37:1], then it clearly emblematic of Israel's restoration after the Babylonian captivity.  This is the clear understanding of most conservative commentators such as:
MacLaren's Exposition:

This great vision apparently took its form from a despairing saying,
which had become a proverb among the exiles, 'Our bones are dried up,
and our hope is lost: we are clean cut off' {Ezekiel 37:11}. Ezekiel
lays hold of the metaphor, which had been taken to express the
hopeless destruction of Israel's national existence, and even from it
wrings a message of hope.

Benson observes:

The first and great object of this prophecy seems evidently to be the
restoration of the Jews from the Babylonish captivity. A nation
carried into captivity ceases to be a nation, and therefore may be
fitly compared to bones, or dead bodies; so that by the valley of
bones was first signified, the Babylonish dominions filled with
captive Jews.

Barnes:

The "dry bones" represented the Israelites dispersed abroad, destitute
of life national and spiritual.

Cambridge:

The vision seems suggested by the saying current among the people,
"our bones are dried, our hope is lost; we are wholly cut off." This
idea and feeling of the people takes form in the vision which the
prophet saw in the valley. The language of the people is figurative:
they speak of the nationality, which is no more,—it is dead and its
bones scattered and dry. And this idea regarding the nationality,
figuratively expressed by the people, is embodied to the prophet in a
vision. Hence the passage is not a literal prophecy of the
resurrection of individual persons of the nation, dead or slain; it is
a prophecy of the resurrection of the nation, whose condition is
figuratively expressed by the people when they represent its bones as
long scattered and dry.

Indeed, V11 specifically says that, "Son of man, these bones are the whole house of Israel. Look, they are saying, 'Our bones are dried up, and our hope has perished; we are cut off.'"
With this understanding, Ezekiel's vision is symbolic of the time that Judah's national fortunes would be restored.  Ezekiel specifically says that the LORD would (V14),

"I will put My Spirit in you and you will live, and I will settle you
in your own land. Then you will know that I, the LORD, have spoken,
and I will do it, declares the LORD."

Ezekiel's prophecy of the restored state of Israel was fulfilled with the decree of Cyrus recorded in Ezra 1 and implemented by Zerubbabel as recorded in Ezra 2 & 3 and still later by Nehemiah.
Answer: The army in Ezekiel's prophetic vision depicts the host of believers upon whom the Holy Spirit would fall following Jesus' ascension, empowering them to go and preach the Gospel in obedience to his commission:

Acts 1:8 (KJV)
But ye shall receive power, after that the Holy Ghost is come upon you: and ye shall be witnesses unto me both in Jerusalem, and in all Judaea, and in Samaria, and unto the uttermost part of the earth.
Comment: Welcome to BH. Please see the Tour and the Help (below, bottom left) as to the purpose and the functioning of the site. Could you enlarge a little and support your thesis with some scriptural references, perhaps ?
Answer: Was the army in Ezekiel 37:10 physical?
NO, the vision is symbolic, the Israelites were spiritually dead in exile and God revitalized them spiritually by putting his spirit in them. (Vs14) and so they began to come alive.
When the Babylonians destroyed Jerusalem, Ezekiel was one of the Israelites captives taken to Babylon, during the captivity he was given by God the symbolic vision of the valley of the dry bones.  (Ezekiel 37:1-10)  When prophecied as commanded, the bones started to come together and becoming covered with sinews flesh and skin. The vision is explained in Ezekiel 37:11-14.
The Israelites saw the fulfillment of the prophecy when Babylon was captured by the Persians, (Ezra 1:1-4, 2;64-65)God delivered them from their captivity and lead them back to Israel. Being in captivity the people of Israel were spiritually dead due to their Babylonian exile, but God put his spirit in his people (Vs14) so they became spiritually alive.
Recommend reading the prophecy Ezekiel  37:1-10  and explanation given by God to his prophet.Ezekiel 37: 11-14
https://classic.biblegateway.com/passage/?search=Ezekiel+37%3A1-14&version=NASB;NET
The Vision Explained  Ezekiel 37:11-14 NASB

11 Then He said to me, "Son of man, these bones are the whole house of
Israel; behold, they say, 'Our bones are dried up and our hope has
perished. We are [e]completely cut off.' 12 Therefore prophesy and say
to them, 'Thus says the Lord God, "Behold, I will open your graves and
cause you to come up out of your graves, My people; and I will bring
you into the land of Israel.
13 Then you will know that I am the Lord, when I have opened your
graves and caused you to come up out of your graves, My people. 14 I
will put My [f]Spirit within you and you will come to life, and I will
place you on your own land. Then you will know that I, the Lord, have
spoken and done it," declares the Lord.'"

Was the army in Ezekiel 37:10 physical?


Where/How do I find the bonus content for the Destiny Digital Guardian Edition?

Question: Everything seems pretty much stock. My inventory doesn't contain anything special either. Are the items level restricted? I completed the introduction portion and can't find anything extra at the tower vendors also.
Answer: You are not the only one. At Bungie's forums, there are posts similar to this, and they say to have solved the problem. http://www.bungie.net/en/Forum/Post/68975633/0/0
"If you are missing any content when you log into Destiny,
simply close the app,
go to your playstation (or xbox) settings,
restore licenses,
Go to Destiny - related content,
Download expansion pass and limited edition content,
Go back into Destiny,
Talk to Tess
...???...
PROFIT"
If you still can't solve your problem, please contact Bungie at their forums or Twitter.
Answer: If you're looking for a definitive answer to this... The solution is to download the add-ons. The items are not unlocked in-game but rather as separate downloads. These downloads should be available without charge if you have purchased the package. If not, you may have to 'restore licenses' in your dashboard settings.

Destiny Collector's Edition Digital Content Pack
Vanguard Armory
Destiny Expansion Pass

You may need to close and re-open Destiny if you download these additions while the game is running.
Afterwards, you can claim the items themselves by visiting the the special orders kiosk and the Vanguard Armory by visiting the Tower.
EDIT
To locate the Vanguard Armory, visit the Quartermaster using the location in the map below.

You will have a selection of level 5 weapons and armor, each at a cost of 250 Glimmer.
Comment: Added armory info
Comment: if you add the information of where the "vangaurd armory" is in game, this will easily be the most complete answer
Answer: If as other answers have suggested you have sorted the download content / licensing issues then there should be some of the bonus content in the your mailbox at the city hub..
Answer: All your pre order and special edition content is in the special orders vendor, in the oppisite end of the same building as the post master.
Answer: To access your Vanguard Armory, see the Vanguard Quartermaster next to the Shipmaster in the tower. Also, your stuff can be found with Tess, the special orders kiosk next to the postmaster. Good luck!


Should I carry my elderly cocker spaniel out of the car?

Question: I own a 13 year old cocker spaniel. I like to drive him around in my 2002 Toyota highlander. I'm worried though, because he has to jump about 2-3 feet down whenever we get out. I think this may damage his joints. He doesn't like being picked up, but he tolerates it. Should I carry him out of the car?
Comment: Follow your heart. When it will be uncomfortable for him, he will show it: hesitating at the top or the bottom of the stairs, and being reluctant to jump in and out of the car. That's when you will know you should carry the old guy.
Comment: Can you provide some sort of ramp that you can keep in the car?
Answer: We kept large dogs (GSDs and Labs) for many years. All of them became arthritic in their old age, and getting in and out of vehicles could be a problem. Some of the dogs didn't mind being lifted in and out, but others found that to be painful, especially if you caught a hip joint awkwardly. The solution was simple enough: a ramp made out of a piece of plywood with some carpet glued on for traction. This allowed the dog to get in an out of a vehicle in its own time, and without the risk of being inexpertly handled. You can buy pet ramps if you do not want to make your own, although a box large enough to act as a step may be all that is needed.
Answer: We looked at the Highlander at one point and its a very tall car.

He doesn't like being picked up, but he tolerates it.

Means it dosen't really cause undue stress.
In addition, once he gets used to it, its a little safer since he'll probably wait to get picked up.
We generally carried out our dog from the car - it gives a little time to ensure things like leads are attached, nothing is stuck, and that the surroundings are safe.
With an elderly dog - your instincts are probably right - its going to be a strain, and its ok to carry your dog out of the car.


PHP, multiple files upload and gets path of each ones files uploads for mysql

Question: I found this code, to upload multiple files
http://www.w3bees.com/2013/02/multiple-file-upload-with-php.html?showComment=1390161630156#c8075663254636569559
I modified a little bit the code for obtain a  upload/subdirectories folder with unique id for each one of the sets uploads ;so  the files also gets a unique id.
$dir=substr(uniqid(),-7); // Uniqid for subdirectory
$path = "uploads/$dir/"; // uploads/subdirectory/
mkdir($path, 0700); // Make directory
$valid_formats = array("jpg", "png", "jpeg", "kml");
$max_file_size = 2097152;
$count = 0;
    // Loop $_FILES to exeicute all files
    foreach ($_FILES['files']['name'] as $f => $name) {
        if ($_FILES['files']['error'][$f] == 4) {
            continue; // Skip file if any error found
        }
        if ($_FILES['files']['error'][$f] == 0) {
            if ($_FILES['files']['size'][$f] > $max_file_size) {
                $message[] = "$name is too large!.";
                continue; // Skip large files
            }
            elseif( ! in_array(pathinfo($name, PATHINFO_EXTENSION), $valid_formats) ){
                $message[] = "$name is not a valid format";
                continue; // Skip invalid file formats
            }
            else{ // No error found! Move uploaded files
                $ext = pathinfo($_FILES['files']['name'][$f], PATHINFO_EXTENSION);
                $uniq_name = substr(uniqid(),-5) . '.' .$ext;
                $dest = $path . $uniq_name;
                move_uploaded_file($_FILES["files"]["tmp_name"][$f], $dest);
                mysqli_query($dbc, "INSERT INTO files (code, name, path, type) VALUES ('$dir','$uniq_name','$dest','$ext')" );
                $count++; //Number of successfully uploaded file

            }
        }

    }

}

This process is carried out correctly.
I want after move_upload_file, get all paths(url) of files uploads.
But I get inserted on the database only path first file selected... the other paths files are upload correctly, but not inserted on the database.
Sorry for my bad english, it's not my first language. I hope you can help me.
Answer: Try something as
$sql_error = ''; // add this before you start the loop

if(move_uploaded_file($_FILES["files"]["tmp_name"][$f], $dest)){
  $qry = "INSERT INTO files (code, name, path, type) VALUES ('$dir','$uniq_name','$dest','$ext')" ;

  $result = mysqli_query($dbc, $qry);
  if ( false===$result ) {
    $sql_error .= 'Error in the query '.$qry.'  Error Desc :'.mysqli_error($dbc).'

' ;
  }
}

Finally add
echo $sql_error ;

At the end of the file , so if there is any error it will show you the error in the query.
Also by adding the query inside
if(move_uploaded_file($_FILES["files"]["tmp_name"][$f], $dest)){}

means you are adding only if the files are getting uploaded.


Integers satisfying condition - highest common factor of $(n,36)$ is $1$

Question: How many integers $n$ in the range of $2 \leq n \leq 1000$ which satisfies the following condition
Highest common factor of $(n,36)$ is $1$?
Comment: Brute force: 332 ;)
Comment: @Dolma: It should be $333$ ?
Comment: @Inceptio 332 is correct.
Comment: @JohnGalt: Yes. Figured it now.
Answer: Hint:  what are the prime factors of $36$?  You are searching for numbers that have none of these.  Since multiples of $6$ are important here (why?) maybe it would help to count by hand the ones up to $12$ and look for a pattern.
Answer: Hint:
Last number divisible by $36$ less than $1000$ is $972=36 \cdot 27$, calculate $\phi(972)$. Then find the co-primes of $36$ greater than $972$, that won't be hard. Use can use $\Phi$ function calculator, else it is just a matter of Inclusion-exclusion principal.
Answer: A number is prime to 36, if it doesn't contain 2 or 3, because 36=2x2x3x3. So all we need to do is search for a number which is nearest to 1000, and is made up of 2s and 3s and some big prime number. "Big" so that we can later on manually exclude the effect of that big number.
If you keep going backwards from 1000, i.e. 999, 998, and so on you will not find any such number. But 1002 is good enough because 1002= 2x3x167. So all you have to do is calculate ϕ(1002), and exclude all multiples of 167 (this is that big prime!) which doesn't contain 2, or 3. So we need not bother ourselves with 2x167, 3x167, 4x167, but we need to care about 5x167, because it is prime to 36, and it has been excluded from ϕ(1002), so we will have to include that manually in our list of co-primes with 36. And again 6x167=1002 is outside our requirement, and it has been included. Also ϕ(1000) counts the number 1 as one of the co-primes, so we need to exclude that.
So, ϕ(1002)=332-1(Exclusion of the number 1)+1(Manual inclusion due to 167x5)=332


Facebook Comments Plugin Moderation Mode Setting not working

Question: I have the Facebook Comments plugin set up on a website, and it's working, however the setting "Make every post visible to everyone by default" doesn't seem to be working. All posts remain invisible to everyone except the moderator and the poster.
Answer: if you are using facebook test account to post comments, you will face this problem *_^ (i.e regardless the moderation settings that you have specified)
check this Auto-approve all comments in Comments Plugin


Advantage of using External Watermarking Tools rather than Photoshop

Question: There are many software products offering to watermark your images in batch without individually selecting the images. Is it common to use this kind of software or would photographers do it in Photoshop, manually, as needed?What are the advantages of using such paid tools
Comment: I'd suspect that most pros (and enthusiasts with high image counts) would be using a watermark-on-export option in their image management software (such as Lightroom), since watermarks are only generally applied to images resized for web publishing and customer proofs, not to entire directory trees (and especially not to originals).
Comment: I don't know how this can really be answered...
Comment: What if the question were rephrased to ask whether there's an advantage to using external watermarking tools, instead of those built into Photoshop?
Comment: @StanRogers Thanks for the comment.Yes i do mean images published via web.Watermarks are meant for protecting images which are displayed publicly
Comment: The answer to "do photographers do it" is simply "yes, some of them".
Comment: This sounds like a poll, which is generally off-topic on SE sites.
Comment: @coneslayer: too late, I guess.
Answer: There are really two questions here:

Is it common to use software specifically for watermarking or better to do in Photoshop?
What are the advantages or task-specific tools?

I don't know any pros who are using any tools outside their normal workflow to accomplish watermarking. Maybe some people do, but Lightroom, Aperture, etc. have really made these tools somewhat irrelevant for photography and they are outside the normal workflow (more on this later).
In answer to the second question, the advantage would be that you could do a large batch of files without thinking about them. It seems appealing until you discover that you still have to look at the result for instances where the watermark was less than optimal (like in a cloud or over a shadow).
Most people are moving or have moved to a workflow that allows their main image processing tool -- Lightroom, Capture One, Aperture -- to apply the watermark to images exported with a given setting. That way, you start with the most resolution you have, create a watermark in a location that makes sense, and then say "export". Still in the same workflow.
And finally... someone once told me that "locks are for honest people." If someone really wants to steal your image, your watermark won't protect it, they'll just get creative with the clone tool. If you are looking to leave attribution on your image (that's what I do), then watermarking will work just fine.


How can one build a multi-scale physics model of fluid flow phenomena?

Question: I am working on a problem in Computational Fluid Dynamics, modeling multi-phase fluid flow through porous media.  Though there are continuum equations to describe macroscopic flow (darcy's law, buckley leverett equations, etc), these models do not apply for heterogenous media (with transport properties).  We could, however, try to use the microscopic model (lattice boltzmann, or pore network models) which would be more faithful to the dynamics of the macroscopic heterogeoneous media.  But any computational simulation of this model would run too slowly to be worth it.  The principals of conservation laws apply at both scales (conservation of mass, momentum, energy), but the equations that describe these laws differ at each scale.  How then, can we upscale microscopic physics in a computationally efficient manner?  Are there any techniques for describing microscopic phenomena at the macroscopic level without such a heavy computational cost?  Is there any technique to build a continuum description at all scales of the problem?
Comment: How is this question related to lattice QFT? Also, I don't understand why you want to use a microscopic model. Probably you just need to generalize a bit the macroscopic equations you started with. I must say I don't quite understand what you mean by heterogenous media. But then I don't know much about fluid dynamics so feel free to ignore my comments (except the first one)
Comment: Sorry... I would have tagged it as lattice-boltzmann, if I had the reputation points to do so.
Comment: This is not my area at all, so this might be a particularly ignorant comment, but can you not simply simulate a small section at the microscopic level for a range of different conditions for the boundaries, and then piece together these into a solution for a larger volume, repeating several times if necessary? The basic idea being that there are many areas for which exactly the same calculation is necessary, and probably relatively few distinct such calculations, so better to build a lookup table than to calculate anew each time.
Comment: Lattice Boltzmann methods aren't necessarily microscopic exactly - the particles in the simulation don't have to represent actual molecules. I believe that such methods have been successfully used to model quite large-scale flows, without having to model $\sim 10^{23}$ individual particles.
Answer: Your problem is highly nontrivial. The theoretical tool to be used is the renormalization group, which extracts the relevant dynamics of the large scales of the system. But if we were able to use it "in a blind way", then we would have a technique to study the macroscopic dynamics of any microscopic system... and this would made a lot of my colleagues unemployed :) The basic idea is to make "blocks" or perform a bit of "coarse-graining" in your original system and see if you can describe the resulting dynamics with the same microscopic laws, but changing a bit the parameters. If you can, then you're lucky. You get a "flow" in your parameter space, and the fixed points give you the macroscopical dynamics: how the system will behave in the thermodynamic limit.
The alternative approach, which is used very often, is to try to write the most general local partial differential equation which is compatible with all your physical requirements and symmetries. These equations will have "open" parameters that you will put later on, in a semi-empirical way. You can see examples in A.L. Barabasi and E.H. Stanley, "Fractal concepts in surface growth", and many other places.