SQL Server 2008 upgrade to SQL Server 2012 on a cluster

Question: I have a Windows 2008R2 2 node cluster with SQL Server 2008 clustered. How do I prevent the cluster from failing over while I am applying the SQL Server 2012 to the alternate node first? Any pointers on upgrading the SQL Server cluster to 2012?
Answer: The Setup.exe will do the dirty work for you and take the passive node (currently upgrading node) away from being a possible owner of the SQL FCI's virtual network name (VNN).  But if you want to ensure that this is happening (which I recommend, it's what I always do), then you can manually take the passive node you're about to upgrade off of the possible owners list for the FCI's VNN.
You could use the GUI (failover cluster admin) or PowerShell to accomplish this task.  Below is an example of the latter:
Get-Cluster -Name "your cluster name" |
    Get-ClusterGroup -Name "SQL Server (your instance name)" |
    Get-ClusterResource -Name "SQL Network Name (your FCI's VNN)" |
    Set-ClusterOwnerNode -Owners "current active node"

All of the parameter strings there need to be specific to your environment.  Note, calling Set-ClusterOwnerNode will set the list of possible owners for that cluster resource.  Depending on how many nodes are in your cluster, that could contain more than one string (i.e. Set-ClusterOwnerNode -Owners "ACTIVENODE", "SOMEOTHERNODE", "ETC.").
Something to be knowledgeable about, there is a KB for a fix for a failover cluster instance upgrade from SQL Server 2008 [R2] to SQL Server 2012.  I recommend you review it before the operation.
As for other tips and tricks, I would recommend you read this BOL reference on upgrading a SQL Server Failover Cluster Instance.  There is a lot of great information in that article that should be considered.
Answer:
How do I prevent the cluster from failing over while I am applying the SQL Server 2012 to the alternate node first?

You can do rolling upgrade and use /FAILOVERCLUSTERROLLOWNERSHIP as follows :

• /FAILOVERCLUSTERROLLOWNERSHIP = 0. Designating this option means that SQL Server instance cluster ownership is not failed over to upgraded nodes. After the node is upgraded, the current node is not added as a possible owner to the SQL Server instance.
•  /FAILOVERCLUSTERROLLOWNERSHIP = 1. This option specifies first to fail over the instance from the current active node that is being upgraded; second, to upgrade the node; and finally, to add the upgraded node as a possible owner.
•  /FAILOVERCLUSTERROLLOWNERSHIP = 2. This is the default setting, which you will encounter when you use the attended (GUI-based) upgrade installation. It results in automatic management of cluster ownership depending on the number of nodes and their upgrade state. If less than half of the nodes have been upgraded, the /FAILOVERCLUSTERROLLOWNERSHIP parameter follows the behavior of option 0 (cluster ownership is not rolled to upgraded node and node ownership is not added). If half or more than half of the nodes have already been upgraded, the /FAILOVERCLUSTERROLLOWNERSHIP parameter follows the behavior of option 1 (SQL Server instance is failed over to an upgraded node and the current upgraded node is added as an owner after the node upgrade is complete).

Refer to :

Upgrade a SQL Server Failover Cluster Instance (Setup)
Cluster Upgrade (SQL Server 2008 R2–> SQL Server "Denali")


How can I tell mac to stop trying to connect "idisk" server?

Question: 10.10.5 and 10.11.6 on same network, Imac and macbook pro. I get a re-ocurring popup that says,  "cannot connect to idisk" popup notification. It keeps returning even though I select "cancel". It holds my system hostage, not allowing other apps to work until I (again, and again) try to click it away by pressing cancel. It goes away for a while, but eventually returns.
Comment: Do you have any apps that may have used iDisk in the past set to run at startup? Check `System Preferences > Users & Groups > Login Items` tab.
Comment: No I do not. IDisk was a part of the subscription of mac.com (when it existed). You were able to access the site through IDisk. It no longer exists as that entity. I was a part of this about 7 or 8 years ago.
Comment: Is there an iDisk app in the Applications folder? You should also check `System/Library/LaunchAgents` and `System/Library/LaunchDaemons` for any iDisk .plist files, as well as `~/Library/LaunchAgents` and `~/Library/LaunchDaemons`. If the .plist files exist, delete them. (There may not be a `LaunchDaemon` folder in your user account, BTW.)
Answer: My own experience is with PCs, but I'll give this a shot.
From what I've been able to discern, iDrive is an online backup program. You don't say, but I'm assuming you have an iDrive account, and it keeps trying to connect. I've seen similar behavior with GoogleSync, when it checks files and brings my own system to a standstill until it's finished.
I checked, and Macs have an equivalent to Task Manager, the Force Quit Applications Manager. Command+ Option+ Escape will bring this dialog up. Search for the iDrive application in the list of apps. There should be an option to click on the list of apps (process name), and it should sort -- I'm basing this on PC experience. Scroll through the list for the iDisk app. Click on it to select, and the QUIT button is on the upper left corner. This should terminate the application. This should free up your machine to do other things.
Once you are done, however, this is a temporary solution. The next time you boot up, you will have the same problem. You need to address WHY the app is having problems. I have not used iDrive, but assume it's subscription. Is your account active? If not, you should uninstall the app. If you are a current and active subscriber, you might then need to call the company to find out why you aren't able to log in. I am assuming it worked before without issues and without bringing your system to a standstill. Assuming you are subscribed and want to keep the app, there may be an option to repair the application; not all software has that option, but the better ones do. Otherwise, barring a call to the company, you might need to uninstall and re-install. Macs are pretty stable machines, but sometimes an application does get corrupted.
The steps above should help you get control of your Mac. Again, then you need to deal with the iDrive program and why it's misbehaving. Good luck!


experience replay in Monte Carlo control

Question: Does it make sense to do experience replay when using Monte Carlo method (ex. on-policy first-visit MC control as in chapter 5.4 of Sutton and Barto 2018). Will experience replay help in the context of Monte Carlo control at all? If so, how to implement it? Store $(s_t, a_t, G_t)$ where $G_t=R_{t+1}+R_{t+2}+...+R_{T}$ and sample them later for updating $Q$?
Answer:
Does it make sense to do experience replay when using Monte Carlo method (ex. on-policy first-visit MC control as in chapter 5.4 of Sutton and Barto 2018).

Experience replay is inherently off-policy when used for a control problem. When the replay memory recalls a specific experience that happened in the agent's past, the agent will very likely have updated its policy in the intervening steps. Which means that the policy that generated the experience is different to the policy that you wish to update the estimated values for.
This means that you cannot just use the stored Monte Carlo return $G_t$ using your idea of storing $(s_t, a_t, G_t)$.
Instead, you need to store enough data to correct the sampling bias from the mismatched policies. That means for each step, you need to store $(s_t, a_t, \pi_t(a_t | s_t), r_{t+1}, s_{t+1})$, where $\pi_t(a_t | s_t)$ is the probability that the agent chose that action under the policy in effect at the time.
With this you can then re-create trajectories and values of $G_t$ for the current policy using importance sampling. This is fiddly and will involve either storing the original data as complete trajectories, or constructing possible trajectories by looking up replay memory based on $s_t$ to get steps in turn (it is OK to mix and match policies in a single trajectory, provided you know $\pi_t(a_t | s_t)$ and therefore can get the correct weighting to apply.
If you are dealing with long trajectories, a large experience replay table, and you want to target the current guess at an optimal policy for updates, then the whole thing is likely to be very inefficient, as many updates for early state, action pairs will end up having zero relevant information in the replay memory to allow you to calculate the importance sampled return. You only get to find that out by performing the calculation, so in some scenarios you could spend a lot of computing power achieving very little.
Unfortunately, the recalculation of trajectory probabilities in order to perform importance sampling makes this method far more cumbersome than when the same idea of experience replay is applied to single-step TD methods, such a Q learning. Singe-step Q learning still needs to re-calculate a sampled expected return (the TD target) from a given state, action pair - however it only evaluates this using data from a single step and does not actually look at any policy decisions that affect the outcome of that step (the first action $a_t$ does not count as it is the one being re-evaluated, and the second action $a_{t+1}$ does not count because Q-learning takes a $\text{max}$ over all choices, ignoring polciy choice). So single-step Q learning does not need to know what the behaviour policy actually was, and can perform calculations based on just one row from experience replay table.
Moving the idea of experience replay to an approach that works with longer trajectories than a single step is not easy, or it involves some kind of compromise. For example, in the "Rainbow" DQN paper, the authors use n-step returns whilst ignoring the need for importance sampling, and it still makes an improvement to Atari benchmarks even though it gains bias due to not handling off-policy of historical data correctly. That is a risk that offsets reduced bias from longer trajectories against increased bias from off-policy sampling, affected by things such as the size of replay memory and the speed at which policy can change and exploratory moves are taken.


Alternating breakers have power and no power

Question: I noticed I had an issue with no power in parts of my house. Both lights and receptacles affected. I go with my multimeter to the panel, and I have on the  8 breakers on the left and 7 on the right, in thleft side,I have power to 1,3,5 and 7. No power to 2,4,6 and 8. On th right side No power to 1,3,5,7 and power to 2,4 and 6. I see a clear pattern, but don't know what to do going any further.
Comment: Call your electric utility and report partial lights out.   Electricity is delivered to you as two separate 120v feeds, one of them has a problem.
Comment: Are your 240 V appliances working: a/c, electric range, electric clothes dryer? It may not be good for them to try to use them, if you have one 120 V leg out.
Comment: If you have a gas kitchen range, it probably has electric igniters. Is it working? What about the refrigerator? What kind of water heater do you have? Most tankless gas water heaters now require 120 V for controls.
Comment: No the dryer is out. Luckilly it hasn't been cool enough to need the furnace. But thank you for your help. I'm gonna call PECO 1st thing tomorrow morning.
Comment: What kind of electric panel do you have: brand and type? Do you have a single master breaker for the whole panel or do you have 240-V 2-pole breakers in one section and all the 120-V breakers in a separate section?
Comment: PECO may come out on Sunday for this type of outage. Report this through their website.
Comment: Where are you located?
Answer: It is clear that you have lost a phase or a neutral. The reason you are getting strange readings is when you experience a phase or neutral loss it can turn some circuits into series circuits. This causes all kinds of weird things and readings to happen.
Start by turning all of the branch circuit and feeder breakers off. Then check the voltages just below the main breaker. You should read approximately 120V to the ground bar on both phase A & B, and 240V across A & B. If you are reading anything other than that. You have lost a phase. Then you can do the same thing to the incoming lugs above the main breaker. If you get different results than what you just read below the main, then you have a bad Main breaker. If you get the same result your problem is either the utility power or at the meter.
If you get the same results above and below the Main, then disconnect the ground wire from the neutral bus and take the same readings both to the neutral and to the ground. If you are getting voltage to the ground and not to the neutral then you have lost a the neutral, and it is usually between the panel and the utility power. Do you have an overhead drop? I have frequently found a break in the drop neutral (the bare wire).
Use extreme caution when taking these readings because you have no real overcurrent protection if you foul up. If you feel uncomfortable then you should bring in professional help.
The bad news is that if it is a main or the meter installation, you will need a professional to do the repair. I would never recommend that a DIYselfer try to make the repair, since it requires a trained person in safety and procedure to perform such a replacement.
The good news is if it's a break in the utility drop. Then they will make the repair.
Stay safe and good luck.
Comment: Some utilities (the one in my area at least) will pull the main panel cover and tighten main breaker lugs while they are out on a 'check customers service' type of call.  They stop at that point tho, if a main breaker needs to be replaced they will not, in fact they will pull the meter and red tag the meter can.  Customer would need an electrician and emergency city permit at that point.


Where is my Geowebcache tile directory?

Question: I have actived and created tiles for layers in my Geoserver 2.5 on windows server 2008 R2. In geoserver it states that I have used 583MB in total after seeding the layer in GWC. Strangely I cannot see where the tiles are being created. I have not set an environment variable to move the tile directory anywhere else, so I expected the tiles to be in the data_dir. However the only directory I have is gwc-layers which contains the xml configuration files. So where is the tile cache?
Comment: I changed the GEOSERVER_DATA_DIR in web.xml. After restarting geoserver in tomcat manager, the gwc directory was created and all the tiles are now being created.
Comment: It's a very strange behavior, because if you didn't change the "geowebcache data_dir" path, GeoWebCache should automatically store cached tiles in a gwc directory inside your GeoServer data directory. Since you say you have already created several tiles you could do a search with windows tool
Comment: Check to see if the tiles has not been placed in the temp files in the windows directory. I had the same problem and for some reason it put the tiles in there.
Answer: By default the tiles are in data_dir/gwc, if not maybe try fo find file geowebcache.xml - it should be placed in folder with tiles
Comment: There is no geowebcache.xml in the entire tomcat webapps directory!?!  I have no idea what went wrong but the directory gwc just didn´t get created. When I seed tiles, it even shows me how many have been created and how many are left to create! Very strange behaviour!
Comment: You can check the dir location, and change it if necessary from within the geoserver ``web.xml``. Check http://docs.geoserver.org/2.5.x/en/user/geowebcache/config.html#changing-the-cache-directory
Comment: Strange indeed... few days ago I launched geoserver on default settings and tile seeding run without any additional operations.
Answer: An easy way of finding GeoWebCache's tile directory is having a look at the bottom of the GeoWebCache homepage:
Answer: If your geoserver url is http://localhost:8080/geoserver or just replace localhost with your domain and then go to the url: http://localhost:8080/geoserver/gwc.
You are now at GeoWebCache home page and scroll down the page.
Below the page you will see something like this
<code>Storage Locations
Config file:    /tmp/tomcat7-tomcat7-tmp/geowebcache/geowebcache.xml
Local Storage:  /tmp/tomcat7-tomcat7-tmp/geowebcache
</code>
This is the geowebcache directory where all your tiles are created and stored after seeding a layer.

Where is my Geowebcache tile directory?


How to use logic classes with styled components

Question: I want to use this logic to applying the corresponding class to an element:

But I am using styled components, I don't understand how I can use logic to totally change the component. Any ideas? I am using Next.js
Answer:
You can pass a function ("interpolations") to a styled component's template literal to adapt it based on its props.

Read this section, Adapting based on props, in Styled Component documentation. In your case, because you didn't provide the details of the code, I can only give you an example:
const DropdownMenu = styled.div`
  display: ${props => props.clicked ? "none" : "block"};
`;


Are there technical names for accidentals?

Question: Are there technical names for non-natural notes? By technical name, I mean tonic, supertonic, etc. For example in C, would B♭ be just be called flat leading note (or sharp submediant) or is there names for them?
Comment: No, B flat is not the sharp submediant. A sharp is. The two notes are enharmonic equivalents, but not the same.
Answer: For your example, B♭in the key of C would be the subtonic. This is for the flattened 7th scale degree (so B♭is still called the subtonic in C minor).
For the others, I'd imagine you'd have to use names similar to what you've already suggested, such as flatted supertonic and flatted submediant.
Answer: Your question itself creates confusion, in a funny way! You ask about accidentals, which are notes that are changed from the key. Then you mention non-natural notes. E.g. sharps and/or flats. If a note is non-natural, then it must be a # or b. So in key D, the leading note is C#, which is a non-natural, whereas in key C, the leading note (B) is a natural.
On the premise you mean non diatonic notes, that's something different. They get called 'flattened fifth', sharp ninth etc. That seems to be more common than 'flattened leading note', etc.
Those #/b in the key sig. do not really count as accidentals - after all, they're there non-accidentally!
Answer: Where you wrote...

...non-natural notes...

...I think you should say "non-diatonic" notes.
When you select C major as the example it will be true that the notes with accidentals will be "non-natural." But the non-natural aspect is not what is important. The alteration from the diatonic notes of the key signature is what is important.
Let's change the key signature to illustrate the point and use A major.
In A major we have three sharps and the leading tone is G sharp. If we want to lower the leading tone, we alter it by applying a natural! Clearly, being "natural" isn't what makes this note altered. Rather, the accidental is what indicates it's altered.

...in C, would B♭ be just be called flat leading note (or sharp
submediant)...

This may seem like splitting hairs, but...

"lowered leading" would be a better wording, because we don't want to assume a flat was used for the alteration.
Also, take care with enharmonic spellings. In C major the submediant is A. If we "raise" the submediant it would be A# instead of Bb.

My last comment brings up some interesting points regarding functional scale degrees and non-functional chromatic notes. I think it is worthwhile to distinguish between the two (or just skip down to the TL;DR.)
Let's stay in the key or C major and look at the ^6 and ^7 scales degrees.
Over a C major we could have a descending line C B Bb A Ab G or an ascending line G G# A A# B C. In both cases we have a tonic chord merely decorated with a chromatic line. In the descending line we have a "subtonic" with the Bb, in the ascending line that is enharmonically a "raised submediant" with the A#. Is the Bb really functioning as a subtonic?
A functional Bb should be doing something vital regarding the key. The subtonic could be introduced as part of modulating to, or tonicizing, the subdominant key/chord. In minor it could be part of the minor v - when the bass descends by step - or perhaps a modulation to the relative major. Bb could be used in a borrowed chord context. Basically, if the altered note is acting in a functional way, it should be moving to or hinting toward another key or part of a harmonic resolution.
In the case of a chromatic decoration of the tonic chord we could call the Bb the subtonic - it's technically correct - but it's not very informative. Maybe a better way to make the distinction is to look at the descending and ascending lines and the alternate enharmonic spellings Bb and A#. If we name them we have "subtonic" and "raised submediant." As mere decoration of a tonic chord is there any meaningful difference?
If we look more closely at the A# and its potential function, things get interesting.
If A# were doing something functional - meaning not mere chromatic decoration - we would want to know what chord A# belongs to. One possibility is F# A# C# tonicizing B. But, in that case the A# is temporarily the "leading tone."
Although, a "raised submediant" or "raised ^6" scale degree is a common concept when in a minor key. Functionally that has a strong association with the dominant chord where raised ^6 and ^7 are used to form V7. (Without too much digression, the raised ^6 doesn't occur without the raised ^7 and the raised ^7 is used for the dominant harmony, so I say the raised ^6 is associated with the dominant.)
It's interesting that while a lowered ^2 scale degree is occasionally used in minor there is a common name for that tone. It's usually just called the "lowered supertonic."
All the preceding about function and naming may seem like a confusing mess. In a way that was intentional. Maybe unique names for all chromatic notes isn't necessary. If the terms - tonic, supertonic, mediant, subdominant, dominant, submediant, leading tone and subtonic (along with the special case 'raised' sudmediant in minor) are the standard, why is there a need for additional terms?
Some theoreticians have given additional names, but they are relatively obscure. This source (Anger, A Treatise on Harmony) offers terms like "interdominanat" for a raised subdominant or "hyperdominant" for a raised dominant. Those terms are not standard terms. Depending on the harmonic context, and the function of those tones, terms like "leading tone" of the dominant or "leading tone" of the submediant both use very standard terms and are functionally descriptive.
TL;DR
My suggestion is to use the standard degree names relative to the functional tonic. Non-functional chromatic notes either require no degree labeling for analysis or can be labeled simply by adding "lowered" or "raised" to the standard degree name.


How can I make photo CDs from iPhoto?

Question: I have a new MacBook. I don't know the OS, but just got it; it's the cheaper model.  I saved a lot of photos on iPhoto and can't figure out how to burn a CD. I tried the "share" function and when I choose a location to save the photos and hit burn I get an error message that says can't create in that location. It needs to be run on a PC or photo processing place.
Answer: Burn the disc using the Finder instead of iPhoto.

In the Finder, insert a blank CD or DVD. Your disc will show up on your desktop as a Burn Folder.

Open iPhoto.
Select the Album(s) you wish to burn to disc.
Choose File > Export.
Click the File Export tab.
Choose a format from the Format pop-up menu.
  Note: Depending on the source of the images, you may want to select JPEG to ensure compatibility.
Configure the Size and Name options that you want. Make sure the "Use extension" or "Use filename" option is selected.
Click Export.
Select the Burn Folder you created to save the exported photos to and click OK.
Quit iPhoto when the export has completed.
From your desktop, open your disc's Burn folder and select the "Burn" button (as seen below).

taken from Apple support

OR
From iPhoto:

Open iPhoto and under the View menu select Show in Toolbar -> Burn and burn icon will appear on the bottom of iPhoto
Choose the album you want to burn on the Left panel.
Click the burn icon in the lower right of iPhoto.

How can I make photo CDs from iPhoto?


Use components from symfony 2.0 in symfony 1.4

Question: Is it possible to use components from symfony 2.0 in symfony 1.4
project. If so, would you explain how to do it right?
I want to use new Routing in my project.
Answer: I would doubt that anything from S2 will work in S1.x. Symfony2 will only work with PHP 5.3 and greater and uses a totally different architecture from 1.4.
As the routing is a key component of the architecture then the chances of it working in a totally different architecture would be vanishingly small. Probably just as well to just use S2 if you want it's routing.


Gnome terminal Edit preference run command clear terminal never opens

Question: I wrote clear command on the reset and run command option Edit-->Preference-->command (something I do not remember)
After this the terminal never opens when I try opening the command prompt.
Do not know how to solve this.
Answer: If you do not remember exactly what you changed, then probably the simplest solution is to reset everything under the /org/gnome/terminal/ schema.
In the absence of a working gnome-terminal, you will need to use an alternate terminal (such as xterm) if one is installed, or the Command Runner which should be accessible via keyboard shortcut Alt+F2
Then type
dconf reset -f /org/gnome/terminal/

Answer: In addition to @steeldriver answer you could set use-custom-command to false (instead of reset all gnome settings). Adapt the profile UID before run the command below.
dconf write /org/gnome/terminal/legacy/profiles:/:b1dcc9dd-5262-4d8d-a863-c897e6d979b9/use-custom-command false

If you have multiple profiles and you don't know which one to select, read the custom-command value for each of them.
dconf read /org/gnome/terminal/legacy/profiles:/:b1dcc9dd-5262-4d8d-a863-c897e6d979b9/custom-command


Regarding Issue with Multi-Lang in Storm While Running Python (WordCountTopology )

Question: I am trying to run the WordCountTopology in storm local mode before running my own application and I am unable to run it. I am continuously getting the following error. I have verified that the splitsentence.py file is kept at the multilang/resources directory which is in the examples/storm-starter directory.
5729 [Thread-22-split-executor[7 7]] ERROR o.a.s.util - Async loop died!
java.lang.RuntimeException: org.apache.storm.multilang.NoOutputException: Pipe to subprocess seems to be broken! No output read.
Serializer Exception:
python: can't open file 'splitsentence.py': [Errno 2] No such file or directory

        at org.apache.storm.utils.ShellProcess.launch(ShellProcess.java:91) ~[storm-core-1.0.3.jar:1.0.3]
        at org.apache.storm.task.ShellBolt.prepare(ShellBolt.java:131) ~[storm-core-1.0.3.jar:1.0.3]
        at org.apache.storm.daemon.executor$fn__4973$fn__4986.invoke(executor.clj:791) ~[storm-core-1.0.3.jar:1.0.3]
        at org.apache.storm.util$async_loop$fn__557.invoke(util.clj:482) [storm-core-1.0.3.jar:1.0.3]
        at clojure.lang.AFn.run(AFn.java:22) [clojure-1.7.0.jar:?]
        at java.lang.Thread.run(Thread.java:745) [?:1.8.0_51]
5734 [Thread-30-spout-executor[9 9]] INFO  o.a.s.d.executor - Opening spout spout:(9)
5734 [Thread-28-split-executor[6 6]] ERROR o.a.s.util - Async loop died!

I have followed the instructions during installation and built my package successfully with maven. My storm version is 1.0.3 and my python version is 2.7.13. I ran the ExclamationTopology and some of my own code which does not need multi-language support and it works like a charm.
I am not able to understand why the multi-lang support in storm is not working. Any help with this is greatly appreciated.
Answer: My problem has got resolved. I just wanted to reply to let others know about the issue. I was using the storm version 1.0.3 which has the problem and the fix is mentioned below.
https://issues.apache.org/jira/browse/STORM-2450
I upgraded my version to one of the fix versions, i.e. 1.0.4 and it is working fine.


I accidentally shorted my RPi and now none of the GPIOs work, is it fixable?

Question: I have a Raspberry Pi 3 Model B, and while messing around with a breadboard earlier, I took out a jumper from the breadboard that was connected to the 5V power pin on the RPi and the jumper slipped out of my hand and brushed across some of the other pins on the RPi and the RPi immediately shut off. I unplugged it, gave it a minute, and plugged it back in, and tried using some of the GPIO pins to activate an LED, which did not work. I also tried connecting an LED to the 5V pin with a stronger resistor and that also did not work. The pi still powers up properly and loads raspbian just fine, but again, no gpio pins write out properly. Does this mean the pi is done for? How can i test this myself? Is there a way to fix this?
Answer: There is no way to repair damaged GPIO.
You can check the current state of the GPIO by using the following two tests.  Both tests should be run with nothing connected to the expansion header.

the wiringPi library pintest utility.
(My) pigpio library gpiotest utility.

Both libraries are probably installed by default on Raspbian systems.
Answer: You could, but it will probably require replacing one of the surface mounted IC chips on the board and possibly other components. Unless you already own the equipment to do SMD solder rework, PIs are so cheap that you will be way ahead in time and money just buying a new PI.


Mean Absolute Error and Data Distribution

Question: I use a memory-based learning model to predict human scores in a [0, 10] range (quiz results). As a forecast error metric I use Mean Absolute Error. I was wondering what is the relation between MAE and data distribution. How can i use the data (or the error) distribution to explain the error and possibly argue whether it is acceptable. For example, can a MAE of 60% be characterized as "good" for a non-normal data distribution rather than a normal one?
Since i am new to statistics, I would dearly appreciate any suggested reference to related bibliography.
Thank you in advance.
Answer: I don't think there is anything published on this. You could always work with simulations: simulate normally distributed data with a given mean $\mu$ and variance $\sigma^2$ and assess the MAE of the perfect forecast $\mu$ (which you know in this case).
Yes, for the normal distribution, you don't really need to simulate - you can easily calculate the expected MAE. But simulations are more easily adopted to other distributions.
So now you can give the minimum possible expected MAE for a time series with a given residual variance $\sigma^2$. You would still need to argue that for a given time series, you actually know the residual variance - that is, you need to argue that you cannot explain any more variance. This is hard, because with more information about the data generating process, you may indeed be able to explain more variance - it may just become unrealistic.
Note incidentally that minimizing the MAE may lead to biased forecasts for non-normal (specifically: asymmetric) distributions.


How to resize the content of a smart object without affecting the parent document layout?

Question: While working I'll more than often just place documents as smart objects. Then I'll end up with a colossal file size. I want to go into the smart objects and reduce its image size but consequently the parent psd will change the layer size of that smart object. I also don't want to resterize those layers.
Comment: What happens if after you change the resolution, you update the width and height to the size of the previous resolution, (i.e, 12487 x 12000)?
Answer: If you change the size of a Smart Object (embedded or linked) by changing the Resolution the size in the parent document should be unaltered.
If you on the other hand change the size by changing the Width or Height it will also change the size in the parent document.

(The same principle applies to images placed in InDesign by the way.)


xmlCtxtGetLastError - Iphone

Question: I have been programming with NSXMLParser for quite a while and lately, I came out with this error. The strangiest thing is that it only happens in debug mode. Once I load the App in Simulator and run it from Simulator (without Xcode involved), it runs fine.
The code is very straight foward, it is a simple XML parsing whose contents were loaded from the web in a separated thread.
Does anybody have alredy encoutered that error??
Thanks in advance.
EDIT:
In time I realized that this error occur when you have a bad formated XML Document. In my case, I was extracting some of the contents of an HTML Page and parsing the resulting string, but this string was not allways well formed. A little modification an voilá...
Ensure that your documents are well formed when parsing or you may have the same mistake...
PS: The parser error method did not catch this error.
Answer: In time I realized that this error occur when you have a bad formated XML Document. In my case, I was extracting some of the contents of an HTML Page and parsing the resulting string, but this string was not allways well formed. A little modification an voilá...
Ensure that your documents are well formed when parsing or you may have the same mistake... PS: The parser error method did not catch this error.

xmlCtxtGetLastError - Iphone


Surface Mount vs Through Hole Aluminium Electrolytic Capacitors?

Question: What are the differences between SMD and TH Aluminium Electrolytic Capacitors? Why are TH variants available with such greater lifetimes? (For example, Digi-key has SMD aluminium caps up to 10k hours, but TH up to 37k hours.) It would appear that the differences extend beyond the way they mount and look.
Comment: TH are generally bigger and able to take expansion/contraction more readily than SMD which are built down to a size?
Answer: Because they were engineered this way. There is no reason why you can't put on of the 37K hour parts on an SMD pad, but not many people would buy it. This is mainly because large parts/pads are significantly harder to reflow solder, can break easily, and take up more PCB area.
The primary reasons you would need a big value cap is 1.) you need it for a filter, and 2.) you need it for high current applications. If you didn't need high current flow on a big cap, than you would be able to surface mount it with a small pad, but if its top heavy, it might break easily and rip the copper pad on the PCB off. You have to use HUGE pads and you have to put thermal/structural relief vias under them. All of the above make running the PCB through a wave solder line worth the extra money.


Is snow Kosher? Icicles?

Question: The recent snow storm got me thinking about this. So are you allowed to eat snow? What about icicles?
Answer: I wish that I could locate a definitive source to answer your question, but, in a way, the answer seems a rather obvious "yes it is kosher. My deduction:
Almost all drinking water occurs "naturally". If you or anyone else has hiked into a forest or anywhere that has a spring, esp. in the beginning of the Spring season, that water originated from snow that melted and seeped into the ground or flowed into a stream or river. Along the way, who knows what else may have gone into that stream - traces of animal feces, microorganisms (amoeba, hydra, etc.), perhaps traces of non-kosher pork chops from a camper's barbecue next to a stream somewhere. People either drink from the stream directly, or if buying bottled water, they're drinking that.
If you're wondering why does bottled water have a heksher, I asked someone from the OU a while ago and he explained that it has to do with the processing plant which may process other non-kosher products in the same plant. But spring water itself needs no heksher.
If you drink tap water, there's no heksher on that. (Yes, I know that there have been attempts to get one on NYC tap water, but so far, those efforts failed.)
I'm trying to make a "kal vachomer" in a way. If you're essentially drinking melted snow without a heksher, I think that whole unmelted snow doesn't need one. Granted, I don't recommend eating "dirty" snow from the street and certainly not from the road. Personally, the concern with such dirty snow is not its heksher but far worse - I don't recommend drinking a slush mix of gasoline and calcium chloride.
Comment: אל תאכל שלג צהוב as they say.
Comment: @DoubleAA - I don't know who says that, but, yes, yellow snow is probably not kosher except for the one who made it yellow.
Comment: @DanF I think it was Frank Zappa who popularized that phrase, but in English, not Hebrew.
Comment: @DanF the one who made it yellow is allowed to drink / eat it ?
Answer: There is textual rabbinic evidence for the consumption of snow, and therefore its permissibility.
Eikhah 4:7

זכו נזיריה משלג צחו מחלב אדמו עצם מפנינים ספיר גזרתם
Her Nazirites were purer than snow, whiter than milk; their appearance
was ruddier than gems, their form, a sapphire

Eikhah Rabbah 4:10 writes:

זכו נזיריה משלג אלו שהיו שותין את השלג
Her Nazirites were purer than snow for they would consume snow.

The Meshekh Hokhmah explains:

מדרש זכו נזיריה משלג אלו שהיו שותין את השלג. פירוש שהיו נשמרין לאכול
על טהרת תרומה טהרת הקודש... והשלג אינו מקבל טומאה שאינו אוכל ולא משקה כמפורש פ' כל
היד (נדה י"ז ע"א), לכן שתו השלג.
The Midrash stating "Her Nazirites were purer than snow for they would
consume snow" the explanation for this is that they were careful in
their consumption 'al taharath terumah taharath ha-qodesh... and
impurity does not devolve upon snow, since it is neither food nor
drink as is explained in Pereq Kol ha-Yad (Niddah 17a), accordingly
they would consume the snow.

See also H. Tumath Okhalin 1:22
From the fact that a Nazir, whose diet is even more restricted than most, we see that consuming snow is not only permissible but under certain halakhic circumstances may even be preferred.
Answer: Just to add a source to the excellent answers above: Iyov 9:30 seems to make the point that snow is kosher, and especially pure:
'Even if I bathed in liquid snow, and were pure down to my hands, You would plunge me into the pit until even my clothes detested me.' (Koren translation).

Is snow Kosher? Icicles?


Improve black prints on a colour laser printer

Question: My Kyocera FS-C5400DN colour laser printer prints some documents that include graphics (greytone or coloured) blured
A pure textpage is perfect and most time colourpages are fine too. It looks if black would be overprinted with CMY and CMY would not have some offset.
Are there known settings in cups, or in a hidden printer menu that would improve this?
Do the files need a kind of preparation to tell the printer about colour ranges?
Here is a screenshot of the first cups configuration menu. I do not know what Trapping and Halftone will exactly do. But i guess halftone will reduce the number of different colours.
Will Trapping help?
Answer: Check in the advanced printer settings for something like "Always use black ink (toner) when printing black in color mode."
If the setting is unchecked, it will combine CMY to create Black if printing in color mode.
I don't know if XEROX Laser printers have this setting. I used to use a XEROX solid ink inkjet printer and I remember this setting for that printer.
Answer: The symptoms sound like a print alignment issue between black and the colors.  Grey could be affected because colored dots are often used in grey gradients.  See if the printer has an alignment test.


interference on R map with geojson file

Question: I downloaded the GeoJSON file from this link : https://public.opendatasoft.com/explore/dataset/contours-iris/export/
and I plot it, but I have an interference polygone
interference_polygon_picture
but on the web site, it shows the polygons and there is not this polygone :
https://public.opendatasoft.com/explore/dataset/contours-iris/map/?q=gers&location=13,43.65999,0.5815&basemap=jawg.streets
I have ever tried to map with another file in shx from another website, and I have the same problem near the same town (Auch)
How can I delete it? Is it a problem with my R code?
Thank you for your help
iris.poly2 <- readOGR(dsn="contours-iris.geojson", "OGRGeoJSON")

ggplot()  +
  geom_polygon(data=iris.poly2, aes(x=long, y=lat, group=id), color="grey", size=0.1) +
  coord_map(xlim=c(0.4627843, 0.6773605),
            ylim=c(43.58996 , 43.72575) )

Answer: Solved with replacing group=id by group=group
ggplot()  +
  geom_polygon(data=iris.poly2, aes(x=long, y=lat, group=group), color="grey", size=0.1) +
  coord_map(xlim=c(0.4627843, 0.6773605),
            ylim=c(43.58996 , 43.72575) )

group=id created a link between 3 polygons => the interference polygon

interference on R map with geojson file


reduce audio quality in mpv

Question: I have very limited data in a remote area and so I listen to youtube (and other video platforms) using mpv --no-video <URL>.
Does anyone know how to lower the audio quality so that I can reduce my streaming
data usage even more? (most of what i listen to is just talk).
I tried adding profile=fast in mpv.conf but mpv didn't recognize it. I also
searched through man mpv but couldn't find what I wanted.
I am using Linux Mint 21.2
UPDATE:
Using the accepted answer and searching man mpv | grep ytdl, I ended up with:
mpv --no-video --ytdl-format=worstaudio/worst <URL>
This reduced data usage by almost half and as far as a podcast goes, there is little difference in listen-ablity.
Answer: mpv relies on youtube-dl (yt-dlp) to get the actual stream URLs. Figure out the relevant youtube-dl -f (format) option, then pass it through mpv's --ytdl-format= (or maybe --ytdl-raw-options=).
After looking at yt-dlp -F <someurl>, the lowest formats YouTube seems to offer these days are 599 and 600, which are AAC and Opus at ~32 kbps. (The Opus stream is 1-2 kbps higher, but I assume the increased quality might be worth it.)
You could specify either the individual formats by ID, or you could do bestaudio[abr<40] to let it automatically select any format which is below the specified bitrate:
Get 600 (Opus ~32k) if available, 599 (AAC ~30k) otherwise:
$ yt-dlp -f "600/599" <url>
$ mpv --ytdl-format="600/599" <url>

Get best format below 40 kbps:
$ yt-dlp -f "bestaudio[abr<40]" <url>
$ mpv --ytdl-format="bestaudio[abr<40]" <url>

Get Opus ~32k if possible, otherwise AAC, otherwise whatever else fits:
$ yt-dlp -f "600/599/bestaudio[abr<40]/bestaudio[abr<100]" <url>
$ mpv --ytdl-format="600/599/bestaudio[abr<40]/bestaudio[abr<100]" <url>

reduce audio quality in mpv


Magnetic monopoles

Question: I am a non-expert in this field, just have a layman's interest in the subject.  Has anyone ever considered the possibility of magnetic monopoles (one positive and one negative charge) being confined together like quarks, and hence that could be the reason monopoles have never been observed? At the macro level the total magnetic charge would always be zero due to the charges being tightly bound.
Answer: The answer to your question, is yes, it has indeed been considered.  The bound state has even been given a name "monopolium".  Here is a paper discussing prospects for detection and production.
I should add the caveat that they're not strictly, in your words "confined together like quarks".  You could separate them if you input enough energy, unlike the quark-gluon case.
Comment: Why do you that they are not confined like quarks? If they exists the coupling would go like 137 as opposed to color confinement where the coupling IIRC is around 1. Seems these states would be much more tightly bound.

Magnetic monopoles


Can Apple's Earpods Be Used With Any Smartphone?

Question: Can Apple's earpods be used with any smartphone, or are they specific for the iPhone only ?
Answer: They can be used in any device that accepts a 3.5mm stereo headphone jack (and that's pretty much anything that has a headphone socket these days, alternatives include a smaller 2.5mm jack, or a much larger 1/4" one), although the inline controls may have limited use or operate differently depending on what you plug them into.
As to advanced features, this depends on a couple of things.  The socket size is the most important consideration, but the next thing is the amount of "poles" that the headphones have, and that the socket supports.  A "2 pole" device (3 separate contact areas separated by 2 solid line/band right around the jack) will provide for stereo sound (left/right/ground), adding a 3rd band/4th pole will add MIC functions and the ability to send controls from an inline controller for volume, track selection etc.  For the latter, the actual commands sent down the connection may vary per device, giving you volume on one device, or tracks on another, but there are a couple of semi-unofficial standards in that it usually works OK across devices so long as the contact is there inside the socket to support the connection.
<code>Standard    Tip         Ring 1          Ring 2  Sleeve          Phones using this Standard
CTIA / AHJ  Left Audio  Right Audio     Ground  Microphone      Apple, HTC, latest Nokia, latest Samsung, latest Sony (2012+), most Android phones
</code>
This page may help if you need to read more.
Comment: Yes. I, for example, use my earpods as hands-free for 3 types of phones. Sound and microphone always works for me.
Comment: The earphones delivered with my Android do work with iPhone. Not the remote control, but audio and microphone (but the remote controls of the earpods also don't work with my Android). So we have a draw here :) ... the thing is: 3.5mm headphone plugs are standardized. That's why they should work on every input and output combined jack.
Comment: Do the majority of smartphones come with a 3.5mm stereo headphone jack ?
Comment: @cyphorious Excellent, another example of Apple recycling I guess.
Comment: @cyphorious I'm guessing the reverse is also true - that the majority of earphones will work with an iPhone as well ? Should I address that as a separate question ?
Comment: @stuffe Thankyou for re editing your answer to make it more comprehensive.
Answer: Some models of Apple earbuds or in-ears like ME186LL/A were very popular in the past, have been critically looked at and are known to work with other smartphones. I couldn't find a complete listing or offical statements of which model supports which standard or if they all follow exactly the CTIA standard, though.
I got the earpods along with ME186LL/A and remember that the middle button was working on Android according to the Android specification. I still have the ME186LL/A which work the same way on Android and Windows Phone. In contrast Sony's MH1C have working volume buttons on generic Android devices and Windows Phone.
Offical statements or a crowdsourced list would be really nice to have.
Answer: I agree with all that has been said here, however I tried using my Apple Buds with a Nokia Lumia phone, and there was an unbearable high pitched whistle that both parties could hear if you were on a call.... Therefore you can't guarantee that they will always work on all phones.


Apple LLVM 6.0 Error

Question: I recently downloaded and installed the XCode6-Beta and I am getting this build error. Steps already taken:

Double checked my prefix header file.
Cleaned project.
Restarted XCode.
Deleted DerivedData like 100 times!

Any thing I may be missing?

Command
  /Applications/Xcode6-Beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
  failed with exit code 1

EDIT:
Temporary Solution.
I removed the 6.0 support which was one of the areas causing problem however, if you need support for earlier versions this will still be an issue.
Comment: And what's the *actual* error? LLVM is not in itself an error.
Comment: Thanks for the impulsive downvote. For your kind consideration the error thrown by the xcode is "Apple LLVM 6.0 Error". I guess you haven't seen that before?
Comment: I've seen plenty of errors that begin with this string, but this part of the error message is irrelevant. Is it s compiler error or a linker error or some other kind of error?
Comment: Did you add any swift code? If so, you'll need to change target version to 7.0.
Comment: Hi..i am facing the same problem...my project runs in Xcode 5 but throw this error in Xcode 6 beta..Any suggestion is highly appreciated.Thanks
Comment: http://stackoverflow.com/questions/25840720/xcode-6-pch-file-not-found    have  a look here
Answer: Ther is one way!
Select Targets/Build Settings/ Scroll to Apple LLVM 6.0 - Preprocessing
-> ENABLE FOUNDATION ASSERTIONS set it to NO
Answer: The problem is, Xcode is not telling you the actual error that clang (LLVM) is throwing; it's just saying that clang process exited with code 1, meaning an error.
To find out exactly what the error is requires a bit of digging...
I don't have Xcode6, but this how it can be done in Xcode 5, and it's probably pretty similar:

If you open the "Logs Navigator" (View-->Navigators-->Logs Navigator or cmd-8) and click on "Build", you should be able to see the build that you just ran. Clicking on the three lines on the side will bring up the full command that was run and the output it gave.
You might be able to see your error here, but if not, you can do one better:
Copy and paste the command (it will be HUGE) from the window into a terminal and run it! You should look something like this:

CompileC /Users/Daly/Library/Developer/Xcode/DerivedData/Misc-hbomxnscgtjodqafsvgpndlyhkes/Build/Intermediates/Misc.build/Debug/Misc.build/Objects-normal/x86_64/template_tests.o Misc/template_tests.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
cd /Users/Daly/Documents/School/EECS/Labs/Misc/Misc
export LANG=en_US.US-ASCII
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c++ -arch x86_64 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=c++11 -stdlib=libc++ -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wmissing-prototypes -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wno-empty-body -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wno-constant-conversion -Wno-int-conversion -Wno-bool-conversion -Wno-enum-conversion -Wno-shorten-64-to-32 -Wno-newline-eof -Wno-c++11-extensions -DDEBUG=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -fasm-blocks -fstrict-aliasing -Wdeprecated-declarations -Winvalid-offsetof -mmacosx-version-min=10.8 -g -fvisibility-inlines-hidden -Wno-sign-conversion -iquote /Users/Daly/Library/Developer/Xcode/DerivedData/Misc-hbomxnscgtjodqafsvgpndlyhkes/Build/Intermediates/Misc.build/Debug/Misc.build/Misc-generated-files.hmap -I/Users/Daly/Library/Developer/Xcode/DerivedData/Misc-hbomxnscgtjodqafsvgpndlyhkes/Build/Intermediates/Misc.build/Debug/Misc.build/Misc-own-target-headers.hmap -I/Users/Daly/Library/Developer/Xcode/DerivedData/Misc-hbomxnscgtjodqafsvgpndlyhkes/Build/Intermediates/Misc.build/Debug/Misc.build/Misc-all-target-headers.hmap -iquote /Users/Daly/Library/Developer/Xcode/DerivedData/Misc-hbomxnscgtjodqafsvgpndlyhkes/Build/Intermediates/Misc.build/Debug/Misc.build/Misc-project-headers.hmap -I/Users/Daly/Library/Developer/Xcode/DerivedData/Misc-hbomxnscgtjodqafsvgpndlyhkes/Build/Products/Debug/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Users/Daly/Library/Developer/Xcode/DerivedData/Misc-hbomxnscgtjodqafsvgpndlyhkes/Build/Intermediates/Misc.build/Debug/Misc.build/DerivedSources/x86_64 -I/Users/Daly/Library/Developer/Xcode/DerivedData/Misc-hbomxnscgtjodqafsvgpndlyhkes/Build/Intermediates/Misc.build/Debug/Misc.build/DerivedSources -F/Users/Daly/Library/Developer/Xcode/DerivedData/Misc-hbomxnscgtjodqafsvgpndlyhkes/Build/Products/Debug -MMD -MT dependencies -MF /Users/Daly/Library/Developer/Xcode/DerivedData/Misc-hbomxnscgtjodqafsvgpndlyhkes/Build/Intermediates/Misc.build/Debug/Misc.build/Objects-normal/x86_64/template_tests.d --serialize-diagnostics /Users/Daly/Library/Developer/Xcode/DerivedData/Misc-hbomxnscgtjodqafsvgpndlyhkes/Build/Intermediates/Misc.build/Debug/Misc.build/Objects-normal/x86_64/template_tests.dia -c /Users/Daly/Documents/School/EECS/Labs/Misc/Misc/Misc/template_tests.cpp -o /Users/Daly/Library/Developer/Xcode/DerivedData/Misc-hbomxnscgtjodqafsvgpndlyhkes/Build/Intermediates/Misc.build/Debug/Misc.build/Objects-normal/x86_64/template_tests.o

(This is from one of my projects.) You can skip the first line (CompileC .... 1_0.compiler), but copy the rest and paste it into a terminal!
Hopefully this lets you see the error and we can work from there (probably in a new question)!
Comment: There are a number of types of linker error that Xcode seems not to correctly handle, so this advice is good.  Duplicate symbols at link-time seems to be one of them.
Answer: This happened to me when I renamed my project.
To solve this, Select Targets/Build Settings and search for the old project name and replace with the new name.
Answer: I got the same error, but what causing it was some missing classes library.
then i added them again to the project but still causing the error.

after i searched it in the build phase, those class that had been missing is still linked to the project, so all i did is to remove those class that been highlighted red.

clean the project, and then build it.
for me, it worked
Answer: Final solution:
Try to delete the appTests like here here:
https://www.dropbox.com/s/j9s6nycb58x3nzs/target_tests.png?dl=0
Credits for this answer:
Apple LLVM 6.0 Error: clang failed with exit code -1
Answer: This example worked for me. Follow this link if you want to do it with the screen shots. Otherwise here are the steps:
STEP 1: From the menu bar of xcode select > window > organizer
STEP 2: The new window will open, copy the derived data address till /derivedData e.g. ~/Library/Developer/Xcode/DerivedData/
STEP 3: Quit xCode
STEP 4: Double click/tap on finder and select "Go to Folder"
STEP 5: Paste the copied address in the text field
STEP 6: The folder that will open delete every single file and folder you see in it.
STEP 7: Empty your trash and open xCode again and run the project.
 It worked for me.
Answer: Temporary Solution.
I removed the 6.0 support which was one of the areas causing problem and that seemed to have fixed it. However, if you need support for earlier versions this will still be an issue.
There might be trouble at the prefix.pch file, make sure you also double check your prefix.pch for any code that might be from the previous os version. If you dont't need the pre-compilation set it to NO by going to TARGETS > PreCompile Prefix Headers and selecting NO. You may then need to manually import the frameworks/file to every class file you make.
EDIT
If you do a hard cleaning cmd + product > clean. You will see an option 'Clean Build Folder..'. Using that sometimes removes the issue. If that still doesn't work reinstall the xcode6 and it will work(since you already have the downloaded dmg setup, it will take 2min only)
Answer: I was able to resolve this error by changing the 'Build Settings -> iOS Deployment Target' value to a more recent iOS version.
Answer: I was trying to use openMP on XCode-9 on Mac-OS Sierra 10.13.4 and I followed these steps : [http://antonmenshov.com/2017/09/09/clang-openmp-setup-in-xcode/][1]
I have the error like this :

clang-6.0: error: cannot specify -o when generating multiple output
  files

I fix that problem by changing some settings in XCode:
In build settings > build options > Enable Index-While-Building Functionality to No
Answer: This problem might occur when the project library looses its reference due to some condition.Go to --> Library -->Developer --> Xcode -->DerivedData .Now delete the "DerivedData" folder.Clean and run your project. This solves the issue. Hope this helps
Answer: Such a problem may occur if you change some Cocoa header by an accident. The compiler will ask you to rebuild precompiled headers (in my case it did so), but the actual error will be different. To make the compiler show you a real error set ENABLE FOUNDATION ASSERTIONS to NO (it's described above), so, you'll find out which header caused failure.
Answer: You need to change the Development target .... it works for me

Apple LLVM 6.0 Error


How do you triple jump with the Force of Nature?

Question: How does one accomplish this while avoiding skyboxes?
Answer: You need to Jump, Double Jump (jump in mid air), then aim the Force of Nature (FaN) at the ground and fire.
This will give you another "jump", thus the triple jump. There is extremely little chance of you hitting the skybox as they tend to be very high.
It's also worth noting that the scout will often woop/cheer when you do this :)
Comment: You can also aim your shot in a direction other than down to gain additional momentum in a different direction.  Note that you can't "rocket forward" by shooting backwards.
Answer: The Force-A-Nature doesn't provide you with a high vertical jump like a rocket jump does for the soldier, so you needn't worry about hitting skyboxes.
For some fantastic ideas on triple jump locations, this video is a must-watch:
TF2 Force a Nature Trick Jumps by Hydro2Oxide


Ok to Have Soffit Vents Next to HVAC Registers?

Question: I have a one-story wood frame home with a fully insulated attic, with 4 large vents at the ridge line and numerous perimeter soffit vents, each consisting of 4 large screened holes drilled in the rafter bay blocks. The home has an attic furnace and insulated ducting with ceiling registers located above windows and near doors.  I noticed that most of the soffit vents are located either right next to or directly above the registers.  This seems inefficient from an energy standpoint.  Is there some reason why this was (or should be) done?
Comment: What do you mean by "fully insulated attic"?
Answer: There's usually no correlation between soffit vents and interior HVAC components. The former are simply outside, in the sense that they're outside the building envelope. They might as well be empty picture frames hanging on nearby trees.
The real question, though, is whether there's somehow a deficit of insulation in those areas due to clearance issues or whatever. You'd have to investigate that yourself. If the walls and ceiling both have full-thickness insulation per your local standards, all good.


Why does the binding energy curve ever decrease?

Question: So the way I understand binding energy is that if I have two nucleons and I let the come together, they'll decrease their potential energy as they move closer and this will speed them up as they're flying towards eachother. Therefore, binding energy is the energy that you must remove from the nucleons so that they stay together and don't fly past eachother rather than a energy you put in to hold them together. But by that logic, wouldn't adding nucleons always increase the binding energy then? For example, if I have nickel-62 and I want to add a nucelon to it, then as the nucleon and nickel atom move closer together with a certain kinetic energy, I have to remove that kinetic energy for them to stay together which would be the binding energy. Therefore, binding energy should continuously increase but the curve decreases at nickel-62, so is my understanding that binding energy is the amount of energy you take out wrong?
Comment: Related post by OP: https://physics.stackexchange.com/q/460457/2451
Comment: The usual binding energy curve shows the mean binding energy per nucleon, not the total binding energy of the nucleus.
Comment: Trying to add a proton to a nucleus is harder than you seem to think...
Answer: Because the strong nuclear force is short range, the Coulomb repulsion between protons has infinite range, and because neutrons are more massive than protons.
The binding energy due to extra nucleons (whether protons or neutrons) increases rapidly at small atomic masses but slowly at large masses, because only the nearest neighbours of added nucleons are bound to them. On the contrary, added protons feel repulsion from all the protons in a nucleus, so this repulsive potential grows slowly to begin with when there are few protons, but grows as the square of the number of protons divided by the radius of the nucleus (which only increases as the cube root of the number of nucleons).
But you can't just add neutrons instead, because if the n/p ratio becomes too high, the higher mass neutrons will beta decay into protons.
The equilibrium between these effects essentially sets the binding energy per nucleon for a nucleus of a given atomic mass and results in the peak around iron and nickel.
Answer: A qualitative argument is : because there are two forces entering into the binding of individual nucleons into ensembles: the strong force (attractive), the electromagnetic (repulsive) and neutrons can act as a |"shield" for an electromagnetic repulsion, it is not strange that there exists a maximum in the curve.
In section 2.5 here a derivation using the liquid drop model is described. It is also in the wikipedia article .
Answer: Because large number of nucleon reduces the strong nuclear force. As when number of nucleon is higher, then the distance between the nucleon at the boundaries will be larger, so  the shirt range force i.e. the nuclear force will be smaller for them so they can be easily separated


Blend different objects of the Bevel Object of a Bezier Curve from Start to End?

Question: I hope I will be clear in the question as English is not my native language.
I am designing Surf Board on Blender, and then CNC them.
I changed quite a lot my process to work with Blender lately to be more efficient and resulting with a better topology.
My process for the one "rail" (then I can do mirror on X) :

Creating the "Outline" curve
Creating the "Rail" curve, which will be the Bevel object of the Outline Curve
Creating the "Scoop" curve, which will be the Curve Modifier object of the Outline.

Outline of the Board :

Scoop of the Board :

The result with 1 curve for the rail :

The problem is that the rail are not the same from the tail to the nose.
I would like to know how to change the Bevel object along the Curve it applied to ? If it's possible, or what would be your preferred workaround ?
I can work with 2-5 control points / Bevel objects along the curve, and so the resulting Bevel would "blend" between the transition of the Bevel Object.
A possible workaround I'm thinking would be to split the Outline Curve into 5 segments, and apply different Bevel object on each segments, and maybe for the blending part with some Loop Tools ?
Result with a Rail with 2 segments :

I'm a bit lost on a clean solution / workaround for this one ? What do you think ?
Have a good day
Test of the solution from StefLancien with NURBS Surface

It works like a charm after understanding the NURBS Surface.
Test of the solution from Alex with Higgsas Loft Splines Geometry Nodes :

This will work pretty well FMPOV. I am creating my different segments of rails, then apply the Higgsas Loft Splines geometry nodes, then the curve modifier for the Outline. I don't need the Scoop curve anymore because the information is already embedded in the different segments rails.
Comment: I would recommend to use NUBRS surfaces instead of multiple curves ? You can have a look here : https://blender.stackexchange.com/a/312103/177431
Comment: Ok. NUBRS surfaces would modelize all the "rail" and differents curves into one NUBRS surface ? I'm not familiar with it and it seems a bit complicated to work with it ?
Comment: Ok, I watched some yt videos and it helped me a lot to understand how to manipulate and edit the NURBS surface. It seems extremely powerful. I love blender... thank you for the tips !
Answer: You could do this by using Higgsas loft spline node
With it, you can create a surface by blending different profiles
Comment: Awesome ! I will give it a try ! Thanks


Should we place '@' before each username?

Question: I noticed that some of us prepend every user name, in questions, answers or comments, with an @. In comments, this notifies the first user mentioned, so one @ is useful. I'm not so sure about the other places. Should we do this?
Answer: I would not do this. There are some reasons why this does not work as well as it does on Twitter or other places:

Usernames can change. If you add an answer that begins with "As @Jan said", but later on I change my username to Maria, this will not make sense. It is better to always create a link to the answer you want to refer to. (This is not such a problem for comments, since they stay in chronological order)
Usernames are not unique, so it is possible that two different users with the same name answer a question. Which answer are you referring to?
Users can write multiple answers to the same question. Which answer are you referring to?
It just looks weird. I understand why this originated this way on Twitter, but we have more advanced tools here (certainly in the question and answer edit boxes), so please just write normal sentences and use links or other markup to add meaning. I have no problem reading "I got good information by reading the blogs of Jan, Peter and Anna", and understanding that this sentence refers to three people, without the extra @. Again, I understand how this is useful on Twitter, where people constantly poke each other with messages, but this is not the case here.
Comment: *@Jan Fabry*: I'm commenting instead of answering because I've decided I don't like how the system encourages people to down-vote opinions they don't agree with on discussions vs. answers. That said, I'm one who uses *@* a lot and I greatly prefer it. It helps me see references to people in which is often otherwise non-descript blobs of text. Moreso I've been wanting to ask StackExchange to emulate Twitter and move to @replyable screen names but I haven't because I figured that since they haven't already done it they must have a reason against so why fight an uphill battle?
Answer: I'm sorry for abusing this system for doing "announcements", but I think it is important to know that (currently) @replies in *italics* don't trigger a notification. It seems the system only matches from an @ that follows a space. So Hey @jan, did you consider A and B? will work, but Hey *@jan*, did you consider C and D? will not. This explains why I missed a lot of notifications here on meta.
Mike had a small discussion with Jeff about this in the comments to an answer on Meta Stack Overflow. The original question there, and a followup question, are also interesting if you want to know what Mike is thinking of to grow our community.


Should I demolish my Residence?

Question: I've built all the settlers that I can from my residence, and as far as I can tell, the building doesn't seem to do anything else but consume my crop. Can I just demolish it now?
Answer: Residences have a couple other uses besides just training settlers. They also produce 77 Culture Points per day at max level, which is slightly above average. However, the main reason to keep it around is that it prevents your village from being conquered as long as it stands, requiring people to catapult it before they can start conquering.
Answer: If you have good defence and you think that you can protect your village, you can destroy this building. Quite often one more Granary will be far more useful then a Residence.
Here are the advantages and disadvantages of demolishing the Residence:
Advantages:

An empty building slot (for a Granary or Warehouse).
In order to build a Palace and have one more slot for a new village or 2-3 Chiefs.
If you are planning to later make that village your capital city.

Disadvantages:

Protects your village from being conquered whilst it stands.
Grants a slight defense bonus (2 × (level2), e.g., a level 13 residence will give 2 × (132) = 338 defense; this amount is also affected by the wall bonus).

Should I demolish my Residence?


Using Windows in other languages

Question: Is it possible to view/use Windows in any of the Indian languages - Hindi or Malayalam?
Are there some softwares that can perform trasliteration or translation of all the text/writings shown in Windows?
Answer: Microsoft provides so-called Language Interface Packs which provide translations of many (but not all) parts of Windows. Both Hindi and Malayalam are available.
Malayalam is currently only available for Vista and XP, while Hindi is available for 7 as well.
Note, however, that these require a specific language version for fallback - I believe it's English.
Answer: Here's a list of supported interface languages in Windows Vista and 7. For India you have:

Assamese,
Bengali,
Gujarati,
Hindi,
Kannada,
Konkani,
Malayalam,
Marathi,
Oriya,
Punjabi,
Tamil and
Telugu.

Using Windows in other languages


How Can I Run JXA from Swift?

Question: If I have a string variable with JXA source code, is there a way to run that from swift? It seems NSAppleScript only works with AppleScript source.
Answer: Here is an example showing how to use OSAKit from Swift to run a JavaScript for Automation script stored in a string:
<code>import OSAKit
let scriptString = "Math.PI";
let script = OSAScript.init(source: scriptString, language: OSALanguage.init(forName: "JavaScript"));
var compileError : NSDictionary?
script.compileAndReturnError(&compileError)
if let compileError = compileError {
    print(compileError);
    return;
}
var scriptError : NSDictionary?
let result = script.executeAndReturnError(&scriptError)
if let scriptError = scriptError {
    print(scriptError);
}
else if let result = result?.stringValue {
    print(result)
}
</code>
This Swift code was adapted from the Hammerspoon source code (Objective-C).
Answer: Why? JXA is a dog in every respect. If you just want to run JS code, the JavaScriptCore Obj-C API is far cleaner and easier. If you want to control "AppleScriptable" applications then use AppleScript—it's the only officially supported† option that works right.
(† There is SwiftAutomation, but Apple haven't bitten and I'm not inclined to support it myself given Apple's chronic mismanagement of Mac Automation. We'll see what happens with WWDC17.)
Comment: There is OSAKit, but it's undocumented so you'll have to figure it out for yourself. Or just save your scripts in `.scpt` format, which `NSAppleScript`/`NSUserAppleScriptTask` will run. (Compiling from source every time is a code-smell in itself; common in naive/unsafe code that parameterizes scripts via code string munging instead of passing them in as parameters to the script's `run` handler.) BTW, another benefit of AppleScript is that AppleScriptObjC to call AS handlers [directly from ObjC/Swift](http://appscript.sourceforge.net/asoc.html) as if they're native methods; vastly less painful.
Comment: I already made tons of JXA scripts, so I'd like to be able to execute from Swift. If Swift can't do it, I guess only way is running shell with osascript through swift?

How Can I Run JXA from Swift?


Why System.InvalidCastException in CrystalReport Export?

Question: I am creating a WCF service which will create .pdf using Crystal Report and save the file in specific path in server. Why I am getting System.InvalidCastException exception in this line? Also I am getting this exception in every Export function.
<code>MemoryStream memoryStream = (MemoryStream)cryRpt.ExportToStream(ExportFormatType.PortableDocFormat);
</code>
Exception Details:

System.InvalidCastException: 'Unable to cast COM object of type
  'CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass' to
  interface type
  'CrystalDecisions.ReportAppServer.Controllers.ISCRReportSource'. This
  operation failed because the QueryInterface call on the COM component
  for the interface with IID '{31E7715A-8AD0-4D1C-958E-C1BE0A6F2D0C}'
  failed due to the following error: No such interface supported
  (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).'

Exception Screenshot
Note: There is no problem with Crystal Report. When I use same code in a console application it works.
Answer: Because it does not return a MemoryStream.
Take a look at this link to get more information. They say that method returns an instance of FileStreamDeleteOnClose since some version of Crystal and it was a decision of the developers.
Take a look at this post to see how to approach it in another way.
EDIT:
In this post, the workaround was to downgrade Crystal Reports. Not nice...
In SAP forums, there is a discussion about it. It is said that, to avoid that, Microsoft Windows Update KB2999226 is a prerequisite for SP21 (among some details). Check your Crystal Reports version and check if it applies to you.
Comment: I said i got this exception in every Export method. In this ExportToDisk() too.
Comment: Thanks for feedback.
Answer: OK. My problem is solved by just updating the Crystal Report to Version 18.0.23. May be older version doesn't work well with WCF.


Percentage field semantics - 1 or 100 for 100%

Question: What should a user input into a Percentage field to state "100%"? Is there a defined semantics or is this something the creator of the fields has to configure by the amount of decimals and validation rules?
Answer: User input for a percentage field is to represent the percentage as a whole number.

.1 = .1%
1 = 1%
10 = 10%
100 = 100%

Worth mentioning also that the value retrieved from the DB comes out in the same format, you need to convert by dividing by 100 yourself.
Answer: To state 100% you just need to input 100 in a percent field.
When you will convert this value to an integer then it will be divided by 100 and you will get 1.


Lego Gray, green, and black parts. What set would these parts belong to?

Question: Lego Gray, green, and black parts.  What set would these parts belong to?
Could you help me identify the set that they go to?
Answer: You've got four pieces of part 30246 Panel 3 x 4 x 6 Turret Wall with Window, in light bluish gray.
It's a relatively rare part - only appears in 18 sets, and only 2 of those sets have 4 or more of it. The green roof slopes tell me it's Bowser's Castle Boss Battle.


Playing blindfolded 2048

Question: Suppose you are playing many 2048 games, all blindfolded. As usual you can press left, right, down, or up to move the tiles. When there are no more moves the game terminates and you are told your score. This is all the information you get. What should be your strategy to maximise your average score?
Answer:
 Swipe mainly in one vertical direction (ex. down) and one horizontal direction (ex. right). Since you can get stuck by doing this, occasionally, swipe left and down to free up some blocks. This way, the largest blocks appear in the bottom right (getting larger to the left).

 Here is the board after using only down and right alternating. Numbers are building up toward 128 on the bottom row. No more down/right moves can be made, so the best option is to use left once then down to combine the 4's and 8's. Going once more down and continuing using only right and down will cause the numbers to continue to go up.

 With this strategy, I normally get around 2000-3500 points and get a 256 or 512 tile as the max.
 With a single random game, this was the outcome (3828 points):

Source: I played this game a lot while distracted and this seems to work pretty well.
[Sort of unrelated, but 2048 is one of the first C++ programs I wrote. Code is here: link to code.]
Comment: Yes, this is one of the best strategies to play the game, even without blindfolds!
Comment: @DmitryKamenetsky It would be a bit like this (although not sure exactly what is optiimal): Repeat "Down, right" 200 times, insert "Left, down" once, Repeat "Down, right" 200 times, etc. Since there is a possibility of no right, left, or down moves being possible, you can insert "Up, down" but *very* rarely. Maybe once every 10000?
Comment: Let's see if I understand correctly: you alternate right-down many times then you do ONE left and ONE up and repeat? Or do you do many left-up? Or do you inject left and up at random times? I would be quite interested to see what these different strategies score on average.
Comment: @DmitryKamenetsky : This answer does not recommend ever using UP moves.
Comment: Do we have a proof or some experimental evidence that this is the optimal strategy? I still feel that one can do better.

Playing blindfolded 2048


Can we access Unikong on mobile?

Question: I hear there's a new game in town called Unikong. I can't get to a desktop browser today though and I don't want to miss out! What do?
Answer: Scroll to the bottom of the page and tap "full site":

Then, tap the link in the sidebar:

Assuming you have a keyboard app that provides arrow keys (like this one), you should be able to play as if you were sitting in front of a desktop PC.
Comment: @nhinkle Unfortunately, no. https://twitter.com/aalear/status/713153888619257856
Comment: So I guess there's no built in mobile support then?

Can we access Unikong on mobile?


Good Hess's Law experiment

Question: I am doing an Internal Assessment for my IB chemistry class, and I want to do something on Hess's Law, and I'll be doing it simulation based, using this website. With the solutions and equipment on that simulation, what is a good experiment I can do? I want to avoid doing something relatively  easy like 'finding the enthalpy change of this reaction' and proceed to do so in under 5 pages, I want something a bit more advanced, but still able to be done on this simulation.
Answer: You could possibly do a formation of a salt using an acid/base reaction, evaporate it, then calculate the heat released when it enters solution. Extra points if you can explain heat lost to the solution in terms of the thermal stability of water.
This would give you a more advanced look into the thermal processes of chemistry, its the kind of lab we would do in Analytical Chemistry. Multiple steps of synthesis and measurement.

Good Hess's Law experiment


Why beta / dirichlet distribution are used as priori in variational bayesian mixture model?

Question: I have been learning variational bayesian mixture model. Appearantly, beta / dirichlet distribution are used as prior distribution. Why use these two distribution as priori and what is the principle behind this?
Comment: They are used for convenience reason.
Answer: A prior distribution represents the prior believe concerning how likely different values of the parameter are. So at its core, a beta or Dirichlet ( [pedantic mode on] called after Johann Dirichlet, so writen with a capital letter [pedantic mode off] ) distribution is chosen by someone because that person thinks that it represents her or his believes. If your believes differ than you choose a different distribution.
However, not all distributions are equally sensible. The mixture parameter is a proportion that must remain between 0 and 1, so a normal distribution would not be the most sensible prior distribution for that parameter because that would assign a positive probility to impossible values (less than 0 or more than 1). A beta distirbution is constrained between 0 and 1 and fairly flexible, so you can represent a lot of different believes with that one distribution. This makes it a convenient choice. A Dirichlet distribution also ensures that the parameters add up to 1, which is typically required, though its correlation structure is somewhat restrictive. In that case it is a convenient choice.
Comment: Thanks for explaining. I thought beta / Dirichlet is used as priori not just because they are convenient (ranging from 0 to 1 representing probability), but also there should be some properties of these distribution that logically / methmatically represent our prior lelieve, right?


Why screen y coordinate is counted from top to bottom

Question: When we draw graps on mathematics or physics lessons the origin of coordinate system is in bottom left corner and Y coord goes up from bottom.
But whe we try to draw something on screen Y-axis switches it direction and coord system origin moves to top-left corner.
Why is that so?
Comment: Could be related to how CRTs used to scan the screen top-to-bottom left-to-right?
Answer: It's a historical thing.
Older CRT monitors fire electrons at the screen in a sweeping motion starting at the top, moving down the screen, sweeping from left to right.  They do a complete sweep of the screen typically 50-60 times a second.
Here's a link to a web page on the subject.
Answer: That's a problem with CRT monitors. You can try LCD's instead of CRT monitors.


Wave packet in quantum mechanics?

Question: When we talk about light waves or EM waves, we simply say that the wave packet is the superposition of other waves of different wavelengths. In quantum mechanics, we say the same thing; the superposition of many waves associated with electron form a wave packet. I don't understand this, because one wave is associated with one electron. It is only superimposed with other electron waves. Does an electron make superpositions with itself having different wavelengths? How is this possible?
Comment: It's not really clear what you're asking imo, wavefunctions can always be written as a linear combination of other wavefunctions because there always exists an orthonormal eigenbasis corresponding to each Hermitian operator (i.e. observable). This is what is meant by "superposition".
Answer:
Bcs one wave is associated with one electron.

This is not true! You should rather say, There is a unique wave function $|\Psi(t)\rangle$ (or In position basis $\psi(x,t)$) associated with a particular state of system.
There is something very nice about $|\Psi(t)\rangle$ but not very new, If $|\psi\rangle$ and $|\psi'\rangle$ represent the possible wave function of the electron then so does the $\alpha |\psi\rangle+\beta |\psi'\rangle$. That's called the Principle of Superposition.
A wave packet is a simple superposition of different wave forms,
$$\psi(x,t)=\frac{1}{\sqrt{2\pi}}\int \phi(k)e^{i(kx-\omega t)}dk$$
Answer: The state of a particle is given by the wave function (state vector $\psi$), which we get by solving the Schrödinger's equation. This wave function can be written as the superposition of many other simpler wave functions analogous to Fourier decomposition. Hence, the superposition of those simpler wave functions gives the overall wave function of a single electron.

Wave packet in quantum mechanics?


How can I transfer photos from iPhone to Samsung Galaxy phone with location information?

Question: I'm trying to transfer photos from iphone to my new samsung galaxy note 20, but the smart switch does not work for me somehow (It asks me to retry after I input my iCloud password, but my friend's iphone works on the same cable). I wonder if there's any other way that I could use to transfer photos, if the location and time information could be kept with photos, that would be great. Thanks.
Comment: I *believe* so. But as I have not tried it myself it is a comment rather than an answer. EG it **should** work, and the cost of doing so is only a little time...
Comment: The location metadata is stored (usually) *inside* the actual picture. Have you tried a free tier of a cloud storage service like Google Drive or Dropbox?
Comment: hi Steve Chambers, I have tried yet, are you saying that if i use Google Drive to transfer those location will come with pictures? Thanks
Answer: At the end, I found I could transfer all my data by iCloud. By default, it shows transfer data of "last 30 days" only, but there's a small gray arrow at right, by clicking this you could choose "all data", and which works perfectly.


Connecting smart switch, identifying neutal wire

Question: Im looking to switch out an old rocker switch to a smart switch, but the wiring appears to be unconventional. Two black wires attached to the same screw, and a white wire, which I am trying to determing if it is neutral or not is attached to the bottom screw, and the ground on the opposite screw. Looking at the picture is there a way to see if this is a neutral wire, even though its connected to the switch.
Comment: That ground wire is going to a green screw on the bottom of the switch, right?
Comment: Can you post a photo that clearly shows the back of this box, as well as a photo of the inside of the box for the light this switch controls?
Comment: Yes it is. Thanks for the feedback. Helped alot
Answer: This is a switch loop.  The unpainted whitee and black are always-hot and switched-hot.
You don't have neutral here.  Further, the extra hot wire can't be on this switch.
Notice how the hot and switched-hot on this switch do not have any paint on them.  They were added later, and are a switch loop to a different circuit.  They were installed before NEC 2011 took effect, because that requires neutral on a switch loop. That would be the neutral you need and do not have.
The paint-speckled hot, however, is a dangerous interloper.  It is stealing hot from this circuit, but returning neutral on another circuit, causing that neutral to be overloaded*.
Further, that invasion is totally needless.  There are plenty of wires back there, so some must surely be hot for its own proper circuit.  This needs to be fixed, by a pro if necessary.
Regardless, given the availability of power here, the switch loop might be "flipped", so the power at the lamp is not used by the lamp anymore, and the power comes out of this box.   If that were done, the two extant wires would become switched-hot and neutral, and you would be able to install a smart switch here.
Answer: When you have a white wire attached to a switch, it's pretty safe to assume that you are dealing with a "switch loop".  There are several questions about that here, and lots of info in general.  The white wire should be wrapped with a piece of black tape to show that it is a switched hot, but that is something that is often forgotten.
Also, when you have two wires connected to the same terminal (one in the screw and one in the push connector), that is just using the switch or outlet as a convenient way to connected two wires.  Using the push connector and the screw is kind of frowned on, but it is done.  A better option would be to bundle those black wires and run a single pigtail to the screw on the switch.  Since you are installing a smart switch, it will probably have pigtails already, so these blacks will end up getting bundled "the right way".
Answer: If it's a neutral don't operate the switch. Like JPhil618 stated, it's a switch loop, not a neutral and should be taped to show it's a switched hot.
The picture doesn't show the back of the box clearly but it looks like there's a yellow wire nut back there but can't determine what wires go into it... (Don't ya love it when they prime your wires). If the wires going into that wire nut are white, there's a good chance they are your neutrals. good luck


When app get rating / review?

Question: I have submitted an app to App Store. It has been downloaded almost 300 times. 5 in app purchase happened. But I do not get any review. I guess it depends on the users, whether they want to express their feelings or not. Is it any statistics when I can get the first review?
Answer: This depends entirely on the app.

Some apps promote reviewing and get more reviews.
Some apps are designed for kids and do not get as many reviews, but sometimes get more reviews due to parents reviewing the app.
Some apps' market demographics means that the users are unlikely to review an app.

There's no single average time frame. It is entirely up to the user whether they review an app, although you can mention/promote reviewing in the app itself if you wish to expedite the process.
Comment: … though any app that nags me more than twice to 'review now' gets the 'never' button or goes in the bin if there isn't one.

When app get rating / review?


Small amount of oil in coolant

Question: My car is honda accord 2015 v6
I noticed that my coolant have some oil in it but it's not creamy or thick, its just coolant water but with extra viscosity, my local mechanic said "this is the coolant water and oil is not mixed with it, and its normal" I checked the engine oil and its good as any oil, the color is good and no signs of water.
I remember that in april i had a heating problem but the car didn't overheat to the max  ,the problem was with the cooling fans and i fixed it.
Comment: Welcome to Motor Vehicle Maintenance & Repair!
Answer: If this were a minimal amount of water in the oil, I'd say there's no issue. Considering it's the other way around, there certainly could be an issue. The reason I say this is because due to the combustion process, there will always be a small amount of water in the oil, which is then usually evaporated once the oil is heated up. On the other hand, there's no real way for oil to get into the water unless there is a leak somewhere. The only other way for oil to get in there is if someone put it in there by mistake.
My suggestion to you is to get the coolant flushed and replaced. If it comes back or gets work, then you know there's a real issue. If it doesn't come back, or if it's there but lighter than it was before (oil is tough to clean out without several flushes), there's probably no issue and chalk it up to "one of those weird things".

Small amount of oil in coolant


Laravel nested route model binding

Question: I am developing an API using Laravel for use with a mobile app and am having some issues with Route Model Binding on nested routes.
The app will have a standalone sqlite db which will synchronise client journeys with the central server when network is available. For that reason, the PK's in the app cannot be used to access the records on the central server. Each user will have a unique username which will be stored on the central server in a table with the following columns:

user_id
username

The journey table will then have the following columns:

journey_id
user_id
user_journey_id

where the user_journey_id will be the PK of the journey record on the client device.
The idea is that the clients can then access the api with something like:
http://example.com/api/client/UNIQUE_USERNAME/journey/1234
to retrieve the journey from the central server.
I have the following resources setup:
Route::resource('client','ClientController');
Route::resource('client.journey','JourneyController');

and have setup route model binding successfully for the client as follows:
$router->bind('client', function($value, $route) {
    return \App\Client::where('username', '=', $value)->firstOrFail();
});

I'm having a bit of trouble with setting up the nested model binding as I require the client username in combination with the user_journey_id to retrieve the correct journey. Is there a way to do this with route model binding?
Or should this just be done in the controller with some like:
public function show(Client $client, $user_journey_id)
{
   ... // have logic here to get the journey.

This is how I do it currently but the route model binding would certainly make it a bit easier.
Comment: Instead of using the username couldn't you just use the user_id so that you don't have to nest the model bind?
Answer: Binding multiple URL parameters to models is certainly possible in Laravel, as is nested route model binding.
One caveat is that you'll need to specify the routes individually for these particular routes, rather than using Laravel's resource controllers as you've used in your example.
To register a route with more than one model binding you'll need to do something like this:
The route definition:
Route::get('/api/client/{user}/journey/{journey}', [
  'as' => 'client.journey',
  'uses' => 'JourneyController@getJourney'
]);

The bind definitions:
$router->bind('user', function($value, $route) {
    return \App\Client::where('username', '=', $value)->firstOrFail();
});

$router->bind('journey', function($value, $route) {
    return \App\Journey::where('user_journey_id', '=', $value)->firstOrFail();
});

You'll then find that both models are being resolved and injected to the action method in the controller class:
public function show(User $user, Journey $journey)
{
     //do whatever you need to do here...

The only real drawback to this approach is the fact that you have to define routes manually instead of making use of Laravel's handy resource controllers. Of course, you could implement some of your own logical to make these kinds of routes easier for you to define.
Answer: I think your approach is not good and you'll end anyways using a separate controller for this, as you probably need to add an auth layer in the future or a more functionality.
Having the username is the URL is not good either as it can be a string with special characters that will be URL encoded, then decoded, so prone to errors. I'd suggest to using the ids as it's an API.
Resources will call a specific method for each requested action, I'd recommend using those methods.

Laravel nested route model binding


How to use JOGL's NEWT model to create a window in Mac OS X

Question: At work I am creating a music visualization program. JOGL was chosen because we needed an API to program 3D graphics and have it work on multiple platforms right away. At the moment, I am using GLCanvas to render all the work, however, the downside is that it uses the EDT to render the OpenGL loop and the EDT is also used to dispatch other GUI interactions. Therefore, if I make the renderer sleep for a certain amount of time in order to wait on a data structure or control the FPS, then I make the whole EDT sleep and therefore slow down the GUI.
What I want to do is have the music player (on one thread) interact with data structures the visualizer is using. I would do this by having 2 synchronized methods that notify the other thread or wait themselves, depending on what's happening. The problem with what I just mentioned is that at the moment the program is implemented where the EDT runs the rendering (this is what happens with GLCanvas). In this case, when the rendering loop (EDT Thread) goes to retrieve an empty data structure, it is told to wait. The thread will wait until a song is loaded then played, however, I cannot load a song using the GUI because the EDT thread is waiting until a song is loaded and played but a song cannot be loaded because the EDT is a sleep. Essentially, this is a dead lock.
I apologize for all the writing. I hope I am making this easy to read.
A perfect solution to my problem is to use JOGL's NEWT, which will run the rendering loop on a separate thread then the EDT separately. This will allow me to sleep the rendering thread and the music player thread back and forth while not touching the EDT, which handles all over GUI interactions.
Before I incorporate NEWT into the actual project, I just want to try basic things with NEWT such as opening a window on Mac OS 10.7. So I created a project that just opens a window and it fails. The code to do so is (well one way to do it, this is the only code in my project):
Display display = NewtFactory.createDisplay(null);
GLCapabilities capabilities = new GLCapabilities(GLProfile.get(GLProfile.GL2));
Screen screen = NewtFactory.createScreen(display, 0);
Window window = NewtFactory.createWindow(screen, capabilities);
window.setVisible(true);

or:
GLProfile.initSingleton(true);
GLProfile glp = GLProfile.get(GLProfile.GL2);;
GLCapabilities caps = new GLCapabilities(glp);
Renderer r = new Renderer();
GLWindow window = GLWindow.create(caps);
window.addGLEventListener(r);
window.setSize(300, 300);
window.setTitle("NEWT Window Test");
window.addWindowListener(new WindowAdapter() {
        public void windowDestroyNotify(WindowEvent e) {
            System.exit(0);
        }
});
Animator a = new FPSAnimator(window);
a.start();
window.setVisible(true);

No matter what way I use, I still get the same errors, which are:

Located in the console, it says:

Detected screen size 1280x800
createWindow0 - Parent is neither NSWindow nor NSView : 0x0
******* viewWillDraw: 0x0x7f9ca062ae18Invalid memory access of location 0x248 rip=0x10df02478

A Window opens saying:
NEWTTRY quit unexpectedly while using the libnewt.jnilib plug-in

I have searched the internet for days and extensively read the NEWT API which is poorly documented. I hope someone can help because using NEWT in high performance programs is extremely beneficial and more flexible than using GLCanvas.
I am using:
OS Version:      Mac OS X 10.7 (11A511)
Report Version:  9
Model: MacBook5,1, BootROM MB51.007D.B03, 2 processors, Intel Core 2 Duo, 2 GHz, 4 GB, SMC 1.40f2
Graphics: NVIDIA GeForce 9400M, NVIDIA GeForce 9400M, PCI, 256 MB
The most recent Java update for Mac
jogl-2.0-b23-20110303-macosx
Answer: This is the tutorial I used to learn the newt operations https://sites.google.com/site/justinscsstuff/jogl-tutorial-2.
It explains the Newt as well as the JFrame setup.


Test-Focused EvaluatorTrace Monad?

Question: Is there infrastructure for writing unit/integration tests for our contracts, without running the full playground?  Is there a test-focused EvaluatorTrace monad, for example?
Answer: There are now test capabilities in the Plutus.Contract.Test module which uses the Tasty library.
This is explained more fully in the unit tests section of lecture 8 of iteration 1 of the Plutus Pioneer Program.
Some highlights:
checkPredicate :: String -> TracePredicate -> EmulatorTrace () -> TestTree

There are a number of functions for producing a TracePredicate. For example:
-- | Check that the funds in the wallet have changed by the given amount, exluding fees.
walletFundsChange :: Wallet -> Value -> TracePredicate

Which can then be combined into a test function:
tests :: TestTree
tests = checkPredicateOptions
   (defaultCheckOptions & emulatorConfig .~ emCfg)
"token sale trace"
   ( walletFundsChange (Wallet 1) (Ada.lovelaceValueOf   10_000_000  <> assetClassValue token (-60))
.&&. walletFundsChange (Wallet 2) (Ada.lovelaceValueOf (-20_000_000) <> assetClassValue token   20)
.&&. walletFundsChange (Wallet 3) (Ada.lovelaceValueOf (- 5_000_000) <> assetClassValue token    5)
   )
myTrace

Which can then be run like this:
Prelude Spec.Trace> import Test.Tasty
Prelude Test.Tasty Spec.Trace> defaultMain tests
token sale trace: OK (1.22s)

All 1 tests passed (1.22s)

Naturally, these tests can be configured to run as part of "cabal test".
Answer: You can use Plutus Playground to test your code and maybe in the near future we will have more options.

Test-Focused EvaluatorTrace Monad?