Are the Artemis Missions direct ascent?

Question: I've been looking at "exploded" SLS rockets, where the stages are all shown, and there never seems to be a lunar lander. Does that mean that the Orion Spacecraft lands on the moon, or will it have a lander attached to it?
Comment: I think the term "direct ascent" is being used incorrectly in this content. A direct ascent is where the vehicle is flying straight up to the moon without going into an orbit beforehand. Similar to a high suborbital flight having the Apogee as high as the moon's attitude. The Artemis program will not launch any rockets on such a trajectory even though it was once considered for the Apollo program.
Comment: @TheRocketfan "direct ascent" isn't about the trajectory, it's about not assembling the spacecraft in LEO, or leaving part of it in LLO while going to the lunar surface in a separate lander. A direct ascent mission could involve parking temporarily in LEO and LLO, the "directness" comes in not involving rendezvous operations.
Comment: @ChristopherJamesHuff Okay thanks for letting me know.
Comment: @Blueskinandglowingredeyes direct ascent is not the flight plan for Artemis. However, this is a (somewhat) decent question noting SLS's massive size may look like a direct ascender to the untrained eye.
Answer: The Artemis mission architecture for crewed missions to the Lunar surface is significantly different from the Apollo mission architecture. The Artemis mission architecture for crewed missions to the Lunar surface consists of five distinct parts:

Lunar Orbital Platform-Gateway (LOP-G), commonly referred to as Lunar Gateway or just Gateway
Human Landing System (HLS)
Orion Multi-Purpose Crew Vehicle (Orion MPCV), commonly referred to as just Orion
Commercial Lunar Payload Services (CLPS) (pronounced "clips")
Gateway Logistics Services (GLS)

Gateway
The Gateway is a Lunar space station orbiting the Moon in a Near-Rectilinear Halo Orbit (NRHO). The Gateway will be permanently crewed and will serve as a science station as well as a waystation for crew to go down to the Lunar surface and back up to the Gateway.
The first two modules of the Gateway will be launched on a Falcon Heavy, further modules are planned to be launched as secondary payloads on crewed flights of SLS Block 1B.
Crucially, crew will never go to the Moon from Earth, they will always stop over at the Gateway.
HLS
The HLS is the vehicle which ferries astronauts from the Gateway to the Lunar surface and back from the Lunar surface to the Gateway.
At the moment, NASA has selected SpaceX as the only provider for the HLS, beating out the National Team around Blue Origin and Dynetics. This decision and its aftermath was widely reported even outside of space-specific media outlets, because of the surprising nature of the selection (it was expected that two competitors would be selected and that one of those would be the National Team, which includes several companies that were already involved with the Apollo program), Blue Origin first protesting and then suing everybody and their dog (and losing every protest and lawsuit), and Blue Origin taking to social media with some extremely misleading info graphics, attacking the SpaceX mission architecture.
SpaceX proposed a variant of Starship without heatshield or flaps, with landing legs and a separate set of landing engines, and with very generous crew space as well as ample cargo space.
Orion
Orion is the crew vehicle which will take astronauts from Earth to the Gateway and back. It will be launched on the Space Launch System (SLS).
Crew will launch from Earth in Orion, then dock and transfer to the Gateway (similar to the ISS). From there, they will transfer to the HLS, which will bring them to the Lunar surface and back up again to the Gateway.
CLPS
CLPS is a program which allows NASA to contract a wide variety of commercial launch providers in order to deliver cargo to the Lunar surface. In the beginning, this "cargo" will mostly be rovers and science platforms whose job it is to scout for possible landing sites and sites for temporary and permament Lunar bases as well as potential resources (water ice).
Further into the program, CLPS will deliver both cargo for the Lunar base as well as the elements of the Lunar base itself.
GLS
GLS is the Gateway equivalent to the ISS Commercial Resupply Services program, where NASA "hires" commercial providers to deliver cargo to the station. Currently, NASA has chosen SpaceX as the only provider. SpaceX has proposed a variant of Dragon v2 called Dragon XL as the cargo vehicle.
Modified mission because of delays
At least, that was the original plan. However, by now, it has become clear that the Gateway is delayed. In order to remove Gateway as a blocker, NASA has modified the mission parameters for the first two crewed landings so that Orion docks directly to the HLS in Lunar orbit, without requiring Gateway.
More potential modifications
One thing happened that NASA didn't expect: they asked for a Human Landing System that can bring a few astronauts from the Gateway (or Orion) to the Lunar surface, sustain them there for a couple of days, and then bring them back up to the Gateway (or Orion) again. But then SpaceX decided to propose Starship as the HLS and won the bid. This completely changes the dynamics:

A single Starship alone has more pressurized volume than a Boeing 747, about as much habitable volume as the entire ISS, and a lot more habitable volume than the Gateway. In other words, while (one of) the purpose(s) of the Gateway is to allow the astronauts to have more space and more freedom than they have on Orion or the HLS, it turns out that the Starship HLS is actually bigger than the entire station, so there is really no point in the astronauts ever leaving HLS for that reason. In that sense, Starship could serve as the station.
A single Starship has more habitable volume than many of the proposed early habitats. In that sense, Starship could serve as the habitat.
A single Starship can take more cargo to the Lunar surface in addition to the astronauts and all the cargo required for them, than any of the proposed CLPS providers. So, you could just stash your cargo inside Starship and send it to the Moon that way.
Since Artemis 3 requires HLS, Starship will necessarily be operational by the time cargo needs to be shipped to the Gateway. So, instead of using Dragon XL, you could simply stash your cargo inside Starship and send it to the Gateway that way.
Once Starship is crew-rated, it could do the entire trip from Earth to the Moon by itself, without the need for either Orion or Gateway, so why have them?
A single Starship can support more astronauts than Orion and Gateway combined, so why limit yourself to only 4, when you can fit 40?

Basically, Starship alone could replace almost all elements of Artemis, it can be the crew vehicle, the cargo vehicle, the lander, the station, and the base.
It is very interesting to see how the mission architecture will take advantage of the capabilities Starship offers that NASA did not ask for. NASA has hinted in the source selection statement that the additional capabilities are interesting to them.
However, there are three problems with relying too much on Starship: NASA likes dissimilar redundancy, which means not only having more than one component / system / provider / path for everything, but having different ones as well. See for example Commercial Resupply Services (SpaceX Cargo Dragon, Northrup Grumman Space Systems Cygnus, and Sierra Nevada Corporation Dream Chaser) and Commercial Crew (SpaceX Crew Dragon and Boeing CST-100 Starliner).
A second problem is a legal and political one: if NASA writes their future requirements in such a way that it is clear from the beginning that only Starship can fulfill them, you can be sure there will be a lot of lawsuits from SpaceX's competitors and a lot of political backlash from Congresspeople in the States where Boeing, Lockheed Martin, Blue Origin, Northrop Grumman, Aerojet Rocketdyne, Firefly, Rocket Lab, and all the others are paying their taxes and employing their workers.
The third problem is also political: Artemis is an international cooperation with many partners: Orion's service module is provided by ESA and built by Airbus, both ESA and JAXA are providing modules for Gateway, CSA is providing a robotic arm, and so on. They will not be happy if NASA tells them their contributions are no longer needed.
Comment: don't you just love when improving something makes more problems?
Comment: Note though that NASA has no public plans for dissimilar redundancy for SLS and Orion. A backup option for those would be politically inconvenient, since their high cost is justified in part by them having unique capabilities that private industry is uninterested in providing. Hence NASA completely ignoring Starship for so long, the uproar over the eventual selection of Starship for the HLS (with Kathy Lueders being removed from decision making for Artemis afterward), and the attempts to legislate selection of another option...one that wouldn't pose a threat to SLS.
Answer: Artemis 1 and 2 will not have a lander, they will simply orbit the Moon in a near-rectalinear halo orbit. Artemis 3, slated for launch around 2025, will dock with a lander near the Moon and land. That lander currently is a SpaceX Starship variant, and is known as the "Human Landing System".

Are the Artemis Missions direct ascent?


How do nodes communicate through tcp over different networks

Question: It is said that the nodes communicate over tcp but how is that acheived across networks over different Nats
Answer:
different networks

Ordinary plain IP routing.

different Nats

The Bitcoin network protocol uses standard TCP sockets with a typical destination TCP-port number of 8333.
The use of Network Address Translation (NAT) by many last-hop routers makes it harder to connect to Bitcoin nodes that use IPV4 private addresses behind a router. In theory the use of IPV6 addresses should make this issue go away.
I believe the NAT traversal  for Bitcoin IPV4 TCP connections probably uses whatever features are provided by the underlying network libraries and/or are configured in the OS by the end-user.
So far as I know, there isn't a Bitcoin-specific solution for this. There are a lot of general solutions that may be appropriate to use.
See

What is the NAT traversal technique used by bitcoin - which has answers mentioning specific support for UPNP if configured.
Can exist bitcoin network with all nodes behind NAT?
How does bitcoin core establish a peer to peer network
Running a Bitcoin node (behind Firewall / NAT or anything else? disallowing inbound connections)
Comment: Yes, there is nothing special about Bitcoin in this regard compared to e.g. a Minecraft server. It's just plain old TCP/IP. NAT traversal is another matter; if a node behind a NAT wants to be accessible on the public internet, the NAT needs to be configured to forward traffic sent to a particular port on the public address to the node.


Continue monitor web server and download newly added files

Question: What are the best way to continuously monitor a web server (HTTP) and download newly added file with min. delay (ideally < 1min. delay)?
Comment: Are you interested in monitoring in the sense of checking the server is up, and complaining to the admin (you) if it isn't, OR only in looking for new files as they appear?
Comment: Giving an idea: First download the list of files from the server as `curl `. Most probably, it will give you list of contents uploaded on that server. After given timeout, again use the same command and check for difference. [It will work if server is missing index.html]
Answer: Monitoring
First of all, for monitoring I recommend you use Nagios, the core source is free, but if you need GUI, you should pay for it, but it's worth paying that much.
You can also use Icinga, PRTG, or whatsoever suits you more.
Collectd (Collection Daemon) is also a free monitoring tool you can download by using yum on RHEL derivatives or apt-get on Debian-based ones. You can read this paper if you wanted to go with Collectd.
Task running every x < 1minute
For the second part of your question, for doing a job every x time where the x is for less than a minute periodically, as you know you cannot use Cronjobs, since you can use some tricks explained by Gilles in this question to do what you want.
It'll be better to have a script for what you need, and run it forever, even at boot if you need. You can have a simple syntax as shown below:
while true; do yourJob; sleep someTime; done

Or you can even go with some more complex scripts depending on what you need.
You can also use watch command. For instance:
watch -n1  command

It will run your command every second and forever.
As you might have guessed, you can also run your shell script with watch if you need to have just a simple script running every x time less than a minute, and not a complex one.
The choice is yours.
Answer: This depends on a couple of factors.
If you have control on the web server, the easiest thing to do would be to install a (RESTful?) service providing the number of files changed since the last check or download. This minimizes both data transfer and load on both client and server. Even more if the upload/modification of files on the server can be directly tracked, e.g. in the upload script instead of relying on the file system.
If the latter, I'd look into some file monitoring solution such as famd.
If you have no control on the server, then you have to get modifications before being able to download them. The easiest thing would be to use some web mirroring utility such as w3mir, since they already take care of checking/supplying ETag and Last-Modified / If-Modified-Since headers. This means that you'll have to issue fewer calls, and therefore be able to run the utility more often.
As to how to run the utility, it depends on where it runs on. You can use a cron job on a Unix machine or just run it in a loop.
If you do the former, however, you'll be well advised to install some sort of semaphore to keep a mirroring process from starting before the previous instance has terminated. It can be so simple as to create a lock file:
if [ -r /tmp/mirror.lock ]; then
    echo "lock file found" | logger -t webmirror
    exit 0
fi
touch /tmp/mirror.lock
...whatever...
rm /tmp/mirror.lock

But you'll also have to catch any signal that might kill your script, otherwise in case of a temporary error the lock file might be left there and keep all further instances from running even after the error has been solved.
Or you could verify that the lock file isn't older than some reasonable amount, and delete it if it is, or verify how many instances of the script are found by ps (normally one, the current; if more, the current one had better abort), and do without the lock file altogether.
Answer: You could do a simple curl command in a cron job, but I recommend you start using a monitoring solution with web monitoring capabilities. There are plenty of them for free, just google "Open Source web monitoring solutions" and you'll get plenty of them!
Comment: Cron min. delay is 1min, I want a faster method to sync
Answer: If you are really looking at files then you can do HEAD request on the URL and the server should return a key (the 'etag') that will tell you if the file has changed.  On an Apache server this is base on the ctime of the file, so the etag may change even if the file did not.
But since the network is likely to me more costly that writing to disk if you download the contents of the file you might as well just store it to disk.
You don't say how many files or how large they are.  If there are a large number of files or files take a very long time to download this script or if you want to put a minimum amount of load on the server then this script should be changed so that each query happens once a minute or as often as possible if the download takes more than a minute.
Below is a very simple Ruby script that will do what I think you want:
#!/usr/bin/env ruby
require 'getoptlong'
require 'net/https'
require 'json'
require 'fileutils'

def main(roots, **options)
  cache = Hash.new

  cache = Hash.new
  ok = true
  path = options[:path]
  while (ok)
    roots.each do |root|
      uri = URI.parse(root)
      http = Net::HTTP.new(uri.host, uri.port)
      case uri.scheme
      when 'https'
        http.use_ssl = true
        http.verify_mode = OpenSSL::SSL::VERIFY_NONE
      when 'http'
      else
        raise "unknow type #{uri.to_s}"
      end

      need_get = true
      if (c = cache[uri.request_uri])
        response = http.request(Net::HTTP::Head.new(uri.request_uri))
        if response.code.to_i == 200
          if response['etag'] == c['etag']
            need_get = false
          end
        end
      end

      if need_get
        response = http.request(Net::HTTP::Get.new(uri.request_uri))
        cache[uri.request_uri] = { 'etag' => response['etag'] }
        filename = File.join(path, uri.request_uri)
        need_write = true
        if File.exist?(filename)
          # you could check if the file changed here, but it does not save you much.
        end
        if need_write
          File.open(filename, 'w') { |file| file.write(response.body) }
        end
      end
    end
    sleep 30
  end
end

begin
  main([http://example.com/ten.html, http://example.com/eleven], { path: "/tmp/downloaded_files" })
rescue => error
  puts error
end

Comment: I like this solution, but I dont know ruby. does it a recursive crawl and fetch ? for caching, can you create a etag-like if missing ? example filesize  and last mod datetime
Comment: It does not crawl, but could.  Almost all the load is in doing a GET rather than a HEAD.  If you have done the GET then it trivial to compare the new data with the current file, is trivial.  I would suggest that you run this script on some of the links/sites you want to watch and see if they are supplying etag data.
Answer: As FarazX said there are several monitoring solutions like Nagios, Pandora FMS,... But maybe these tools are too big for your purpose. Perhaps Uptimerobot is enough for you.
Take a look on the proposals and choose the best for you but bear in mind that a monitoring solution with more options gives you more possibilities for your environment.
Comment: I think OP wants more than that, but the suggestion's not bad.


Mass Effect 3 Ammo Types

Question: I continually find ammo packs on the ground and I will be low on one type of ammo, but when I go over to it, it tell me my ammo is full. How do I tell between the different types of ammo lying around so I know which ones I need and which ones I don't need to run over to try and pick up?
Answer: Ammo packs on the ground will refill some percentage of all of your weapon's ammo, regardless of type. They will refill ammo for weapons that you've got holstered, as well as your active weapon.  The exception seems to be certain "heavy weapons" like the Krogan flamethrower.
I haven't worked out exactly how much they refill, but when you get the "Ammo Full" message, all your reserve ammo is full on all of your weapons.
Comment: clips restore different amounts for different weapons.
Comment: Hmm, I could've sworn that my sniper rifle didn't refill when I got ammo. But I just tested it and it seemed to work fine. Must have been an illusion of battle. Good to know about the heavy weapons though.
Comment: @RavenDreamer, is it a percentage of total ammo?  I haven't worked it out completely.  I keep meaning to SCIENCE! it.
Comment: @agent86 I'm sitting at a spot where I can science a little bit. I'll see what I come up with :)
Comment: @Ktash, I asked a different question for this, since it's kind of different from what you asked: http://gaming.stackexchange.com/q/54944
Comment: @agent86 Alright, I will report my findings there.

Mass Effect 3 Ammo Types


How do I remove all traces of a plugin?

Question: I am busy writing a plugin (called supermail), so I install, activate, deactivate, and delete the plugin fairly often. However, quite often one or more of these operations doesn't go smoothly, and I just manually delete the files. When I install the plugin again by uploading a zip file, called supermail.zip, I find the plugin installed under a directory called plugins/supermail1. I assume this is because WP still has a record of the plugin, somewhere in the DB, or even maybe just in session. Short of restarting Apache, is there anything I can do, both in my plugin code to help ensure this doesn't happen, and as administrator, to result the issue when it does happen?
Answer: wordpress plugin installer don't rename dir ever. It could be renamed in your zip. When directory already exists wordpress plugin installer just show the error plugin already exists.
Comment: It doesn't rename the directory, it assigns it the 'new' name from the start, even when no directory already exists. This is what my question is asking about.  And, it is always only the original name in my zip. I've seen this enough to know what is happening.

How do I remove all traces of a plugin?


Prove that there are 2 numbers whose difference is divisible by 2n.

Question: I have been trying to solve this problem using pigeon hole principle but I think it has some subtleties I might not be paying attention to :
 We have the natural numbers $1,2,...,2n$ and we have written them arbitrarily in $2n$ numbered places. If we add each number to the number of its place, prove that among these $2n$ numbers there are $2$ numbers whose difference is divisible by $2n$.
Answer: Let me see if I understand your formulation correctly.
You consider the natural numbers $1,2, \dots , 2n$ for some $n\in \mathbb{N}$ but you order them randomly. So basically, to each natural number in this list, you assign a different natural number from the same list. That is, you have a bijection $f\colon \left\{1,2,\dots ,2n\right\}\to \left\{1,2,\dots ,2n\right\}$. Here $f(k)$ is the spot number $k$ belongs to.
Now you consider the numbers $a_1=1+f(1), a_2=2+f(2), \dots , a_{2n}=2n+f(2n)$ and you want so show that $2n\mid (a_i-a_j)$ for some $i$ and $j$.
Consider the function $g\colon \left\{1,2,\dots ,2n\right\}\to \mathbb{Z}_n: i \mapsto a_i \mod 2n$. It suffices to show that $g$ is not injective. Indeed, if $g$ is not injective, there exists an $i$ and $j$ such that $g(i)=g(j)$ and thus $a_i-a_j=0\mod 2n$ as required.
Assume by contradiction that $g$ is injective, then all $a_i$'s have different values modulo $2n$. Then $$\sum_{i=1}^{2n}a_i\mod 2n=\frac{2n(2n+1)}{2}\mod 2n=n\mod 2n.$$ On the other hand, it is clear that $\sum_{i=1}^{2n}a_i=\sum_{i=1}^{2n}i+f(i)=2n(2n+1)$ and thus $\sum_{i=1}^n a_i\mod 2n=0\mod 2n$. This concludes the proof.
Comment: Should we instead use the pigeon hole principle on the ai s themselves?
Comment: @Pegi: That doesn't solve the problem, there are exactly $2n$ numbers $a_i$, hence they could all have different outcomes modulo $2n$.

Honestly, I posted this method to quickly as an answer, I think we can get there using the generalized pigeonhole principle on the differences and thinking a bit more but it's not entirely straightforward!
Comment: @Pegi: If you can find a reason why the $a_i$'s can only have $2n-1$ outcomes modulo $2n$ you solved the problem. I wrote down a couple of examples, and this seems to be the case.
Comment: But if 2 of the differences have the same quantity modulo 2 they might be 4 different numbers with the same remainder  and that does not give the proof.
Comment: @Pegi : You are absolutely right I thought perhaps the generalized pigeonhole principle could help here, but it's not.

I think the $a_i$'s can only have $2n-1$ outcomes modulo $2n$ and that would solve the problem using the pigeonhole principle on the $a_i$'s as you suggested. It's clear we need to exploit that $f$ is a bijection to do this, but I don't know how yet.

Again, I apologize for answering a bit to quickly, it's less trivial than I thought (unless I'm missing something easy here).
Answer: Let's assume each number we randomly put in each cell is $a_i$ if the difference of none of them is divisible by $2n$ then they all have different values modulo $2n$.In that case , the sum of them is $ 0 + 1 + ... + 2n-1 = n*(2n-1)$ on the other hand we know that $ \sigma(a_i )= 2*\sigma(i) = 2n * (2n + 1) $ and this is a contradiction so there are at least 2 numbers with the same value modulo 2n and that means their difference is divisible by 2n.
Comment: Indeed, that was the easy thing we were missing, I've included it in my answer as well, albeit formulated differently. I don't think your question deserves the amount of downvotes it did. Having said that, I do think the formulation and style can be improved.
Answer: We are considering
$$N_k=\sum_1^k k=\frac{k(k+1)}2, \quad k=1,\dots,2n$$
and we need to prove that $k_2\ge k_1$ exist such that
$$\frac{k_2(k_2+1)}2-\frac{k_1(k_1+1)}2=2n \iff k_2(k_2+1)-k_1(k_1+1)=4n$$
$$k_2^2+k_2-k_1^2-k_1=4n $$
$$(k_2-k_1)(k_2+k_1+1)=4n$$
then it suffices to take

$k_2=2n$
$k_1=2n-a$

$$a(4n-a+1)=4n \implies4na-a^2+a=4n$$
which has solution for $a=1$.
Comment: I don't understand this answer. Why are you considering the numbers $N_k$?


Cashed RRSP For Startup Venture

Question: I cashed out my RRSP to fund a startup venture. The RRSP value was significant, $100k.  It now appears that the startup venture may not proceed.  Can I put the money back into an RRSP with minimal penalty or am I screwed?
Comment: How much RRSP contribution room do you have left?
Answer: No, unfortunately withdrawals from an RRSP cannot be returned on a tax deferred basis, outside of 2 specific exceptions:

Money taken out for purchasing your first home (exceptions and limits apply); or
Money taken out to cover medical costs (exceptions and limits apply).

What you may be able to do is make an additional contribution to your RRSP, out of the money you have already withdrawn. RRSP contributions are made on the basis of a % of your income earned in Canada, and the CRA assesses what your available balance is at the end of every year when you file your tax return. You can look at your tax return from last year to see how much room you still have available.
If you have minimal room left in your RRSP, you may want to consider putting it in a TFSA account, which does not create a tax deduction, but all income earned there is completely non-taxable.
Comment: OK, so to put the money back into an RRSP what penalties am I on the hook for?  The withheld amount (30%) and on top of that the difference in income tax I will owe?  For a TFSA, is there not a limit to what I can contribute in a year?  or can I put the full amount into one right away?
Comment: @Dag77 Unfortunately you will not be able to recontribute those amounts to your RRSP, period. You can only contribute additional amounts as you earn additional income [ie: on the basis of earning additional RRSP room each year]. The penalty for overcontributing is a punative 1% each month until the amounts are corrected - ie: it costs you 12% / year. https://www.canada.ca/en/revenue-agency/services/tax/individuals/topics/rrsps-related-plans/contributing-a-rrsp-prpp/what-happens-you-over-your-rrsp-prpp-deduction-limit.html
Comment: @Dag77 As for TFSA - check your last notice of assessment; it should have your current TFSA room listed on it.
Comment: @Dag77 Whatever amount you are able to contribute back into your RRSP -- provided you have sufficient unused RRSP contribution room available -- should provide a deduction to offset some of what was withdrawn in the first place. You would lose the contribution room, but a re-deposit should negate the tax impact of the same amount of money withdrawn.
Answer: Grade 'Eh' Bacon gives the correct answer, and what I am writing here will not help you as it is too late. However future readers might find it helpful.
RRSPs can be put in a wide variety of investments, including equities. You could  in principle have invested your RRSP funds in your startup, while keeping it in the RRSP. Start reading around "self-directed RRSP".
There has to be at least some arms length relationship between the RRSP and you, and you will have to convince the CRA that this is not some trick to let you have access to your RRSP funds while pretending to keep them in the plan. I would very strongly advise you to get professional advice before doing this. And don't forget that putting all your retirement funds into something as uncertain as a startup is an extremely high risk venture, made worse by the fact that if the startup goes belly-up you will be left without a job AND without retirement funds.
Comment: fascinating stuff ....

Cashed RRSP For Startup Venture


Asymptotics of Bessel functions

Question: With $J_n$ standing for the Bessel function of first kind, $n\in \mathbb N$, I define
$$
f_n
(\rho)
=\int_0^π J_n(\rho \sin \theta) \sin \theta \ d\theta.$$
Assuming
$1\ll\rho\ll n$, I would like to find an equivalent of $f_n(\rho)$. Is it a straightforward consequence of the known expansions?
Comment: $f_n(\rho) = \pi J_{\frac{n-1}{2}}(\rho/2) J_{\frac{n+1}{2}}(\rho/2)$ may help.
Answer: We could just take the large-$n$ asymptotic of $J_n(z)\rightarrow (2\pi n)^{-1/2}(ez/2n)^n$, and then
$$f_n(\rho)\rightarrow \frac{1}{n}(\tfrac{1}{2}e\rho/n)^n.$$
This seems to be quite reasonable in the desired range $1\ll\rho\ll n$:

blue is the exact result, gold is the asymptotic expression, plotted as a function of $n$ for fixed $\rho=10$.
Answer: Large-n asymptotic expansions of the Bessel functions themselves have been derived by Olver and Temme. See http://dlmf.nist.gov/10.20 and http://dlmf.nist.gov/10.19 for formulas and citations. For practical purposes, they are very complicated and onerous to derive and evaluate, and they don't converge very quickly unless n is in the tens of thousands or above.
Given Robert Israel's result, the large-n expansion for $f_n(\rho)$ is just going to be an order-by-order multiplication of terms from the large-n Bessel expansions, and unless a dramatic simplification occurs, they are going to be complicated and onerous, too. I suggest you do the first two terms and see.

Asymptotics of Bessel functions


Suggestions for good books on class field theory

Question: Recently I tried to learn class field theory, but I find it is difficult. I have read the book "Algebraic Number Theory" by J. W. S. Cassels and A. Frohlich. In the book, the approach to class field theory is cohomology of groups. Although I have learned cohomology of groups, I find that those theorems in the book are complicated and can not form a system.
I'm wondering what are people's opinions of the book above, can you give me some suggestions on learning class field theory, and could you recommend some good books on class field theory?
Comment: Yes, CFT is hard to learn (and hard to teach).  The book by Cassels and Frohlich is excellent, but some of the material is rather concisely presented for someone who is learning the material for the first time.  (Most other books take more pages to cover less ground.) To students learning CFT for the first time, I recommend Prof. Milne's lecture notes on the subject, available at jmilne.org.
Comment: Have you tried Milne's notes?
Comment: For local class field theory, look at Iwasawa's beautiful book "Local Class Field Theory".  It is out of print, so find it in a library.  You should have a vague understanding of the use of complex multiplication to generate abelian extensions of imaginary quadratic fields first, in order to have the motivation for what is in Iwasawa's book.
Comment: You can read it online for free [on JSTOR](https://www.jstor.org/stable/2317083?seq=1#page_scan_tab_contents). Answers section is not a place to ask questions though.
Comment: Sorry, does anyone have a link for Wyman's article "What is a Reciprocity Law?"
mentioned above? Can't find the complete article in the net. Thank you.
Comment: Since this question popped up again, I'm surprised nobody has mentioned the excellent ["History of Class Field Theory"](http://www.math.uconn.edu/~kconrad/blurbs/gradnumthy/cfthistory.pdf) notes by Keith Conrad. It's fairly short and very clearly discusses the various approaches and formulations of class field theory and their relationships, and provides good pointers to original sources.
Answer: When you are first learning class field theory, it helps to start by getting some idea of what the fuss is about.  I am not sure if you have already gotten past this stage, but if not, I recommend B. F. Wyman's article "What is a Reciprocity Law?" in the American Mathematical Monthly, Vol. 79, No. 6 (Jun. - Jul., 1972), pp. 571-586.  I also highly recommend David Cox's book Primes of the Form $x^2 + ny^2$ (mentioned by Daniel Larsson).  Cox's book will show you what class field theory is good for and will get you to the statements of the main theorems quickly in a very accessible way.  (You can safely skim through most the earlier sections of the book if your goal is to get to the class field theory section quickly.)  As a bonus, the book will also give you an introduction to complex multiplication on elliptic curves.
However, Cox's book does not prove the main theorems of class field theory.  You will need to look elsewhere for the proofs.  There are several different approaches and someone else's favorite book may be unappealing to you and vice versa.  You will have to dip into several different books and see which approach appeals to you.  One book that has not been mentioned yet is Serge Lang's Algebraic Number Theory.  Even if you ultimately choose not to use Lang's book as your main text, there is a short essay by Lang in that book, summarizing the different approaches to class field theory, that is worth its weight in gold.
Answer: The obvious answers for beginners, bound to come up at some point, are:

Nancy Childress' recent book "Class field theory", Springer
David Cox's "Primes on the form $x^2+ny^2$", Wiley (I think)

Besides these the notes by Milne mentioned in the comments above are really excellent, as is the approach by Neukirch (as is given in his book "Algebraic Number Theory") even though this is rather abstract.
Comment: I would rate Childress's notes as slightly more accessible for beginners than Milne's notes.
Comment: ...Advising a student I would probably urge her/him to browse through Childress' book getting a feel for the theory, perhaps spending a few hours on it, and then move right up to Milne's notes.

Or rather, in fact, first I'd have them browsing Cox's book and *then* Childress' and Milne's.
Comment: I am not familiar with Childress' book, having completed the long, pain-staking process of finding a CFT literature collection that satisfies me before it came out.  Can you -- or someone else -- speak to the merits of Childress' book?  Why would one look there instead of Milne's notes, for instance?
Comment: @Pete: Hmmm, the merits... It's been a while since I looked in it (and I don't have at hand now) but the most obvious I can think of now is that is relatively easy to digest right after a course in basic algebraic number theory. No cohomology, no central simple algebras, no abstract class formations etc. The down-side is that it is, in my opinion, not so quick coming to the central ideas and theorems of CFT. But on the other hand this can also be seen as one of its strong sides since it instead travels the classical, chronological route.
Answer: I'm surprised no one has mentioned Algebraic Number Fields by Janusz. This is the most down-to-earth book I know which presents a complete proof of the theorems of global class field theory and which is relatively clear and well-written. The beginning of the book describes the basic theory of algebraic number fields, and the book finishes with class field theory. The proofs use a small amount of group cohomology (you should be fine) and use the original, analytic method to prove the First (or Second depending on the author) Fundamental Inequality.
The formulation of the theorems is the more elementary one using ideal theory (as opposed to Childress, which uses ideles). Once you have learned the ideal-theoretic proofs, you might want to read this article. The idele-theoretic versions of the main theorems may be easily derived from the ideal-theoretic ones.
Unlike the book by Cox mentioned above, Janusz's book contains complete proofs of all the theorems. But, as someone who shares your distaste for Cassels-Frohlich, I think Janusz is fairly easy to follow (that doesn't mean the proofs of class field theory are easy, though!).
You also might find this thread to be of some use.
Comment: Janusz was the first book I tried to learn class field theory from. I found it the clearest for conveying the statements of the theorems, but (even more) difficult than the other usual sources for the proofs. Since I think it is important to have the main result thoroughly in one's head before moving to the proofs, I second the recommendation of Janusz.
Answer: Perhaps the article  Class field theory summarized (Rocky Mt. J. Math. 11, 195-225 (1981)) by Dennis Garbanati should be contained in such a list as a very accessible introduction. For those who can read German, both Hasse's Marburg lectures and Deuring's
notes from Goettingen are excellent. Neukirch's cohomological approach (Klassenkoerpertheorie in regenbogen's list)  will be translated into English this year.
Edit: I am a little bit reluctant to put this link here as I can't access this web page anymore; but a couple of links are still working, and google will probably find the rest.
Comment: Since he's apparently too modest to say so himself, I'd like to point out that Dr. Lemmermeyer himself has a very good book on reciprocity laws, which has been a pleasure to dip in now and then. For myself, I've found class field theory persistently difficult and technical over the years. Being provided a mixture of clear mathematics and a broad historical perspective by a knowledgeable author goes a long way towards easing the pain.
Comment: The appearance of part 2 was linked to my being in a position to do so. A teaching load of 25 hours per week and a two hours drive to the next university library slow things down somewhat -)

I also realized that explaining Kummer and Hecke requires a considerable background in analytic techniques, so my current plans are writing a book on the beginnings of class field theory (Euler, Dirichlet, Kronecker, Kummer) up to the first two inequalities before continuing with part 2.
Comment: Sounds good! Do let us know when the CLT-book is nearing its completion so we can all be prepared to run to the bookstores :)
Comment: I completely agree with this! That is an excellent book. My only question is: when does the promised part II arrive? :)
Answer: Among the few books on class field theory I tried to read, Weil's Basic Number Theory is the one I found most accessible. By far.
Comment: Maybe it is bacause you are more familiar with Analysis.
Comment: Weil's book determines the kernel of reciprocity map in section 8 of the last chapter, which appears neither in Cassels-Frohlich nor in Milne's notes.
Answer: I'm a beginner with basically no background in algebraic number theory, and am close to finishing  Number Theory 2: Introduction to Class Field Theory by Kato, Kurokawa, Saito.
I love this book - it does a good job explaining the big pictures of number theory (e.g. the local-global philosophy) and providing motivation. It begins with concrete examples of what class field theory says - this is one thing I wanted. Throughout the book, they state theorems and their consequences and postpone the proofs, but still give proofs eventually. I really like this style, as it prevents getting bogged down in proofs. The last section claims to outline the proof of the main theorems of class field theory, but I haven't read it yet. I have not read Volume 1, and was able to get through Volume 2 without any difficulty.
Answer: Algebraic Number Theory by Neukirch is a good one for first learner.
I've read Janusz's book, it's also very good.
However some treatment in Janusz's book on algebra is not so careful, you could read Zariski's Commutative Algebra to find better explanations.
Answer: There is also an older book of Neukirch on Class Field Theory: http://www.mathi.uni-heidelberg.de/~schmidt/Neukirch/index.html
An English translation will appear soon.
Edit: It has appeared: http://www.mathi.uni-heidelberg.de/~schmidt/Neukirch-en/index-de.html
For local class field theory, there is Local Fields and Their Extensions by I. B. Fesenko and S. V. Vostokov: https://www.maths.nottingham.ac.uk/personal/ibf/book/book.html
And "Class Field Theory: From Theory to Practice" by Georges Gras.
Edit (19.09.2018): Here are Uwe Jannsen's lecture notes on class field theory: http://www.mathematik.uni-regensburg.de/Jannsen/Classfieldtheory-gesamt.pdf
Geometric class field theory is easier and covered in Milne's Arithmetic Duality Theorems.
Answer: If all you need is the major statements from CFT with a few examples, check out the appendix in Lawrence Washington's "Introduction to Cyclotomic Fields" for a speedy overview of both local and global class field theory. It's not big on exposition, and you won't learn the proofs, but it's short and not time-consuming to read. You can then see some applications of the theory in chapter 11 of the same book.


Finding the source file containing the definition of functions and variables

Question: Is it possible to merge find-function and find-variable to a
single find-function-or-variable to be able to search both functions and variables at the
same time and going to their definition in the same way as for find-function and find-variable?
(possibly with the ability to use
TAB completion like the original find-function and find-variable and choosing between two options when a function and a variable bear the same name as remarked by @lawlist).
Comment: You can evaluate `(let ((f-and-vs nil)) (mapatoms (lambda (s) (when (and (boundp s) (fboundp s)) (push s f-and-vs)))) f-and-vs)` to get all loaded cases of a symbol being both a function and variable.
Comment: This is problematic because some functions and variables bear the same name and the interface would need to be adjusted to then ask the user which one -- or display both.  It is of course doable, but is *perhaps* a larger project than would fit squarely into a standard answer.  However, there are some really bright forum participants who may have a quick modification that would pleasantly surprise me.  I have *grep* on speed-dial, along with `find-function`, `find-variable` and `find-face`.
Comment: @lawlist Is bearing the same name for the functions and variables loaded by `emacs -Q` too frequent?
Comment: I can only think of a few off the top of my head -- `org-agenda-files` -- `buffer-file-name` -- but the answer would be easier to write up if the user is forced to choose which one when presented with two hits/options, rather than displaying both answers in the help-buffer.  The latter is doable, but may be a larger project.
Answer: You can use C-h o (describe-symbol) on Emacs 25, here is the related NEWS info:

Changes in Emacs 25.1

** New doc command `describe-symbol'.  Works for functions, vars, faces, etc...

(It was originally called describe-function-or-variable according to this commit.)
Variable and function with the same name can be showed at the same time, for example, emacs-version
Comment: Thanks xuchunyang, I use 24.5, but it is interesting to know. My main motivation is to go to the definition in the source file as is for `find-function` or `find-variable`.
Comment: I think you can just try to use [Tags](http://www.gnu.org/software/emacs/manual/html_node/emacs/Tags.html), Emacs's etags works well for me, you need to create Tags and set `tags-table-list` first, then type `M-.` to use it.
Comment: If anyone wants to use this for 24.x, I've assembled the necessary code from the Emacs 25 sources and placed it in a [gist](https://gist.github.com/troyp/93b020c18c6869f4e61f545b72e1421b).


How to fix Managed Package Installation Failure (Missing Task.RecordType) for Production packages

Question: I am new to SF CRM and while I saw that there is a good answer for the same question for Scratch Orgs might also we need to fix the same issue for our package for PROD org so that we are able to release a bug-free version of our package. For the Scratch org, the solutions are provided here:
Managed Package Installation Failure (Missing Task.RecordType)
Please advise how we could resolve this by adding additional configuration for the Developer and the PROD kind of Orgs?
Answer: If your package depends on the existence of a task record type, you may include some record types directly in your managed package itself. This way, your package will be able to install in any org that supports record types.
Alternatively, you may choose to use dynamic apex, where you always query the field dynamically with Database.query and always access the field dynamically via someRecord.getSObject('RecordType')?.get('Name'). If you have other hard links, perhaps in validation rules or other automations, you would definitely need to include a record type in your Managed Package.
Comment: @ИскренСтаниславов Record types are packaged with object metadata, so as long as you have a `CustomObject` metadata entry for the `Task` object in the package.xml, it would include the record types for that object.
Comment: I would like to fix that issue with using metadata, as these errors only appear without actually using the RecordType in the Controller/Helper apex classes.
Comment: What we actually did at the end was to remove the dependency of RecordTypes as it was not needed, but what helped with allowing the installation to complete was manually add at least 1 RecordType for the objects the package requested... I wanted to know how to include some of these RecordType with package.xml meta data entries.


JavaFX TextArea and autoscroll

Question: I am trying to get a TextArea to autoscroll to the bottom with new text which is put in via an event handler. Each new entry is just one long string of text with each entry separated by a line break. I have tried a change handler which sets setscrolltop to Double.MIN_VALUE but to no avail. Any ideas of how this could be done?
Answer: You have to add a listener to the TextArea element to scroll to the bottom when it's value is changed:
@FXML private TextArea txa;

...

txa.textProperty().addListener(new ChangeListener<Object>() {
    @Override
    public void changed(ObservableValue<?> observable, Object oldValue,
            Object newValue) {
        txa.setScrollTop(Double.MAX_VALUE); //this will scroll to the bottom
        //use Double.MIN_VALUE to scroll to the top
    }
});

But this listener is not triggered when you use the setText(text) method, so if you want to trigger it after a setText(text) use the appendText(text) right after it:
txa.setText("Text into the textArea"); //does not trigger the listener
txa.appendText("");  //this will trigger the listener and will scroll the
                     //TextArea to the bottom

This sounds more like a bug, once the setText() should trigger the changed listener, however it doesn't. This is the workaround I use myself and hope it helps you.
Comment: I can't seem to get it to work, my TextArea just stays scrolled to the Top. Any Ideas? Both using         `Platform.runLater(() -> this.setScrollTop(Double.MAX_VALUE));` or `setScrollTop(Double.MAX_VALUE)`. In addition my Textarea seems to be blurry.
Comment: `setScrollTop(Double.MIN_VALUE);` scrolls to the top, while `MAX_VALUE` scrolls to the bottom.
Comment: I'd recommend setting the scroll within Platform.runLater() -- my text area sometimes missed some scroll updates without it.
Comment: @AdamJensen you were absolutely right. I just fixed that. Thanks!
Comment: @AdamJensen I'll make a test here, because I answered this some time ago and I just can't remember by looking at it. Thanks for the report.
Answer: txa.appendText("") will scroll to the bottom without a listener. This becomes an issue if you want to scroll back and the text is being constantly updated. txa.setText("") puts the scroll bar back at the top and same issue applies.
My solution was to extend the TextArea class, ammend the FXML tag from textArea to LogTextArea. Where this works, it clearly causes problems in scene builder as it does not know what this component is
import javafx.scene.control.TextArea;
import javafx.scene.text.Font;

public class LogTextArea extends TextArea {

private boolean pausedScroll = false;
private double scrollPosition = 0;

public LogTextArea() {
    super();
}

public void setMessage(String data) {
    if (pausedScroll) {
        scrollPosition = this.getScrollTop();
        this.setText(data);
        this.setScrollTop(scrollPosition);
    } else {
        this.setText(data);
        this.setScrollTop(Double.MAX_VALUE);
    }
}

public void pauseScroll(Boolean pause) {
    pausedScroll = pause;
}

}

Answer: I don't have enough reputation to comment, but wanted to give some insight for future readers as to why setText doesn't appear to trigger the listener, but appendText does, as in Math's answer.
I Just found this answer while encountering similar issues myself, and looked into the code. This is currently the top result for 'javafx textarea settext scroll' in a google search.
setText does indeed trigger the listener.
According to the javadoc on the doSet method in TextInputControl (TextArea's superclass):

     * doSet is called whenever the setText() method was called directly
     * on the TextInputControl, or when the text property was bound,
     * unbound, or reacted to a binding invalidation. It is *not* called
     * when modifications to the content happened indirectly, such as
     * through the replaceText / replaceSelection methods.

Inside the doSet method, a call is made to updateText(), which TextArea overrides:
  @Override final void textUpdated() {
        setScrollTop(0);
        setScrollLeft(0);
    }

So, when you set the scroll amount in the listener as in Math's answer, the following happens:

The TextProperty is updated
Your listener is called, and the scroll is set
doSet is called
textUpdated is called
The scroll is set back to the top-left

When you then append "",

The TextProperty is updated
Your listener is called, and the scroll is set

The javadoc is above is clear why this is the case - doSet is only called when using setText.
In fact, appendText calls insertText which calls replaceText - and the javadoc further states that replaceText does NOT trigger a call to doSet.
The behaviour is rather irritating, especially since these are all final methods, and not obvious at first glance - but is not a bug.
Answer: Alternative to that strange setText bug without using appendText
textArea.selectPositionCaret(textArea.getLength());
textArea.deselect(); //removes the highlighting

Answer: One addendum I would add to jamesarbrown's response would be to this would be to use a boolean property instead so you can access it from within FXML.
Something like this.
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.SimpleBooleanProperty;
import javafx.scene.control.TextArea;

public class LogTextArea extends TextArea {
    private final BooleanProperty pausedScrollProperty = new SimpleBooleanProperty(false);
    private double scrollPosition = 0;

    public LogTextArea() {
        super();
    }

    public void setMessage(String data) {
        if (isPausedScroll()) {
            scrollPosition = this.getScrollTop();
            this.setText(data);
            this.setScrollTop(scrollPosition);
        } else {
            this.setText(data);
            this.setScrollTop(Double.MAX_VALUE);
        }
    }

    public final BooleanProperty pausedScrollProperty() { return pausedScrollProperty; }
    public final boolean isPausedScroll() { return pausedScrollProperty.getValue(); }
    public final void setPausedScroll(boolean value) { pausedScrollProperty.setValue(value); }
}

However, the problem with this answer is that if you get flooded with an unreasonably large amount of input (as can happen when retrieving a log from an IO Stream) the javaFX thread will lock up because the TextArea gets too much data.
Answer: As Matthew has posted the setText call is the problem. A easy workaround is to call clear, appendText and then setScrollTop. The other suggestions above did not work well for me, with enough delay it worked but was unreliable behaviour.
  textAreaListener = (observable, oldValue, newValue) -> {
            textArea.clear();
            textArea.appendText(newValue);
            textArea.setScrollTop(Double.MAX_VALUE);
        };

JavaFX TextArea and autoscroll


Can anyone identify what/where this photo is of?

Question:
This is a photo by the Real Photograph Co. (Liverpool) No.684.
I think it may be a crashed WW1 Biplane (lots of the photos with it were WW1 biplanes).
Comment: The engine looks like it's 9-cylinder radial, and given the way the cylinders are seated on the body I suggest the engine is likely to be a Le Rhone 9J.

There's a fairing behind the pilots head, not large, which has come away revealing possibly access to the tank. That's a big clue. Further, the position of the fairing makes it likely a small single seater.

It's likely WW1 judging from the officer's uniform. Based on that, tentatively it could be an Airco DH5 or Nieuport 17.
Comment: @Party Ark Nice suggestion on the Le Rhone. I would however suggest that it is not  an Airco DH5, I base this on the fact that the DH5 utilized a spinner, which is not in evidence here. The Newport 17 also does not fit, due to the fact that it had a metal seat, while this aircraft has a wicker seat, in addition the Newport did not have a tank behind the seat. I would suggest that this may be a Sopwith Camel, I base this on the fact that the Camel has both a wicker seat and a tank behind the cockpit. I cannot however identify that specific tank design, so this is not an answer just a guess.
Comment: Not all Aircos had spinners (and it might have come off in the crash), but you're right the seat looks wrong. Camel is a good one; I'd expect the tappet rods in front of the cylinders to be visible, but it's not very clear. Certainly the tank position fits, and there is a suggestion of a wing support by the cockpit (left side as you look) which would be a v positive indicator. However, my reading is that there's a fairing behind the pilot's head that's come away - Vickers F.B.19 might be another contender, just to muddy the water. http://www.airwar.ru/image/idop/fww1/fb19/fb19-3.jpg
Answer: This could be a Sopwith Camel without its guns.  At least these details don't disagree:

cowling's shape and front opening
9-cylinder radial engine (tappett rods lost when crushed by the cowling)
8-bolt prop hub
wicker seat's weave spacing (many photos if you search "sopwith camel seat")
fuel tank's position and shape match that in the Haynes Manual
location of the remnants of the cabane struts.

Although some of these details are common to many aircraft of the period, it's noteworthy that this many details agree in one place.  A statistical argument may be the best one can do with what's been given.
Answer: It definitely looks like the nose of a WW1 or pre-WW2 aircraft. You can clearly see the pilot seat with the fuel tank behind it. In addition you can see the engine with  the rest of the two blade propeller.
I personally think that it is most likely a post WW1 but pre WW2 aircraft because it appears to have a NACA Cowling, like on this image from Wikipedia:

It was developed in 1927. As for the aircraft type, for me personally it's hard to tell what it could be.
Source: Wikipedia (https://en.wikipedia.org/wiki/NACA_cowling)


AudioFocusChangeListener cannot listen

Question: I encounter a problem using the AudioFocusChangeListener, but still cannot listen to the audio focus change. Could someone help me find the reasons? Here is what I do:

In my FM app, when FM starts in startFM, I place requestAudioFocus() to get resources:
int result = mAudioManager.requestAudioFocus(mAudioFocusListener, AudioManager.STREAM_FM,AudioManager.AUDIOFOCUS_GAIN_TRANSIENT);
if (result == AudioManager.AUDIOFOCUS_REQUEST_GRANTED) {
    Log.d(LOGTAG, "Successfull to request audioFocus listener");
} else {
    Log.d(LOGTAG, "Failure to request focus listener");
}

When quitting the App in onDestroy(), I used abandonAudioFocus() to release resouces.
The member variable mAudioFocusListener is as follows:
private OnAudioFocusChangeListener mAudioFocusListener = new OnAudioFocusChangeListener() {
public void onAudioFocusChange(int focusChange) {
    switch (focusChange) {
        case AudioManager.AUDIOFOCUS_LOSS:
            Log.v(LOGTAG, "AudioFocus: received AUDIOFOCUS_LOSS, turning FM off");

            if (isFmOn()) {
                fmOff();
            }
            break;
        case AudioManager.AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK:
            Log.v(LOGTAG, "AudioFocus: received AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK");

            if (isFmOn()) {
                Log.d(LOGTAG, "AudioFocus: FM is on, turning off");
                mute();
                stopFM();
            }
            break;
        case AudioManager.AUDIOFOCUS_LOSS_TRANSIENT:
            Log.v(LOGTAG, "AudioFocus: received AUDIOFOCUS_LOSS_TRANSIENT");

            if (isFmOn()) {
                Log.d(LOGTAG, "AudioFocus: FM is on, turning off");
                mute();
                stopFM();
            }
            break;
        case AudioManager.AUDIOFOCUS_GAIN:
            Log.v(LOGTAG, "AudioFocus: received AUDIOFOCUS_GAIN");

            if (isFmOn()) {
                Log.d(LOGTAG, "AudioFocus: FM is off, turning back on");
                unMute();
                startFM();
            }
            break;
        default:
            Log.e(LOGTAG, "Unknown audio focus change code " + focusChange);
    }
}
};

According to the log, it prints "Successfull to request audioFocus listener", but doesn't print any AudioForcus change log when alarm is on or other audio-changed events. Could anyone figure out what is wrong with it?
On the other hand, I place log in AudioService.java and AudioManger.java, where in AudioService.java, requestAudioFocus():
 if (!mFocusStack.empty() && (mFocusStack.peek().mFocusDispatcher != null)) {
       try {

            mFocusStack.peek().mFocusDispatcher.dispatchAudioFocusChange(

                     -1 * focusChangeHint, // loss and gain codes are inverse of each other

                     mFocusStack.peek().mClientId);  // This doesn't excute

        } catch (RemoteException e) {

            Log.e(TAG, " Failure to signal loss of focus due to "+ e);
            e.printStackTrace();

         }

     }

in AudioManager.java, Here doesn't excute either:
    private IAudioFocusDispatcher mAudioFocusDispatcher = new IAudioFocusDispatcher.Stub() {
public void dispatchAudioFocusChange(int focusChange, String id) {

    Message m = mAudioFocusEventHandlerDelegate.getHandler().obtainMessage(focusChange, id);

     mAudioFocusEventHandlerDelegate.getHandler().sendMessage(m);

 }

That's all my question. Could anybody tell me why this listener cannot listen to alarm events and other audiofocus-changed events? By the way, how could I successfully listen to the events? Maybe I missed some step or used a incorrect way? Many thanks.
Answer: Try this:
private class MyService extends Service implements AudioManager.OnAudioFocusChangeListener {
    public void onAudioFocusChange(int focusChange) {
        switch (focusChange) {
            case AudioManager.AUDIOFOCUS_LOSS:
                Log.e(TAG, "AudioFocus: received AUDIOFOCUS_LOSS, turning FM off");
                break;
            case AudioManager.AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK:
                Log.e(TAG, "AudioFocus: received AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK");
                break;
            case AudioManager.AUDIOFOCUS_LOSS_TRANSIENT:
                Log.e(TAG, "AudioFocus: received AUDIOFOCUS_LOSS_TRANSIENT");
                break;
            case AudioManager.AUDIOFOCUS_GAIN:
                Log.v(TAG, "AudioFocus: received AUDIOFOCUS_GAIN");
                break;
            default:
                Log.e(TAG, "Unknown audio focus change code " + focusChange);
        }
    }

    public IBinder onBind(Intent intent) {
        return null;
    }
}

and...
mAudioManager.requestAudioFocus(new MyService(), AudioManager.STREAM_MUSIC, AudioManager.AUDIOFOCUS_GAIN);

Its works for me.
Comment: Thanks, it seems that music and FM conflicts. I solve it by modifying music. The music app have been taken the focus after it interrupts. Thank you all the same.
Answer: DeerCoder,
I believe that if you are requesting the audio focus for the type AudioManager.STREAM_MUSIC, you would only receive events affecting this specific audio stream.
mAudioManager.requestAudioFocus(new MyService(), AudioManager.STREAM_MUSIC, AudioManager.AUDIOFOCUS_GAIN);

The alarms and notifications are managed on separate audio stream such as AudioManager.STREAM_NOTIFICATION, AudioManager.STREAM_ALARM, AudioManager.STREAM_RING, etc...

AudioFocusChangeListener cannot listen


htaccess rewrite

Question: I am trying to rewrite a url from a sub-directory of the web root.
http://mysite.com/wiki/index.php/Main_Page

to this (note question mark):
http://mysite.com/wiki/index.php?Main_Page

What I'm doing wrong here? (wiki/.htaccess)
 RewriteEngine On
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule ^index\.php/(.*)$ ./index.php?$1 [PT,L,QSA]

Comment: Try commenting out your conditions and see if that makes a difference
Comment: It did, they were preventing it from working since index.php is a file. Then also the query string needed to be title=$1.
Answer: These two lines here got it sorted:
RewriteEngine On
RewriteRule ^index\.php/(.*)$ index.php?title=$1 [PT,L,QSA]

htaccess rewrite


Add a menu to a DNN 6 module

Question: I'm developing a module for DNN 6.0. I need to add a menu to the module, each item in the menu will load a usercontrol into a placeholder.
I'm missing the menu stuff any1???
10x
Answer: Module level menus are not supported by default in dotnetnuke module development.
There are many ways to implement it, which is similar to normal asp.net development.
You can use query string, you can use asp.net menu and handle it's click event and there is an endless list of ideas.
Please add some more specific requirements to get exact tip on how to handle that smartly in dotnetnuke.
Answer: Thanks for the reply.
I ended using "asp:LinkButton". I had problem with the asp.net menu.
10x

Add a menu to a DNN 6 module


If I use multiple different RSA public keys to encrypt a single AES key for distribution, how much does that degrade the encryption?

Question: I would like to store encrypted AES-256 keys in a public location and give 100 different people access to the AES key by using each of those 100 people's public RSA encryption key to encrypt the AES key. How much does this degrade the encryption? The AES key would be random, not passphrase based.
Answer: Assuming the RSA key was of sufficient size, it would not degrade the encryption meaningfully. RSA does not lend itself easily to batch attacks. Of course, there is still the concern that those 100 different people all have access to the key, so all it takes is one person to be compromised to compromise the other 99. But from a purely cryptographic standpoint, you will not be harming security.
If you want the nitty-gritty math behind it, you may want to ask on Cryptography.
Comment: Thanks for the quick response! Point taken about the increased exposure.
Comment: Very good answer to very bad question. What does OP means by encryption degradation? What do you mean by encryption degradation? This is a bit nonsensical.
Comment: I think @forest understood me... but to be clear, I am talking about the ability for the data I am encrypting to be cracked and the key I am encrypting to be revealed. Is it truly a bad question, or just confusing terminology?
Comment: @ChrisSeline I don't think it's a bad question, but it's a little basic and the terminology is a little messed up. The thing with security is that there are so many different definitions to keep track of, so "degrade" could mean many things. I took it to mean "reduce the computations required to calculate the private key from the public key".


ASTQB State Transition Question

Question: Question 28 of the ASTQB Foundation 2018 Sample Exam 1 reads:
You have been given the following requirement:
A user must log in to the system with a valid username and password.
If they fail to enter the correct combination three times, they will receive an error and will have to wait 10 minutes before trying again. The test terminates when the user successfully logs in.
How many test cases are needed to provide 100% state transition coverage?
a. 1
b. 2
c. 4
d. 5
According to the answer table, the correct answer is B:

But I'm struggling to understand why this answer is correct as it does not cover the transition from Attempt 3 - Success:

I'm wondering if someone could clarify for me why my thinking is wrong and why the answer of 2 is correct.
Answer: The key is in the phrase "state transition coverage" - the question is asking for the smallest number of tests that can cover each transition between states at least once.
Essentially the states you are transitioning between are:

Login page (not logged in)
Home page (logged in)
Wait (too many invalid login attempts)

Since you will always start from the Login page, the Wait state is temporary, and you are testing invalid logins, your scenarios can only be:

Start at the login page, make no more than 2 invalid attempts, then make a valid login attempt and end at the home page.
Start at the login page, make 3 invalid attempts, wait, then make a valid login attempt and end at the home page.

Obviously you can have many more test cases, but this is the minimum to cover all the state transitions at least once.

ASTQB State Transition Question


How much video RAM to run 'Final Cut Pro' on a Mac Pro (2013)

Question: I'm using Final Cut Pro and my friend and I are disagreeing on whether 2GB of video memory with the Dual AMD Firepro is enough or should I go with 3GB? If I go 2GB is the video memory upgradable? I haven't bought the Mac Pro yet.
Comment: Not an answer, but most of the people I see running FCP are doing quick edits on set, on laptops. That would indicate, though not conclusively, that you don't *have* to have massive GPU/RAM to run it. I'd be interested in an authoritative answer, though, as I'm looking at the same machine [well, whatever might be the upgrade in October]
Answer: The minimum amount of VRAM Apple recommends for running Final Cut Pro X is 256 MB. As a Final Cut Pro user myself (albeit a very light user), I find that 1 GB is sufficient, though I rarely put the program "through its paces," and the work you will be doing will likely be on a larger scale. 1 GB also happens to be Apple's minimum recommendation for editing 4K video and 3D titles.
Ultimately, it depends on how intensive the work you're going to be doing is. Are you going to be doing intensive work with 4K content? Or are you going to do smaller home video-style projects? It may be useful to use Apple's recommendations as bases for comparison as you make your decision (see below).
To view the entire list of minimum system requirements, see Apple's Final Cut Pro X Tech Specs page. This Apple Support Communities discussion also has some interesting details about VRAM and how it applies to Final Cut Pro X.
Answer: The video memory will not be upgradable. You can upgrade the system RAM, and if you were able to find one, the Solid State Drive.
I have no Final Cut Pro experience, so I can't say if the 2gb video RAM is enough.
Answer: While gaming related, this post looks relevant to you. The long and the short is that VRAM actually affects video performance fairly minimally. The major gain is the ability to run multiple monitors/higher resolutions.
That said, the answer to "is enough" in computer circles is almost always "get the most" if you're planning on using a single monitor and editing 1080p video, the standard 2GB FirePros will be absolutely fine (Final Cut runs well on my 2011 MBP with a slower Radeon card and 1GB VRAM). If you plan on doing higher-end things (4k video editing at resolution with multiple clips and editors on multiple monitors), you will feel the upgrade.
Bear in mind all the advice you'll be getting will be relevant now, if this is a work machine that you can play on using for several (5+ years) and have the extra money, having more VRAM certainly won't hurt anything...
Comment: I alluded to it above, but it's worth noting: VRAM is not upgradeable (ever?), and there are various other advantages to the more power cards like higher clock rates and more stream processors that's are more likely to make a difference to you.
Comment: Thanks for the feedback. I am using the latest version fcp on my mbp which only has 512m of vram and when I load up clips off my go pro, the whole thing crashes. I know a Mac Pro isn't cheap so I wanted to be sure that whatever version of FCP comes out down the road, it can handle it.
Comment: If that's the case, [this](https://www.apple.com/support/macbookpro-videoissues/) may be of interest to you. I'd expect any retina Mac to run FCP fine for home use


What is radio-emitting gas?

Question:
What is radio-emitting gas? (I think it refers to the Magellanic Stream, but I can't be convinced.)
Comment: Can you add the source of your image.
Answer: Referring only to the image you present, the radio part of the image (I think this is a stacked optical and radio image) shows something called the Magellanic stream. Despite what the wikipedia page says, I believe it was discovered by Dieter (1971) using 21 cm observations of neutral hydrogen atoms.
The radio emission in the case of the picture you show arises from the so-called "spin flip" transition associated with changes in the relative spin of the proton and electron in a hydrogen atom. A configuration where the spins are anti-parallel has a lower energy than where they are parallel. (Quantum mechanics only allows these two possibilities). The energy difference is small - only $5.87 \times 10^{-6}$ eV. In hydrogen gas in space it is possible for the atom to make a transition from the higher level state to the lower level, in the course of which it emits radiation with a wavelength of 21 cm (i.e. radio waves). This is not seen in terrestrial laboratory samples because the gas is collisionally de-excited before it has the chance to emit radiation. Hence 21cm radiation is an example of a forbidden line, with a long radiative lifetime and which is only observed from the rarefied neutral hydrogen gas found in the interstellar medium.
The intrinsic width of the emitted spectral line is very narrow. This means that the observed wavelength of this 21 cm line is an excellent probe of the motion of the emitting gas, since the observed radio waves will be doppler shifted from the 21 cm wavelength at which they were emitted according to the line-of-sight velocity of the gas.
The gas in question here has been stripped from the two satellite galaxies of the Milky Way, known as the Magellanic clouds. Although the picture also shows copious 21 cm radiation arising from neutral hydrogen gas in the plane of our Milky Way.
There are many other ways that gas can be a source of radio emission. In addition to atomic and molecular transitions that give radio emission at discrete wavelengths (including the radio equivalent of lasers, called masers), there can be continuum emission caused by the acceleration of electrons in the electric fields of partially and completely ionised ions - so called bremsstrahlung or free-free emission. There is also recombination radiation (free-bound) radiation and continuum radiation emitted by electrons that are accelerated in electromagnetic fields - cyclotron radiation; synchrotron radiation (if the electrons are relativistic); curvature radiation (a variety of synchrotron radiation) or even just the Rayleigh-Jeans tail from cold blackbody emission (e.g. in the cosmic microwave background).
A decent introductory summary can be found here.
Comment: Well, now you will allow me to be picky: The question is "What is radio emitting gas?", not "What do we see here?".
Answer: One type of ratio-emitting gas is ionized gas, which is penetrated by a magnetic field. Also known as a plasma, the charged particles that make up this gas will start rotating around the magnetic field lines.
Their paths will have a local radius of curvature equal to the gyroradius, which is the natural movement radius of charged particles in a magnetic field.
Then, because circular motion is accelerated motion, and accelerated charges in general emit electromagnetic radiation (EMR), the gyrating charges will emit EMR.
One can calculate that for typical magnetic field strengths in interstellar space this radiation will then be emitted in the radio-range.
The details depend a lot on where the charged particles come from, what their energies are, viewing geometry of the observer etc. but essentially it's that.
Comment: Do not assume that someone commenting is the downvoter
Comment: Atomic gas emits radio waves. That is what 21cm radiation comes from.
Comment: @RobJeffries: Wow, so a partial answer is reason to downvote? Drastic.
Comment: I upvoted, but such a complex explanation would benefit from PARAGRAPHS to tell the reader when he should pause to think of the previous phrase... before going on to the next one. Paragraphs give a text structure, clarify it, and prompt the reader to understand a paragraph as an actual phrase, they help him navigate and read over again. Generally avoid starting a complex phrase with "Also known as a plasma" when you can start it with "The charged particles" "Also known as"... is not a start to a text, a simple, clear, conceptual phrase progression. I write unclearly myself so well done you ;)
Comment: @JanDoggen Indeed. And although I was, now I am not.

What is radio-emitting gas?


Skyrim follower - Ria

Question: So I fell asleep during some quest, and had Ria as my follower. When I switched on today, she's nowhere to be found. Not my house, not in Jorrvaskr, and my load files date back too far and I'll lose my progress. I have fast travelled several times, and "waited in game" for over a week game time. The worst part is, I can't get a new follower, everyone tells me it seems I already have someone. So what do I do now? I'm using a PS4.
Answer: Since you use a PS4 this problem is a bit harder to fix than on PC were you have the console to fix almost any bug.
You have really only 1 option if you don't want to lose any progress:
backtrack to the position where you lost her and look in the surrounding area. Followers can get stuck and not be able to teleport back to you even if you fast travel. There you can try to either Fus Ro Dah her lose, or just kill her.

Skyrim follower - Ria


Journey Builder entry criteria - Is "No Re-entry" based on Subscriber Key?

Question: When the setting "No Re-entry" is chosen, is this based on Subscriber Key?  Meaning, if a subscriber with Subscriber Key "email@example.com" and Email Address "email@example.com" gets injected into the journey, then say a week later, they change their email address to be something like "firstname.lastname@example.com" (while SubscriberKey remains the same, "firstname.lastname@example.com"), can this subscriber enter the journey again if "No Re-entry" is selected, or will they not be able to because it's based off of SubscriberKey?
Comment: Couple quick notes.  Subscriber Key being an email address is not best practice...If you have SalesForce connector in place, the ContactID from Salesforce will be their All Subscribers subscriberkey.  If you have other data source for subscribers, you'll want to delimit their ID as another Unique Identifier.
Answer: If I remember correctly it's based off of Contact ID but if your contact's email address changes they should still be prevented from entering as long as their Contact ID remains the same.
Answer: When I use the contactid as subscriber relationship, contacts are not getting injected into the journey. I have to change the subscriber relationship to email address in order for journey to work.


Is there any effect on efficiency of electromagnet if winding wire cross each other during winding?

Question:
While winding a core of the transformer some turns cross other turns. Will this affect the magnetization produced by the core?
Answer: For a toroid (a closed magnetic core)
Providing that the windings are electrically insulated there is no significant effect of them crossing each other. More turns means more inductance whether they are wound side-by-side or on top of each other. You could argue that an overlapping wire is slightly longer because of its radius and this has slightly more resistance of course. You can also argue that overlapping wires produce more self-capacitance and this can lower the self-resonant frequency of the wound component. But, given your title states an "electromagnet" this is of no consequence because they are generally run at DC or low frequencies.
For open magnetic cores
You get a better concentrated magnetic field with overlapping wires than with side-by-side wires up to a certain point. This is because side-by-side turns at extreme ends of an open core do not readily couple with each other. At the other end of the extreme, if you could pile turns on top of each other, there comes a point when it's sensible to also wind them side-by-side (in order to maximize the magnetic field for the minimum number of turns used).
Anomaly in the question title

Is there any effect on efficiency of electromagnet if winding wire
cross each other during winding?

A closed toroid is (and never can be) an electromagnet. An electromagnet is used to attract ferrous metal and requires a gap in the core that forms north and south poles so that iron (e.g.) can be physically attracted.

While winding a core of the transformer some turns cross other turns.

A transformer is not an electromagnet so, there appears to be significant confusion in your question. If it is a transformer then it could be used at high frequencies and lower self-resonant frequencies (due to overlapping windings) may be of significant interest in how the device performs.
Answer: When wound round a high permeability core, crossing wires in a winding simply takes up more space than laying the wires uniformly.
Other things being equal, with the same space available for winding and the same number of turns, a scramble-wound winding has to be designed with thinner wire than a neat winding. This means it will be higher resistance, and so less efficient. It may also have poorer thermal conductivity through the winding to the surface, so may run hotter internally.
With a low or unity permeability core, there will be subtle effects on coupling coefficient and self capacitance, which in precise applications may need to be controlled by precise winding.


What are the Twitter Buffs for D&D Encounters, and how do they work?

Question: I take part in a weekly D&D Encounters program and the question often comes up. What are the "Twitter Buffs", and this is quickly followed by "how do they work"?
Comment: One warning:  While the Twitter buffs can be fun to include, they do include penalties as well as bonuses--so a player may be unhappy to find that the 'buff' is an effect that makes them have to make Acrobatics checks to move more than 4 spaces.  Likewise, some of the buffs may be encounter-breaking, such as buffs that make all enemies give combat advantage--in a party with any number of rogues, that can invalidate the challenge.  Keep this in mind before including them.  -- DM for Season 3, DnD Encounters, who used Twitter buffs for 2 chapters, then stopped.  ;)
Answer: If you follow http://twitter.com/#!/Wizards_DnD (possibly more specifically, #dndenc) on twitter, it sometimes tweets random buffs. You can then apply them to the combat rounds you are playing in. For example, last one so far has been:

Shreds of spiderwebs catch on a breeze and flutter around your
  heads, clinging to your faces. PCs are
  -1 to hit lizardfolk.
Comment: My recollection is: The first one posted after a session start is the one that applies.  Encounters are supposed to last about an hour, and they are posted roughly hourly during the evening hours, so only one should ever come up. They apply immediately (or in practice when someone notices the post). They last for the duration of the session. A fair number will require GM interpretation; cramming color and rules into 140 characters is tough!
Comment: This is US centric, too (and restricted to some time zones, I guess). But since Encounters itself is US centric, I think it'll be alright.


Heat equation with problematic boundary conditions

Question: I'm asked to solve the heat equation
$$u_t = \kappa u_{xx}$$
for $t \ge 0$, $0 \le x \le L$, given boundary conditions
$$u_x(0,t) = u_x(L,t) = 0$$
and an initial condition
$$u(x,0) = f(x) = 100x/L.$$
This seems problematic to me. In particular, it seems $u_x(x,0)$ should coincide with $f'(x) = 100/L$, so that $u_x(0,0) = f'(0) = 100/L \ne 0$, contradicting the first condition that $u_x(0,t) = 0$ for all $t$. Other contradictions seem to arise if I try separation of variables on $u$ (which I'm also asked to do). In general, if you prescribe an $f(x)$ in a situation like this, shouldn't it have to satisfy $f'(0) = 0$? What am I missing here?
Comment: In this situation we can require that the boundary conditions be satisfied for all $t>0$ but not at $t=0$.
Answer: This is ok because as soon time starts running, the solution will pick up the boundary condition. The phenomenon is related to the fact that the heat equation immediately makes things smooth even if you start with a nonsmooth initial datum. Imagine you reflect the initial datum $f$ in an even manner across the point $x=0$ so that now you have a function (that looks like a V) on $-L\leq x\leq L$, and then you copy this indefinitely on every interval of length $2L$, to get a periodic function that looks like sawteeth. Now if you solve the heat equation on the real line with this initial condition, it would be equivalent to your original problem. Then the smoothing of those sawteeth at their peaks so that they become horizontal would be equivalent to the original solution picking up the homogeneous Neumann boundary conditions.


How to retreive data from web analytics using console application?

Question: I have a sharepoint site where where i have web analytics service started. I will get a rrport denoting the no of visits by the user and also below i have last modified date and no of visits by all users in that site? I need to retreive the last modified date and no of visits by the user using console application. thanks
Answer: I came across this today: http://otak-otak-it.blogspot.com/2011/05/how-to-get-sharepoint-2010-web.html
The article explains how to pull Web Analytics data from SQL Server. While that does not get the data to the console, it may be useful in developing a solution that does; a powershell script perhaps.


Publication outlets for research by undergraduates?

Question: In mathematics, we have lots of undergraduate research journals. In CS, you can publish by either conference proceedings or journal papers. Are there peer-reviewed conferences or journals aimed at research by undergraduate students? I am already aware of MCURCSM (but it didn't happen last year, and might not in 2019 either). Thanks!
Comment: @BenI. Or exceptional work (no matter the brilliance of the student). See Dweck.
Answer: I am not aware of any journals for undergraduate research journals in computer science. Note that anyone can submit to the journals and conferences, there can be student only papers.
ACM does have a student research competition at two levels, one for undergraduates and one for graduate students in computer science. Those are held at many conferences.
ACM SRC Web page
Comment: Welcome to Computer Science Educators! Thanks for your answer =)
Answer: A number of CS conferences also have Poster Sessions at which work in progress, for example, can be presented. They may not have the same prestige as a full paper, but are useful for beginners at research to get feedback.
Another possibility, in the absence of specialized conferences for undergraduates is joint work with a professor at any conference.
But you don't need any credentials to submit to a CS conference (other than some interesting work). Interesting work by teams of students, with or without a professor as co-author, are another possibility.
If you are a professor that is familiar with some conference and its standards, there is no reason you can't have one or more of your students submit to it when you think it is ready for prime time. Even the experience of getting rejected can be useful to a beginner if the reviewers give helpful comments.


Multidimension array iterating -- my eyes have crossed

Question: I have this code:
<code>    try {
                $this->_connect = new PDO(DB_TYPE.':host='.DB_HOST.';dbname='.DB_NAME, DB_USER, DB_PASS);
                $this->_connect->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
                $stmt = $this->_connect->query('SHOW TABLES FROM '.DB_NAME, PDO::FETCH_ASSOC);
                    while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
                        foreach ($row as $key => $value) {
                            $this->_schema[$value] = "";
                            }
                        }
                foreach ($this->_schema as $key => $value) {
                    $stmt = $this->_connect->query('SELECT COLUMN_NAME, DATA_TYPE, COLUMN_DEFAULT, CHARACTER_MAXIMUM_LENGTH '.
                                       "FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = '$key'");
                    while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
                        $this->_schema[$key][] = $row;
                        }
                    }
                foreach ($this->_schema as $key => $value) {
                    $colData = null;
                    foreach ($this->_schema[$key] as $keyTwo => $valueTwo) {
                        foreach ($this->_schema[$key][$keyTwo] as $keyThree => $valueThree) {
                            $colData[][$keyThree] = $valueThree;
                            }
                        }
                    $this->$key = new Table($colData);
                    }
                }
        catch(PDOException $e) {
            echo $e->getMessage();
            }
        if (isset($stmt))
            $stmt->closeCursor();
        }
    }

Class Table {

    public $select;
    public $update;
    public $delete;
    public $insert;
    public $replace;
    private $_columns;

    public function __construct($colData) {
        $this->select = new Select;
        $this->update = new Update;
        $this->delete = new Delete;
        $this->insert = new Insert;
        $this->replace = new Replace;
        $this->_columns = $colData;
        var_dump($this->_columns[0]);
        }
</code>
It's trying to grab the entire schema from a database.  The $this->_schema looks good when I var_dump it, so I think the problem is after it's done being made.  I'm trying to iterate over the database, grab each table's metadata and store that data in an array.  Then, I iterate over the array to create a new Table object for each table and send it an array of column data that I extracted.  I have been looking at this code for the better part of today and can't figure out where I went wrong.
When I var dump on the last line there, it dumps like this:
<code>array(1) { ["COLUMN_NAME"]=> string(4) "type" } array(1) { ["COLUMN_NAME"]=> string(8) "username" } array(1) { ["COLUMN_NAME"]=> string(2) "id" }
</code>
Which is wrong -- it is the column names for table 1, column 1; table 2, column 1; and table 3, column 1.  It's supposed to be the name, data type, default, and max length of table 1, column 1.
Can anyone see where I went wrong or suggest a better method for going about this?
Comment: My eyes have crossed too...
Answer: I fixed it -- finally.  I took out the third foreach (unnecessary) and assigned the entire arrays under $keyTwo to $colData[$keyTwo] and it worked out how I planned.


ipad wont leave the charging icon

Question: Today I wanted to check my social media, but it didn't work. Then I saw the charging icon and it said it was charging, even tho it was unplugged. I tried turning off my ipad, but my ipad didn't allow me to do it. So I decided to restart it from the settings and now it just stuck with the apple logo it's not finishing restarting. What's happening?
Answer: hold power+home button simultaneously till the screen turns off (reset).
maybe try restoring your iPad through iTunes to an older backup.iOS Version?it might be a bug with iOS 11.

ipad wont leave the charging icon


How to move logo relative video on program monitor in Adobe CC?

Question: How to move a picture like logo which is on one videotrack relative video which is on other videotrack in Adobe Premiere CC? In previous version it was easy to do double click on the picture in program monitor and was possible to move or transform picture like in "freetransform" in Photoshop. But it doesn t work in Adobe CC.
Comment: The double click thing still works. Try clicking *harder* ;)
Answer: Assuming I understood your question correctly (which I'm not certain of, given your poetic writing style that appears to have transcended past the need for meager punctuation), you can still double click the image in the program monitor to get into the 'free transform' mode. I just tested it in the current version of Premiere Pro CC and it works as expected.
Alternatively, you can select the clip that you want to move/scale in the timeline and open the Effects Control panel. Click on this icon next to the Motion tab:

This will also enter the free transform mode that allows you to move/scale the clip.
Comment: Not everyone on SO speaks English as a first language. If you're looking for a place to lecture people about their grammar, http://english.stackexchange.com/ is where you need to be.
Answer: In the 2017 version I can't see it working anymore either. Yes, I can use effects. But the 'free transform' function seems to be gone. Or maybe someone has a solution in some hidden setting?
Comment: No, it's still there, I just double checked. You do need to have track targeting turned on for the track your clip is in (the track name needs to be blue), but it has always been thus.


ASP.NET Custom Errors vs. Compilation debug="false" and security

Question: I keep reading that an ASP.NET based web site should have custom errors enabled in the web.config because exceptions will show a stack trace.
I may have a faulty memory (currently don't have access to an ASP.NET website under development), but I thought as long as Compilation debug="false" in the web.config file, then the stack trace will not be displayed.
Is my understanding correct about the debug flag and display of the stack trace? If so, then even if custom errors are not enabled, then won't the only message displayed to remote users for an exception be a the non-descriptive message:
"The page cannot be displayed because an internal server error has occurred."
If so then wouldn't it be OK, from a security perspective, to not display a custom error page for the exception?
Comment: do you mean "custom" errors not "customer" errors???
Comment: yes, I corrected the typo. Hope I fixed all instances.
Answer: No, a stack trace will still be shown even if the debug flag is off, but it will not have line numbers for each call in the stack.
The non-descriptive message is what the browser usually shows instead of the actual error message from the server, unless you change the configuration. Anyone wanting to expose information by causing error messages would know how to do this.
Displaying the stack trace isn't a security risk in itself, but it does expose some information that could potentially make it easier to hack the site. A hacker might for example get a clue as to what's done to sanitase the input and find a way around it.
Comment: Then using one global custom error page, would be an improvement in terms of best practices, verses no custom error pages, correct?
Comment: @harrije: Yes, it keeps the error message from leaking information, and it gives a better experience for users who happen to get an error message.
Answer: Custom error messages should almost always be prefered over the default error thrown.  It gracefully sends your user to a location where they can keep browsing your site without having to go back and try again.
Turning DEBUGGING off in your web.Config is VERY important and goes beyond just not showing the line numbers and stack trace... it also tells the compiler to build in release mode which optimizes performance dramatically.  As soon as your app goes to production, all debugging should be disabled.


How to find a footprint?

Question: I have just started using KiCAD (with no other experience e.g. in Eagle). I was basically able to put together a schematic and layout a board but I am struggling with some footprints. How would I search for, e.g., a footprint for these?
Can I expect footprints somewhere in the library for most components or is creating my own a common task?
Answer: I use Eagle and, despite its huge libraries, most of the time I prefer to create my own footprints since I can adjust them to suit my needs.
For example, I usually use a 0.25 grid and the 0603 capacitor as it is on the library doesn't allow a 0.25 mm trace to pass between pads with a 0.25 mm clearance without warnings so I redesigned the footprint so it generates no warnings.
Besides that, it is common not to find the components you need on the libraries or to make slight modifications to adjust them to your design preferences.
Answer: Make your own footprint from data available in the data sheet for the component you're using.  In the long run, you'll spend more time making sure libraries you download are accurate than you would spend just making  your own correct footprint.
Answer: There are a lot of existing module and footprint libraries for KiCAD, but sometimes they may be difficult to locate. Here's the default starting point: http://www.kicadlib.org/. On the top of the page, there's also a link to a KiCAD library search engine.
Another option is converting existing libraries from another CAD tool to KiCAD format. Particularly, there's an Eagle2Kicad conversion script.
Regardless of how you obtain a library, it's always a good practice to  double-check the particular footprint against the component in your hand. For some components, there's just too much variation (and mini-USB receptacles are among those).
Comment: Here are some large collections that I regularly check when I'm searching for a component:

http://smisioto.no-ip.org/elettronica/kicad/kicad-en.htm, [Renie Marquet's Lib](http://www.reniemarquet.cjb.net/bibliotecas_en.html), [SparkFun's Lib](https://forum.sparkfun.com/viewtopic.php?f=20&t=26457)
Comment: kicadlib.org seems to have been abandonded and now is a collection of random junk articles to attrach search engines.

How to find a footprint?


Wii Scratching Disks

Question: I've had 3 disks broken not by the handling, but by the Wii itself.  It's a circular scratch that's pretty noticeable so I'm sure the Wii's doing it.  Replacements are costly and it takes a half of my salary to buy a new cd where I'm from so I'd really really like to know, how do you keep your Wii from doing this to your disks?
Comment: also note that **even pretty bad scratches can be fixed** by rubbing them with some brasso (brass cleaning liquid) and a lint-free cloth (microfibre works well). See here under "polish the CD": http://www.wikihow.com/Fix-a-Scratched-CD  (I fixed a few Gaemecube discs this way).
Comment: I bought mine at a hardware store, but you can use some toothpastes as well. Google "fixing cd scratches" or something, there are some good solutions. Saved me hundreds of dollars.
Comment: so, did it work?
Comment: I haven't found any brasso yet. Not sure to where to look for some where I live. (I'm probably looking at the wrong places) =/
Answer: This person on the Tilted Forum Project forum seemed to get lucky with Nintendo's Customer Service. Try contacting them.
As to trying to prevent the problem, is your Wii mounted in the vertical orientation? According to some websites, placing your Wii horizontally may reduce the scratching of the discs.
Answer: I would suggest to contact Nintendo Customer Support, as this seems like a hardware problem with your Wii unit itself.
During normal operation, the Wii should not scratch disks, especially not with a perfect circular. (unlike certain Xbox360 Models)
Comment: Any scratch would end up being circular regardless, but the Wii definitely shouldn't be scracthing disks.

Wii Scratching Disks


Problems with cyrillic

Question: I have feature class settlement in my geodatabase and i have two attributes for them. Name on latin and name on cyrillic. When I use same feature to another computer (export feature class) i cannot see cyrillic letters in tabel, and can't label it. On both computer I have arcgis version 10.0. Do i need some additional settings on second computer?
Comment: You might want to check if the relevant font is installed on that other computer (Control panel --> Appearance and personalization --> Fonts).
Answer: Problem is most probably with computer or database, not ArcGIS. Check regional setting in control panel( for example: default language for non unicode ) and geodatabase collation properties. Problem must be in one of them.

Problems with cyrillic