Is file_exist() in PHP a very expensive operation?

Question: I'm adding avatars to a forum engine I'm designing, and I'm debating whether to do something simple (forum image is named .png) and use PHP to check if the file exists before displaying it, or to do something a bit more complicated (but not much) and use a database field to contain the name of the image to show.
I'd much rather go with the file_exists() method personally, as that gives me an easy way to fall back to a "default" avatar if the current one doesn't exist (yet), and its simple to implement code wise. However, I'm worried about performance, since this will be run once per user shown per pageload on the forum read pages. So I'd like to know, does the file_exists() function in PHP cause any major slowdowns that would cause significant performance hits in high traffic conditions?
If not, great. If it does, what is your opinion on alternatives for keeping track of a user-uploaded image? Thanks!
PS: The code differences I can see are that the file checking versions lets the files do the talking, while the database form trusts that the database is accurate and doesn't bother to check. (its just a url that gets passed to the browser of course.)
Answer: As well as what the other posters have said, the result of file_exists() is automatically cached by PHP to improve performance.
However, if you're already reading user info from the database, you may as well store the information in there.  If the user is only allowed one avatar, you could just store a single bit in a column for "has avatar" (1/0), and then have the filename the same as the user id, and use something like SELECT CONCAT(IF(has_avatar, id, 'default'), '.png') AS avatar FROM users
You could also consider storing the actual image in the database as a BLOB.  Put it in its own table rather than attaching it as a column to the user table.  This has the benefit that it makes your forum very easy to back up - you just export the database.
Comment: but BLOB isn't good for performance. You get overhead of running PHP, MySQL, and you'll have to write support for HTTP cache validation, otherwise browsers will needlessly keep re-downloading avatars.
Comment: It is important to note that PHP will only cache the results of files that do exist, it will not cache the results of files that are non-existent. See: http://www.php.net/manual/en/function.clearstatcache.php
Comment: The cache info is very reassuring, I ended up going with the file_exists solution. However, the BLOB idea looks very interesting, I might just try that later on. Thanks!
Answer: Since your web server will already be doing a lot of (the equivalent of) file_exists() operations in the process of showing your web page, one more run by your script probably won't have a measurable impact. The web server will probably do at least:

one for each subdirectory of the web root (to check existence and for symlinks)
one to check for a .htaccess file for each subdirectory of the web root
one for the existence of your script

This is not considering more of them that PHP might do itself.
Answer: In actual performance testing, you will discover file_exists to be very fast. As it is, in php, when the same url is "stat"'d twice, the second call is just pulled from php's internal stat cache.
And that's just in the php run scope. Even between runs, the filesystem/os will tend to aggressively put the file into the filesystem cache, and if the file is small enough, not only will the file exists test come straight out of memory, but the entire file will too.
Here's some real data to back my theory:
I was just doing some performance tests of linux command line utilities "find" and "xargs". In the proceeds, I performed a file exists test on 13000 files, 100 times each, in under 30 seconds, so thats averaging 43,000 stat tests per second, so sure, on the fine scale its slow if your comparing it to say, the time it takes to divide 9 by 8 , but in a real world scenario, you would need to be doing this an awful lot of times to see a notable performance problem.
If you have 43 thousand users concurrently accessing your page, during the period of a second, I think you are going to have much bigger concerns than the time it takes to copy the status of the existence of a file more-or-less out of memory on the average case scenario.
Answer: At least with PHP4, I've found that a call to a file_exists was definitely killing our application - it was made very repetidly deep in a library, so we really had to use a profiler to find it. Removing the call increased the computation of some pages a dozen times (the call was made verrry repetidly).
It may be possible that in PHP5 they cache file_exists, but at least with PHP4 that was not the case.
Now, if you are not in a loop, obviously, file_exists won't be a big deal.
Answer: file_exists() is not slow per se.  The real issue is how your system is configured and where the performance bottlenecks are.  Remember, databases have to store things on disk too, so either way you're potentially facing disk activity.  On the other hand, both databases and file systems usually have some form of transparent caching to optimized repeat access.
You could easily go either way, since chances are your performance bottleneck will be elsewhere.  The only place where I can see it being an obvious choice would be if you're on some kind of oversold shared hosting where there's a ton of disk contention, but maybe database access is on a separate cluster and faster (or vice versa).
Answer: In the past I've stored the image metadata in a database (including its name) so that we could generate useful stats.  More importantly, storing image data (not the file itself, just the metadata) is conducive to change.  What if in the future you need to "approve" the image, or you want to delete it without deleting the file?
As per the "default" avatar... well if the record isn't found for that user, just use the default one.
Either way, file_exists() or db, it shouldn't be much of a bottleneck to worry about.  One solution, however, is much more expandable.
Comment: You got downvoted and I'm not sure why, this is a good answer and I never thought of it myself.
Comment: I can't comment in the correct answer, but one more thing -- DO NOT STORE IMAGES AS BLOBS.  It's really bad performance.  Believe me, it's been discussed ad infinitum all over the web.
Answer: If performance is your only consideration a file_exists() will be much less expensive then a database lookup.
After all this is just a directory lookup using system calls. After the first execution of the script most of the relevent directory will be cached in storage so there is very little actual I/O involved, and, "file_exists()" is such a common operation that it and the underlying system calls will be highly optimised on any common php/os combination.
As John II noted. If extra functionality and user inteface features are a priority then a database would be the way to go.


Failover timeout problem

Question: I'm looking for an additional bit of help with regard to some problems I'm looking at for one of my company's clients. Basically I have two related problems with regard to a 2-node active/active cluster hosting an instance of 2008 R2 on each instance.
One of the instances, normally on node#2, is at RTM. And when failing over to node #1 there is a time-out bringing the SQL Server service on-line, however once the time-out has, er, 'timed out', the service can actually be brought on-line OK manually. And looking at the Log there are errors of the form

'Login failed ..... Reason: Server is in script upgrade mode…..'.

At first I thought this was the result of a failed attempt at installing SP1 however I'm now not so sure. SP1 has definitely been installed on both nodes and the other instance, normally on node #1, is at SP1. I assume this was following the recommendation to install the service pack on the 'inactive' node, failing over and repeating the process. However I'm having difficulty interpreting the installation logs to see if just one instance has been updated or both, with one failing. So I was hoping someone could help me with that in terms of what log file I should be looking at.
Also, what might be the meaning of the 'script upgrade mode' errors? Does this indeed sound like a failed SP1 upgrade or is something else at play here? Curiously the problem only occurs in one direction - from node #2 to node #1. When failing back to node #2 the SQL Server service comes back on-line without the need for any manual intervention.
Answer: Had forgotten about updating this one after getting help from Microsoft Support. Turns out that the build number on one nodes was slightly different to the other due to a Security Patch that had only been applied to one node, possibly due to a Windows Update.

Failover timeout problem


Is the object that is associated with an action selected?

Question: I have a script that goes through all of the actions in bpy.data.actions. for action in bpy.data.actions: First, is there a way to return the object the action is associated with and second, is there a way to return whether or not that object is selected?
Any help is greatly appreciated!
Answer: Make a lookup table.
In going the other way can look at all objects in blend and from their animation data check all actions either assigned directly or via the NLA.
For example sake have used a defaultdict assigned to a set. Iterated over all objects and added all assoc. actions to set.
import bpy
from collections import defaultdict

actions = defaultdict(set)
for ob in bpy.data.objects:
    if not ob.animation_data:
        continue
    ad = ob.animation_data
    if ad.action:
        actions[ob.name].add(ad.action)
    actions[ob.name].update(s.action for t in ad.nla_tracks for s in t.strips if s.action)

# print results

for k, v in actions.items():
    print(k, v)

Example output
Cube {bpy.data.actions['Action'], bpy.data.actions['CubeAction.002'], bpy.data.actions['CubeAction']}

Once we have created lookup above can iterate over actions where  any that  intersect actions[ob.name] are associated with object ob
An object is selected if ob.select_set() is True
Alter above and use for ob in  context.selected_objects: to only look at actions assigned to selected objects in the context scene. (context = bpy.context If we make test code using context it pastes nicely into operator / panel code)
When an action is created by keyframing in the UI the action is assigned name, for example on object "Cube", "CubeAction" and the action is given an Action.id_root = 'OBJECT' to associate this action with objects (not meshes, shapekeys etc).
However IMO perhaps neither can be relied on, if the action is renamed, or created via code and the id_root is not set.
Comment: Thank you! I appreciate the help!


How to use External option in Texture painting?

Question: How to use this part in texture painting? I pressed "quick edit", I was transferred to a separate graphics editor - Photoshop - where I painted the texture. What's next? How to project what is drawn?
Answer: 1- Choosing the resolution of the projected image - "Screen Grab image"
2- Select the desired angle in the viewport
3- Click "Quick Edit"
4- it throws us into the program for 2D editing (important - check that the path to "Image Editor". Path - Preferences > File Paths > Applications > Image Editor). We draw and edit the image any way we want, then (importantly) we merge everything into one layer and save it.
5- Then in Blender press the "Apply" button.


Where is the restore function in the DHIS 2 admin panel?

Question: I couldn't find the restore function to import demo database in the admin area of dhis2-live.
Answer: The DHIS 2 Live package or the DHIS 2 software itself do not provide a function for restoring a database backup file. This should be handled using import tools available for your database system.
If you use PostgreSQL you can use the psql tool. You can learn how to crete and restore dumps in the DHIS 2 documentation here.


How to create a strong magnetic field using permanent magnets

Question: I would like to build a strong magnet using 100 6"x4"x1" permanent magnet blocks. What is the best way to place them so I get the strongest magnetic field? (Should I stack 2 rows of 50 blocks and put them side by side? Should I place them like a Halbach array?...) I use this magnet to attract metal particles that are on a conveyor. The field must attract the medium-sized particles (2"x3"x2" approx.) upon a fairly good distance.
Comment: You answered your own question writing about [Hallbach array](https://en.wikipedia.org/wiki/Halbach_array), aren't you?
Comment: You are going at this the exact wrong way. In engineering we don't start with "I have six brick, now how do I build a house?" but with "I want to build a house, how many bricks do I need?". The correct procedure here is experimental. Use one or a few of your magnets to measure the area in which they attract exactly the kinds of parts that you want, then scale it up. Using magnets alone, without a proper magnetic return path is not going to get you a good magnet, anyway, though.
Comment: If you tie these magnets parallel to each other such that all the north are facing one direction you would likely to have a strong attracting force. It is just my gut feeling, in any case field very close to magnet pole remain same as of one magnet.
Comment: Ok thank you I'll make some your tests monday and I will come back with the results!
Answer: The permanent magnets are magnetic dipoles which means that their field goes down like $B\sim 1/r^3$ with the distance from the dipole. The number of such magnets in a volume goes like $r^3$, so regardless of the value of $r$, the magnetic field will have basically the same magnitude.
In particular, if you just double all the dimensions, the whole "picture" will just magnify but the magnitude of the magnetic fields at the corresponding points will stay the same.
Moreover, the magnetic field right at the top of each magnet will be the same regardless of the arrangement. There's basically no way to increase the magnetic field by combining many magnets. Different arrangements will produce different shapes of the magnetic field. One can make the field stronger above the magnets but a bit weaker on the sides, or vice versa, but you would have to describe exactly which quantity of the magnetic field you want to be maximized.
Comment: This is a cleverly simple answer without much math, very nice! Luckily we have iron.
Comment: The place where I want the strongest magnetic field is the side parallel to the conveyor(seen as the bottom), so the particles get attracted. The four sides and the top are not important at all. Thank you
Answer: This is waaaay late, but I've been examining the question of how to maximise magnetic field for the amount of magnetic material used and I had the following findings.  So far I've been examining arrays where one side is used, similar to the one for your production line.
First a femm model of pair of N40 neodymium magnet poles in air for a baseline.  The magnets are 2cm by one cm thick and one inch deep.

Note that your strongest field in air is at the edge between the poles, so with this configuration you'd want this seam to be across your belt so all product passed below that point.
Next a model of the same pair of magnet poles with an iron back.  You can see this slightly strengthens the field on the front.

Note that the iron back is rather thick and nonetheless saturated, so getting front side field improvements this way takes a lot of iron.
Next a model of a pair of halbach array poles in air.  You can see the front side field is much stronger than even the magnets backed by iron.

Finally a halbach array with an iron back.  You can see because much less of the magnetic circuits are on the back, little iron is actually used and the improvement in front side field is small.

Then why don't we look at a side by side comparison in the same order to see better how much stronger the fields are at pole center(More relevant to rotary machine design but I'll put it in here since it's made):

So this is zoomed in on the air directly in front of the poles, with lines added for millimeters of distance from the magnet.  You can see that the halbach array produces a similar field to the iron backed traditional array an additional 2 mm out from the face of the magnet.  You can also see that the improvement from adding iron to the halbach array is fairly small.
As a final note, you're using rather large and strong magnets, and magnets push against being forced into a halbach configuration, so you'll probably have to be very careful in how you assemble the finished array.


How to plot the projection of the flat surface of a truncated sphere on a plane?

Question: I would like to see how the projection of the flat surface of a truncated sphere (as shown in the image) change when rotating the sphere. I would also want to know the area of the projection. Could anyone tell me how to do this? Thanks!
Comment: Please post your code.
Comment: Welcome to the Mathematica Stack Exchange. Please provide code for the presented image. There are two pieces of information missing in this post: **(1)** The equation for the disk in 3D space and **(2)** the equation for the plane where you want to project the image of this disk.
Answer: The projection can be done by simply setting one of the coordinates to a fixed value.
The area of the projection is more difficult to calculate. The projection of the whole sphere is a circle. The circular cut projects to an ellipse. We first subtract the area of the circular segment of the projection that is replaced by half an ellipse and then add the area of the ellipse.
To make things simpler, we choose a sphere of radius: 1:
<code>acs[h_, r_] =
  r^2 ArcCos[1 - h/r] - (r - h) Sqrt[
     2 r h - h^2];(*area circular segment*)
ael[phi_, dphi_, r_] =
  Pi  r  (Sin[phi + dphi] - Sin[phi]);(*area ellipse*)
Manipulate[
 rm = RotationMatrix[phi, {0, 1, 0}];
 sp = ParametricPlot3D[
   rm . {Sin[p] Sin[t], Cos[p] Sin[t], Cos[t]}, {p, 0, 2 Pi}, {t,
    dphi, Pi}, PlotPoints -> 20,
   PlotLabel -> StringForm["Area= ``", Pi +
      Which[Pi/2 > phi + dphi || Pi/2 < phi - dphi , 0,
       phi <= Pi/2, 1/2 ael[phi, dphi, 1] - acs[1 - Sin[phi], 1],
       True, 1/2 ael[Pi - phi, dphi, 1] - acs[1 - Sin[Pi - phi], 1]
       ]]];
 proj = ParametricPlot3D[{#[[1]], #[[2]], -1} &@(rm . {Sin[p] Sin[t],
       Cos[p] Sin[t], Cos[t]}), {p, 0, 2 Pi}, {t, dphi, Pi},
   PlotRange -> {{-1, 1}, {-1, 1}, {-1, 1}}, PlotPoints -> 20];
 Show[sp, proj, PlotRange -> {{-1, 1}, {-1, 1}, {-1, 1}}]
 , {phi, 0, Pi}, {{dphi, 0.8}, 0, Pi}]
</code>
Comment: Thanks a lot! That's very helpful. Actually, the projection I am interested in is the circular cut part (the flat disk). May I ask how to revise the code to show the area and projection of the disk (it is shown as a hole in the current code) as the sphere rotates(with the same manipulation parameter phi and dphi)? It seems to be easier than the current case, could you give me some hints? Thanks!
Comment: The half axes of the ellipse are: r ( Sin[ phi + dphi] - Sin[phi ]) and r Sqrt[1-Sin[phi]^2] and the center of the projection: {r Sin[phi],0,-1}


How to join 3 traces is a PCB?

Question: Usually I route my PCBs never making a 90º turn as best practices recommends, but sometimes there are points were 3 traces must intercept, if I always do 45º turns, in this intersection will be a 90º turn, so is it ok, or there is a better way of doing so?
Answer: The 90º intersection will not be a issue for most traces. If your trace is very thin (< 15 mill) and/or the PCB boards aren't being professionally manufactured you can use mitered traces (chamfer) as helloworld922 pointed out. Adding chamfers will eliminate the 90º intersection and help to strengthen the trace. For high frequency traces (> 1GHz) it also helps reduce signal reflections.

The lines have constant impedance along their length regardless of
  routing which is a highly desirable property. Note: this is less true
  at the highest frequencies where abrupt corners in a track also cause
  reflections. For this reason most PCB designs employ mitred (45°) or
  chamfered (curved) corners.

Best practice in circuit board design

There are other methods to help prevent signal reflections, like the following image shows:

The image above is from Microstrip, Stripline, and CPW Design.
For more reading material, take a look at 90 Degree Corners: The Final Turn.
Comment: "The same holds for bends with angles \alpha greater than 90 degrees"
What do you mean by that? 180>90 so that would hold for all wires/traces as wires/traces/are made from smaller straight pieces.
Comment: @Gunnish It means that a bend of 90 degrees or more will cause reflection for high frequency signals. An example is the 135 degree angle in [Camil Staps's answer](http://electronics.stackexchange.com/a/53207/9730) Although like text is specifically talking about a bend, not an intersection like the OP's question.
Comment: Also, that snippet is from a document that is discussing microstrip design. This is not exactly the same as what the OP was posting, but I thought it was interesting to add mostly for the increased inductance notch image.
Answer: You can add some internal chamfers to the PCB trace.
Answer: Either straight 90 degrees or added mitres is fine. One thing to avoid is angles of less than 90 degrees, like the internal angles in a 'Z', or the "increased inductance" example in Garrett's answer.
These are sometimes called "etchant traps" and cause manufacturing problems with some board manufacturers. For a hobbyist PCB I wouldn't worry too much, but if you were building a million I would re-design to avoid them.

How to join 3 traces is a PCB?


Microstrip Patch Antenna Design

Question: I am Awais and I want to design a dual-band antenna in CST studio. My requirement is to design at an operating frequency of 2.45GHz and 5.8GHz. The problem is when I simulated, it was resonating round about 5.3 but have no resonation at 2.45. How I can make it at 2.45 also?
Comment: Maybe make it twice as large? That way it can resonate at 5.3/2 GHz. I think it will still resonate at 5.3 because that is the 2nd harmonic.
Comment: hm, it'*s not really clear what you're asking us here; your question is isomorph to "can you explain the full design methodology for dual band antennas; I don't tell you how much I know about the basics of simpler antennas, so you'll have to explain that too"; sorry, nobody will write a complete book on antenna design as an answer! You'll have to be way more detailed and explain what you understand, what you don't understand and what you've tried.
Answer: You may tune certain parameters of the design using the 'parametric sweep' in CST MWS. Some of the tunable parameters might include slot dimensions, gap associated with the feed ( such as inset feed, for example), dimensions of the radiating patch, and dimensions of the ground plane.

but have no resonation at 2.45 GHz

Are you using a standard square copper or a defective ground structure? If your antenna has no resonance at 2.45 GHz, this means that the designed ground plane (preferably the defective ground plane) might have provided almost zero transmission at that frequency. You may check the S-parameter plot and check the plots of S11 (reflection coefficient) and S21 (transmission). If you are using a Floquet port model, you can check 'SZmax(1),Zmax(1) for reflection characteristics and 'SZmin(1),Zmax(1) for transmission characteristics.
If the magnitude of reflection is greater than the magnitude of transmission, there will minimum to no transmission.
'SZmax(1),Zmax(1)'= 'S11'
'SZmax(1),Zmin(1)'= 'S12'
'SZmin(1),Zmax(1)'= 'S21'
'SZmin(1),Zmin(1)'= 'S22'

Microstrip Patch Antenna Design


Shipping calculation on the product page

Question: We have a shipping calculation module its name is "FRETE RáPIDO" the documentation says it appears on the product page. For some reason, my theme doesn't work. What code do I put in my theme to make it work?
I would like to make the shipping calculation work on the product page. Probably the theme is not carrying it.
Comment: Is it available for selecting on Magento backend Shipping Methods? Stores > Settings Configuration > Salles > Shipping Method. Or you can't even see the module there?
Comment: The module appears in the backend and at checkout, it works normally. however, the freight calculation does not appear on the product page.
Comment: Yes. Just checked their documentation. It should add the shipping block below Add to Cart button. If your store is in the dev mode, I would suggest running the Debug / Template Hints and check the product page... if the Frete Rápido Block is being called. If it isn't, you may add the block or ask for their support. By the way, it is a minor issue... at least the shipping costs are being calculated at checkout.
Answer: this code calls the add-on from within the module
<code>    <referenceContainer name="product.info.social">
        <block class="FreteRapido\Quote\Block\Product\View" name="product.info.shipping" as="shipping" template="product/view/shipping.phtml" />
    </referenceContainer>
</code>


What temperature, in degrees, should I set my slow cooker to for a 5-pound pork shoulder?

Question: I'm making pulled pork with a 5-pound pork shoulder in my slow cooker. My cooker has a temperature control that ranges from 200 to 400 degrees Fahrenheit. I hope to have it done in 6 to 8 hours. What temperature should I set for it?
Comment: Usually a slow cooker (aka crockpot) is something for braising, where there's always at least a little liquid, and the temperature doesn't go over boiling, so there's no temperature control, just a high/medium/low type control. Do you have some kind of small oven or something?
Comment: It's a Presto Kitchen Kettle "multi cooker / steamer".
https://www.gopresto.com/downloads/instructions/06000.pdf
Answer: I'm pretty sure that no matter what you do, it's going to end up braising, so it doesn't really matter exactly what temperature you set it at.
The manual does have suggestions for this:

Start with 1 1/2 to 3 pounds of beef or pork... [various cuts]
Preheat multi-cooker at 375˚. Brown roast in... [various oils]
Add 2 cups... [liquid]
Turn heat control down until pilot light goes out. Cover and simmer 1 to 3 hours or until tender.

So you can do it like that, and presumably that'll help get things going quickly and maybe get you some nice browning.
But the meat is going to release water and fat, and at that point it's basically like any slow cooker: you'll have liquid in the bottom, and steam held inside by the lid. As long as there's liquid left, it can't really go above 212F/100C.
The suggested 2 cups of additional liquid is presumably to avoid sticking to the bottom and burning; you can probably get away with way less, likely even what the meat releases naturally. But until you figure out exactly what works in that particular cooker, you'll probably want to check in on it after a while, and add more if it seems like it's sticking.
And yes, a braise should have a pork shoulder done within 6-8 hours.
Comment: Yeah, the instructions include turning the flame off until the pilot light goes out, so it sounds like it's just a way to quickly preheat the container? Looks like it can do some browning before the liquids are added, which sets it apart from the average slow cooker.
Comment: While cooking, the "pilot light" has been in a cycle of turning on for a minute and turning off for a minute. I think the light turns on when the heater turns on, the unit heats up and reaches the user-set temperature, then the heater and the light shut off, the unit cools below the user-set temperature, then the heater and light turn on again, etc. Using the light's behavior near the start of the cook to determine what temperature to cook at doesn't seem very reliable. The temperature setting at which it shuts off would depend on how long I preheat the unit and how long I "brown" the roast.


install package from debian backports pool

Question: I want to upgrade my dovecote installation to version 2. I discovered the package here. I also already added deb http://backports.debian.org/debian-backports squeeze-backports main to my sources.list. But the desired package inside the pool directory. How can i access there packages via apt? I'm using debian squeeze
Comment: You should be good already with that line in `sources.list`. Did you do `apt-get update` after adding it?
Answer: I use the following line for backports:
deb http://backports.debian.org/debian-backports squeeze-backports main contrib non-free

After you added the backports to sources.list make sure to run:
apt-get update

Then in order to install a package from backports you run:
apt-get -t squeeze-backports install examplename

The option -t squeeze-backports tells apt to specifically use backports for that package. It then will also pull any dependencies that are present in backports from backports. Not using the -t option could work, in case the package name does not exist in squeeze (for example linux-image-3.2.0-0.bpo.2-amd64) AND the install does not depend on packages that also have to be pulled from backports.
Also remember that as far as I know backports packages do not automatically update through a regular update (such as apt-get upgrade). You would have to run the above command again for each package in order to pull in a possible newer backported version.
Answer: Try to do a search at first:
apt-cache -t squeeze-backports search a_fancy_package

and then choose the exact name of a package from the list
apt-get install -t squeeze-backports the_fancy_package

I'd do it like this:
apt-cache -t squeeze-backports search dove | grep -v ice

and then probably
apt-get install -t squeeze-backports dovecot-core dovecot-imapd dovecot-pop3d

and whatever else you need.


Cleaning an R&T A1250 toilet fill valve

Question: I have a slow-filling toilet, and it looks like a common fix is to clean out the fill valve. For some types of fill valve you just push down and turn to take it apart; this one, apparently an R&T A1250 or similar, I don't know how to take apart. I'm on the verge of giving in and calling the plumber, but if one of you fine folk happen to know what to do I may try doing it myself. Here's a picture of it.
Comment: Can't get it apart to clean it will not turn.
Answer: I have an R&T A1260, which looks very similar. This is how you open it up. At the bottom, you'll see a little pull tab. Pulling on it will remove a filter.

The top has a blue cap that can be lifted by the two protrusions.

There is a horizontal pin here that you can remove with a pair of needlenose pliers by simply pulling it out.

This frees up the water level adjustment arm, which you can set off to the side. Now you want to rotate the whole top part so that the groove that held the adjustment arm rotates to align with the green overflow tube, which is about 15° counterclockwise. Take a pair of standard (not needlenose) pliers and grip the two raised walls that contained the adjustment arm, push down into the shaft and turn. This unlocks the top of the mechanism so you can just remove it.

With your needlenose pliers, grab the inner plunger and lift it out.

When it stops, gently tug on it with some more force. There are some O-rings that give some resistance but you should be able to overcome it easily. This pops the whole plunger out, finally exposing the inner chamber of the shaft.

In my case, I found a piece of metal that had blocked the inlet. It's otherwise in good shape, except perhaps for the worn gasket at the bottom. Yes you could replace the whole thing, but if you have the patience to disassemble and clean it out, you could probably get a few more years of life out of it.
Comment: Holy cow! This may be one of the best, most detailed answers I've ever seen on DIY!
Answer: I'd think if you called a plumber, they'd just replace the valve. I've fixed my fair share of toilets and I've never 'cleaned' and then re-installed a fill valve; there's no way to back that up. You'd get to call me back for free to do what I should've done in the first place; replace it.
That is of course, assuming the shut-off valve and the line isn't clogged. You could try closing it to squish any crud that may be blocking flow. If you do, you should disconnect it from the toilet and bleed it into a bucket while you open and close it a few times (that's what you should be doing if you have to replace the fill valve anyway).
Comment: Plumber came and replaced the fill valve and fixed some other stuff (old owners did a DIY installation that was not exactly  according to plumber). Replacement is a Fluidmaster fill valve and here are the instrcutions the kind of cleaning I was thinking about on this model: http://www.fluidmaster.com/toilet-fill-valve-runs-non-stop.html
Answer: I have two seasonal residences that are on wells that have the same toilet valves as the R&T valve shown in the first response. Periodically silt clogs the strainer that is inside the bottom of the valve. This clogging is the cause of the water flow being reduced. To access this strainer,

turn the water off,
drain the toilet tank.
disconnect the water inlet at the bottom of the toilet.
uninstall the water valve by undoing the 1" nut holding the valve at the outside bottom of the tank.
remove the nut, washer, and rubber gasket and put aside.
remove the valve.
at the bottom of the valve there is a plastic screen. It can easily be removed by gently prying it out with a very small
Remove the debris by rinsing it from the outside-in with high flow water and a small scrub brush or old tooth brush..
re-install the screen.
to assure a good seal of the valve, clean the inside and outside of the toilet tank where the valve sits, wipe clean the outside of the valve rubber seal and the outside gasket removed in step 5.
Re-install the valve, turn the water on, and check for leaks. If alls well, the toilet should now fill properly.

Cleaning an R&T A1250 toilet fill valve


Best way to connect Java and Visual Studio 6 C++ via API

Question: We have a web platform written in Java. It will expose certain functionality via some kind of an API - soap, rest or some kind of home-brewed XML. The point is that it'll expose itself via HTTP/s.
There's another stand alone application that was written in C++ (Visual Studio 6) which needs to connect to the aforementioned API. I'm not an expert in C++ so I have hard time recommending something that can accomplish the task. I'm mentioning VS6 as per request of our developer since upgrading is not on a table.
Can someone recommend some library for C++, standard or not, that can simplify API interaction between two applications? If pointed to the right direction, we'll be able to review ourselves to make final decision.
Answer: We use lmx.


Double cousins influence on 1C1R

Question: Working on mystery cousin match who gave me access to her data.  She is seeking birth father whose relatives who have tested are our shared matches. Using DNA painter tools and my known relationships, I have narrowed birth father possibilities to my great aunt and uncle's grandsons. Two of their sons married sisters. My mystery cousin has 996 cMs with my 2C. The possibility of mystery cousin and my 2C being 1st cousins is virtually nil.  Is it probable that of my 2C's brother, 2 1st cousins, and her double cousin, that the birth father is the double cousin.  Would the double relationship passed to mystery cousin result in increased cMs with what should be a 1C1R? My 2C and her son are the only ones who have tested and there is little chance any of her 1st cousins I listed would participate.  Sadly, the double cousin died very young from cancer complications and without any children. All of the potential birth fathers likely had opportunity while visiting father and uncles who lived in the area of my mystery cousin's mom.
Comment: You have a lot of information in your question, but it is difficult to sort through it. A clearer explanation or chart of the cousins you mention would help.
Answer:
I've made a quick diagram to sort out the relationships that you mention in your question, with descriptors referencing the original poster (OP), 2C = OP's 2nd cousin, who matches 996 cM with the Mystery Cousin (MC). GA + GU are the OP's great aunt & uncle, S1 & S2 = their sons, SisA & SisB their wives who are full-sisters, and D the parent of 1C & 1C, 2C's 1st cousins. DC = double cousin of 2C, and E is her son.
2C and her full-brother 2Cb should share ~866 cM with their 1st cousins. As of yet, no tools similar to DNA Painter are available that incorporate complex relationships like double cousins into their DNA relationship estimates. The DNA Geek is working on one.  However, in theory, 2C and 2Cb should share an amount of DNA similar to that of half-siblings ~1759 cM (1160-2436) with their double cousin (DC), because they share two sets of grandparents.
If MC is a child of one of 2C's 1st cousins, then the relationship between them should be that of 1C1R ~433 (102 – 980) cM. If 2Cb was the father of MC, a full Aunt/niece relationship with 2C would be expected, with cMs matching in the range of 1201 - 2282. If MC is the child of DC, MC's DNA relationship to 2C would be similar to that of Half Aunt/half niece, which according to DNA Painter is 871 cM (492 – 1315). Their actual DNA match of 996 cM fits well within that range, so DC is the most likely candidate to be MC's biological father.
Answer: double 1st cousin have around 2000cm there children have about 1000cm which puts your 900cm at a 1st cousin 1 times removed which clearly lines up with the double 1st cousin line
for reference I have one at about 2100cm and there child at around 1200cm
it just basically doubles all relationships that follow so 1st = half sibling, 1st 1 time = 1st, 2nd = 1st 1 time, and so on

Double cousins influence on 1C1R


Has/have been vs was/were

Question: I understand we should use has/have been for something which started in past and still continuing in present. But is it right to use for something which started in past but has just completed or completed a few hours ago?
For example - I want to tell someone in what I did the whole day. Should I say - I have been in meetings all day or I was in meetings all day? May be I should use "was"? Because day is already over? Please suggest. Thanks.
Answer: You can use have been when something has just recently ended. For instance, you would say:

I'm exhausted because I've been in meetings all day.

was would also be acceptable, but I don't think it's as common in this case.
But if it was in the more distant past, you must use was:

I didn't get any writing done yesterday because I was stuck in meetings all day.

It would be wrong to use have been here.
Comment: Thanks Barmar. Can we use also use  "had been" in your example - I didn't get any writing done yesterday because I had been in meetings all day.

Has/have been vs was/were


Installing Android emulator without eclipse

Question: How do I install an android emulator on a computer without eclipse?
Answer: No need to install eclipse for android emulator. Just download the android sdk and install it. You have to install JDK before installing android SDK. After completion of successful install. You will get two apps SDK manager and AVD Manager.
The SDK manager is used to update the SDK and to download the available libraries for different API versions and other libraries as you require.
The AVD manager is used to create android-virtual-devices for available API versions.
Open AVD manager from program files if you are using windows OS, it is very easy to create new AVD for any android API level available.
I hope it may help you.
Eclipse is just IDE to develop apps by using the installed SDK for android.
The "AVD Manager.exe" application can be found in the root SDK folder.
Answer: The android eclipse plugin is simply sitting on top of the command-line tools which android provides for creating an emulator.
Once you have the android SDK on your machine, it provides these command-line tools.
See this article for details.


Error in creating linked server

Question: I have two SQL servers that both have a SQL login called "SQLAuditor" defined with the same password. I want to create a linked server where only that user can "make the jump" over to the other server. I try to do so through SSMS. On the security tab, I use the login as the local login and remote user. In the bottom of the dialog box, I indicate the for a login not defined above, a connection not be made. When I click on OK, I get the error message:
Access to the remote server is denied because no login-mapping exists. (Microsoft SQL Server, Error: 7416)
Any suggestions? Thank you.
Answer: Please create a proper user mapping.
more on this security is listed here : MSDN

Error in creating linked server


Catching the session expiry in pharo seaside 3.2

Question: How to catching the session expiry notification in Pharo Seaside 3.2?
I need remove the user from de active user list when the session expiring.
Answer: You can subclass WASession and tell Seaside to use your session instead via the configuration (see WAApplicationConfiguration>>describeOn:). In your subclass implement #unregistered. This method will be executed when the session has expired (note that this may not happen immediately but only upon the next request to the same application as the this is triggered by the session cache).
Comment: 1. You can react to expiration by overriding `#handleExpired:` in your application class (subclass of `WAApplication`).
2. I don't see why it matters whether a user is logged in to more than one session at a time. It can even be convenient when you use two browsers to access the page at the same time.
Comment: 348/5000
I had tried. The problem I encounter is this:
When the session finishes by timeout and the user tries to login again, the #unregistred method is not executed yet. I use this method to call a method (#logout)) that removes the user from the list of connected users. In this way, the user still appears as connected yet.
Comment: Why don't you store the user in the session?
Comment: I store each user that connects to avoid a double login. If I store it in the session, I do not know how to access it from another session...
Maybe it is my ignorance of the scheme that uses seaside, but should be able to capture the death of the session, for example to present an expiration page. However everything I read is apparently obsolete.
Comment: thank you very much!!I solved it (in part) in that way.
I expected that handler to belong to the class Session...


Why is 192.168.1.1 the most common default router gateway?

Question: Why does most routers has default ip gateway 192.168.1.1? How do I change the gateway? If it gets changed, does every pc connected get a modified ip?
Comment: Your question is in fact 2 questions: why is an @IP often used as a default gateway? and how to change a network gateway?↵You'd get better answer by separating these 2 questions and providing some more information for the 2nd one.
Answer: There are various non-routable (private) address ranges.  See https://www.rfc-editor.org/rfc/rfc1918 and http://en.wikipedia.org/wiki/Private_network for details.  The various ranges allow for varying numbers of subnets and hosts within a subnet.  The reason 192.168.1.1 is so common is that it falls within the smallest private address space (192.168.0.0 - 192.168.255.255)... home networks, relative to business networks, are very typically small so the larger private address spaces (172.16.0.0 - 172.31.255.255 and 10.0.0.0 - 10.255.255.255).
It's not possible to provide specific assistance with changing the configuration of your router without knowing what make/model it is (and version of software it is running). I can simply suggest you to look into changing its "internal" interface IP address.  The configuration of the interface/network will determine the clients' configurations.
For example, in a typical residential broadband connection, if you change your internal interface from 192.168.1.1 (subnet mask 255.255.255.0, network 192.168.1.0, broadcast 192.168.1.255) to 10.0.0.1 (subnet mask 255.0.0.0, network 10.0.0.0, broadcast 10.255.255.255) the clients' gateways will be 10.0.0.1.
Your questions are actually very broad so I hope the above helps and gets you started searching further.
Answer: I believe is because it's easy for remembering - knowing that the router is part of the C network (if we speak for home or small business network), you can easily guess what is his default gateway - they are usually 192.168.0.1/1.1 or 2.1; and yes, you can change it by the router settings, under LAN settings menu.
Answer: like user1801810 said 192.168.xxx.xxx /24  (255.255.255.0) is a class C private address (this means that it can be used by anyone, on a private network such as a home or a office) this traditonally gave 254 usable address e.g. 192.168.0.1 to 192.168.0.254 where 192.168.0.0 was the network address (mainly requried for DCHP (Dynamic Contol Host Protocol)(what assigns your IP addresses)). And 192.168.0.255 is your broadcast address.
Where through the usage of VLSM (Variable length subnet masks), the class-full system is all but obsolete, the base addressing scheme e.g.

Name   Address range   Number of addresses     Classful description    Largest CIDR block
  24-bit block   10.0.0.0–10.255.255.255     16777216    Single Class A  10.0.0.0/8
  20-bit block   172.16.0.0–172.31.255.255   1048576     Contiguous range of 16 Class B blocks   172.16.0.0/12
  16-bit block   192.168.0.0–192.168.255.255     65536   Contiguous range of >256 Class C blocks     192.168.0.0/16
  (https://en.wikipedia.org/wiki/IPv4#Private_networks)

simple example (N = network section H = host section)
NNN | HHH HHH HHH    Legacy Class A 10.0.0.0 to 10.255.255.255 (address range) /8 (cidre = 255.0.0.0 - subnet mask = 0.255.255.255 - wild card (only used when configuring certain routing protocols e.g. OSPF and EIGRP)
NNN NNN | HHH HHH    Legacy Class B 172.16.000.000 to 172.31.255.255 (address range) / 16 (cider = 255.255.0.0 - subnet mask = 0.0.255.255 - wild card mask)
NNN NNN NNN | HHH Legacy Class C 192.168.0.0 to 192.168.255.255 (address range) /24 (cidre = 255.255.255.0 - subnet mask = 0.0.0.255 wild card mask)
wikipedia has good articles on both subnet masks and wild card masks
These (address if not in totality due to VLSM (variable length subnet masks) are still used by network admins, to help predetermine the size of network which they are dealing with.  I hope this answers question 1 of 3 which you asked.
as for question 2:
each router is different, there should be no reason you could not change what address range it distributes (as long as it co insides with the above range).  however with out the actual router make and model I can not advice up on that.
as for question 3.
every pc typically will get their IP address from the router via protocol called DCHP, when your PC is connect to a network it will send a DHCP request using UDP, to ask for a IP address.  If a DCHP server hears this request and has address left in its pool then it will temporally reserve an address and offer this address to the client in this case the PC.  the DCHP address pool is configured upon what the addressing system has been set to. e.g. 192.168.0.0 /24 then it will release an address between the ranges of 192.168.0.1 to 192.168.0.254 (inclusive)  however they may be (almost certainly) "reserved addresses" which are address which should not be sent via DCHP, these are typically the address of any routers (default gateway), manages switches and servers which are on the network.
Hope this helps
TLDR;

the default gateway address comes from the old class-full addressing system
it should be possible look in your router's setting
the address come from a protocol called DCHP


How do I change my skin in Bedrock?

Question: So its tells me to go to different websites and it still doesn't let me change my skin i'm on Bedrock Minecraft and on Nintendo Switch but this happens and i'm also new to Minecraft can anyone help me?
Comment: you have to be on the actual game, i believe switch actually doesnt support custom skins, only marketplace skins
Comment: oh okay thanks!
Answer: The Nintendo switch doesn't actually allow you to make custom skins, but it does allow you to buy different things from the marketplace to customize your character. To do this, buy some mine-coins, head over to the button that says "Profile" and then you can customize your character by pressing "Edit" on the character you want to edit. You can change skin color, height, hair color, and other things like that, as well as buying different clothes and using them. There are also free things, so if you don't want to buy anything, you could just use those free items.

How do I change my skin in Bedrock?


Free fall ellipse or parabola?

Question: Herbert Spencer somewhere says that the parabola of a ballistic object is actually a portion of an ellipse that is indistinguishable from a parabola--is that true? It would seem plausible since satellite orbits are ellipses and artillery trajectories are interrupted orbits.
Answer: The difference between the two cases is the direction of the gravity vector.  If gravity is pulling towards a point (as we see in orbital mechanics), ballistic objects follow an elliptical (or sometimes hyperbolic) path.  If, however, gravity points in a constant direction (as we often assume in terrestrial physics problems: it pulls "down"), we get a parabolic trajectory.
On the timescales of these trajectories that we call parabolic, the difference in direction of gravity from start to end of the flight is so tremendously minimal, that we can treat it as a perturbation from the "down" vector and then ignore it entirely.  This works until the object is flying fast enough that the changing gravity vector starts to have a non-trivial effect.
At orbital velocities, the effect is so non-trivial that we don't even try to model it as a "down" vector plus a perturbation.  We just model the vector pointing towards the center of the gravitational body.
Comment: For the orbital model, the magnitude of the vector changes (as $1/r^2$) as well as the direction.
Comment: "*This works until the object is flying fast enough that the changing gravity vector starts to have a non-trivial effect*" or it works as long as constant gravity field is a good approximation. I think this wording is better, because it's a direct relation, now for whatever reason it changes (speed, timescale, mass, etc.) the simplified model stops working. It also makes clear that the parabola is not a part of the ellipsis, but the approximation as well. (Notabene: Radial gravity model also stops working at certain conditions.)
Comment: For certain types of artillery and missiles we need to do elliptical calculations instead of parabolic because the distances covered means we can no longer assume that the Earth is flat. When firing beyond the horizon the error can be quite significant
Answer: One easy way to tell the difference between a highly eccentric elliptical orbit and a true parabolic orbit is that an object in a parabolic orbit travels at its escape velocity exactly.  In astronomy, such orbits are as rare as circular orbits, i.e. they don't exist.  An object well below the escape velocity can be in an elliptical orbit that has an eccentricity very close to 1, making it look much like a parabolic orbit when only part of the curve is examined.
A relatively slow projectile on the surface of the Earth is actually a closed curve ellipse, and if the Earth got out of its way by shrinking to the size of basketball with the same gravitational field, the object would return to its original place in a long cigar shaped elliptical path.
As an aside, if an object is traveling faster than its escape velocity, it is in a hyperbolic orbit.
Comment: To expand a little more: the path of a Newtonian ballistic projectile under the influence of a single other mass is always a conic section. If the eccentricity is exactly 0, its orbit is a circle, if it is less than 1, the orbit is an ellipse, if it is exactly 1, the orbit is a parabola, and if it is greater than 1, the orbit is a hyperbola. However, the very concept of an "exact value" for a physical measurement is not definable (serious issues under Newton, and strictly not definable in QM). So true circular and parabolic orbits do not exist in reality.
Comment: Because in the movie Hidden Figures the intriguing issue was going from ellipse math to parabola math. Thank you
Comment: What is said in this answer is, sure. But I don't think this is what the paraphrase in the question alluded to.
Comment: To revisit, the problem of going from the mathematics of ellipse to the math of parabola did not come up when landing on the moon (in the movie Hidden Figures) but did come up when landing on the earth. Perhaps the gravitational force of the larger, more massive earth is no longer functioning as a point source. Would this distributed gravitational pull on earth produce a parabola?

Free fall ellipse or parabola?


Is it easy to test human Flicker Fusion Threshold?

Question: How would you go about testing human flicker fusion threshold? Is the testable rate consistent in humans over time or volatile?
Answer: Flicker-fusion rates are very easy to test in humans: you provide a flickering light-source, set it to flicker at different speeds, and get the people to tell you whether the light is flickering or constant. This paper (from 1952) achieved a flickering light by putting a rotating disc with holes in it in front of a projected light source. A more modern testing unit is demonstrated here.
The human flicker-fusion rate does not appear to be a constant. In addition to being influenced by attributes of the light source (such as its wavelength, how much the brightness changes, etc), it also appears to be influenced by factors such as stress and fatigue (pdf).
Comment: Great - thanks for the information. I'm mainly curious on how human flicker-fusion rate in athletes might correlate to size and/or performance. As in some players (possibly smaller) 'see' the game faster. But this seems tough to test in a non-biased way. It seems like testing reflexes/reaction times would be more appropriate.


Restrict users from running DSQuery and DSGet

Question: As a new AD Admin for our Server 2003 domain it's recently been brought to my attention that any authenticated user can run DSQuery and DSGet on any of our Domain member machines. They can even run it from a USB drive. I need to configure Active Directory to restrict DSQuery and DSGet to specific security groups but so far haven't found even a hint of that possibility. Any ideas?
Comment: You're going to have a hard row to hoe trying to "break" the default behaviour / permissions in AD to accomplish what you're trying to do. You can't stop the users from running programs that can query AD (any LDAP client), so you're going to have to go the route busting up the default permissions which will likely leave you with users who can't logon and PCs that don't "act" properly w/ respect to AD client operations.
Comment: Thanks, Evan. Our AD profiles are fairly fully populated and there had been a concern by some faculty (we are a 4-year university) with regards to students querying that info from AD. I'm new to top-level AD administration and, although it didn't seem like a feasible goal, told them I'd at least give it a shot.
Answer: What are you trying to accomplish with restricting them in this way? Every user in AD needs to have read access to the AD so that it can do look ups and get needed authentication and authorization information.
If you are really just concerned about limiting those two programs (which wouldn't prevent them from using something else that reads info from LDAP) you could prevent the use of these programs through a GPO. (User Configuration -> Admin Templates -> System -> Policy -> Don't run specified Windows Applications).
This really sounds like trying to do security by obscurity ... which is just not worth it.
Comment: I completely disagree with Evan's comment. Security through obscurity on its own may be worse than nothing but I, and the global technology security community at large, believe in multi-layer security. The term "security through obscurity" has received a negative stigma (mostly in first year IS Security classrooms) when in fact it can be a valid piece of an overall security plan. Having a very secure lock on your door is great. But in addition to that, not showing burglars the keyhole is even better. However, independent of his last sentence (not worth it), Zypher answered my question. Thanks.
Comment: +1 - Security through obscurity isn't security-- it's worse than nothing, actually, because it gives a false sense of security.


Does purchasing a registered domain name extend the expiration date?

Question: I recently purchased an existing domain name through the site name.com and after I made the payment, I realized that the domain expired about 10 days earlier. Is it legal/good practice to sell already expired domains as-is, or would most domain selling companies also extend the expiration date by an extra year. It wouldn't be such a big deal, however domains with this particular TLD cost $89/year to renew.
Answer: The day that the registration is up they are valid to be resold to someone else.  Registrars won't take on an extra year for free.
Answer: You don't purchase domain names. You pay a registrar a sum of money to register the domain for a period of time.
When the registration period is up the domain is up for grabs (presuming you didn't pay a registrar another sum of money to keep it).
**
When domains expire many (but not all) registrars keep them alive for a grace period (10 days used to be pretty common).  This allows the registrant (you) the chance to renew the domain before someone else grabs it (and thus you avoid a protracted UDRP fight with the new "owner").  Registrars are not obligated to do this though, as far as I'm aware.
Similarly when you move to a new registrar they may honor the balance of your old registration period, or give you a "free year" of registration -- this is just a sales gimmick though: They're not selling a product, just an administrative service which is about 90% automatic and computer controlled, and they're still making plenty of profit off your registration :-)
Comment: Perhaps I didn't make the question clear. I was talking about changing registration of the domain from one person to another, not changing registrars. The registrar has the domain registered for PersonA and personA tells registrar that they want to sell the domain. The registrar then contacts PersonB and PersonB agrees to pay the registrar for the already registered domain name and registrar passes that money along to PersonA minus their service fees. Anyway in my case, they did extend the domain for an additional year.


Ws on transcript affecting admission to engineering masters?

Question: I have a 3.67 GPA at Rutgers in Materials Engineering and I plan on going to UConn for a masters in Mechanical Engineering since my job after graduation is more aerospace and mechanical engineering ( I am working for Pratt & Whitney) and I am more interested in the crossovers between MechE and MSE. However I have some W's on my transcript. One was a Matlab course my freshmen year I took that I hated and dropped a week after the withdrawal deadline (wasn't needed for my major). Another was during my junior year when I did a full time internship and this was an elective in industrial engineering for systems and reliability engineering. The course was in the evening but at a horrible time after work and I disliked it by the middle of the semester and I didn't have an interest in the material anyway. I also withdrew from 2 major classes because of courseload problems one semester my senior year but I took them the next semester and got an A in both. I dropped a graduate level MSE class in thermo recently because the course subject matter was dry (I don't like phase diagrams and chemical thermo too much) so I dropped it; I took the class originally to see if I would like MSE at the graduate level despite my career path moving towards mechanical engineering just to get a feel for things.
I anticipate doing well on the GRE and I can have many letters of recommendation.
Will these W's hurt my chances of being accepted into the UConn engineering masters program?
Comment: Could you explain "W"?
Comment: Rutgers and UConn are universities, right?
Comment: A W is a withdrawal from a course, and yes those are both universities
Comment: So what does "withdrawal" exactly mean? Do you have to register for courses and if you change your mind you obtain this "grade"? Does it have any implications? ..You might want to clear your question up for the international audience.
Comment: In the USA, students have a grace period of sorts at the beginning of a semester/quarter during which they can drop and add classes on a whim (more or less), with no penalty. After this period a student can withdraw from a course without affecting their GPA, and it shows up on a transcript as "W". Some institutions have a WF or WP, to indicate if the course was dropped with a failing a grade or passing grade.
Answer: While it is impossible to know what is in the minds of an admissions committee, I would think a few W's shouldn't matter much as long as your GRE scores are strong and your letters are positive. However, I would consider briefly addressing those withdrawals in your personal statement in a positive way (ie, you preferred another course vs you hating a course).
Basing this on a brief stint on a medical school admissions board in the USA.


Poliigon textures reflection map with PBR

Question: At the moment Im using Blender 2.78. Im using Blender Guru's PBR Workaround for materials. In the scene I'm working on I use textures from Poliigon.com. In the Poliigon help guide it says that reflection maps should not be used in a PBR workflow. So that socket will have no node connected to it. Is it then up to me to estimate the reflection value for the material? That doesn't feel right.
Comment: What does a "*reflection map" mean? Do they mean an Environment Map or a Specularity map? If it is the former it makes sense, and a specularity or reflection map would take care of the reflection amount, otherwise something would indeed be missing.
Comment: Imho you should direct this at Poliigon support how to use their textures. It is paid so they should assist their customers. Their statement that reflection map in PBR workflow should not be used is wrong. It can be, but has very little effect and usually is omitted, because dielectric materials have very similar reflection values (and very low).
Answer: This is how Andrew Price set up his wooden floor.

After some digging I came to the conclusion that this value should be left at 0 in this case.


What is the best way to manage a lightning node to develop a paywall app with c-lightning?

Question: I want to develop a lightning powered paywall app with Django on heroku but don't know how to implement lightning part of the application besides using a rpc lightning package which needs a lightning node address which is online constantly. I am currently running a bitcoin node and a c-lightning node on my laptop but I shutdown my computer at nights(electricity costs too much in Turkey). So what should I do? Should I switch to a seperate lightning node like Umbrel which runs 24/7 without the need of a laptop, install lightning node on Heroku(I dont know if it is possible) or use 3rd party providers like btcpay-server(if it is possible)?
Answer: Accepting LN payments requires being online because the protocol is interactive.
Running pre-configured hardware nodes like Start9 Embassy, Nodl, Raspiblitz or Umbrel is relatively easy way to get there.
Another way is to host your lightning node on a VPS server online, similar you would host your website.
Answer: Yea if you are looking to take lightning payments having your own node is ideal. probably you wouldnt run it on heroku but you could run the code that interacts with your node on heroku easily. Unfortunately I can't point you to a working application of this but generally all you need the program to do is generate a lightning invoice in the amount the user needs to pay and then send that to the users endpoint. It should be relatively simple. Only security feature might be anti-spam so people dont flood the node with requests for invoices. Checking for payments is a bit more tricky i suppose, for that you will need to assign users to their invoices in a way that you can depend upon.


In Agatha Christie's, 'One, Two, Buckle My Shoe', how did the killer know Mr. Amberiotis was going to the dentist at that time?

Question: The story is very clever. But, I've always wondered how the killer was able to plan the murder centered around the dentist. How did the killer know Amberiotis was going to that dentist on that day and time?
Answer: The novel does not say.

The day at the dentist's would have required planning about the shooting, the injection and Blunt being seen to leave. But this would have been simple compared with organising the appointment structure. Disappointingly, however, we are not told how Amberiotis became a new patient of Blunt's dentist, how Blunt found out about this or about the timing of the appointment or how he secured the immediately preceding appointment while allowing enough time for the 'false' Miss Sainsbury Seale to be fitted in later.
John Goddard (2018). Agatha Christie's Golden Age, chapter 19. Stylish Eye Press.

However, perhaps we can imagine a suitable sequence of events. What we can reliably deduce from the novel is that:

Miss Sainsbury Seale "came home from India on the same boat as Amberiotis" where they met.
"About three months ago" Miss Sainsbury Seale recognized Mr Blunt in the street and told him "I was a great friend of your wife's, you know".
"About a week or so before he died", Mr Amberiotis had lunch at the Savoy with Miss Sainsbury Seale, where she told him that her friend Gerda had married Mr Blunt.
Mr Amberiotis deduced that Mr Blunt was a bigamist and phoned or wrote to blackmail him.
"Gerda went to see her [Miss Sainsbury Seale], asked her to tea … Mabelle Sainsbury Seale came, quite unsuspecting. She never knew anything—the medinal was in the tea."
Gerda, impersonating Miss Sainsbury Seale, paid the latter's bill at her "hotel near Russell Square" and took her belongings to the Glengowrie Court Hotel, where she continued to impersonate her.
Mr Amberiotis booked an appointment with Mr Morley (the dentist). In chapter 2 his notebook already contains the time and place, "Twelve o'clock. 58 Queen Charlotte Street."
Gerda, impersonating Miss Sainsbury Seale, rang Mr Morley and managed to persuade him to fit her in on the same day as Mr Amberiotis. We get Mr Morley's account of the call in chapter 1: "A full morning, and that Sainsbury Seale woman to fit in somewhere as she is in pain. I suggested that she should go to Reilly, but she wouldn't hear of it."
Mr Blunt murdered Mr Morley and Mr Amberiotis with Gerda's assistance.

So we have to imagine some additional events. One possible schedule is as follows:

(a) When Mr Amberiotis was having lunch at the Savoy with Miss Sainsbury Seale, he told her about his toothache.

(a) While Miss Sainsbury Seale was drinking the poisoned tea at Gerda's flat, she chattered in her usual way and mentioned that Mr Amberiotis was suffering from toothache.

(a) Gerda, impersonating Miss Sainsbury Seale, contacted Mr Amberiotis and recommended Mr Morley to him.

(a) Gerda discovered the date and time of Mr Amberiotis' appointment by ringing up (as Mrs Chapman, say) for an appointment, mentioning "her friend Mr Amberiotis" to the receptionist (Gladys Nevill), and worming the time (12:00) out of her. We know that Gladys was fooled by the false telegram, so she may have been easy for Gerda to manipulate.

(b) Mr Blunt (or Gerda acting as his secretary) rang up and insisted on getting the 11:30 appointment. We know that Mr Blunt was an important man financially and politically, so he may have been able to bully the receptionist into moving another patient, or he may have gotten lucky and the slot was available.
Answer: These points may or may not work as there will be too much going on around the appointment's time and  Mr Morley's secretary would become a bit suspicious or at least would notice. Nothing of the above points are mentioned in the novel hence it's a whole lot of deduction. What is mentioned though in the first chapter is that Mr Amberiotis is using a toothpick while happily thinking about some prospect (getting blackmail money from Blunt), he gets a bit careless and pricks himself hence the sudden visit to the dentist that day. By that time Miss Sainsbury was already dead. There is no way that Mr Blunt and his wife could be aware of when and why Amberiotis was going to visit that same dentist. They planned the dentist's murder so he can't identify Sainsbury and also to switch the dental records so it would seem that Mrs Chapman had died. So there can be no connection between Amberiotis and Sainsbury regarding a dental issue at that time (Sainsbury was already dead and the dentist's murder was planned for that day) that could have coincidentally and randomly come to the attention of The Blunts making them adjust the murder of Amberiotis in the same dental visit. That is a huge plot hole. Also the fact that Amberiotis chose the same dentist for his first visit is a bit odd but may be he was the only famous and good dentist in the area of his hotel (nearby to where Blunt, his wife and the deceased Sainsbury lived). Plus the Blunts couldn't have thought of it  that day to kill Amberiotis too by just spotting him at the dentist as their appointment times was carefully planned and they used the dentist's death as an excuse to cover up for Amberiotis murder. And also used his anesthetics to kill him. Both murders were so carefully preplanned but the key information of how would they know that Amberiotis will be there at that certain time is so grossly overlooked. It is extremely annoying.
Comment: Mr Amberiotis' visit is not as sudden as you suggest—after poking himself with a toothpick (chapter 2), "He took out his notebook. Twelve o'clock. 58 Queen Charlotte Street." So he had already made the appointment.


Stability of clusters in a unsupervised machine learning

Question: I am new to Unsupervised learning.  I am working on a customer segmentation data (with no labels). I have done K-Means and also calculated the silhouette score for the model. Now I want to study, if the model is good or not (similarity or stability for clusters) using Adjusted Rand Index. Can anyone give an idea how to do it, as I have have only the cluster labels which I believe are 'labels'. In the formula of RAND score, we need the "labels_true, labels" what should be the first one. I have checked on the internet, but not much is available. By the way, I am using Python. Thank you.
Answer: From scikit-learn document Link-

Given the knowledge of the ground truth class assignments labels_true and our clustering algorithm assignments of the same samples labels_pred, the (adjusted or unadjusted) Rand index is a function that measures the similarity of the two assignments

<code>labels_true = [0, 0, 0, 1, 1, 1]
labels_pred = [0, 0, 1, 1, 2, 2]
metrics.rand_score(labels_true, labels_pred)
</code>
126.96.36.199.2. Drawbacks

Contrary to inertia, the (adjusted or unadjusted) Rand index requires knowledge of the ground truth classes which is almost never available in practice or requires manual assignment by human annotators (as in the supervised learning setting).
Comment: Thanks. But do you have  other examples how it is done, other than Iris dataset. I knew the fact before.
Comment: You can try on MNIST digit. Define the clusters _e.g. KMeans with K=10_, use _true_labels and cluster_labels_. Repeat for _K=20,10,100 etc._


Raspberry pi as vr headset

Question: I have come to the conclusion that I want a VR headset for my PC. With the Blu-ray drive I can watch 3D Blu-ray and steam sports VR interface.  That said I don't want to shell out the cash for a VR headset so that leaves me building one.  I found a headset that uses a 4.5 to 6 inch phone and several small screens on eBay.  Thus brings us to the Raspberry Pi itself. My vision is to use the Pi as a second monitor to run the screen and audio as well as being a control interface with an accelerometer and some hand controls and then conections it to the PC using Bluetooth.  I have never used a Raspberry Pi so I have no clue if this is even possible.
Answer: If you have a recent iPhone or Android phone, then the easiest and cheapest way to get into VR is one of the many Google Cardboard headsets. Cardboard headsets made from actual cardboard range from free to a few dollars, nice plastic headsets can be found from $15-$20. There are more expensive Cardboard compatible headsets, but they can be expensive.
The Pi3 is probably roughly comparable to late '90s SGI workstations like the O2, so you may be able to drive a pair of low-resolution screens with simple wireframe or non-textured triangles. But the amount of work necessary in terms of both hardware design and software development is likely to be substantial.
Further, the Pi doesn't have a video input port, so you are unlikely to be able to take video content from a PC and display it on a Pi. If you have the EE skills to DIY your own Rift headset, you are probably better off applying for a job at Oculus.
That said, the Pi can be an effective local Cyberspace Deck, hosting a small web server that provides little VR apps written in Three.js or similar. You will still need separate hardware for your headset, but the Pi can be a great way to ensure that your demo content is always available, even when a network connection isn't.
Comment: thanks like I said I am not realy familiar with the Raspberry Pi platform but it sounds like it might be better off just wireing a hdmi from my graphics card to the monitor in the headset and using a aduino as a head tracking sensor
Comment: An AVR may be a much better choice for bringing sensor data into a VR headset. Linux is far from a real-time OS, so the Pi platform may introduce unwanted latency into your project. Additionally, after you prototype your project with Arduino, you can build your own minimal AVR board to keep volume and mass down. Critical considerations in VR.

Raspberry pi as vr headset


Writing a game for the Nintendo Wii

Question: I'd like to write a game for the Nintendo Wii. How do I go about obtaining an SDK and/or any other tools necessary for writing a game?
Answer: The Wii Remote and Wii Balance Board use bluetooth.  You can pair them with your PC and write your own PC apps that interact with them (like this guy).  If you want to make something that actually runs on the Wii, you can try finding some homebrew development help.
If you want to actually sell your software for Wii, you need:

game development experience
secure office facilities
$2,000 - $10,000 for dev kit (WiiWare is cheapest)

The Nintendo Software Development Support Group
Authorized Developer Application
UPDATE: Also see the Wii U Developer Site. Nintendo now has a simple application for individual developers to makes games for the Wii U, giving you access to the SDK and dev-kits.
Comment: What about 2020? There are any free dev kit?
Answer: You could spend literally thousands of dollars on the dev kit or you could be a bad person and go look at the homebrew stuff. It is technically hacking though, so I only hypothetically recommend it.
Answer: If you are a one-man team, then your only option is really WiiWare. At $2000 for the kit, you picked the right console. That's a tiny fraction of the cost of a 360 or PS3 dev kit.
You do have to have your own business. You also have to get your game rated by the ESRB which will put you back another $2500. Your game also has to be really good. In the end you could spend all the money and time and have Nintendo refuse to publish your game for any reason whatsoever.
Answer: A different approach... Flash.
You could develop a Flash game that is controlled only with the mouse. Put the game on the web so that it can be played on the Wii via the Wii's browser. The game might not be as exciting as a direct-to-Wii game, but you won't have to deal with things like development kits and modded Wii's either.
Comment: I really wanted to know more about the wii balance board, but I have since modified the question to make it more general. I like your answer, so +1, but it  doesn't apply to my situation.
Answer: You would have to get in contact with Nintendo of America and obtain a developer kit from them. Be prepared to spend a wad of dough though.
Check this out:
http://www.nintendo.com/corp/developer.jsp
Answer: Yes the SDKs (and dev hardware) are expensive, and you must be an actual company with an actual office to get one.
Answer: The information in this post is dated.  Today I set up an account with Nintendo as an individual using my full name as the company name. With this account I have access to the Nintendo Development Portal.  There is some level of support provided.  I should be able to develop an app.  To expose my app on the Nintendo site will require that they have access to the code and full approval rights. I'm mostly in it for fun right now.  But if you are looking for something interesting to do and have some ideas I would check it out.
https://developer.nintendo.com/

Writing a game for the Nintendo Wii


How to safely try KDE?

Question: There's a way to safely try KDE on top of an Ubuntu installation, keeping the possibility to revert the changes in case I dislike how it runs?
Answer: The absolute safest way to do that is to install it on a separate partition, but that's probably more work than you need.
What I'd recommend is to install Kubuntu. I'm not sure if that's really what you meant when you said "KDE on top of an Ubuntu installation", but Kubuntu is little more than KDE+Ubuntu. Just do:

sudo apt-get install kubuntu-desktop

on any terminal window (it will install a ton of kde packages). By the end, you'll get prompted if you want to use gdm or kdm as login manager. It's OK to choose either one, but kdm will give you the full Kubuntu experience.
Next time you boot, just before logging in, choose KDE as your session manager. It will use the same $HOME and the same root folder, and thus you'll still have all the same programs installed, and their respective settings will be kept. I might be wrong, but I think only the settings stored under ~/.gnome2/ won't be loaded by KDE (they are gnome settings after all).

Finally, you don't really need to remove KDE after that. You can keep using gnome regularly, and never choose KDE again in the session manager. If, for some reason, you do want to really remove KDE (maybe you need to free up space), here's what you do:

sudo apt-get purge kubuntu-desktop

kubuntu-desktop is a dummy package (you'll notice the removal process will be quick), removing this package will make apt consider all of the kde packages as unnecessary (since they were brought along by this one), so just do:

sudo apt-get autoremove --purge

If you chose to keep gdm as your login manager, you can stop here. If you happened to choose kdm as your login manager back in the first step, you'll have to either reinstall gdm (it's technically already installed, so you can just reconfigure it if you know how) sudo apt-get install --reinstall gdm or reinstall kdm again sudo apt-get install kdm.

EDIT According to @AnwarShah the method above for removing Kubuntu doesn't actually work. I don't have an Ubuntu machine on which to test that right now, so I'll just provide an alternative method.
The command provided in this answer, should purge all traces of kde from your system. Before running it you should read all of the packages and make sure none of them had been previously installed by you! Make sure to remove the name of any packages you want to keep.
(Also, I haven't read through all of those packages, so I can't garantee anything regarding the commands effectiveness.)
Alternatively, you could keept track of all packages installed when you install kubuntu-desktop, and then just do apt-get purge on these packages. This requires the forethought of copying the list of packages back when you installed kubuntu-desktop (and remembering where you saved it), but it's a little safer to do.
Comment: Thank you so much: how do I keep track of every packages that come with kubuntu-desktop?
Comment: @dag729: When you perform that first command, apt-get will list all packages that will get installed and ask for your confirmation. Copy them somewhere.
Comment: Usually, after "apt-get purge kubuntu-desktop", you can run "apt-get autoremove --purge" to remove everything else it pulled in.
Comment: Perhaps, though `gdm` should still be there.  If not, try following it with `sudo apt-get install ubuntu-desktop` to make sure it had everything Gnome needs.
Comment: @kees: I thought about that, but wouldn't that remove kdm as well (thus causing issues on login)?
Comment: gdm will certainly still be there, but it will need to be reconfigured (or reinstalled) in case kdm is removed. I'll edit the answer with your method.
Comment: @BruceConnor.I test it and never works. Did you actually test it in your machine ?. It only removes `kubuntu-desktop` and after the second command nothing happens. I happens because `kubuntu-desktop` is a metapackage and in the case of metapackage, apt does not remove other packages which this metapackage brought.
Comment: I'm not sure, I think I just trusted @KeesCook comment. =) From reading the manpage it seems like it should work. I'll add an extra method anyway.
Comment: @BruceConnor, Thanks that you notice it, But the problem with second method is it is dependent on the version of Ubuntu, (actually Kubuntu, since the default packages installed by `kubuntu-desktop` may change. Anyway, It will helps users.
Answer: Just install it...

sudo apt-get install kubuntu-desktop

At login (after entering your username) you can select which one you want to boot (gnome/kde/xfce/...) so it's always possible to go back to gnome, even without rebooting.
Comment: That works. Uninstalling the parts if you don't like it is not quite as straightforward, but can be done.
Comment: I'd also add a new user just for testing KDE so it doesn't clutter up your existing $home with KDE configuration files. If you like KDE, fine, just use your normal user with the KDE session. If you don't like it, your profile hasn't been affected in any way.
Comment: Creating a different user for testing purposes is in my opinion the best solution.
Comment: @frabjous: Though if you mark everything kubuntu-desktop requires as an automatic (instead of manual) install, e.g. through aptitude, that should be much easier.
Comment: Uninstalling is not that easy. I tried it in natty, oneiric, and now in precise. It never works. Because dependents packages are never marks as automatically installed. This can give you a hint. `apt-config dump`.
Answer: Maybe http://www.psychocats.net/ubuntu/kde can help you.
Just install Kubuntu Plasma Desktop system on your computer through the software center.
To uninstall it follow the instructions given here:
http://www.psychocats.net/ubuntu/puregnome
Answer: Run it in a VM?
Or try a Live CD.
Comment: Not an option, because I want to see how it works on the same conditions as gnome: I know how it is (I used kde back in karmic), but I want to try it with this new hardware and configurations.
Comment: Ah, okay. Well a Live CD would work as well.
Comment: @Mitch "Run it in a VM or try a live CD" is definitely an **answer** to how to safely try a wide variety of software, *including* KDE. Answers don't become comments *just* by being short. If this were posted as a comment, I'd comment requesting that the author make it into an answer.
Answer: My choice (since refurbished systems are really cheap ~ $200) build a test-bench with these! I have several test-bench systems that I install on - before installing or upgrading critical systems. I've tried the live CD, but I prefer the test-bench.
Comment: The poster is specifically wanting to see how it runs on his system.
Comment: yes - but you don't experiment in a production environment (or if there is a fear you may lose data.
Comment: I use this standard - even on LTS upgrades.

How to safely try KDE?


Estimating the number of clusters

Question: For a collection of points in $\mathbb{R}^n$, is there a statistic that I can compute which will estimate the number of clusters with some level of confidence?
Answer: I don't know if this is the most effective answer, but it has to be one of the coolest:
Barcodes: the persistent topology of data
It lets you estimate not only the number of connected components but also the higher Betti numbers.  (For instance, if you take a random sample of enough points from an annulus, you will be able to measure both H0 = Z and H1 = Z.)
Comment: I don't think persistent homology actually would help with this. The question doesn't seem to be about data analysis, but clustering of data.
Comment: Isn't persistent 0th homology pretty relevant to the OP's problem?
Comment: Yes, that's true.
Comment: Actually, this "Barcodes" paper points to projection of high-dimensional datasets into lower dimensions and then recognizing shapes.  The projection vector used to decrease the dimensionality of the data points has a strong effect on the possible separability of the clusters.  I actually don't know if there's a good way to pre-estimate the number of expected clusters without considering *a priori* factors about what the data set it.  But the paper does not necessarily address what the best projective vector might be.
Answer: Carlsson has developed methods from applied topology to do clustering work. Robert Ghrist called a talk about this "Clusterfunctor" since it involves a functor from metric spaces to "persistent sets". It's talked about in Topology and Data, a survey article about using topology to do data analysis.
Answer: This is an age-old question, which actually does not have (I think even cannot have) a definite answer, because first you need to define what you mean by a cluster and so on. A famous saying in this regard is that "cluster is in the eye of a beholder". It is easy to construct examples where somebody could see one cluster, but somebody else more than one.
This being said, the MDL (minimum description length) principle would lead you
to devise (IMHO) a clustering cost function in a most principled way, which by
optimizing you could the find the cluster assignments and number of clusters
simultaneously. For multinomial data you can see following:
P.Kontkanen, P.Myllymäki, W.Buntine, J.Rissanen, H.Tirri, An MDL Framework
for Data Clustering. In Advances in Minimum Description Length: Theory and
Applications, edited by P. Grünwald, I.J. Myung and M. Pitt. The MIT Press,
2005.
The intuitively-appealing idea behind MDL clustering is that by clustering you
create a model of the data. So the assumption is that a very good model is one
that lets you compress the data well.
Anyway MDL might not be easy to apply, if you are looking for a practical way to detect the number of clusters. BIC (Bayesian information criteria) and the F-ratio have
proven to work OK in practice.
Answer: I think that for computing a level of confidence you need a model of clusters, for example a gaussian mixture model.
If the level of confidence is not an issue and you need simply the "right" number of clusters I would repeat what Ville said plus the following article:
Estimating the number of clusters in a dataset via the Gap statistic (2000)
Tibshirani, Walther, Hastie
http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.34.6664
Answer: There is a whole research field on this, and the answers so far have only highlighted a few of the specific algorithms developed. Check out this Wikipedia article on cluster analysis for an overview and some references.
Comment: See also [Determining the number of clusters in a data set](http://en.wikipedia.org/wiki/Determining_the_number_of_clusters_in_a_data_set) on Wikipedia and [Chapter 8](http://www-users.cs.umn.edu/~kumar/dmbook/ch8.pdf) (especially Section 8.5) of *Introduction to Data Mining* by Tan, Steinbach & Kumar. (Chapter 8 has kindly been made available on Kumar's [website](http://www-users.cs.umn.edu/~kumar/dmbook/index.php).)

Estimating the number of clusters


Eventualities and their existence

Question: Emmon Bach uses in "The algebra of events" the term 'eventuality' to denote states, events, processes, etc. How can their actual existence be expressed logically? For example, when I say "John came" the eventuality e in ∃e.came(John) obtains whereas in "I want John to come" John's coming is an eventuality which doesn't obtain. Can a first-order predicate be used, something like Obtains(e)?
Comment: Perhaps various systems of modal logic are more suitable to express intentions, or things that "don't obtain" (are not actual) generally, than extensional logic.
Comment: You will typically get opaque context paradoxes with intentions. Say you don't know that Clark Kent is Superman: "I want Clark kent to come" can be true while "I want Superman to come" is false, which violates the principle of substitution of identicals of extensional logic.
Comment: @quen_tin But this is the point. If your two sentences would be eventualities e1 and e2, then Obtains(e1) needn't imply Obtains(e2) as the embedded VPs would also have different eventualities.
Answer: You can use an  "obtain" predicate but it sounds very much like Meinong's distinction between being and existence, and it's not a very popular solution.
Predicates are used to denote properties but it is doubtful that existence (or "obtaining") is a property as such.
See this article for alternatives: http://plato.stanford.edu/entries/nonexistent-objects/
Comment: Thanks. So I think that Obtains is an extranuclear predicate (and the existence of eventualities their extranuclear property). I at least know now what to look for.

Eventualities and their existence


Why do i get Lens reflection in final photo with Lee Nd filter super stopper 15 stops

Question: Why do i get Lens reflection in final photo with Lee Nd filter super stopper 15 stops   100x100mm
I have attached photos of final picture and the set up i am using a 77mm adpater ring and holder
Lens-tamron 10-24mm
I have also taped up my viewfinder as i have heard this can let light through onto the lens but no difference
Comment: What does the back and sides of the filter setup look like?
Answer: As BobT noted, you are getting light leakage from behind the filter.
Lee's "Stopper" line of filters have a foam gasket on the back side of the filter, on all edges. For extreme filters such as the ND4.5 / 15-stop Super Stopper, it's absolutely imperative to block all light leaks.
Looking at your Zomei filter holder, there is no single flat surface where a square foam gasket will completely block all extraneous light from behind:

The "scallops" at the top left and right will likely cut the corners behind the gasket.
It looks like it might be possible for light to leak behind the filter at the very top and bottom because the curvature of the filter holder might be larger than the dimension of the filter.
The adapter ring surface does not sit flush with the front face of the filter holder. If it were to sit flush, as the Lee filter holder does, it would provide additional gasket bearing surface on the tops and sides of the filter, to help block more light.

I believe your Zomei filter holder is not up to par for light stopping filters such as the Little/Big/Super Stoppers. It's probably fine for 1–4 stop ND or ND grad filters, etc. (which don't have light-blocking gaskets), but not for any gasketed filter.
To make up for the light leaking on the Zomei, you will need to be diligent to completely block the light from behind with light-blocking material, gaffer's tape, etc.
Comment: Thanks for all the information it all makes sense now.I am going to purchase another nd holder that is sealed a lot of money but hopefully this works. Thanks for all the comments on this question much appreciated
Comment: @Ryan I use the Lee filter holder myself. But if you don't think you'll make much use of graduated ND filters in conjunction with the super stopper, you might consider round screw-on ND filters instead, as BobT suggests.
Comment: A lot of time the cheaper third party holders let the light leak in on the *sides* where the holder is punched out to grip the filter.
Answer: Since the filter is a slide-in type rather than a screw-in type there is some potential for light leakage around the frame of the filter and/or holder. Normally this may not matter, but with the long exposures you're making -any- leakage can show up. Try putting a dark-cloth or other light opaque material over the camera/filter assembly, making sure to cover the edges of the filter assembly. Opaque black tape might be useful as well.
Comment: Thanks for the advise. I got a 100x100mm nb would a 100x150mm filter help this as my cheaper filters were this size and i got no problem with this what so ever?
Comment: @Ryan Do the Stoppers come in 100x150mm? I don't think they do (no need for them to be rectangular, since they don't need to slide up/down like ND grads need to)
Comment: @Ryan No... I don't think that alone would fix the problem. In fact, it'll make it more difficult to mask out extraneous light. IMHO a screw-in filter is the best way to go... I don't know what your 'cheaper' filters do, but I doubt that they require the exposure that the 15 stop ND requires, so leakage is less of an issue.
Comment: It's really not so much about the filter as it is about the holder. Some of the cheaper off-brand holders are bad about letting light through the sides of the holder.
Answer: The next problem you will encounter after fixing the filter light leakage will be the camera viewfinder light leakage, if you try using your strong ND filter outdoors (the problem probably won't show up indoors, which is why you haven't seen it yet).  Slip the DK-5 eyepiece cover over the eyepiece.  You can attach the DK-5 onto the camera strap so you'll have it when you need it, and you can leave it on the strap while slipping it over the eyepiece.
This works better than tape, which can leave undesired residue.  Higher-end Nikons have an eyepiece shutter for the same purpose.


Scientific methods to obtain perfect color gradient between red and green for scale

Question: I am in the course of designing an application that allows users to ask survey questions by swiping along a coloured scale. For preliminary testing, I just took a coloured gradient from the internet that transitions from red green with yellow in the middle, which has worked fined, in principle. However, since the app will now be subject to scientific testing and perhaps result in a scientific paper, I was wondering about two things. First of all, is there any literature or reference as to which shades of green / red are recommended for scales that represent agreement / disagreement or any other scientific literature related to this topic? Secondly, I asked myself if there is a scientific method for obtaining a "perfectly fair" gradient between two colours, and if there is a way to obtain and especially formalise the process maybe by using mathematical formulas, so that it can be replicated by anyone. Since I'm really new to the design aspect, please excuse my limited knowledge, any hint or thought is highly appreciated.
Comment: If this is something that will be used for scientific research, why use a slider that's questionable in its answer accuracy? Is there a reason you're not using a standard 0-10 type radio button or check box method?  I'm also not really sure that this belongs in this forum.
Comment: @Alith7 It is a new instrument that ought to be evaluated and compared to standard methods such as a slider like you are mentioning. But thanks for pointing out that this might not be fit for this forum.
Comment: This is just an assumption on my part, but I also think that for general public input, anything that uses the difference of red to green is avoided due to avoiding any issue with color blind people.
Comment: Take a look: https://graphicdesign.stackexchange.com/questions/83866/generating-a-series-of-colors-between-two-colors/83869#83869
Answer: Color theory is not a hard science, its more traditional level stuff. Mixed with older hard science studies. Now color science, which is a cognitive science subfield, is a hard science, but also really really complicated. .
There are some standard scientific scales. Like for example on better figures org. Color science gives you methods to calculate color distances, but not to my knowledge how sequences should be made. We can not really objectively answer the question how to correctly go from red to green for example because there are no straight lines in color just several different straight and curved lines.
However you might want to avoid obsessing about this too much since once you do you will find that human color vision is affected by surrounding color ambiance so if you a want to be scientifically truly accurate you would need to calibrate the tablet several times an hour. Even so you need to calibrate your tablets to show same color or a count for this in some way. No screen is exactly the same as another without this step.
Comment: that reference link is an exceptional explanation!  Thank you for sharing!