Spectrum of adjacency matrix of block graph

Question: Let us consider a graph $G$ having $m$ number of complete sub-graphs $K_{n_1},K_{n_2},...,K_{n_m}$ which have size $n_1,n_2,...,n_m$ respectively. Further $\forall i$, one vertex of $K_{n_i}$ is connected to one vertex of $K_{n_{i+1}}$ by an edge. Similarly, one vertex (different from previous one) of $K_{n_i}$ is connected to one vertex of $K_{n_{i-1}}$ by an edge. In this way, complete sub-graphs are connected in chain to form $G$. Find the eigenvalues of adjacency matrix of $G$.
Comment: Where did this come from? A path of length $d=2m-2$ fits this description with  $n_1=n_m=1$ and otherwise $n_i=2.$ The $d$ eigenvalues are well known and nice, but not trivial. For your graph you would have  $n$ eigenvalues. You can see that all but about $d$ are equal to $-1$ (add an identity matrix and consider the rank). The other $d$ or so are not as nice as for a path.
Comment: I am working on signed graphs. There is concept in signed graphs that, if a signed graph can be clustered in groups of nodes such that each edge inside a group is positive while each edge between any two group is negative we call such signed graph a balanced graph. Eigenvalues of these graphs describes useful properties. Above problem also having groups(here complete sub-graphs) connected in chain by an edge to its adjacent groups.  Although my interest is in when the connecting edge is negative, but I think I can solve it if you help me considering it as positive edge.
Comment: What do you mean by a positive or negative edge? An eigenvector of the usual adjacency matrix assigns values to the vertices.
Comment: In social networks negative edge denotes hatred or enemity between two nodes.  In adjacency matrix of signed graph/network we put (i,j)th entry equals to 1 if edge between nodes i & j is postive. Similary (i,j)th entry equals to -1 if edge between nodes i & j is negative  otherwise (i,j)th entry is 0.
Answer: The characteristic polynomial of a complete graph with $n$ vertices is $(x-n+1)(x+1)^{n-1}$. By deleting a vertex from the complete graph $K_n$, the remaining graph is the complete graph $K_{n-1}$ with characteristic polynomial $(x-n+2)(x+1)^{n-2}$.
Consider subgraph $G_i$ of the graph $G$ that is constructed from the union of two complete subgraphs $K_{n_i}$ and $K_{n_{i+1}}$ of $G$ and the edge which connect these two subgraphs. By using the following theorem of Schwenk, you can find the characteristic polynomial of $G_i$.
Schwenk A. J., Computing the characteristic polynomial of a graph, in Graphs
and Combinatorics (eds. Bari, R., Harary, F.), Springer-Verlag (New York), 1974.

For any edge $uv$ of the graph $G$,
    \begin{align*}
P_G(x)=P_{G-uv}(x)-P_{G-u-v}(x)-2\sum_{Z\in C(uv)}P_{G-V(Z)}(x),
\end{align*}
    where $C(uv)$ denotes the set of all cycles containing $uv$.

Since the edge which connect the two complete subgraphs in $G_i$ is not contained in any cycles, the third part of the above formula is zero. So, the characteristic polynomial of $G_i$ is
\begin{align*}
(x-n_i+1)(x+1)^{n_i-1}(x-n_{i+1}+1)(x+1)^{n_{i+1}-1}\\
-(x-n_i+2)(x+1)^{n_i-2}(x-n_{i+1}+2)(x+1)^{n_{i+1}-2}
\end{align*}
Such as above and by using the above theorem repeatedly, you can find the characteristic polynomial of $G$.
As Meyerowitz mentioned, you can find some roots of this characteristic polynomial that is equal to $-1$ simply, but finding some of them is difficult in general.
Comment: Thanks a lot.  Please, give me some reference to above theorem of Schwenk, I want to read more about it.
Comment: @Ranveer Singh: I added a reference to the answer.


Can I do an alternator check at idle in a C152?

Question: I have one question about alternator check in Cessna 152. During engine run-up we should check whether alternator is working or not, so we switch it off and then the warning light should illuminate. But we do it on pretty high RPM (1700). Would this warning light illuminate if I switch off the alternator also on lower RPM i.e. idle?
Answer: The problem is the light might come on on its own at idle, which is normal.
The warning light comes on when the system voltage is below 12.5 volts on a 14 volt system, and 25 volts on a 28 volt system. Automotive alternators (which most Lycomimg powered light aircraft have) need to spin at at least 2000 rpm to make adequate charging current to maintain system voltage under load.
The belt drive on the engine that overdrives the alternator relative to engine rpm may or may not maintain this rpm with the engine idling, so the bus voltage of the system may be just over 12.5/25 vdc or just below it, depending on the loads on the system (like radios and lights, etc.) and the alternator's condition.
The 152's POH specifically warns you that the light may come on after extended idle periods with electrical loads on the system, so this is to be expected, and it means that a test done with the switch can't be trusted to give a valid result (the light could be on because of "normal" idle low voltage, not because you switched it off).
Doing it at runup rpm just makes sure the alternator is spinning well above this marginal operating condition so it's producing normal charging current when you switch it off.
Comment: I believe so.  All the light knows is there is less than 12.5 v at the bus.  Whether that's because you turned the alternator off by switching off its field supply with the alt side of the master, or because it's current output isn't enough to keep the voltage over 12.5, shouldn't matter to the light itself, so it should come on if it's off at idle, then you switch off the alt.  Maybe they mean if you turn the ALT and BAT sides off together you won't get a light.  Anyway, try it yourself and see what happens.
Comment: BTW the principle advantage of upgrading to 28 v is a tiny weight reduction because lighter thinner wires can be used to carry the same wattage, and a bit better electrical reliability (in theory) because the higher voltage makes circuits a bit more tolerant of degraded electrical connections.  Operators were not too happy with the switch because if you had a fleet of 14 v airplanes you now had to also stock parts for 28 v systems if you acquired some 28 v ones.
Comment: Oops you caught me out. I was talking about 14v systems and forgot that the Cessna changed their airplanes to 28v systems in the 80s I believe.  I see that both 12 and 24 v batteries are available for 152s so it looks like the change was made sometime in mid production (with the 152 II?) but it's hard to find any info on what year the change was made.  150s were 14 v though.   In any case, if the airplane has a 28 v system, the light would go on at 25v (12.5 x 2).  Otherwise, same same.  Note the battery voltage is 12/24, but the normal system voltage maintained by the alt is 14/28.
Comment: Ok, I understand. One more question: so there is higher chance that the alternator light will illluminate "by itself" if the airplane is at idle for a long time; and there is almost no possibility, that the light won't illuminate if the alternator is switched off at idle engine RPM (assuming no warning system failure)? Because some time ago someone told me that the light won't illuminate if I switch the alternator off at engine RPM close to idle, because there is no load on it, what I assume is false.
Comment: One more question, voltage in C152 electrical system is 24 V, so system allows voltage drop to 12,5 V? That's a lot imo.


"the starting is good" or "the start is good"

Question: I want to give my impression about the prologue, which one 'the starting is good' or 'the start is good' is the correct way?
Answer: Choosing between both options, the better answer would be "the start is good."
This is because you're talking about an object, the prologue, and not an action. However, "the start is good," sounds a little unnatural and isn't used by very many native English speakers.
Instead, I'd recommend something along the lines of, "the beginning is good," or instead of using words like start or beginning, you have the option of mentioning the prologue as-is (e.g. "the prologue is good."), unless you're talking about just a section of the prologue.
Comment: Good points. Also, if you want to say that the prologue makes you want to read the rest of the story, one could also say something like, "It starts off good," or, "It's a promising start."
Answer: I'd be more likely to say

the first part is good (but then it goes downhill)

"Starting" is not idiomatic.  "Starting" actually means "the process of beginning something" and not "the beginning part of [something]"

Starting a new job is always exciting, but can be challenging.

As J.R. points out in his comment, you can say:

It starts off good (but then gets boring).


Linux find command - show progress

Question: I was wondering if there's any way to display some kind of progress info when searching for files in linux using find. I often find myself searching for files on a big disk and some kind of progress indicator would be very helpfull, like a bar or at least the current directory "find" searches in. Are there any scripts that do that, or does find support some hooks?
Comment: thanks for the answers, i'll check all the solutions and decided which one is better. If it were up to me i would mark all the answers as accepted.
Comment: depending on which search criteria youb are using locate is much more faster than find
Answer: with this trick you can see the current folder - but no progress bar - sorry.
 watch readlink -f /proc/$(pidof find)/cwd

Comment: @ThorstenS works fine on Ubuntu 14.04 LTS but not on Ubuntu 16.04 LTS (even with `sudo`) maybe because the OS is now hidding the `cwd` of the process from the user
Comment: that's cool. Should be noted thou that you need superuser privileges in order to access cwd. thanks!
Answer: A little utility called pv (pipe viewer) may help. From the fantastic summary by Peteris Krumins:
Pipe viewer is a terminal-based tool for monitoring the progress of data through a pipeline.
You can use pv in a number of ways. When playing around here, I put it immediately after a pipe to monitor progress of the output generated by find (should pass stdin to stdout untouched)
find / -mtime -1h | pv > /dev/null

which will show output a bit like this:
6.42MB 0:01:25 [31.7kB/s] [         <=>      ]

(I redirected stdout to /dev/null so I could see the progress bar in action without output flying by. This is likely not your intent with find, so tailor accordingly)
I'm honestly not sure how well this works in the wild. For "expensive" finds like the one above (traversing from root), it appeared to work fairly well. For simpler commands in a deeper node in the directory tree, pv failed miserably. These commands are returning results immediately, so a progress bar is probably moot here.
At any rate, play around and see if this works at all for what you need. Food for thought, at least.
Comment: +1 for a nice utility
Comment: What would that progress bar show? Neither `find`, nor `pv` know how long the search will take,, so they cannot compute the percentage. All we can see in the `pv` output is the time since the search was started.
Comment: This is correct. I had thought there was some magic going on, somewhere, that allowed pv to check the progress of the directory traversal (which is incorrect). Given standard input at a constant rate, **pv** simply moves the progress bar at a constant frequency. Try `yes | pv > /dev/null` to observe
Comment: Judging progress is non trivial. Not even web browsers loading pages are able to do that. I guess for file contents you can divide by the file size, but for Unix streams you don't know the total amount of data is usually, and this tool is meant to be flexible for any kind of stream data, not just files.
Comment: you have to use the `-l` argument, to count the `newline` instead of the bytes. If you know the number of files, you can let `pv` create the progress bar using the `-s` option. I use it like this for converting `png -> jpg` from `/myfolder` to `/tmp`: `cd /myfolder; alias myfind='find . -maxdepth 1 -iname "*png" 2>/dev/null'; myfind_count=$(myfind | wc -l); myfind | pv -l -s ${myfind_count} | xargs -I{} convert {} /tmp/{}.jpg`
Answer: I searched for this today and got here via Google. I had a long-running find running on OS X and apparently, watch doesn't exist there. So here's another solution:
lsof -Fn -a -c find -d cwd +r 10

lsof = list of open files
-Fn = just show the name of the file/directory (prefixed with 'n' character, skip this if you prefer the full lsof output
-a = tell lsof to show only lines matching all criteria (by default it shows lines matching any criteria)
-c find = show files/directories opened by process named find (actually, process whose name starts with find, but it's case-sensitive so Finder won't show up)
-d cwd = show lines with FD (filedescriptor) cwd (current working directory)
+r 10 = show output every 10 seconds until no open files are found (find is finished)

This will show the directory find is processing every 10 seconds, so it should give an idea if find is still working and how far it has progressed.
Comment: But this does not work with GNU find.
Comment: Still works on macOS 8 years later. Nicely done!
Answer: There's an example of parallel searches with find in man find. Using it, you can perform multiple checks for every item, performing multiple actions depending on which condition works. The first check may be, for example, simple-print, so all names are printed to stdout. The second check will do what you want. Something like:
find /work \( -fprint /dev/stderr \) , \( -name 'core' -exec ls -l {} \; \)
If the second check should display filenames, too, you can redirect one of them to stderr using -fprint /dev/stderr.
Comment: I have'nt tested this but I think is the right way.
Comment: You could use `-fprintf /dev/stderr '%h\n'` as the first action to print current directory during the operation, but it prints one directory line per each file. It would be better, if it printed only when the directory changes.
Answer: This is a list of current files opened by find, so it's the same of what find is looking 'right now'.
Its lightweight as just query address of file descriptos used by find  every second and don't interfer in find itself. Also you can do it with any program you wish.
# watch -n 1 'ls -l /proc/$(pidof find)/fd | cut -d ">" -f 2 | grep -v /dev/'

The grep -v /dev/ is to hide files STDOUT, STDIN and STDERR, that are files used to receive and print data on your console.
Comment: The above much higher-voted answers (as of the date I write this, anyways) from years ago simply don't work for me. *This* answer works. However, I suggest a modification of this answer to really see what the `find` is doing: `watch -n 1 'ls -l /proc/$(pidof find)/fd | grep -v /dev/'` (i.e, show the full line and show each file, not just the folder, and update every second). Thanks so much!
Answer: AFAIK, it doesn't, and implementing it would be nontrivial.
... Hmm. Perhaps a script running find <target dir> -type d first, storing the list and then echoing each dir before running a find <list item> -maxdepth 1 <rest of find parameters> in a for loop.
Note that you're trading a /significant/ loss of performance in exchange for being able to vaguely see what it's doing.
Answer: If all you want is some kind of indication that something is happening, you can simply add an exec echo for each entry:
find . [other arguments] -exec echo -n '.' \;

Answer: Not an exact answer to the question, but I imagine most use cases of find involve doing something non-trivial with the results, for example piping each result to tesseract for OCR processing.
An elegant way to obtain a progress bar is to use GNU Parallel with the --bar option (alternatively, there is also a --progress option).
Minimal example:
seq 1000 | parallel --bar sleep
Produces:
0% 3:997=16m12s 11

Linux find command - show progress


Identify a short story about a piece of beating heart tissue that grew in a pond

Question: As a teen I read a story about a scientist who had kept a piece of heart tissue alive - a piece of it was discarded into a pond and grew into a menace (the detective figured out that the 'blob' was causing the problems in the story).
Comment: When were you a teen? How did the heart tissue menace anyone?
Answer: "The Thing in the Pond", a short story by Paul Ernst; first published in Astounding Stories, June 1934, available at the Internet Archive. It has appeared in a number of anthologies; does any of these covers ring a bell?
It started with a bit of heart tissue from a chicken:

"Professor," said Sharpe, "it was about ten years ago that your discharged servant got back at you by dumping that laboratory stuff into the pool, wasn't it?"
"Yes," said the old man, his lips twitching.
"Among the stuff was a lot of sodium, potassium, and calcium salts, and probably a barrel of sugar," guessed Sharpe.
"Y-yes," admitted Weidbold.
"Now, while I was here ten years ago you cut off a bit of that chicken-heart muscle you've kept living and pulsing for sixteen years in a solution of potassium, calcium, sodium, and sugar. I remember that distinctly. You've cut off several bits; otherwise the stuff would outgrow the nourishment-capacity of the case. What happened to that fragment?"
"I-it got lost, or something."
"It's conceivable that it was among the stuff your servant dumped into the pond, isn't it?"
"Such a fantastic accident—" mumbled Weidbold.
"All accidents are fantastic," said Sharpe curtly. "That's why they call them accidents. It's conceivable—isn't it?"
Weidbold nodded.
"And in this warm, life-filled pond," Sharpe pursued relentlessly, "the tiny bit of muscle substance flourished. It absorbed the chemicals freakishly dumped in with it, and finally all the small life. Then it began to reach out for more food in its voracious growth."
"I tell you it's impossible!" almost shrieked the professor. "It could not live outside a laboratory! Ask any scientist—"
"I'd prefer to ask Raeburn's cow or your dog," Sharpe cut in dryly.
Comment: @Arthur. If you are interested in some of the real life background that some believe led to creation of the story you might consider reading the following Wikipedia site:  https://en.wikipedia.org/wiki/Alexis_Carrel  Carrel did an experiment with chicken heart tissue he kept alive in a solution as an experiment in aging.
Comment: Yes- that is the story. Thank you so much!
Comment: @Arthur You're welcome!


q?=admin page accessible for anonymous

Question: How do I prevent this? I'm not sure what is causing this. This site is running over 60 modules now and yesterday I noticed something changed my admin_menu toolbar layout, but don't know if this has to do anything with this.
Answer: Check the user permissions. The anonymous role might have one too many permissions granting access, such as "Use the administration pages and help".
You aren't running any sort of caching setups that might be caching a logged in experience and displaying it for anonymous users are you?
Comment: You were right, it was the 'Use the administration pages and help', but I also have the AdvAgg, so gonna have it in mind.

q?=admin page accessible for anonymous


Job scheduling to minimise squared completion times using mixed 0-1 quadratic program

Question: I have come across an Optimization question as follows:

There are $n$ jobs that have to be processed on a machine. The machine can process only one job at a time.  The time taken to process job $i$ on the machine is $t_i$.  For a given sequence of jobs on the machine, the completion time of job $i$ is the time at which the machine finishes processing job $i$.  The goal is to find the sequence of jobs which minimises the sum of the squared completion times.

I have attempted to solve it as follows but am not sure if it's correct. In particular I'm unsure about the constraints for the binary variables.

Variables: Let $x_{ij}=1$, for $i \in {1,...,n}$, $j \in 1,...,n$, $j \neq i$ if job $i$ is completed after job $j$, 0 otherwise.  Let $y_i$, $i \in {1,...,n}$ be the completion time for job $i$.
Min. $\sum_{i=1}^n y_i^2$
s.t. $y_i - \sum_{j \neq i} t_j x_{ij} \quad \forall i \in {1,...,n} $
$\quad\; x_{ij} + x_{jk} - 2x_{ik} \leq 1 \quad \forall i \neq j \neq k$
$\quad\; \sum_{i \neq j} x_{ij} = \sum_{m=1}^{n-1}m$
$\quad\; x_{ij} \in {0,1} \quad \forall i \neq j $
$\quad\; y_i \in \mathbb{R}^+$
Answer: Hint: If you interchange two jobs, what happens to the objective?
Conclude that the jobs should be sorted by ...
Comment: The jobs should be sorted by time?


How can I access tumblr rss feeds from europe without using a browser?

Question: I usually use rssowl to read rss feeds but a while ago it stopped working with tumblr feeds.  I think this might be because of the gdpr consent page.  Is there a way to bypass this in rssowl or another way to do this?
Comment: If they are actual RSS feeds and tumblr is still providing them you probably should investigate what you see when you try to view them manually?
Comment: When I view them in my browser they look like normal rss feeds, possibly because because I've already clicked through the gdpr page and my browser remembers it.  I don't know a way to view the raw feed in rssowl, but the status says "The last attempt to load this feed failed.  Reason: Invalid or Malformed Feed".
Comment: That might be a reason. You probably will have to look into how you can view the raw rss or some more information what makes it malformed and/or wait for tumblr to adjust it. Assuming it's really the GDPR page.
Answer: First of all, I can confirm that the problem lies in the redirect to the GDPR consent page. If you manage to somehow view it in your reader and click "Accept" (and if your reader stores cookies), the feeds start working again.
The exact way to do this will depend on the specific RSS reader. Unfortunately, I'm not familiar with the one mentioned in the question (RSSOwl), so I can't help with that.
But, for anyone using Thunderbird, the solution is pretty simple - see below.

Bypassing the tumblr GDPR page in Thunderbird
In Thunderbird, there's a simple trick that allows you to open any website without installing any plugins:
Simply go to Thunderbird settings, and in the "General" tab, there is an option for "Thunderbird Start Page". Replace the default address with your RSS feed link and then restart Thunderbird.

Now, instead of the usual "Welcome to Thunderbird" text in the message area, you should see the tumblr GDPR consent page:

Click "Accept" and it should reload to show you the actual feed. You can now change the start page back and you're done.
If it doesn't work, make sure you have Thunderbird set to allow cookies (via the Privacy tab in settings).
Note: If you don't want to allow all cookies, adding just oath.com, tumblr.com and [something].tumblr.com as exceptions should be enough.


FCI implementation

Question: Could you suggest, please, a manual/textbook/tutorial for implementing FCI (full configuration interaction) method on computers. I am interesting in algorithms mainly. I would like to write my own code, so I want to study how one can provide convenient indexing for configurations and what tricks are usually used to decrease computation time.
Answer: MOLPRO has a full CI module (by Peter Knowles), but it also costs quite a bit of money.  You can also do full CI in GAMESS (I think Ruedenberg's implementation), and perhaps any MCSCF/CASSCF program that is efficient enough to include all orbitals in the active space.
I regret to inform you: you may be in for a lot of work if try to write your own code.  :-(  This is an area of very deep, highly mathematical and numerical concepts.
So as far as a manual/textbook:  You may want to try Molecular-Electronic Structure Theory, especially Chapter 11 and 12.  There is just a crazy amount of work that you will have to do prior to CI, including the coding of the various four-center integrals for electron repulsion, kinetic energy, and overlap (earlier chapters).
Comment: Molpro is not nearly as expensive as truly commercial packages like Gaussian.  As one can see on http://www.molpro.net/info/products.php?portal=visitor&choice=Licence+types, a single workstation license costs $350/$600 for the serial/parallel version.  That's about the same price as Microsoft Office was the last time I looked (close to 10 years ago).
Answer: I happen to have a simple FCI code with detailed documentation of implementation. You can find it at http://scholar.princeton.edu/boxiao/software/fci-201302
Answer: Useful links include:

http://vergil.chemistry.gatech.edu/notes/ci/node23.html
http://www.sciencedirect.com/science/article/pii/0009261489874640
http://scitation.aip.org/content/aip/journal/jcp/98/4/10.1063/1.464087
http://www.sciencedirect.com/science/article/pii/0010465589900337
http://www.sciencedirect.com/science/article/pii/0009261488874128
http://www.sciencedirect.com/science/article/pii/000926149085633N
http://www.sciencedirect.com/science/article/pii/000926148485513X
http://www.sciencedirect.com/science/article/pii/0301010480800450
http://www.tandfonline.com/doi/abs/10.1080/002689798168303#.UmRKqJRgbVk

And there is the more recent Monte Carlo FCI method:

http://scitation.aip.org/content/aip/journal/jcp/132/4/10.1063/1.3302277
and many more courtesy of Google Scholar

FCI implementation


Calculator application, pupulating textfield from buttons, iphone

Question: I am creating a simple calculator application. I have 10 buttons labelled 0 through 9, and 5 buttons for the operations. I have an uitextfied which should be populated from the buttons. ie when the user click button 1, 1 should be entered in the field and so on. Also the value entered should be there even if the user taps another one. how to do that..pls help..
Answer: I would personally store user input in a NSMutableString, validating input (for numeracy)and adding it to the variable if validation returns true.
Then when a button is pressed it is simply a matter of updating the UITextField with the contents of the NSMutableString.
For the purpose of calculations, the string value can be converted to the appropriate numeric type when a calculation is required.
Answer: You need to declare the textfield (and the buttons) as Outlets in Interface Builder. Then you need to connect the touch up inside event of each button to a method. You can either have 10 methods which is one for each button or just one method and filter on id or tag. In the button actions you can easily update the textfield by appending the the correct number.


Find out booking class of past flights

Question: Is there a way to find out the booking class of a past flight, only having your name, flight number and booking reference/ticket number?
Comment: If you mean you no longer have the ticket/e-ticket, that will probably depend on the airline and/or the channel you booked through. Also, how far back are talking about?
Comment: I was thinking about flights up to 1 year in the past (which usually also is the maximum time to redeem missing flights). Yes, I'm referring to flights where I do not have the information anymore (neither the ticket/boarding pass, nor emails where the fare class is stated). It already seems from your comment and Zach's answer that there is unfortunately no general (online) tool, that can provide this...
Comment: I'm not sure if tools like checkmytrip include past bookings? Also I wonder in what situation you would have the ticket number but not the rest of the info?
Comment: Checkmytrip does not show the booking class (atleast in some cases). It is possible to have the ticket number but no booking class, for example, the boarding passes in Apple Wallet usually also contain the respective ticket number, but not necessarily the booking class.
Comment: Do you have the emails?
Comment: Not for all flights. I'm also asking this as a more general question "Is it possible obtain X with only Y, Z and ..."
Comment: Will the airline's website allow you to print another receipt or ticket?  Since it will have a date in the past, there's little risk that you will use it to actually go anywhere.
Answer: The airline may have a mechanism to request a receipt after you travel. United, for example, has a form you can fill out and they'll send you back a receipt within two weeks. If your airline doesn't have an online form for this, you can contact them and ask if there is any such process. You might also have a copy in your email if you booked the tickets yourself.
Another place to look is your frequent flyer account, if you have one. Since mileage earning sometimes depends on the booking class, it may be displayed on your statement. I know that United shows it on their statements (see this example, which lists the flight number and G-class), as does Ethiad (see this example, which lists the booking class after the / for each flight).

Find out booking class of past flights


What is the use of SYNONYM?

Question: What is the use of SYNONYM in SQL Server 2008?
Answer: In some enterprise systems, you may have to deal with remote objects over which you have no control.  For example, a database that is maintained by another department or team.
Synonyms can help you decouple the name and location of the underlying object from your SQL code.  That way you can code against a synonym table even if the table you want is moved to a new server/database or renamed.
For example, I could write a query like this:
insert into MyTable
(...)
select ...
from remoteServer.remoteDatabase.dbo.Employee

but then if the server, or database, schema, or table changes it would impact my code.  Instead I can create a synonym for the remote server and use the synonym instead:
insert into MyTable
(...)
select ...
from EmployeeSynonym

If the underlying object changes location or name, I only need to update my synonym to point to the new object.
http://www.mssqltips.com/sqlservertip/1820/use-synonyms-to-abstract-the-location-of-sql-server-database-objects/
Comment: @Samcd No.  For more information see this discussion http://www.sqlservercentral.com/Forums/Topic1427405-391-1.aspx
Comment: Can I get to know the current identity value of row inserted using function like this-> Select IDENT_CURRENT('')? I don't want to get the identity value by doing max(ID) of that table. Is it possible?
Comment: Does using synonyms have any effect on performance when accessing a remote server?
Answer: Synonyms provide a great layer of abstraction, allowing us to use friendly and/or local names for verbosely named or remote tables, views, procedures and functions.
For Example
Consider you have the server1 and dbschema as ABC and table name as Employee and now you need to access the Employee table in your Server2 to perform a query operation.
So you have to use like Server1.ABC.Employee it exposes everything ServerName,SchemaName and TableName.
Instead of this you can create a synonym link Create Synonym EmpTable for Server1.ABC.Employee
So you can access like Select * from Peoples p1 inner join EmpTable emp where emp.Id=p1.ID
So it gives the advantages of Abstraction, Ease of change,scalability.
Later on if you want to change Servername or Schema or tablename, just you have to change the synonym alone and there is no need for you do search all and replace them.
If you used it than you will feel the real advantage of synonym. It can also combine with linked server and provide more advantages for developers.
Comment: Does using synonyms have any effect on performance when accessing a remote server?
Answer: Seems (from here) to create an alias for another table, so that you can refer to it easily. Like as
select * from table longname as ln
but permanent and pervasive.
Edit: works for user-defined functions, local and remote objects, not only tables.
Answer:
An example of the usefulness of this
  might be if you had a stored procedure
  on a Users database that needed to
  access a Clients table on another
  production server. Assuming you
  created the stored procedure in the
  database Users, you might want to set
  up a synonym such as the following:
  USE Users; GO CREATE SYNONYM Clients
  FOR Offsite01.Production.dbo.Clients;
  GO
Now when writing the stored procedure
  instead of having to write out that
  entire alias every time you accessed
  the table you can just use the alias
  Clients. Furthermore, if you ever
  change the location or the name of the
  production database location all you
  need to do is modify one synonym
  instead of having to modify all of the
  stored procedures which reference the
  old server.

From: http://blog.sqlauthority.com/2008/01/07/sql-server-2005-introduction-and-explanation-to-synonym-helpful-t-sql-feature-for-developer/
Answer: I've been a long-time Oracle developer and making the jump to SQL Server.
But, another great use for synonyms is during the development cycle. If you have multiple developers modifying the same schema, you can use a synonym to point to your own schema rather than modifying the "production" table directly. That allows you to do your thing and other developers will not be impacted while you are making modifications and debugging.
I am glad to see these in SQL Server 2008...
Answer: A synonym is a database object that serves the following purposes:

Provides an alternative name for another database object, referred to as the base object, that can exist on a local or remote server.
Provides a layer of abstraction that protects a client application from changes made to the name or location of the base object.

Have never required the first one but the second issue is rather helpful.
msdn is your friend
Answer: You can actually create a synonym in an empty database and refer it to an object in another database, and thus make it work as it should even though it is in a completely empty database (besides the synonym that you created of course).

What is the use of SYNONYM?


IIS 10 (Server 2022) error 500 with name, 404 with ip

Question: I've got a new server 2022 setup I'm just getting up and running, and when pulling a page from IIS, I get a 500 error if I use the name in the URL, but get a 404 if using IP.  The difference between the two URLs it what is throwing me off, so I honestly don't know where to look next.  Why would a 500 error be thrown?  Name lookup resolves to the same IP that I am using and getting the 404 error.
Comment: `iisreset` on the server, `ipconfig /flushdns` (admin elevated) on the client, wait 5 minutes, retry. Any relation to Peter Piper whom picked a peck of pickled peppers.
Comment: If you read more about site bindings, the reason should be very clear, https://docs.jexusmanager.com/tutorials/binding-diagnostics.html#background
Answer: Within IIS in the Bindings for your website, have you got a binding entry for the IP and port with no hostname?
Since IIS allows you to have multiple websites, using multiple combinations of hostnames, IP addresses and port numbers, it determines which website you're trying to reach by taking your request and finding the website that has a matching binding. The combination of those three elements is always unique across the sites hosted on that server.
So in your case you'd want your site to have two bindings. One for the hostname/IP/port combination you have now, and the second almost identical entry with an empty hostname entry.
Note, if IIS is already listening on port 80/443 using that IP address and no hostname elsewhere (for instance in a default site that's still running) then it won't let you add it, but that could also explain why you're getting a different result as a different website is responding to the query. So while the URL connection is throwing a 500 error indicating an issue with the website itself, the IP 404 is indicating it's being sent elsewhere, but somewhere that perhaps the default page isn't found hense the 404 file not found error.
Comment: Thank you for this.  I haven't done any sort of web dev work in.. let's say a larger number of years, so it never occurred to me that the hostname bit of the URL would be used for more than just the DNS lookup to find the IP (much simpler times back on the early web).  I'll give some of this a look when i get back to it tomorrow or the day after.


How does the transaction log work in SQL Server when i run a DML

Question: I would like to ask you something about a query execution in SQL. in general, I know that when I run a SELECT query I mean a view, this is loaded in cache memory then is parsed, compiled and then the query optimizer applies improvements based on execution plans so for that we have also the support coming from buffer pool (storage engine and relation engine). So, all that happens in memory and finally the result set is sent to SQL client.
Otherwise, we have the log file in a DB and here is my doubt because I don't know if the log file in SQL is also used in queries 'SELECT' executions. Or it's just used in transactions like an update, delete or insert so I really would like to know the role of transactional log in SQL when I perform a query (view) and also his role in the other DML transactions.
Answer: Yes, SELECT statements can in fact use space in the tempdb transaction log, as temporary working space to complete the query:
The Transaction Log (SQL Server):

Long-running transactions might also fill up tempdb's transaction log. Tempdb is used implicitly by user transactions for internal objects such as work tables for sorting, work files for hashing, cursor work tables, and row versioning. Even if the user transaction includes only reading data (SELECT queries), internal objects may be created and used under user transactions. Then the tempdb transaction log can be filled.
Comment: Thanks so much @Brad, I was thinking about this whole weekend lol. so in this way i just have one last doubt but is related the executions plans so, I will create a new post for my second question thanks,
Answer: Generally, the transaction log only interacts with data modification language statements such as insert, update and delete by recording the exact modifications made to the database so those changes can be guaranteed to either complete or be rolled-back.  This is the primary mechanism by which SQL Server guarantees ACID compliance.
Select statements are not generally affected by the transaction log.
However, heavy transaction log activity resulting from a large number of concurrent DML statements may slow the system so much that select statements may appear to be affected.
If you have a specific question, please add the details to your question.


How do I make a curved solid line?

Question: I'm a newbie to blender and I'm trying to make a curved solid line. I want it to be perfectly curved, as half a circle. I want it to have thickness and be round on the tips. Think of a sausage.
I've tried multiple ways, but couldn't do it.
Thanks for the help!
Comment: What way have you tried and why were you not satisfied? I don't think there's any easy way to do it with a bezier curve, you'll need to stick 2 half-spheres to each end of the curve, if you work with mesh you can use Skin + Subdivision Surface modifiers
Comment: https://blender.stackexchange.com/questions/55302/rounded-caps-on-a-bezier-curve-pipe https://blender.stackexchange.com/questions/53523
Answer: Set up a Bezier Curve to be a hemi-circle like this:

Building a "Hot Dog" shape by deforming a UV sphere (the red tube) and then applying a curve modifier to it should get what you asked for (the blue tube)

How do I make a curved solid line?


Java2D: Capturing an event on a Line object

Question: I have a JPanel which has a line, circle, etc. Now when I click on the line, will the event get reported as a line event or a general JFrame event. I need to be able to move the line if the user clicks on the line and moves it. Is this possible in Java2D?
Answer: Yes, but you will need to do some work (see java.awt.Shape).  Basically you need to track a list of Shapes.  The JPanel will recieve a mouse event, which you can translate to (x,y) coordinates.  You can then call Shape.contains(x,y) to see if your various shapes were clicked on.
This will work well for Circle, Polygon, Arc, etc; however in the case of Line2D, it won't work as easily, but you can use Line2D.intersects() with a small rectangle around the mouse click (this is also good UI since you don't want to force the user to click exactly on a pixel that is hard to see).
Answer: There is no such concept as a "line event" unless you decide to implement one.
I would suggest adding a MouseListener and a MouseMotionListener to the Canvas or JPanel onto which your geometric shapes are drawn.  Use the MouseListener's mousePressed(MouseEvent) callback to determine whether a given shape has been clicked on.  Once you've established this, use MouseMotionListener's mouseDragged(MouseEvent) method to move and redraw the shape as the mouse cursor is moved.
Answer: Here's a simple example that demonstrates some of the techniques adduced in other answers.
Answer: I created a canvas markup library in Java a few years back and if you don't need to worry about transforms on the canvas (scaling, rotation, etc.) it is very easy to do.
Basically you just need to maintain a collection of the canvas shapes in a List (not a Set because Z order is probably important).  The mouse listener will be on your canvas, and not on individual shapes.  Add new items to the beginning of your collection (or iterate the list backwards later).
When the canvas receives a mouse down event iterate through your collection of shapes until you find one that is underneath your mouse coordinates.  The easiest way to do this is to have your shapes implement an interface that defines some sort of hitPoint(int x, int y) method.  That way your rectangles can implement a contains(), lines can do intersects() or graphics paths, you can account for some hit padding, etc.
Taking it one step further, your shapes should define their own draw(Graphics2D g) method so that you can easily do things like selection boxes, or set the paint mode to XOR to make shape 'moving' easier.  The paintComponent method of your canvas would just have to iterate through your collection of shapes, calling shape.draw(g) on each one, passing in the graphics instance provided to the paintComponent method.


Recommended project structure for Flex builds

Question: I'm starting a new project using Flex3 for a reasonably intricate UI getting its data from a collection of RESTful web services. I wondering what experiences others have had in structuring a moderately complex Flex project. The issues I'm thinking about include:

I want to use our FlexBuilder licenses for visual editing of layouts and debugging code on Eclipse
automated build script so that we can use a CI server
testing strategies, particularly automatable unit tests
cross-platform Linux and Windows development environments (yes, I know the Linux version of FlexBuilder doesn't do visual editing, but everything else should ideally run cross-platform)
dependency management for at least the Java code (are there library dependency managers for Flex?)

I've just burned a day trying and failing to get a maven2/flex/jetty build setup working smoothly (based on Jeff Maury's tutorial). I'm not dead-against using Maven as we go forwards, but I'm sure there must be a less painful route. The main issue I had (other than maven documentation being patchy) is that maven's "single artifact per build" rule means that you have to jump through a lot of hoops with a complex build, and I'm not enough of a maven initiate not to trip over the hoops and fall on my face!
Would Ant and Ivy be a better option than maven2? What other choices are there?
Answer: I don't know Flex development but I know CI so I'll comment on that aspect.
I work on CruiseControl, so that's what I use (when not being paid to setup something else). And there are blog entries that describe setting up Flex projects under CC for both Windows and Linux. CC has been around for a long time so there is a large community of users and lots of 3rd party tools that work with it.
But other people are likely to recommend Hudson and it would be hard to argue against them. Hudson is very easy to get up and running and has a nice web based UI. This project is very active, has lots of fans and lots of buzz and has matured very rapidly. I don't have anything bad to say about it. This blog entry describes running acceptance tests under Hudson.
I don't know enough about Maven to offer advice there but I'm working with Ivy at a client right now and I really like it. We've got a combination of Java and C++ code and we're able to get Ivy to do what we need.
Answer: Well we are using maven. With some help of a lot of different web sties I have an enterprise application being built using maven.
This article via adobe has really help a lot.
http://www.adobe.com/devnet/flex/articles/fullstack_pt1.html
http://www.adobe.com/devnet/flex/articles/fullstack_pt2.html
http://www.adobe.com/devnet/flex/articles/fullstack_pt3.html
You really need a common configuration project that will be shared between both flex and java, and possibly your c++ code. This article explains how to set that all up.
Down side, if you are not knowledgeable with maven there is a slight learning curve.


How to use missForest in R for test data imputation?

Question: I want to use the R missForest() function at work to perform missing value imputation. However, after reading up on the algorithm more, I can't decide how to impute future/test data - running the algorithm on just the test data, or run it on train + test combined.
I have heard many times that you training & test datasets should not inform one another at all, but this algorithm is an example of where I think that doing so would increase predictive performance a lot, and crucially I see no reason why I wouldn't be able to apply this same approach in production for future unseen data.
Here's an example of what i'm proposing. First I do a train/test split and introduce missing values:
library(datasets)
library(missForest)
library(randomForest)
data("iris")

# train/test:
set.seed(2)
train_index <- sample(nrow(iris), 120)
feature_train <- as.matrix(iris[train_index, 1:4])
feature_test <- as.matrix(iris[-train_index, 1:4])

# introduce NA's to both:
feature_train[sample(length(feature_train), 40)] <- NA
feature_test[sample(length(feature_test), 10)] <- NA

I impute the training data and build a model on the imputed data:
imp_feature_train <- missForest(feature_train)$ximp

rf <- randomForest(x = imp_feature_train, y = iris$Species[train_index])

Method 1:
For the test data, this is the method that I prefer. It uses the imputed training data to inform missForest() in imputing the test data. Is there any issue with this, as long as (if the model was put into production) I also used this training data to inform any future data?
feature_train_test <- rbind(feature_test, imp_feature_train)

imp_feature_test_v1 <- missForest(feature_train_test)$ximp[1:nrow(feature_test), ]

pred_test_v1 <- predict(rf, imp_feature_test_v1)
sum(pred_test_v1 == iris$Species[-train_index]) # 27

The reason I want to use this approach: imagine your training dataset is 1M observations, and you are building a model that must be ran hourly on 1k observations. The 'quality' of the missing value imputations will surely be higher if you use those 1M observations to 'inform' the missForest() algorithm, as apposed to simply running the algorithm on the 1k observations alone.

Method 2:
This imputes the train and test datasets completely separately. I imagine that performance would degrade considerably as the test dataset gets smaller:
imp_feature_test_v2 <- missForest(feature_test)$ximp

pred_test_v2 <- predict(rf, imp_feature_test_v2)
sum(pred_test_v2 == iris$Species[-train_index]) # 26

Thanks in advance.
Answer: In Method 1, I think it is a kind of target leakage because you use test data for predicting each NA value.
How about using this modified dataset rbind(feature_test[each_row], imp_feature_train)? just predict each 1 data sample.
I am searching for about good imputation example by using missforest.
Comment: Random forests are notorious for overfitting so I would recommend caution in using it for imputation.  Be sure to verify using simulation the accuracy of confidence interval coverage when using this approach.
Comment: Hey, I actually ended up doing a fair bit of work on missforest after asking this question. You might find this useful: https://www.kaggle.com/lmorgan95/missforest-the-best-imputation-algorithm
Comment: Thanks for the article, @LiamMorgan! Probably naive question, but is it safe to say that your missforest implementation can efficiently impute/recover missing data?


Steam library only some dlc and some not

Question: I bought civ v complete edition which includes all dlcs and expansion for civ v.     When I look in my library it only shows 2 of the dlcs and the normal coc games.  I still have the features from the other dlcs but I would just really like to actullay see them in my library when I open steam.  I geuss it doesn't matter but how can I fix this?
Answer: I assume the two DLCs you're referring to are the expansions, Gods & Kings and Brave New World. They're displaying because they're expansions rather than DLC. Most DLCs aren't usually listed in your library- it'd be pretty hard to find anything if they did!
If you want to view the DLCs you have for a game, right-click the game in your library and select "properties". Then click the DLC tab.
Comment: Not sure this is correct, with the new way Steam show "installed" DLC on the Game page in your library, which seems to be what the OP is talking about -- for Civ 5 I see all the scenario packs, etc. separately. I think it might be to do with how the game was bought (e.g. buy each item individually, or buy it all in a bundle?)


Flight Simulator X change controls behavior

Question: I'm trying to play Microsoft's Flight Simulator X, but currently i'm having a bad time, as I'm used to flight games where when you unpress a key, the control surface returns to its initial position. On FSX, it keeps in the same state. Wether that's realistic or not is not the problem, is there just a way to change this behavior?
Comment: Simplest solution is probably to use a gamepad or joystick if you have one.
Comment: @MBraedley nope, buying a joystick is not an option for me
Answer: Go into controls and assign a key, or use the mouse yoke. Press  Ctrl-Y to activate the mouse yoke


What happen to my pi

Question: I standby for 8 hour and shutdown. Can't open why?
Sorry for my english.
Answer: Your Pi won't start because the boot sequence is unable to mount your root file system. This might be due to a misconfiguration or possibly a corrupt SD-card.
Answer: I would lean more towards the SD Card being corrupt in this case. If it was an issue with the actual OS I would have suspected more of a clear indication that no OS or something found or more direction in terms of error message.

What happen to my pi


Why don't people plug inoculate ends of logs, just the sides?

Question: I've seen a lot of videos with people inoculating the length of the logs. Why don't people do the width?
Answer: With the exception of "trees" such as palm trees, as a tree grows the inner conductive tissues lose their ability to transport nutrients up or down and become hardened into heartwood, providing structural strength and leaving the outer tissues to keep the roots and canopy supplied with food. So the "length" under the bark is soft wood and will be more easily penetrated by the fungal mycelium and providing a quick establishment of the colony. While you can inoculate the ends it will only work satisfactorily when the wood is very soft such as with North American basswood where the heartwood remains spongy or palms which do not produce heartwood since they are grasses, designed to bend in high wind rather than attempt to stand straight and stiff.
Comment: There are several fungal diseases that will *kill* palms (diamond scale, pink rot, fusarium, the fungus causing "crown drop" where the entire top of the palm falls off without warning after the trunk has rotted from the inside, etc) but are there *any* "beneficial" (or even "harmless" fungi that grow on palms? I suspect not!


Protection on the AC side vs DC side

Question: The circuit below shows a three phase rectifier with 3 filter inductors at the input side, and a capacitor, a MOV, and fuse at the output side. I wonder what the differences are in protecting the AC side vs the DC side. I've seen designs where they use 3 fuses, 3 MOVs at the input side. This seems like an increase in cost if we compare it to using just one fuse and one MOV at the DC side. I've also seen the use of TVS diode after the bridge. What would the best approach be?
Comment: Well, a fuse on the DC side isn't going to protect against something like a diode failing short on the AC side. Similarly, a MOV on the DC side won't protect against a line-to-line voltage spike blowing a diode.
Comment: By the way, I think that fuse should go before the varistor, so clamping takes out the fuse, not the varistor. :)
Answer: An MOV on the input side will protect the diodes from the voltage spike, with an MOV on the DC side you obviously save cost, but the current spike you'll get when the MOV conducts may damage the diodes. It'll protect whatever is downstream - which may be the costly parts.
AS for the fuses, it's a lot harder to find fuses rated to clear on DC, since you don't have the current zero that allows the arc to extinguish, and many fuses, thermal trips and breakers will only have an AC rating for that reason.

Protection on the AC side vs DC side


How can I effectively "sentry jump" with the wrangler?

Question: Now that the wrangler has been introduced to the engineer, the engineer can get to places previously unreachable.  Is it possible to get propelled upward with just the gun from the sentry to take less damage? If rockets are used, is it possible to pick up the sentry immediately after rocket launch, so that you can take the sentry with you on the jump? What other tips do you have?
Answer: You can reduce damage and fly farther by jumping and crouching in mid-air as you shoot the rocket.
To answer your other question, I present you a page of helpful videos instead.
Answer: I'm honestly not sure about using the gun to propel, or if you can microsecond-time the pickup of the sentry post rocketblast. However, the fairly obvious tip would be to build a teleporter exit in a safe spot wherever you rocket jump to and have your entrance waiting in a convenient spot for afterwards. You'll be able to move your sentry / dispenser quickly without the hassle of having to rebuild everything.
Answer: You can also propel yourself using shots from the mini-sentry.  Stand on top of the mini-sentry and shoot upwards.
Answer: I was practicing sentry jumps the other day and came to discover that if you:

Stand on top the sentry
Look down at it
Simultaniously right click (rocket) and press 3 (change to wrench)

You can pickup the sentry whilst jumping relatively easily to carry it to new places.
you may have to right click just before you press 3 and spamming right click instead of just hitting it once can also help
Hope this helps :D
Comment: With the inclusion of the Rescue Ranger you don't need to worry about switching to wrench and trying to pick up your sentry at the same time, you can just jump over and 'Ranger the sentry to you.  That is, if you have that item, for those of us who don't you have a good method though :)
Comment: @hammythepig Yes, however, this method is useful when either you dont have it (as you've mentioned), or when you dont wish to spend metal to activate the Rescue Ranger, or even if you just prefer a different wrench :)


Gap between tub and tile. 100+ year old bathroom. Tile over plaster walls & heavy cast tub

Question: I caulked this gap but the caulk cracked, water soaked in and became moldy.
I've removed most of the caulk and thinking about shoving some grout into gap at bottom then finishing off with a grout/caulk combo.
Should I use some backer bead material first? Or just grout? Or any other suggestions?
I really want to be done with this but don't want to replace tile!
Thanks![
Comment: One trick of caulking/grouting a bathtub, is to fill it with water first.
Comment: What kind of caulk did you use?
Answer: People who don't know any better will often use ALEX caulk for something like this, reasoning that "caulk is caulk." These caulk jobs fail spectacularly, where it can take less than a month.
For a ceramic tile bath enclosure, 100% silicone caulk is what you want. Technically there's a testing standard called ASTM C920 for qualifying the suitability of sealants for different levels of joint movement. You want a caulk that's "class 25" or better under ASTM C920 . The 25 is basically its stretchiness, where class 50 is twice as stretchy as class 25. The cheapest 100% silicone caulk that you can find at a corporate hardware store will probably be class 25. I've seen "supreme" 100% silicone listed as class 50. Be careful shopping for silicone caulk, though. There are all sorts of marketing tricks trying to get you to buy the wrong stuff. You don't want "siliconized" caulk. You don't want "better than silicone!" caulk. You want 100% silicone. It should stink like vinegar, although there is such a thing as "neutral cure silicone" that doesn't stink. I avoid it because it can behave poorly after it has expired.
Before applying the silicone caulk, you gotta get all of that old stuff outta there. A plastic putty knife is my favorite tool against a tub surface, where metal tools against a tub should be a last resort to avoid scratching the tub's finish. Ceramic tile isn't so delicate, so metal tools on the tile surfaces is fine.
The horizontal joint under the bath controls appears to need backer rod. The backer rod should have a diameter equal to the joint width plus 1/8". For setting the backer rod's depth, the depth of the caulk at its thinnest point should be half the joint's width. I mention it so you don't make the joint way too deep, not because missing the mark by 1/16" will cause a catastrophe. Making it too shallow so that the backer rod pokes through? That's a catastrophe.
The vertical joint in the corner looks constructed for a triangular bead of caulk with little to no filling of the gap beneath it (I like this style for horizontal joints too, but your horizontal joint is too wide). No need for backer rod here, but install it flush to the tile surface if you use it. I think it makes a more resilient joint, but I don't believe there's a chance of it debonding if you don't use the backer rod. Do be sure that the edge of the caulk bead overlaps the tile edge by at least 3/16" so that it adheres well.
I can't tell for the other joints with all of that stuff still in them.
The silicone is unpleasant to work with if you're used to something like ALEX caulk. You'll need a roll of paper towels when you're applying the stuff.
Comment: Is using silicone caulk at the top of the tub/bottom of the tile the right thing to do? Does anyone leave this uncaulked so that water under the tile can move down and out of the wall?
Comment: @Jim, for out of level tub installs there's often a jagged edge of cut tiles at the bottom that needs hiding. For an old install like this with possibly no waterproofing behind it, that's an interesting question, though. I can't imagine gravity pulling dampness down to run out the bottom significantly. Without that, I'm skeptical that diffusion toward and evaporation from that little bit of wall material behind the tile can remove moisture in the long run versus the additional moisture from an occasional splash. That big of a gap, though? _Maybe_ you're right. Could you tolerate looking at it?
Comment: appearance of a large gap *is* awful. I asked to see if anyone would say the gap is necessary, or even a benefit, for drying.
Answer: Grout is not appropriate to use in gaps at changes of plane or material. Use good quality, flexible caulk. Clean and dry the gaps as much as possible, I don't know of any caulk that will stick to wet substrate or soap residue. If that gap at the tub is deep, use of thin backer rod (plastic foam usually) will greatly reduce chances of the caulk bead failing.
Answer: Caulk should be firm and not crack in seams and corners.  If you had water infiltration and in the past the grout cracked, it is most likely that the sheathing behind the tile is compromised.  If that is the case anything you do is an exercise in futility.
Press firmly on the walls not only near the corners but all over. If any part gives at all, your best bet is tearing out the walls and rebuilding with cement board and proper waterproofing.
I know this is not the answer you want to hear.  However there is no value in providing a false cure that just masks the real problem.


What happened to Chiphacker? Electronics Exchange?

Question: Where did Chiphacker and Electronics Exchange go?
Answer: Geez, no heads-up?  I miss the octopus.
Answer: R.I.P Electropus!
Comment: Most all of the answers to http://electronics.stackexchange.com/questions/671/ have `alt text' instead of the image, and nothing is available on Google, either!   Maybe Electropus is just hiding?
Answer: As described in the original Area 51 proposal, Chiphacker.com has become a 100% Stack Exchange Network site. The owners have agreed to let us import the uses/questions and the use the domain name to get the "Electronics and Robotics" Stack Exchange off to a strong start.
It was a good match. The posts and Google ranking is a windfall to this community and using the same domain name provides a seamless experience for the existing users.
Wherever possible, we are working with the Stack Exchange 1.0 sites that have created successful communities. Generally, it is better to bring them into the Stack Exchange Network rather than shutting them down or creating competing sites. The more people we get together in one place, the better the site will be.
Comment: "And use the domain name" -> Does that mean that this question: http://meta.electronics.stackexchange.com/questions/15 is already answered?  If so, why are we looking at the rather wordy electronics.stackexchange.com URL right now?
Comment: The electronics.SE site expired several months ago and I do not know if the owner chose to export or publish their data. At the time the site went down, it had only about 120 questions and was getting barely a small trickle of activity (2-3 questions per week, maybe).
Comment: Glad to see them merged.  I was afraid Electronics and Robotics was going to coexist with Chiphacker and I'd have to be visiting both sites.
Comment: where is the content of the SE 1.0 site *Electronics Exchange*? (I have opened a question at http://meta.stackexchange.com/questions/6542/where-is-the-content-for-electronics-exchange-stack-exchange-1-0-site)
Answer: Have the old Electronics Exchange questions been migrated in a similar way to the Chiphacker ones? Although I didn't use it much I was a member there just after I joined Chiphacker and there were a few questions which it might be worth keeping.
Comment: @Amos: no, they have not been migrated. See http://meta.stackexchange.com/questions/6542/where-is-the-content-for-electronics-exchange-stack-exchange-1-0-site. I agree with you: there are questions worth keeping. If you know the title (or other content) for questions some of them can still be recovered from the Google cache.
Comment: What's happened to my gravatar? Did I ask this before my bogus id had been merged into my proper one?
Answer: Electronics Exchange is the Chiphacker 2.0 version. The name "electronics" is more generic and apropriated for this site.
Comment: Electronics Exchange was also a SE 1.0 site, which was also (I believe) merged with this version.
Comment: I agree that Electronics is really a better name than Chiphacker because my favorite questions at Chiphacker were not about circuits using integrated circuits (chips) but about those with discrete components.
Comment: @reemrevnivek: no, the content of Electronics Exchange 1.0 is not here. I checked 11 questions. Only one was here (it may have cross-posted at the time), 7 are in the Google cache and 3 are not in the Google cache. I have opened a question at http://meta.stackexchange.com/questions/6542/where-is-the-content-for-electronics-exchange-stack-exchange-1-0-site
Comment: @Peter - Thanks for that question!  However, since this is technically an Area51 site at the moment, shouldn't that go on meta.stackoverflow.com?  Also, I later came to the conclusion that EE 1.0 wasn't merged with EE 2.0 (you're right, my above comment was incorrect), in researching this question: http://meta.electronics.stackexchange.com/questions/39


What do I enter in the API Username and API password for the Commerce CardPointe module so that it works with Clover Connect?

Question: I have installed the Commerce CardPointe module in Drupal 10 and have a merchant account with Clover. The module asks me to input the API Username, API password, merchant ID and Site. I know the Merchant ID, but unsure what to enter in the API Username, API password and Site fields. I called technical support but they were only aware of an API token - which sounds different from API Username and password. Any help here would really be appreciated! New to Drupal and trying to figure this out for a client ASAP.
Thank you!!
Comment: Hey Jeff, if you want to reach out via the contact form at centarro.io, happy to help. It does look like the docs have changed since we wrote the readme, but we have contacts at Clover who we can likely connect you to for support with your account.
Comment: Absolutely - will do, thanks Ryan!
Answer: For those who find this later, it turns out you need to get the API username and password from technical support when you setup your CardPointe account. This will be different from the relationship you may have with Clover for POS sales established through your bank.


overfitting of random forest in r

Question: I am running a random forest classifier in R and during 10-fold cross-validation, I discovered that the model is overfitting. I am using a grid search to find the best hyperparameters and used the best model to predict the same training set again. The random Forest model classified every data point of the train set perfectly. I ran the same model on the test set and got an accuracy of 0.6976. Does this mean that the model is overfitting? I thought random forest models don't overfit?
My data is slightly imbalanced with 110 positive samples and 95 negative samples.
Answer: How does the 70 % accuracy of your CV compare to the rF's oob estimate?

The behaviour you observe is to be expected for random forests, see also my old answer: https://stats.stackexchange.com/a/208018/4598
The submodels of a random forest are unpruned decision trees. Training data for such an unpruned tree will basically be recognized as known and assigned to the correct class. Since each case in the training set for the random forest is training case for ca. 68 % of the trees, these correct predictions will also dominate majority vote.
Training error is therefore usually not even reported for random forests -- and it cannot tell you anything about the generalization error of the forest, nor whether the forest is overfit.
This is not a flaw in the algorithm, it's by design. Usually, when worrying about overfitting the idea is that the model may be too complex and thus unstable. Random forest by design uses overfit trees as submodels. The ensemble prediction then takes care of the overfitting.

The out-of-bag estimate of generalization error that is usually computed alongside random Forest training, however, in the usual implementation depends crucially on independence between the data rows. If rows are dependent (clustered/hierarchical/nested data structure), the oob esimate will have an optimistic bias.
In that case, a cross-validation whose splits achieve independence will help to get a more realistic estimate of the generalization performance.
An off-the-shelf cross validation randomly assigning rows won't - it has the same problem the oob estimate has with such data.

I am using a grid search to find the best hyperparameters

When evaluating the grid search results, you do take into account that some of the rF hyperparameters behave differently from how most hyperparameters for other models behave, do you?  In particular, don't expect a classical optimum for the number of trees.
Answer: Random Forest Classifiers (RFC) with 100% training accuracy are not necessarily problematic.
Make sure you are optimizing your hyperparameters on a separate validation set, this is especially important with RFC because overfitting is more difficult to identify. In the end, you should have a training, validation and a testing set. Other than that, you may be in good shape.
Comment: The linked blog post does **not** say RF is known to overfit: "The post explains why 100% train accuracy with Random Forest has nothing to do with overfitting."
Comment: You are correct, I should have taken more effort to make sure the ideas communicated in my answer were reflected in the linked blog post.

overfitting of random forest in r


Can't get to Forgot Password page in Lightning Community

Question: I am trying to get to the Forgot Password page in my Lightning Community because it currently has a typo on it.  When I am in Builder & try to go to the page, it just hangs and never brings up the page.  I have tried this in Firefox and Chrome.  I am not having this problem with other Community pages.
Answer: The Community Builder will execute the init method of all custom components on a page when you try to view it in the builder.  If there is a failure in any of the init methods, you may not be able to view the page properly.
Also, if an init method does a redirect in certain situations, you may find that the builder forces the redirect and so you cannot view the original page.
The workaround is to temporarily comment out the init methods of the custom components on the page so that the builder can display the page.
Comment: David...how do I see what components are on the page if I can't get the page to come up in Builder?  I understand what you are saying about commenting out the init.  However, I don't know which components are coming into play at the momen.
Comment: Actually I see the components.  I can access that part of the page.  I will try commenting out inits.
Comment: Well, I still need help.  I can see that the Forgot Password Community page has 4 components on it.  Three are rich content components and one is a Forgot Password component.  When I create a new test Community page, I don't see an option to add the Forgot Password component to it.  When I look at the inaccessible Forgot Password Community page via Builder, I can see that there is an Identity Forgot Password component.  I am not sure how to see this component.  I don't see it in the Developer Console.
Comment: I Builder next to the Forgot Password component on the page, it just has a trash can.  It doesn't have the normal option that components have where you can click it and you will be taken to the component in the Developer's Console where you can see the code.
Comment: I just created a new blank page variation of the ForgotPassword page.  It has no components on it & it is hanging.  I can't get to the page to add components, etc.
Comment: If that's the case, you should open a case with Salesforce support.
Comment: I seem to be having this problem with all of my Login pages in production.  It is not happening in my sandbox.  Because I don't use the Register page, I removed all of the components from it.  The problem is still happening.  I will open a case with Salesforce.
Answer: I contacted Salesforce & they emptied my Sites.com trash can to resolve the issue.  When I probed about how I can do this, I was told it can only be done by Salesforce.  Below is the response...
You have a new comment on Case #22179008
Salesforce Support  March 25 at 8:00 PM EDT
Hello Michele,
I apologize but the information regarding on how to empty a trashcan is internal information so I won't be able to share it with you.
As for the reason, I believe that you have added a custom component with the page then when you have removed it, some data was not removed so emptying a trashcan solved the issue.
Let me know if you still have any issues or concern regarding the case or if we can now proceed with closing this one.
In case of no response, my next case update will be tomorrow between 10am - 12pm Eastern time.


Is it true that everything is unconditionally changeable?

Question: Given that except Nirvana everything is impermanent, is it true that everything is unconditionally changeable? In other words whether, given something ,isn't it true that it will change no matter whether there is any reason behind it or not?
Can we say all conditions are superfluous for a change to happen? Can we say change happens with or without conditions ?
Comment: I'm voting to close this question because this question does not appear to be about Buddhist philosophy, teaching, and practice
Answer:
All conditioner have 3 sub-characteristics (upāda[jāti], ṭhiti[jarā], and bhaṅga[maraṇa]) according to the description of 5 aggregates and 12 dependent originations.
Saṅkhāra means cause of effects. This is conditioner aggregate of dependent origination.
Saṅkhata means effect of causes. This is conditioned aggregate of dependent origination.
Because saṅkhāra of saṅkhata, have to be saṅkhata of the other saṅkhāra.

So, nothing is no condition, except nibbāna. And that everything, except nibbāna, must be changed (jāti, jarā, and maraṇa) by it's multi-conditioners.
Answer: I understood the doctrine as being that conditioned things are caused:

They exist when all the conditions for their existence are present.
They cease to exist when conditions for their existence are no longer present.

For example:

A fragile thing (e.g. a sand castle) exists for as long as nothing hits it, and ceases to exist when that condition is no longer true (i.e. if something hits it)
A living thing exists as long as it's born and fed and healthy and not too old (etc.), and ceases to exist when those conditions change

What I said above about "conditioned" things is generally true of "put-together things" or "compound things" -- everything that's made (or compounded) of several things put together will eventually come apart.

I'm not sure about "reasons" -- perhaps reasons are man-made or artificial. For example the question "Why did the apple fall from the tree?" has several possible explanations -- maybe "reasons" can be called empty, like "things" are.
Answer: No, it is not true that everything is impermanent. Only compounded phenomena are impermanent. Non-compounded phenomena are permanent- for example, concepts.
For a phenomenon to arise, it depends on some conditions and causes- they are not arbitrary or superfluous. Nothing arises out of anything. Phenomena which occur are definitely because of causes.


Abbreviations on tennis tournaments

Question: Abbreviations on tennis tournamentss. I know LL (lucky loser), SE (special exempt) , PR (protected), W (wild card), Q (qualifier), but now there is (O) appearing next to names. What is (O) qualifying for tourneys?
Comment: Welcome to [sports.se]! Do you have an example you can link to?
Answer: There is no (O) abbreviation, at least not in English. Maybe you meant WO or W/O which means, that player advanced to the next round via walkover. Walkover means, that opponent has retired from the match even before it started.

Abbreviations on tennis tournaments


Understanding the working of relay

Question: I have to design a circuit where a momentary switch is used to control the main power of board. Since its a momentary switch I have a requirement of latching relay. Using only one switch I have control turn On and turn Off of the board. Once press the switch and release switch, power is On and it remains in the ON state as long as switch is is pressed once again. I press it again the power should turn OFF.
Hence I understood that I should use latching relay in my design. I have selected 1937650-9 from TE. Can someone please explain me the working of this.
If i consider this relay my design will look something like attached image.
Im still not sure whether this relay would fulfill my requirement.
How would the relay get to know that in first press of switch, the set coil has to energize and output should be latched.
And when I press the same switch for second time, the reset coil will energize.
Can someone please explain me how the selected relay works. Or the relay that I have selected is not a correct one for my requirement. If its not a suitable one for my requirement can someone suggest a alternate relay..
Comment: As a suggestion, when I am unsure of how a IC/component works, I buy one of each (of the components I think will do the job) and hands-on testing them to find out (with the help of datasheet). I don't know how this one works, so I would do the same. Buy one and start playing with it
Comment: Seeing as you have wired up A3, you must have bought the 2 coil version.  However as you have got it wired there, when you press the button the 2 coils will both be powered and will fight against each other.
Comment: There is a CircuitLab schematic drawing button on the editor toolbar. Double-click a component to edit its properties. 'R' = rotate, 'H' = horizontal flip. 'V' = vertical flip.

Note that when you use the CircuitLab button on the editor toolbar and "Save and Insert" on the editor an editable schematic is saved in your post. That makes it easy for us to copy and edit in our answers. You don't need a CircuitLab account, no screengrabs, no image uploads, no background grid.
Comment: Why do you want to use a relay when you can use a toggle flip flop and FET switch to bridge the DC voltage whenever AC is available or disable your SMPS and define the power on reset condition at will with memory or by capacitor voltage at reset with bias R . You can even do the same with a standby voltage to power the logic and drive an electromechanical SPST switch
Answer: The datasheet shows that the 1937650-9 is a 24 V, bistable 2-coil relay.

Table 1. The datasheet shows that the 2-coil relay has a common + terminal (A3) and that to operate the relay you connect A2 to '-' and to reset it you connect A1 to '-'.

simulate this circuit – Schematic created using CircuitLab
Figure 1. How the bistable 2-coil relay is intended to be operated.
You can't do what you want with one relay and a push-button unless you use the impulse relay I showed you in your previous question, How to select a relay for main power input.

Figure 2. The pawl mechanism is advanced on every impulse of the relay coil. Image source: HomoFaciens.
Comment: Do you have any impulse relay in your mind. If you could suggest a part number it would be helpful
Comment: No. I've never used one. Also, be aware that on power down these relays don't reset and will power up in the same state that they switched off.

Understanding the working of relay


Types of reasoning in mathematics

Question: Can we say that analytical approaches is deductive reasoning and numerical approaches(numerical analysis) is inductive reasoning  ?
Comment: No deductive reasoning & inductive reasoning have definitions already established. The word inductive can be used outside of reasoning and that may be confusing to people.
Comment: No.  Any "approach" (to solving problems) is non-deductive by definition. Its point is to help *find* solutions, deduction can only be used to *verify* when they are already found. While induction is helpful (in both cases), one also typically needs [abduction](https://en.wikipedia.org/wiki/Abductive_reasoning).
Comment: Wondering where proofs of the the 4-color theorem fit in.
Answer: Hilbert in his book, Geometry and the Imagination, pointed out that there were two modes of mathematical reasoning, one deductive and the other inductive. He considered the inductive process to be more important, but in fact the two are intimately involved in a kind of dialectic. Mathematics would not have got very far relying on just one.
Thus mathematical reasoning is a dialectic of inductive and deductive thinking.
Answer: Your linked pages are to mathematical analysis and numerical methods. Disclaimer: I am not an expert in either.
However, consider your typical numerical methods course. It is a study of algorithms used for approximations, maybe take newtons method. Does newtons method always work? (It doesn't, just consider derivative equal to 0, or function not continuously differentiable, etc...). So applying a numerical method really relies on some background conditions guaranteeing convergence to a solution ( at least, in a large class of cases). This generally takes the form of an analytic proof. So even the application of numerical methods is primarily deductive (if you consider proofs to be deductive). I take it that this is what @davidGudeman was trying to say.
Answer: Mathematics is all deductive, not inductive in the way those words are used in logic. There is something called mathematical induction, but that sort of reasoning is logical deductive reasoning not logical inductive reasoning according to most definitions.
Mathematics however does deal with inductive arguments in various ways. As you suggested, numerical approximation techniques are one such method. There are also probability, statistics, and fuzzy sets, that I know of. All are deductive methods to deal with problems that can't be perfectly solved deductively.
These methods use deduction to come up with an answer that is not exact or not complete, but that is better than no answer at all. You could say that the solution is inductive in the sense that you can't prove the solution you get is the true answer to the problem, but you did not arrive at that solution through inductive reasoning. If you used mathematics, you used deductive reasoning.
ADDENDUM: since a commenter seems not to have understood my point, let me try an example: you are going to draw two balls out of an urn without looking. After you draw the first ball, you will replace it and remix the urn before drawing the second. There are 10 balls in the urn, all identical to the touch, but 9 of them are black and one of them is white. The urn has been thoroughly mixed. You want to predict whether you are likely to draw the white ball. You make the following steps of reasoning:

On a single draw, there is a 0.1 chance of drawing a white ball.
The chance of drawing a white ball in two tries is 0.1+0.1-0.1*0.1=0.19.
This means that you would expect to see a white ball roughly 19/100 times you try the experiment.

Steps 1 and 3 of this reasoning are inductive. Step 2, the step where you do the actual mathematics, is deductive. There is inductive reasoning in the overall process, but the part of the reasoning that can be described as mathematics is deductive.
Mathematics is used all the time to support inductive reasoning. In fact, that's the main use of mathematics. Even in physics, if you use mathematics to predict the acceleration of a mass under a force, your overall process is inductive but the math part of the reasoning is deductive.
Comment: Comments are not for extended discussion; this conversation has been [moved to chat](https://chat.stackexchange.com/rooms/138480/discussion-on-answer-by-david-gudeman-types-of-reasoning-in-mathematics).
Comment: Could not be more wrong. Mathematical discovery is inductive. The proofs are deductive. One goes from looking at specific cases to making conjectures to trying to prove them. The deduction is the last thing that happens. The inductive inferences precede the deductions.
Comment: What you are calling induction is not mathematical reasoning. Mathematical reasoning includes only the deductive part.

Types of reasoning in mathematics


Printing from iOS devices to existing printer connected to windows pc?

Question: I am aware of AirPrint activator as a great solution for printing from iOS devices using a Mac on the network. Is anyone aware of a solution for someone with only a pc?
Answer: The way suggested by @Clayton Jones above, links to a good tutorial.  However, on the same site, I found an installer that will do all of this for you.  Here are the written instructions, for after you have downloaded the installer, via jaXov. You can also find a link with full color step-by-step screenshots in the previous sentence.
If you are facing any difficulties in following the manual procedure to enable AirPrint service on Windows, now you can install AirPrint service through AirPrint installer (by TadGhostal) which is compatible with Windows 7, Windows XP and Windows Vista. For those who don't know, iOS 4.2.1 comes with a unique feature called AirPrint which allows you to print your documents, emails, web-pages and photos over a Wifi connection with your Apple iOS device.
Prerequisites:
Download and install iTunes 10.1 from here
Make sure the printer is setup as a shared printer on your local PC
Printer and iOS device should share the same Wifi connection
Make sure you have full administrator privileges to enable / disable services on your PC
Procedure:
Download AirPrint installer for Windows from here. Once downloaded, right-click on setup.exe and choose Run as administrator from the pop-up menu.
Just follow the on-screen instructions to install AirPrint service on Windows:
Once installation completes, Windows Firewall will prompt you allow or deny AirPrint features to be shared over networks. Click on Allow access button.
Please note that only HP ePrint enabled Photosmart, Officejet and Laserjet printers currently supports Apple's AirPrint service. You don't need any additional network setup if you are using one of these printers and can print any media directly from your iOS 4.2.1 AirPrint enabled iDevice.
Answer: I haven't used this software personally but the comments left by users suggest that this works very well and does what you need it to do:
http://jaxov.com/2010/11/how-to-enable-airprint-service-on-windows/
Answer: FingerPrint (OS X & Windows) is a paid application that enables a printer connected to your Mac or PC to become an AirPrint printer. It is a paid application.

There is also a free program specifically for Windows. You can download the files here. One they are downloaded, unzip the zip file and run the AirPrint_Installer.exe Then run either AirPrint iOS 5 FIX - 32Bit.reg or AirPrint iOS 5 FIX - 64Bit.reg depending on if you are running a 32 or a 64 bit version of Windows. Go back to AirPrint_Installer.exe, make sure "Service Startup" is set to "Auto" and click "Start". Reboot your computer. All these instructions and troubleshooting instructions can be found in the links above.


Level spacing distribution

Question: I have started learning level spacing distribution and it says that level spacing distribution for classically regular system show poison curve. But is it valid for the integrable system as well, because assuming simple harmonic oscillator, there the energy levels are just $E_n=(n+\frac{1}{2})\hbar \omega$ hence level spacing are all same which is $s = \hbar \omega $? Now in this case level spacing distribution would be $P(s) = \delta (s-\hbar \omega)$ not Poissonian.
Answer: The level spacing distribution is essentially a statistical characterization, aimed at studying intrinsically complex or perturbed systems - so it's not surprising it doesn't work so well on the harmonic oscillator.
In the paper The problem of quantum chaos in a kicked harmonic oscillator (1991), Berman et al. are clear about that in their conclusions:

In the zero approximation (no perturbation: x = 0) the system (2.3) is linear, and even in the classical limit it should be investigated out of the framework of KAM theory [20]. There is no quantum consideration of these systems in the region of parameters of quantum chaos at present.

Though it should be mentioned that Gulisashvili and MacCluer calculations lead them to conclude that (e-print):

The annihilation operator of the unforced quantum harmonic oscillator is chaotic.

And there are exceptions to this correspondence even among systems where it should/could work. An example is described in the paper Core-induced chaos in diamagnetic lithium:

We present a theoretical study of the connections between quantum and classical descriptions of lithium in a magnetic field. We find that the localized nature of the ionic core causes a breakdown in the generic connections between energy-level statistics and classical motion: classical chaos is observed in a regime where the energy-level distribution is Poissonian.
Answer: It is been amazingly described here at page 176:

Generally, for classical integrable nonlinear systems, i.e. $det( \frac{\partial^2H}{\partial I_i\partial I_j}) \ne 0$, with
respect to the action variables $I_i$, with at least two independent degrees of freedom, Berry and Tabor convincingly argued in favor of the following conjecture (Berry-Tabor conjecture): In the limit of large energies (semiclassical limit), the statistical properties of the quantum spectra of classically integrable systems correspond
to the prediction for randomly distributed energy levels.

And of course, the harmonic oscillator does not have "at least two" independent degrees of freedom, and Berry-Tabor conjecture does not apply to it.

Level spacing distribution


Send action signal via radio using energy generated by piezo

Question: I have an idea going on in my mind but I am not sure if it is even feasible, so please be patient!
Here is my problem. I have a set of chairs, say several dozens. I would like to be able to monitor at any time which chairs are occupied (i.e., someone is sitting on them), and I would like to do this in a way that is at the same time cheap and easy to maintain.
After thinking about some complicated and involved heuristics with cameras, proximity sensors etc, I figured that probably my best chance would be to detect pressure under one of the chair's feet. It should be reasonable to do something like this: there is a significative difference between maybe a few kilos of an empty chair and the, say, 50-90 kilos when someone is sitting on them.
I gave it a try with a force sensitive resistor and a Spark Core, and it worked fine. Actually, I was expecting that! When some pressure is detected, the Spark Core will send a signal through WiFi and I can detect if someone is sitting on the chair.
This solution, however, is neither cheap nor maintainable: a Spark Core can cost up to 40$ and I have to power all this! Since I don't want my users to stumble upon power chords, all the chips should be powered by battery, meaning that batteries need to be charged somehow, and so on, and so on.
So I thought: is there a way to make this more simple? Here is what I would like to do:

When someone sits, I generate some energy from the change in pressure (e.g.: piezoelectric?)
I use that energy to just blindly send out a signal (that doesn't need to be as complex as a WiFi signal, it should just be a simple signal since I want just to be able to tell if someone is sitting or standing up).
Some antenna receives that signal. It is sampled by, say, an Arduino or a Spark powered on a desk.

This, however, has some issues. First of all: can I generate enough energy to send out a signal? Moreover, can I make those signals different between each chair without the hassle of using some very complicated or expensive device? And... how could I do that?
I am definitely not an expert in electronics, so if you could make as few assumptions as possible, that would be great.
Comment: Sounds similar to the early version of [EnOcean](https://en.wikipedia.org/wiki/EnOcean) which used piezo, later replaced by coils. So it is possible but tricky and is covered by some patents.
Answer: you could port your code over to a Atmel Tiny or Atmel 328 (arduino Uno) and with a few other parts (crystal clock, caps etc.), and the best part is if you make the circuit from the bare bones up (not using a prefab board) then the total cost would be $6 + the price of the sensor.
Comment: This doesn't take into account the problem of energy! How can I power up my device?


Should I upgrade my iPad 2 to iOS 9.3 from iOS 5.1.1? ( Late March 2016)

Question: I recently recovered my lost iPad 2. I cannot afford a new tablet at the moment and I will use my iPad 2 as a daily driver (to browse the web, read books, college lectures, play games and other light applications). My biggest concern is that the iPad might become unusably slow with iOS 9. It runs smoothly with iOS 5 at the moment but most of the applications are not compatible and many features are not functioning (mail etc.).
Comment: If you are happy with the performance now, why would you change something you cannot revert? Also - what subjectively is "performance" to you? Apple clearly don't release updates to devices that become "unusably slow" due to testing and QA before release.
Comment: This is largely opinion-based, but if it were me, I wouldn't hesitate to update to iOS 9.
Comment: Right now there are problems with iOS9.3 on some older devices. Long-term I'd say yes, update... but give it a couple of weeks until 9.3.1 is out - ref: http://9to5mac.com/2016/03/24/bricked-iphone-5s-5-ipad-2-ios-9-3-fix/
Comment: iPad 2 iOS 9.3 is stable supposedly. But you should update only because basically all new apps aren't going to be usable on iOS 5.
Answer: This Wikipedia Page states that "Although the A5-based iPad 2 is relatively archaic, showing signs of its age in iOS 8, iOS 9 is said to feature performance improvements that may help the aging device function more smoothly, and initial tests suggest that it did not significantly impact available space."
I upgraded three iPad2s last week, and did not notice any degradation in the short time I had for testing. I was making sure that they could be managed by our MDM and that a small set of common apps we use worked.
Answer: Do NOT upgrade. 9.3 is a brick on an IPad 2. Stay with version 5 if performance or reliability is an issues. Compatibility with newer apps would be the only reason. I updated and have regretted it ever since.
Apple do not give you,the owner of the device the opportunity to backdate should you change your mind AFTER you have updated and are not happy.
Not cool Apple.
Comment: Brick is misleading, it may cause slowdowns, but it won't brick your device for sure. There's some valid reasons to not allow downgrades though, as unfortunate as it is for the end user.
Answer: Do not install iOS 8 or 9 on your iPad 2 !!!
I was very happy for my iPad 2 with iOS 6, but after upgrading, it is slow as f...
Apple makes sure, we cannot install older software, so now my tablet is almost useless.
That policy makes me an Android user.
I will never buy an iOS device again.


Infinite loop "Are you sure you want to buy this item?" in the App Store

Question: I have the latest Apple iPod touch. I just received a iTunes gift card and started downloading free apps.
When I try to download apps that are $0.99 or higher, it asks me for my billing information. After I hit clicked 'done', it asks me if I still want to buy the item. I say yes and it starts asking me for my billing info again and then if I'm sure again and again...
Can someone tell me what to do?
Answer: Have you tried going to http://appleid.apple.com and confirming your billing information there (going to billing, clicking submit) and then trying again ;-)


Dealing with data from multiple individual spreadsheets. Should data be merged OR are there better ways to deal with multiple sheets?

Question: I have transactional data (spreadsheets) from different time periods and would like to know if there are better ways to import the data to a mastersheet, than to merge all the spreadsheets into one? If I merge the data, I will have to append items to this master document in the future which could be an option, but am wondering if there are methods to consider?
Comment: Welcome to [Web Applications Stack Exchange](https://webapps.stackexchange.com/tour). Consider sharing a publicly editable [sample spreadsheet](https://webapps.stackexchange.com/a/138383/269219) with realistic-looking data, and showing your _hand-entered_ expected results there. You can put all data in tabs in the same spreadsheet file. Explain clearly whether the data is actually in separate spreadsheet files or all in the same spreadsheet file.
Answer: You can use the importrange() function to merge data from multiple spreadsheet files into a master spreadsheet. It would look something like this:
=query(
  {
    importrange("spreadsheet id 1", "Sheet1!A1:F");
    importrange("spreadsheet id 2", "Sheet1!A2:F");
    importrange("spreadsheet id 3", "Sheet1!A2:F");
    importrange("spreadsheet id 4", "Sheet1!A2:F")
  },
  "where Col1 is not null",
  1
)

The results will automatically update every 30 minutes, and usually much more often. They will be view-only.
If the data is stored in tabs in the same spreadsheet file, and the master sheet is in the same spreadsheet file as well, do not use importrange() but an { array expression }.