Why does this progression sound so good?

Question: What is the first chord that makes the CMaj9 sound so good? And what is that progression called?
Comment: Based on the notes (C, F, Gb, Bb, C, Eb <--> F) it seems to be a D alt 7 (from the D altered scale : D, Eb, F, Gb, Ab, Bb, C). Note that this chord resolves nicely to a GMaj7 as well, which would be a V --> I movement. In this case it is a II7alt --> I  movement, which Im not sure how its called, but sounds great
Comment: @hirschme You should have posted this as an answer, well done. Since there is no root it can also be thought of as an Ab13, or bVI13–>Imaj9, wouldn't you agree? Also I've heard some pianists use the notes in a D7alt/Ab13 voicing for a Cm7b5, just a thought, Im7b5–>Imaj9...
Comment: @JohnBelzaguy ah yeah for sure you are right, as every alt-7 works as the tritone sub for a non-altered dominant (right?). The half-diminished C fits in there as well, had not noticed that. I've heard of a Idim7 -- > IMaj7 movement, so I guess it is kind of similar. Thanks!
Comment: Now I am thinking it may be a G(sus)alt ->I Maj. Right?
Answer: So with support from @John Belzaguy I think we have come to a possible answer:
The chord in question (C, F, G♭, B♭, C, E♭ <--> F) resolving to a CMaj9 can be seen as a A♭13 or its tritone substitution D7alt. Other options could include a Cm7♭5 (with an added 4th = F)
Respectively, the movements would be IV7 --> I , II7alt --> I, or Im7♭5 --> I
I guess that although this does not resolve a tritone to the tonic, the voicing in all mentioned cases have very smooth movements of half-tones into the resolving chord, so it still makes for a satisfactory sound.
Comment: Don't you hear a bit of Ebm6 (add9) in there too?
Comment: I'd go for Cm7b5, with the F as a passing note, and since Cmaj9 contains a G maj. triad, it works!
Comment: @piiperiReinstateMonica for sure. The Cm7b5(add4) is just another voicing for Ebm6(add9) right? I could have included an endless list of possible chords, but I guess that would have missed the point. By the way I love your deeper take on the question! I learned a lot with your answer!
Answer: TL;DR : there's an actual answer to the "why" question in the end. The recipe is: move (absolute) voices somewhere and make the listener re-think the (relative) harmony. That's basically all there is to jazz harmony. Don't settle for the most obvious choice, put the listener's imagination to work.
"Why does X sound good" is the wrong thing to ask. It's one of those common idiomatic things to say, and cannot be taken literally. Just like "Where did these chords come from". You mean to ask "please help me understand what's happening here" - and "understanding" means things like this:

I want to see this in terms of other patterns I'm already familiar with
I want to be able to utilize the structural patterns in my own music in a controlled way
I want to know what I can do when I encounter this pattern (this is what people want when they ask "what scales should I shred if there's such and such chord")
I want to be able to identify this pattern in other pieces of music in the future
I want to have a name for the pattern (or its components), to help me categorize, handle and communicate things
If the pattern can be seen as a combination of simpler more atomic patterns, I want to know those.
How can the pattern be categorized - what other options are there to perform similar functions?

If you can answer those questions, then you can really say you understand it!
It's not possible to learn all this in a "one question, one answer" way, as if all of the listed perspectives could be pushed into your head as pure information. It's a learning process, like learning to taste different food ingredients and how they interact and how to utilize them in your cooking. The answers we give can only provide source material and suggestions for your personal and individual learning process.
In my experience, the way to obtain the "understanding" i.e. handling ability, is to interact with the notes and chords, and see how the interactions affect your feelings and possibilities. You try to simplify and modify the chords, and play different notes on them. If you add or remove notes, does it change the essence of the harmony? What scales can you play on it while retaining the same harmonic feeling? Can you replicate the same harmony in terms of simpler chords? Where do you feel the tonic could be at different stages of the progression? Where does each note "want" to resolve? Can you play it in different keys? Can you apply the same pattern in an existing song you're familiar with?
I don't know if this helps in any way, but what do you say about this - does it have the same essential characteristics of as the original chord progression? Is something different? I interpreted the first chord as E♭m6 or Cm7-5

Then again, wouldn't this sound even better? Now it resolves to a B♭ major chord and the leading melody line is kept the same.

Is that too obvious? The original had a bit of a surprise in it, and now the surprise was removed.
But I think just about any voice movement sounds good. This sounds good too:

The movement makes my ear accept almost anything, but there's an additional interest boost, because each new chord makes me re-think the harmonic context. Sort of like what they do with the chromatic modulation in Eurovision Song Contest entries. Move and rethink.
This sounds good too. Now we keep some voices in place and move others. Each new combinations sounds interesting.

You could try to "analyze" the chords and see functions, but IMO the magic comes from the same recipe: move voices and make the listener re-think.
The one with the Cm7-5 - B♭maj9 progression did move, and re-think a little bit, but not much. The original Cm7-5 - Cmaj9 makes you re-think more.
The same melody and initial chord could go to any number of places. Most of these end up somewhere around Gm or B♭, but not all.

So why does this sound good, how about this why does it sound good. Why does anything sound good. Move and re-think.
Comment: @Haversine Reading my answer again now, I'm not sure if it's very coherent and logical. Did you get something from this that you could actually use in your playing? The absolute vs. relative notes and triggering a re-identification of the relative interval structures among the voices is a general pattern in jazz harmony, but said like that it's quite abstract. The way to learn it IMO is to keep playing songs and harmony tricks, and eventually the patterns are learned, just like learning to identify any patterns, learning through examples, bottom-up practice first, not top-own theory-first.


PTIJ: Can I use my cattle prod to get people to minyan?

Question: If I leave an electric cattle prod on from before Shabbos, may I use it to coax Jews (gently) to come to minyan?

This question is Purim Torah and is not intended to be taken completely seriously. See the Purim Torah policy.
Comment: I don't see how this qualifies as PTIJ under the policy. Take away the disclaimer and you have perfectly serious looking question
Comment: @DoubleAA I then have a lot of other questions, but, technically, yes.
Comment: Definitely does not have a serious answer and seems to be PTIJ
Answer: Lichorah the chakirah is as follows:
Let's say it is permissible to use an electronic device on Shabbat where the device is always on, and you only modulate the amount of current flowing by using it, and there is no hashma'as kol (so for example, the United Synagogue Bet Din allows the chazan to sing into a microphone that feeds into an induction loop that goes round the synagogue for people with hearing aids).
Then the question is:
When I prod the mitpallel with my cattle-prod, am I creating a new circuit because electricity goes from prod to ground through congregant (forbidden - because we now have a new circuit and therefore I have done a melacha of boneh) or am I simply modulating the amount of current going through the prod (permissible - as above).
The answer appears to depend on the spiritual level of the congregant.
If the congregant is on a high spiritual level and far away from artziyut then we cannot consider him as a ground and it is permissible. However if the congregant is close to artziut then he is a good ground and it is forbidden.
From which we see that be'derech she'adam rotzeh le'lech molichin oto.


What kind of finish should I use inside dresser drawers?

Question: I'm building a chest of drawers out of reclaimed barn wood.  For the drawers I've used 1/2" sanded ply for the sides and 1/4" for the bottoms.  They're pretty darn smooth but I'd like to put a clear coat on them to protect them.  I've read that poly can cause undesirable odors so I guess I should avoid that.  What about water based poly or shellac?  Seems it's pretty much 50/50 on whether people even finish them at all (vs. unfinished/unprotected) but I'm looking for some practical advice on the topic.
Comment: What kind of use do you expect for them, and what kind of 'look' are you going for?  On second look, I think this question might be too broad to answer well without knowing more of you 'needs'
Comment: If you have planed the inside of the drawers smooth it should not be necessary to apply finish but a thin coat of poly or lacquer won't hurt anything either
Comment: Something to consider would be protection of the clothes being put into the drawers. `Pretty darn smooth` could still snag socks and ruin them. That (and the low price) probably have a lot to do with manufactured drawers being made out of particle board/chip board. You might consider taking an old pair of socks and dragging them across your wood to see if anything snags as a test of smoothness.
Answer: Major re-write as I missed that you were asking specifically about the drawers themselves.

Seems it's pretty much 50/50 on whether people even finish them at all

The traditional practice was for drawer bodies, and in fact the entire interior of a chest of drawers, not to be finished in any way. There are possibly multiple reasons for this, one of which might simply have been penny-pinching!
But one reason that is mentioned in some older books is that the contents of the drawers might stick to any finish in warm and/or damp weather. This is not likely with any finish that dries hard however, and particularly not if a very thin coating is applied (i.e. not enough finish to form a distinct film on the surface of the wood).

I've read that poly can cause undesirable odors

If you wanted to use oil-based poly you could wait for a full cure before inserting the drawers. One of the indicators of a full cure is that the finish has no odour with your nose right at the surface. This might take as long as a month though!

What about water based poly or shellac?

I think shellac would be the better choice between these two because it's so easy to make a very dilute version, which would provide just that bit of protection that you might be looking for.
An advantage of using oil-based poly over waterbased poly is that the former can easily be thinned to a "wiping consistency" (note: can still be applied by brush) just by adding additional spirits, while with waterbased poly apparently you shouldn't thin them heavily with water as it interferes with how they dry and harden.
Waterbased varnishes have one other potential disadvantage worth nothing, as with all finishes that are based on water there is the possibility that the first coat of waterbased poly will "raise the grain", that is, swell the surface wood fibres and make your previously super-smooth sanded surface rough again. There are a number of ways of dealing with this but probably the best is to deliberately raise the grain in advance by wiping over with water. After the wood has dried you lightly sand to remove the raised grain. Some users do this two and even three times to ensure that when their finish goes on the wood it will remain smooth.
Comment: To clarify, the question is referring *specifically* to the interior surfaces such as the sides and bottoms of the drawers, not the exterior surfaces.
Comment: @rob, ah I totally missed that! I need to do a major re-write, thanks for the headsup.
Comment: Glad to help; great answer!
Comment: I've used shellac on drawer interiors, and have been very happy with the results. Super fast dry time between coats too.
Answer: I wouldn't be afraid to using straight polyurethane. I build shelving for my room in the form of a large book case and a small dvd shelf. I covered both in straight poly and after drying it neither has a smell or any stickiness to it as graphus suggested it possibly could.
The only issue I had with it was that I only used one coat and didn't sand. I found out later that it stood the grain up slightly in some places. Not enough to really notice, even when running your had over it, but I sure notice it when I try to dust and dust and the duster try to stick to it. So if you do a couple of coats and sand lightly between, I think you'd be good to go. It will also help protect your wood pretty well. There is a slight shininess to my boards, but I think it looks good and I'm sure a buffing with a very high grit sandpaper would nock the shine off. If you were looking for something that wasn't as heavy, I've think you can mix water with the ploy to make a thinner wiping varnish, but I think that's mostly an issue of how easy it is to apply and how tough it is. I'm sure you have similar issues and benefits to full strength poly, just to a lesser degree.
Answer: Surf Wax, or something similar, rub it in, wipe excess, there probably wont be any, done.


Expired US Passport / Dual Citizenship Traveling

Question: So my US passport expired a few weeks back and I expedited the renewal process, however, I'm not sure it will arrive in time for me to fly out the Mexico in a couple weeks. I have dual citizenship for the US and Ireland, and I'm wondering if it would be any issue for me to leave the US with my Irish passport? I know I need my US passport for reentering the US, so I can either have my sister fly it down when she comes to meet our family as she'll be leaving a few days after me (or I believe I can have it FedEx-ed to a secure place if not)... Aside from the obvious question as to whether I'll get my US passport back in time for my departure, can anyone please tell me or confirm that exiting the US without my US passport won't be an issue?
Answer: The US doesn't have exit controls, so you won't have a problem usually. The regulation doesn't have a penalty to be enforced anyway. You don't need to be worried about the US here, but whether the airline will let you board or not, which depends on if you'll be able to enter your destination. I assume that on an Irish passport, you'll be able to enter visa-free in Mexico, although under a bit harsher conditions than with a US passport. You would probably get a migration/tourist card, which you have to keep on your person and give it back when leaving.
Comment: It's a statute, not a regulation, though that doesn't change the answer.  @Bobbie there is one very unlikely scenario in which you might be prevented from flying, which is if you encounter a CBP spot check at the gate.  They'll look into your immigration status, which means they'll discover that you're a US citizen, and then they would most likely prevent you from boarding because of this law.  You might be able to talk your way onto the plane if you explain what you did to get the passport and that it nonetheless didn't arrive in time.
Comment: "How likely are such checks?" I've never seen one except on TV.  There's a user at flyertalk who reports encountering them regularly on flights to some destination that is associated with money laundering and/or organized crime, so it seems to depend on one's itinerary.
Comment: Yeah according to all the sites I've looked at, Irish passports don't need visas for getting into Mexico, and I've already updated my information for that passport on Delta so it shouldn't be an issue with the airline. I just had a bit of a panic attack when remembered they check your passport at the kiosk and the gate, but since that's not technically any sort of passport control or customs I suppose that won't be a problem... Thank you for the reassurance!! Definitely needed it
Comment: thank you @phoog - I remembered that wrong then, thought there was no such consequence. How likely are such checks?
Answer: Quoting from the U.S. DEPARTMENT of STATE - BUREAU of CONSULAR AFFAIRS:

U.S. nationals, including dual nationals, must use a U.S. passport to enter and leave the United States.

The US doesn't have consistent exit controls, but some users online report of random checks being carried out by Customs.
Personally I've never seen any, or know anyone who did, so I'd assume they're fairly rare.
Assuming you find a workaround, or leave anyway, I would strongly suggest bringing the expired passport with you.
DO NOT HAVE YOUR SISTER CARRY IT FOR YOU. Generally speaking, you're not allowed to carry someone else's password, if they're not traveling with you. I know in the US to legally carry it she would need an authorization letter from you, but I'm not sure it would be enough to cross the border. It might be illegal.
Answer:
can anyone please tell me or confirm that exiting the US without my US passport won't be an issue?

It's not an issue. US has no exit controls. You can enter a third country with any passport you like.

I know I need my US passport for reentering the US,

Since it's so hard to renew passports, there is a Covid exemption in place: https://www.state.gov/return-travel-on-recently-expired-u-s-passports/ You probably board a US bound plane with an expired passport, although I would check with the airline first.
Comment: "US has no exit controls": Customs and Border Protection does spot checks at boarding, and an officer performing such a check could prevent a US citizen who lacks a US passport from boarding the plane.  The checks are apparently fairly frequent on some flights, according to a user at flyertalk who has posted several messages about this over the years, but I've never flown any of those routes and I've never seen one of these checks except on television.


disable win hotkeys in windows 10

Question: how can you disable the windows hotkeys (win+S, win+D etc.) in windows 10? the methods from windows 8, which involved changing values in the registry, didn't work for me. i'd like to be able to select which hotkeys to disable, but i'll also settle for disabling these hotkeys altogether.
Answer: Sorry,first time to giving help,
you can modify reg like this
<code>HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer
NoWinKeys REG_DWORD 0x00000001 (1)
</code>
Except Win+L&Win+U can all be blocked
and i use Autohotkey to solve rest problem
Comment: i don't have this kind of folder structure in my registry in windows 10. i can only go up to `HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies` or `HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer`

disable win hotkeys in windows 10


How scaleable really is a web-services based architecture?

Question: Whenever someone talks about a services-based architecture, they often mention scalability, often in the same breath. However, it seems that using services adds more overhead, rather than reducing it, since there is now a protocol, like SOAP or REST, involved. So, does a web services based architecture really add performance benefits as the number of users of, say, a web application, scales by perhaps an order of magnitude? Or are the scalability requirements simply offloaded onto the services, rather than the core application?
Answer: Scalability and performance are two separate things.  Yes, a service based approach does add the overhead of a network protocol, but this is a minimal sacrifice for the benefits of being able to rapidly adopt well-tested services in any application on the domain.
If the overhead of the network is a deal-breaker for the system you want to build then clearly SOA is the wrong choice for you.  Remember that not ever service must be accessed over HTTP.  I think you would be surprised how fast some protocols (like net.tcp) can be.
Answer: Remember that you can scale out a web service to run on multiple servers, without affecting the clients. That doesn't work so well with a tightly-coupled system.
Answer: A properly-designed SOA allows each component in the system to work independently of all the others and run asynchronously in parallel, so both performance and scalability (two different things) become limited only by the slowest/least scalable piece in your system, rather than the total time it takes for all components to execute in serial.
SOA is not appropriate for all solutions though, so if you don't see any clear benefit for your particular case, then there may be none.
Answer: Web services don't give you scalability for free. In fact it's pretty easy to build a service that won't scale.
What they do give you is opportunities to build in scalability. And, by having well defined service interfaces, you can swap out a quick-and-dirty non-scalable implementation of a service with a better implementation when you need it.
The important thing is not to forget the 'A' in 'SOA'. You can make a huge mess by just wantonly creating a bunch of services. Make sure you have an architecture.
One huge step towards scalability is moving away from the basic, synchronous, query/response type services (such as SOAP RPC), towards asynchronous services. See Hohpe and Woolf's 'Enterprise Integration Patterns'
Answer: RESTafarians will remind you that REST isn't a prototol--it's an architectural style. REST is a way to use HTTP directly, without the wrappers that SOAP uses, to provide a services model. REST is much closer to the wire that SOAP. That alone doesn't make one better than the other, they both have their place.
The scalability of a services model isn't so much directly related to "services" (as in Web Services with a capital W and a capital S) than it is to the stateless nature of these services. Well built Web apps are also scalable and could be argued to be as scalable as any services-driven architecture.
One of the differences between the two models is that the Web app without "services" is interacting with referenced modules living in the same process at a binary level--no serialization necessary. Web services (SOAP or REST) introduces some level of serialization that adds overhead. This overhead though, is often deemed worthly given the resuse it provides (ie, the same Web services that drive your apps internally can also be used to make business partners happy).
One good architecture is to expose the service classes (not Web services, it can get confusing quickly! Services in this context means the classes that are serving low-level business process) to your local apps directly in process--exploiting the ability to talk to this services binarily. But then, for business partners and other services uses, put a thin Web services layer over these already-tested service classes to offer the same services layer available as Web services.
Answer: Okay, so let's define "scaleability" first.  Most anything will scale: if you need more capacity, to a first approximation, you can simply throw more hardware at it.  But some architectures are "more scaleable" — what does that mean?  It has to do with cost: an architecture is "more scaleable" if the cost per unit of added capacity is less.
Scaleability in general has three ranges in any architecture: there's a fixed cost for the first part, so over an interval it's linear with a slope of 0; past that point the slope increases, and at some point usually adding capacity is very expensive.
We say a system is "linearly scaleable" if the function describing cost per unit of added capacity is roughly linear over a large range.  Obviously, it's desirable for that slope to be less.
So, now, when someone asks about the "scaleability" of an SOA, SOAP or REST or whatever, that's what they're talking about.
Service-oriented architectures are said to be "more scaleable" because adding more capacity is relatively inexpensive, even though, as you say, there may be overhead that makes you need more capacity to service a single user.  This is because a big part of the cost and complexity of managing a big system comes from the need to maintain session state, that is, keep track of what's going on between calls.  Service-oriented architectures avoid that by making each call relatively independent of the next, with RESTful architectures being the limiting case -- all the session state is encoded in the representation, so the rest of the system doesn't need to know about it.  When you want to add capacity, all you need to do is add another server; simple load balancing will be sufficient to route messages to the new one.
(Notice this is also inherently more fault tolerant: if a server dies, the other more or less automagically get the requests, and there's no session to lose.)
Architectures that require lots of session state, like some J2EE systems, tend to scale less well, as you need lots of extra complexity to manage session state.
The sort of limiting case, which you saw in old CGI-based architectures, is the one where each user session requires a full heavyweight process; I've seen systems in the field where fork/exec was 40-50 percent of the load, where there needed to be a complicated software load-balancing rig to make sure that requests always got to the machine that held the session, and where simply running out of process slots was a major issue.  One such system required buying a whole new high-end Starfire server to add capacity.


Collect.js Predictive Intelligence Set User Info Email Value

Question: The "Marketing Cloud install collect tracking" documentation clearly states that to be able to use Predictive Intelligence then the setUserInfo email property must be the subscriber's email address. It goes on to say that for privacy reasons you should not use an email address or any other PII data but to use a hashed email or other non-PII identifiers. Is this just bad documentation, or is there a loss in functionality of Predictive Intelligence for not using an email address in the email property? Here is the documentation for reference: https://help.salesforce.com/articleView?id=mc_ctc_set_user_info.htm&type=5
Answer: You will be perfectly fine using anything but the email address. There is only one place which depends on setuserinfo using email address, and it is the automatically provisioned attribute group in data designer, which links your contact model with Personalisation Builder via email address from your contact with email field of IGO_PROFILES data extension. However, I am still to see a single implementation making use of this attribute group.
Normally I process data from a number of these data extensions, e.g. IGO_PROFILES and IGO_VIEWS, using Query Activities, where I can join this on any key I want.
You need to ensure though, your email recommendation code uses the same attribute as you use in setuserinfo instead of emailaddr as provided in the default code snippets:

Hence it is beneficial ensuring this field is always a part of your spendable data extensions.
My recommendation for what it should be depends highly on what other applications (e.g. DMP) that you use. As in some cases a hashed email address is the best option.
Comment: Do email recommendations and behavioral trigger content still work if something other than email address is used in setUserInfo?
Comment: @Hellodolly9999 - Yes, please see this comprehensive reply by Macca: https://salesforce.stackexchange.com/questions/344977/einstein-email-recommendation-set-user-info
Answer: Well, looking at the documentation it states that it should be either email or some unique ID, the unique Id can be randomly generated and used as a subscriber key, something like an advertising ID.
The unique Id is not a PII per se because others cannot link a user with that info, they can with an email but I do understand that there are some other areas in SFMC which rely on the email address.
Have a look  at this answer which goes into more details on how to prevent PII being exposed.
Configuring web tracking code for tracking subscribers

Documentation:

Copy and customize the script by replacing "INSERT_EMAIL_OR_UNIQUE_ID"
  with dynamic code to get the Subscriber ID. A Subscriber ID is
  typically an email address or number unique to that user.
Comment: Yes, the documentation says you can use any Id, but the tip says `In order to use the Personalization Builder Integrations, you must use the user's email address. For privacy reasons, we recommend using a non personally identifiable information (PII) identifier or hashing the email.` I interpret this as if you want to use Predictive Intelligence then use email and sacrifice privacy. If you want privacy then use non-PII ID or hashed email and sacrifice Predictive Intelligence. It's just not clear what won't work in PI if you don't use email.


Real experience of being hacked on linux?

Question: I would like to hear real stories, how your linux box/server was hacked and what you do not to fall in to the same hole again.
Answer: About 2 years ago one of my co-located web servers was hacked.  I tracked down the vulnerability to be in a php script I was running, an old version of PHPBB.  The hacker basically used a hole to place a script on my server and execute it, which gave him full access to the server.
Luckily, he didn't do any damage, he simply installed a new website to be served off my box.
I was going through the logs one day, as I had seen my bandwidth usage skyrocket, and I found that he had installed a spoofed copy of another website on my server.  Essentially it was an easy misspelling of an online store for watches, and I believe he was selling watches, collecting money, and obviously never sending anyone anything.
After I discovered this, I made a copy of everything he did - logs, scripts, the entire website, and archived it as well as sent it to my hosting provider.
I cleaned up his tracks, and began to secure my server.
As a result, I learned a lot about Linux security, and did several things:

Tightened up my SSH security including running it on a non-standard port.
chrooted apache
Installed and configured apache mod_security (which is amazing)
Started running some log monitoring/intrusion detection scripts
Killed any processes running on ports which I was not actively using

As a result, I have not been hacked since, and whenever anyone tries, I am alerted.
Some of the easiest ways your server can be hacked, if it is a standard web/email server are through common script vulnerabilities.  You also should take extra steps if you are running an email server to ensure you are not an open relay of any kind, the spammers will find you and suddenly all email coming from your server will get blacklisted.
Comment: +1 for calmly identifying the problem, monitoring the situation, and then securing it. Too many people over-react when they get hit.
Answer: Couple of years ago I've created a user with a name consisted of two symbols. I haven't thought though that well experienced hacker that this account is was for could use his login as a password. Of course that machine was hacked in a week and when I asked the guy, what he was thinking, he told me that he wasn't aware that someone can check every possible short user name on the server and he knew for sure no one could get the list of users so he thought he was safe enough.
Hackers installed some kind of back door and probably used this machine to send spam. Luckily it wasn't such an important server so we just reinstalled OS on it.
Answer: The hosting solution (unsupported dedicated server) was cheap and sounded cool, I didn't really know what I was doing, didn't keep the system up to date and I probably had done something bad with iptables/ipchains configuration.  One day when backpacking around Western Europe I fired up the site and nothing was there.
My solution was to abandon everything and trust someone else until such a time that I'd gained more server admin experience; that was about 7 years ago and I still trust the other guy!
Comment: I think there are too many hosting providers that give you a dedicated or virtual linux server without expecting the people renting it have any idea how to administer it.  Id be willing to bet that the vast majority of spam and hacked servers are in this category.
Comment: Agree and although I totally accept culpability I at least expected that the provider would've been providing a vanilla install which was configured to meet their security requirements, i.e. that had I kept it patched (failing on my part) and not changed any configuration, it would've remained relatively secure.  It wasn't clear to me whether the provider did though, and I guess I learned to research the reputation of the company much further in future.
Answer: ~5 years ago I was working as a system administrator at our university and our workstations that ran an outdated version of suse (it wasn't my fault!) had been hacked with the ssh exploit that was also used in matrix btw.
As result our boss removed the route to the gateway to "shield" our workstations, because they couldn't connect to the outside world. There was only one server that was in both networks and was used as login server from the outside...
Answer: Many years ago, I was somewhat responsible for a clients system.  The system was not being patched and it had somehow gotten removed from my list of systems to maintained.
A security flaw in bind allowed someone to get into the system and get root.  They used the system to send out spam and they setup a web server.  While bind was installed on the system it actually wasn't being used for anything
The results of the intrusion

pulled the hd in-case the police wanted to see it
reinstalled the OS on a new hard drive
restored the data from an older backup
remove un-needed package (bind) which was the vector for the attack.
applied security patches, and setup a system to notify the system's owner when a patch needed to be installed
setup better activity logging for all our systems
tweaked our backup selections because a couple things where overlooked.
Answer: Last December, my main Linux server got many complaints via selinux's tool setroubleshooter.  The two categories were

SELinux is preventing the sh from using potentially mislabeled files (./x).
SELinux is preventing the http daemon from connecting to the itself or the relay ports

Looking in my HTTP access logs, I saw lines like
220.127.116.11 - - [05/Dec/2008:04:32:11 -0600] "POST /wordtrans/wordtrans.php HTTP/1.1" 200 1348 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows 98)"

Looking in the HTTP error log, I also saw complaints.  I then used wordtrans myself to compare a true use vs what I had in my logs; I had wordtrans installed as a toy that I didn't truly need.  True use of wordtrans had many GETs along a few POSTs.  The attack only had POSTs.
I Googled for "http attack wordtrans" and found the version I had installed was attackable, so I immediately uninstalled the wordtrans-web package.
Had I not been running selinux, the attack certainly would have been successful, and I wouldn't have known.
This is yet another lesson to not run any service (that is exposed to the public internet) that you don't truly need.  Each service installed, however small, including PHP packages, web services, etc, is a potential attack vector.  Also, my decision to enable selinux with that install months earlier had been a good one.
Answer: A few years back we put a system on a college campus (connected to the college network). It was rooted in approximately 2 days. Since we could easily replace it, we just over-wrote the drive and ran Nmap on the system before reconnecting to the campus network.


Suggestions, isporations and ideas for report page for an ERP

Question: I am designing a reports page where users come and fill in the required fields and get the report. They can then choose to download or view the report. Considering that our users are not very tech-savvy we have decided to make the process easier for them by prefilling some of the fields required to get the report. To make the UI look cleaner we have decided to show a minimized version of the fields where the users will have to only fill the most important fields required for the report and the rest of the fields will be prefilled. If the users need to change the other fields they will have to maximise or (see more details) and then make the changes and then view the report.
Any suggestion on how to design the minimized version of the screen which will have both input fields and predefined selections. Also any references for screens like this would. be appreciated.
I will attach an image for reference
Answer: I would work on structuring the form elements. Would make them more understandable and cleaner. Below are some examples for inspiration.


The pronunciation shift of T to D in the United States

Question: I'm from the United States and I have recently discovered that I don't pronounce the T as a soft D as other Americans do. Neither do most of the people in my area or my parents. I pronounce the word "butter" like someone from most areas of Britain would, I don't pronounce it like "budder." Other than the pronunciation of this consonant, my pronunciation aligns with the main American pronunciation. I was wondering if there is some kind explanation as to why the pronunciation of the t hasn't shifted to a D in my area? I live in the Southern New Hampshire by the way.
Comment: Can you be more specific as to what you mean by "northeast"? New York Siddy? Rochesder? Connedicut? Bosdon?
Comment: so anytime you hear the flap T on TV, isn't it weird to you that you speak differently from anyone else?
Comment: I'm from southern New Hampshire
Comment: I really didn't notice until recently, and that was only because someone else pointed it out
Answer: Maybe you have (or have remnants of) the so-called Mid-Atlantic Accent.  https://www.atlasobscura.com/articles/how-a-fake-british-accent-took-old-hollywood-by-storm
Comment: So, the way I speak is technically unnatural? This would make some amount of sense due to the fact that area I live in is called New England. Most people in my area speak without the flap T. We also tend to use some vocabulary that would be considered British, such as "posh".
Comment: By the way, the only feature I seem to have from this accent is the pronunciation of t. The rest seem to match the modern American pronunciation.


Can I make this assumption about the utility function?

Question: My question concerns a household's utility function U(c,l). We're told that the partial derivatives dU/dc and dU/dl > 0, and the second order partial derivatives are negative. Now, can I assume anything about the sign of the partial derivatives Ucl (or Ulc)?
Answer: No.
In general, based on the information you have, there are no results you can infer for the partial derivatives $U_{cl}$ / $U_{lc}$. In this context they could be anything.
As to what you are allowed to assume is a different story. You can assume anything in general, of course. Nevertheless, there is no way to check if your assumptions would be correct in this case.
Answer: For a "well-behaved" bivariate utility function as regards utiliy maximiaztion, we need the Hessian matrix of partial derivatives to be negative definite, which translates into
$$U_{cc}<0, \;\;\;U_{ll}<0,\;\;\; U_{cc}U_{ll} - \left[U_{cl}\right]^2 >0$$
$$\implies |U_{cl} | < \sqrt{U_{cc}U_{ll}}$$
The first two conditions you have by assumption, the third condition poses a constraint on the relative magnitude in absolute value of the cross-partial, although not on its sign: it has to be smaller in absolute terms than the geometric average of the own-second derivatives, at least at the optimal point.
I notice that in many research papers it is assumed that the cross-partial is zero (utility additive in consumption and leisure).
Nevertheless, this is a good opportunity to apply some economic/behavioral thinking: what would it mean, as regards the relation between consumption and leisure to have $U_{cl} <0$? What would it mean to have $U_{cl} >0$ ?


What's the practice for short-forming or nicknaming words called?

Question: Is there any term for the habit of playing around with words, or even names, and nickname them? Like 'No' becoming 'nopes', 'whatever' becoming 'tevs', milky-wilky etc. This happens a lot with cricket teams, who keep nicknaming people - Wilkinson becomes Willy or Wilks, Hogg becomes Hoggy (though it's longer).
Comment: For people, "nicknaming" would be the word I would use.
Answer: 'Nicknaming' specifically for names.
Other words you can use: 'abbreviation' or 'to abbreviate' and 'dimimutive'

di·min·u·tive (adjective) /diˈminyətiv/
Extremely or unusually small
  - a diminutive figure dressed in black
(of a word, name, or suffix) Implying smallness, either actual or
  imputed in token of   affection, scorn, etc., (e.g., teeny, -let,
  -kins)


process.waitFor() never returns

Question: Process process = Runtime.getRuntime().exec("tasklist");
BufferedReader reader =
    new BufferedReader(new InputStreamReader(process.getInputStream()));
process.waitFor();

Comment: Please note that on JAVA 8 there is a waitFor overload that let's you specify  the specify a timeout. This might be a better choice to refrain from a case where the waitFor never returns.
Comment: In my case i added waitFor() before reading output stream and that caused deadlock situation.`if(!process.waitFor(15, TimeUnit.MINUTES)) { process.destroy(); } else { process.getOutputStream().close(); BufferedReader stdout = new BufferedReader(new InputStreamReader(process.getInputStream()));`
Answer: There are many reasons that waitFor() doesn't return.
But it usually boils down to the fact that the executed command doesn't quit.
This, again, can have many reasons.
One common reason is that the process produces some output and you don't read from the appropriate streams. This means that the process is blocked as soon as the buffer is full and waits for your process to continue reading. Your process in turn waits for the other process to finish (which it won't because it waits for your process, ...). This is a classical deadlock situation.
You need to continually read from the processes input stream to ensure that it doesn't block.
There's a nice article that explains all the pitfalls of Runtime.exec() and shows ways around them called "When Runtime.exec() won't" (yes, the article is from 2000, but the content still applies!)
Comment: This answer is correct but it misses a code sample to troubleshoot the problem.  Have a look at Peter Lawrey answer for useful code to find out why `waitFor()` doesn't return.
Comment: @d-b: in that case simply don't call waitFor().
Comment: If the process isn't supposed to quit? If you run `ls` it will quit but what if you start `httpd`?
Comment: @d-b: I'm not sure what your question is. Yes, that's another reason why `waitFor()`doesn't return.
Comment: The question is: how do you handle that situation? You want httpd or whatever to stay open.
Answer: It appears you are not reading the output before waiting for it to finish.  This is fine only if the output doesn't fill the buffer.  If it does, it will wait until you read the output, catch-22.
Perhaps you have some errors which you are not reading.  This would cause the application to stop and waitFor to wait forever.  A simple way around this is to re-direct the errors to the regular output.
ProcessBuilder pb = new ProcessBuilder("tasklist");
pb.redirectErrorStream(true);
Process process = pb.start();
BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
String line;
while ((line = reader.readLine()) != null)
    System.out.println("tasklist: " + line);
process.waitFor();

Comment: For info : ProcessBuilder being a real builder, you can directly write ProcessBuilder pb = new ProcessBuilder("tasklist").redirectErrorStream(true);
Comment: I'd rather use `pb.redirectError(new File("/dev/null"));`
Comment: Should be the accepted answer I believe, I replaced my code with this and it immediately worked.
Comment: why do you need to use `waitFor` since you're already reading err/out until you receive EOF ?
Comment: @Toochka Just for information, `redirectError` is only available since Java 1.7
Comment: Thanks @Peter. `pb.redirectErrorStream(true);` solved my problem.
Comment: @Sybuser it's probably not needed, you could check the exit code with this method
Answer: Also from Java doc:

java.lang
Class Process
Because some native platforms only provide limited buffer size for standard input and
  output streams, failure to promptly write the input stream or read the output stream of
  the subprocess may cause the subprocess to block, and even deadlock.
Fail to clear the buffer of input stream (which pipes to the output stream of subprocess)
  from Process may lead to a subprocess blocking.

Try this:
Process process = Runtime.getRuntime().exec("tasklist");
BufferedReader reader =
new BufferedReader(new InputStreamReader(process.getInputStream()));
while ((reader.readLine()) != null) {}
process.waitFor();

Comment: Two caveats: (1) Use ProcessBuilder + redirectErrorStream(true), then you are safe.  Else, (2) you need one thread to read from Process.getInputStream() and another to read from Process.getErrorStream().  Just spent about four hours figuring this out(!), aka, "The Hard Way".
Comment: You could use Apache Commons Exec functionality to consume the stdout and stderr streams simultaneously: `DefaultExecutor executor = new DefaultExecutor(); PumpStreamHandler pumpStreamHandler = new PumpStreamHandler(stdoutOS, stderrOS); executor.setStreamHandler(pumpStreamHandler); executor.execute(cmdLine);`, where stoutOS and stderrOS are `BufferedOutputStream`s I've created to write out to appropriate files.
Comment: In my case I was calling a batch file from Spring that internally opens one editor.  My code was hanging even after applying code of `process.close()`.  But when I open input stream as suggested above and close immediately -- problem goes away.  So in my case Spring was waiting for stream close signal.  Even though I am using Java 8 auto closable.
Comment: @kevinarpe You can use `InputStream.available()` to consume both streams from a single thread without blocking. So long as the method returns a positive number you are guaranteed a read will not block.
Answer: I would like to add something to the previous answers but since I don't have the rep to comment, I will just add an answer.  This is directed towards android users which are programming in Java.
Per the post from RollingBoy, this code almost worked for me:
Process process = Runtime.getRuntime().exec("tasklist");
BufferedReader reader =
new BufferedReader(new InputStreamReader(process.getInputStream()));
while ((reader.readLine()) != null) {}
process.waitFor();

In my case, the waitFor() was not releasing because I was executing a statement with no return ("ip adddr flush eth0").  An easy way to fix this is to simply ensure you always return something in your statement.  For me, that meant executing the following: "ip adddr flush eth0 && echo done".  You can read the buffer all day, but if there is nothing ever returned, your thread will never release its wait.
Hope that helps someone!
Comment: When you don't have the rep to comment, _don't work around it and comment anyway_. Make this an answer on its own and get rep from it!
Comment: I don't think it is the `process.waitFor()` that hangs it is the `reader.readLine()` that hangs if you have no output. I tried to use the `waitFor(long,TimeUnit)` to timeout if something goes wrong and discovered that it was the read the hung. Which makes the timeouted version require another thread to do the reading...
Answer: There are several possibilities:

You haven't consumed all the output on the process's stdout.
You haven't consumed all the output on the process's stderr.
The process is waiting for input from you and you haven't provided it, or you haven't closed the process's stdin.
The process is spinning in a hard loop.
Answer: As others have mentioned you have to consume stderr and stdout.
Compared to the other answers, since Java 1.7 it is even more easy. You do not have to create threads yourself anymore to read stderr and stdout.
Just use the ProcessBuilder and use the methods redirectOutput in combination with either redirectError or redirectErrorStream.
String directory = "/working/dir";
File out = new File(...); // File to write stdout to
File err = new File(...); // File to write stderr to
ProcessBuilder builder = new ProcessBuilder();
builder.directory(new File(directory));
builder.command(command);
builder.redirectOutput(out); // Redirect stdout to file
if(out == err) {
  builder.redirectErrorStream(true); // Combine stderr into stdout
} else {
  builder.redirectError(err); // Redirect stderr to file
}
Process process = builder.start();

Answer: For the same reason you can also use inheritIO() to map Java console with external app console like:
ProcessBuilder pb = new ProcessBuilder(appPath, arguments);

pb.directory(new File(appFile.getParent()));
pb.inheritIO();

Process process = pb.start();
int success = process.waitFor();

Answer: You should try consume output and error in the same while
    private void runCMD(String CMD) throws IOException, InterruptedException {
    System.out.println("Standard output: " + CMD);
    Process process = Runtime.getRuntime().exec(CMD);

    // Get input streams
    BufferedReader stdInput = new BufferedReader(new InputStreamReader(process.getInputStream()));
    BufferedReader stdError = new BufferedReader(new InputStreamReader(process.getErrorStream()));
    String line = "";
    String newLineCharacter = System.getProperty("line.separator");

    boolean isOutReady = false;
    boolean isErrorReady = false;
    boolean isProcessAlive = false;

    boolean isErrorOut = true;
    boolean isErrorError = true;

    System.out.println("Read command ");
    while (process.isAlive()) {
        //Read the stdOut

        do {
            isOutReady = stdInput.ready();
            //System.out.println("OUT READY " + isOutReady);
            isErrorOut = true;
            isErrorError = true;

            if (isOutReady) {
                line = stdInput.readLine();
                isErrorOut = false;
                System.out.println("=====================================================================================" + line + newLineCharacter);
            }
            isErrorReady = stdError.ready();
            //System.out.println("ERROR READY " + isErrorReady);
            if (isErrorReady) {
                line = stdError.readLine();
                isErrorError = false;
                System.out.println("ERROR::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::" + line + newLineCharacter);

            }
            isProcessAlive = process.isAlive();
            //System.out.println("Process Alive " + isProcessAlive);
            if (!isProcessAlive) {
                System.out.println(":::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: Process DIE " + line + newLineCharacter);
                line = null;
                isErrorError = false;
                process.waitFor(1000, TimeUnit.MILLISECONDS);
            }

        } while (line != null);

        //Nothing else to read, lets pause for a bit before trying again
        System.out.println("PROCESS WAIT FOR");
        process.waitFor(100, TimeUnit.MILLISECONDS);
    }
    System.out.println("Command finished");
}

Answer: I think I observed a similar problem: some processes started, seemed to run successfully but never completed. The function waitFor() was waiting forever except if I killed the process in Task Manager.
However, everything worked well in cases the length of the command line was 127 characters or shorter.  If long file names are inevitable you may want to use environmental variables, which may allow you keeping the command line string short.  You can generate a batch file (using FileWriter) in which you set your environmental variables before calling the program you actually want to run.
The content of such a batch could look like:
    set INPUTFILE="C:\Directory 0\Subdirectory 1\AnyFileName"
    set OUTPUTFILE="C:\Directory 2\Subdirectory 3\AnotherFileName"
    set MYPROG="C:\Directory 4\Subdirectory 5\ExecutableFileName.exe"
    %MYPROG% %INPUTFILE% %OUTPUTFILE%

Last step is running this batch file using Runtime.
Answer: Here is a method that works for me.
NOTE: There is some code within this method that may not apply to you, so try and ignore it.  For example "logStandardOut(...), git-bash, etc".
private String exeShellCommand(String doCommand, String inDir, boolean ignoreErrors) {
logStandardOut("> %s", doCommand);

ProcessBuilder builder = new ProcessBuilder();
StringBuilder stdOut = new StringBuilder();
StringBuilder stdErr = new StringBuilder();

boolean isWindows = System.getProperty("os.name").toLowerCase().startsWith("windows");
if (isWindows) {
  String gitBashPathForWindows = "C:\\Program Files\\Git\\bin\\bash";
  builder.command(gitBashPathForWindows, "-c", doCommand);
} else {
  builder.command("bash", "-c", doCommand);
}

//Do we need to change dirs?
if (inDir != null) {
  builder.directory(new File(inDir));
}

//Execute it
Process process = null;
BufferedReader brStdOut;
BufferedReader brStdErr;
try {
  //Start the command line process
  process = builder.start();

  //This hangs on a large file
  // https://stackoverflow.com/questions/5483830/process-waitfor-never-returns
  //exitCode = process.waitFor();

  //This will have both StdIn and StdErr
  brStdOut = new BufferedReader(new InputStreamReader(process.getInputStream()));
  brStdErr = new BufferedReader(new InputStreamReader(process.getErrorStream()));

  //Get the process output
  String line = null;
  String newLineCharacter = System.getProperty("line.separator");

  while (process.isAlive()) {
    //Read the stdOut
    while ((line = brStdOut.readLine()) != null) {
      stdOut.append(line + newLineCharacter);
    }

    //Read the stdErr
    while ((line = brStdErr.readLine()) != null) {
      stdErr.append(line + newLineCharacter);
    }

    //Nothing else to read, lets pause for a bit before trying again
    process.waitFor(100, TimeUnit.MILLISECONDS);
  }

  //Read anything left, after the process exited
  while ((line = brStdOut.readLine()) != null) {
    stdOut.append(line + newLineCharacter);
  }

  //Read anything left, after the process exited
  while ((line = brStdErr.readLine()) != null) {
    stdErr.append(line + newLineCharacter);
  }

  //cleanup
  if (brStdOut != null) {
    brStdOut.close();
  }

  if (brStdErr != null) {
    brStdOut.close();
  }

  //Log non-zero exit values
  if (!ignoreErrors && process.exitValue() != 0) {
    String exMsg = String.format("%s%nprocess.exitValue=%s", stdErr, process.exitValue());
    throw new ExecuteCommandException(exMsg);
  }

} catch (ExecuteCommandException e) {
  throw e;
} catch (Exception e) {
  throw new ExecuteCommandException(stdErr.toString(), e);
} finally {
  //Log the results
  logStandardOut(stdOut.toString());
  logStandardError(stdErr.toString());
}

return stdOut.toString();

}
Answer: Asynchronous reading of stream combined with avoiding Wait with a timeout will solve the problem.
You can find a page explaining this here http://simplebasics.net/.net/process-waitforexit-with-a-timeout-will-not-be-able-to-collect-the-output-message/
Answer: public static void main(String[] args) throws PyException, IOException, InterruptedException

these should be the exceptions thrown
Comment: Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer).

process.waitFor() never returns


FIFA - What are player cards and what are they used for?

Question: I haven't played FIFA in a long time (about 5 years now) and I recently found out that you're able to get player cards. The question is, what are those cards used for and what exactly are they?
Answer: Fifa Ultimate Team. You can read more about the 2016 version here: https://www.easports.com/fifa/ultimate-team/features
Basically you build a squad of cards for playing against people online. There are different levels of cards including bronze, silver, gold, and special Team of the Week/Team of the Year cards that give stat boosts to players. In addition to player cards, there are also manager, contract and item cards that you use to keep your team together and healthy.
Comment: Thanks @Rome_Leader awesome explanation! But let's say you've a team of Ronaldo, Messi and few other giant players in your team. Can the opponent team also have those very players if they got it?
Comment: If you can afford these players, you must be one of the best FIFA players in the world! Or at least very rich :)

But to answer your general question, yes, there are multiples of players. In the case of Jermaine Defoe, there will likely be millions. In the case of world class players like Ronaldo, there are probably fewer as he is rare in packs. Players come from packs that are bought, either via in-game coins or real currency, or provided as tournament prizes, etc. But there is not only one of each

Feel free to accept my answer if it has helped you by clicking the checkmark to the left!


Delete Directory from ASP.NET application returns to new session

Question: I'm deleting a directory from within an ASP.NET application. The deletion goes fine, but when I return from it all my session data from before the delete is lost.
It doesn't matter whether I use:
<code>                if (Directory.Exists(folderPath))
                    Directory.Delete(folderPath, true);
</code>
Or:
<code>                System.IO.DirectoryInfo d = new System.IO.DirectoryInfo(folderPath);
                if (d.Exists)
                    d.Delete(true);
</code>
In both cases I lose my session data.
Has anyone run into this problem?
Answer: If you are deleting a subdirectory within your application, your app domain will restart.  This removes all session data.  To alleviate this issue, only add/remove directories outside your application home directory.
Answer: Is the directory within the same application? Then deleting it will cause an AppDomain restart, which will result in loss of session state.
Comment: No, not that I know of. Directories within the web site should not be used for storage.
Comment: The directory is in a virtual directory in the application. Is there a way to get around the AppDomain restart?
Answer: Yes! Deleting a directory IIS is serving, causes a reset (or something). I have had this problem, I redesigned the app to not delete directories.
Shame on the -1 for the question, this is a real problem. +1 for someone with a fix.


Tag Editor badge

Question: For some reason, I had an edit accepted to a tag (two actually) but no badge. Is this a bug, or is there something in badge qualifications that requires more?
Answer: Actually, you created those two tag wikis, technically you didn't edit them.  If you actually change or tweak an existing tag wiki, then you will get the badge.  But creating or filling in blank tag wikis doesn't count as "editing.
Comment: Huh. Does that still count as a bug?
Comment: no, I think that is purposeful @soandos.
Comment: Then should the tag edit button be edited from "help us edit this tag" to "create a new tag" or something?
Comment: Editing from blank is the same as create a new. @soa
Comment: I'm saying to change the text on the link is all.
Comment: Looks like by-design :D

Tag Editor badge


Proof by contradiction that an expression is irrational

Question: The question is: Proove that $\left(\sqrt[3] \frac{q^2-1}{qx}\right)$ is irrational if x is irrational and nonzero and q is a rational number that is not 0 or 1.
   I started my proof with: To get a contradiction, suppose that $\left(\sqrt[3] \frac{q^2-1}{qx}\right)$ is rational. Therefore $\left(\sqrt[3] \frac{q^2-1}{qx}\right)$ is in the set of rational numbers. So $\left(\sqrt[3] \frac{q^2-1}{qx}\right)$ = r. I know I now have to proove that x is irrational, but how?
 Are these steps correct so far?
Comment: It's an expression not an equation.
Answer: You can continue by solving for $x$ in $\sqrt[3]{\frac{q^2-1}{qx}} = r$ and get a contradiction once you look at what you obtain.
Answer: From $$r=\frac{c}{d}=\sqrt[3]{\frac{q^2-1}{qx}}.$$ we obtain $$\frac{c^3}{d^3}=\frac{q^2-1}{qx}\Leftrightarrow\frac{c^3q}{d^3(q^2-1)}=\frac{1}{x}.$$ The LHS is rational, since $q,c,d$ are rational. Thus, $1/x$ is rational and $x$ is rational, contradiction. Note that $c^3q$ is an integer and $d^3(q^2-1)$ is a non-zero integer by assumption.
Comment: Is it wrong if I say that x = $\left( \frac{q^3-1}{qr^3}\right)$ because r hasn't been proved rational?
Comment: q^2-1* I was hoping I could say that x was equal to that where q,1, and r is rational, but I realized that I couldn't prove r was rational. So I would be better off with this?
Comment: The assumption to obtain a contradiction is that $r$ is rational. So you can do that but should write a line about why $r$ is non-zero.
Comment: Then the final proof would be : Restate what is written in the question, do algebra to solve for x, explain that r is rational and not 0, and then say that x equals the rational number, a contradiction. And would this be correct so I don't have to do it the way you said in your question?
Comment: That's what you can do. However, what I wrote in my answer is just the algebra to solve for $x$. The only difference I can see in what you wrote is that you keep $r$ as it is and don't write it as $c/d$ as I did.
Answer: Let $c=\left(\sqrt[3] \frac{q^2-1}{qx}\right)$
Say $c$ is rational meaning we can express $c = \frac mn$, where $m$ and $n$ are integers.
Similarly since $q$ is rational we can write $q = \frac ab$, where $a$ and $b$ are distinct integers with $a \neq 0$.
You can do the algebra (including a cubing step) and express $x$ in terms of the other variables. You should easily be able to reach the required contradiction showing $x$ as a rational expression of two integer expressions.


To sell the house or not to sell the house?

Question: Needing advice on how to get on track to be financially successful.  I am 35 years old single parent and Currently have a home at 3.75% interest rate. Owe 220 and it's worth 290k.  Debt totaling 126k including a 48k car loan and 14k in cc debt and the rest Is federal tax debt.  Wondering if it is smart to sell my home and use the equity (50k) to pay off some of my debt, sell the car (48k) and get rid of my car note then continue on a strict budget to pay off the remaining (30k)?  My average income for the last two years is 150k but subject to change since I am self employed.   If I sell I was thinking of buying another home To keep my mortgage the same since it is not a stretch financially.  (Selling because I'm ready for a new house and want to get a jump on the debt using the equity.  Trying to get to a place where the only debt I have is the home so I can save more and put more towards the potential new mortgage to pay it off sooner.  I also have 1 child getting ready for college in the next couple of years. Obviously I haven't been the smartest financially and something has got to change. I have started living on a budget but need to know what to do from this point on.  Any advice is greatly appreciated.  I have options but I am confused and afraid to make any more bad choices.
Comment: It would be far more valuable to list your current average net income and how much you are repaying on each of these debts each month (and how long it'll take to pay them off). You say your average income is 150K. Is that per year or for two years? What currency is this? Why do you need such an expensive car, assuming US currency? How much is the car worth if you sold it?
Comment: @SolStack A 48K USD car is an extravagance and should probably be replaced with a much cheaper car, if trying to reduce debt. A 48K INR car is probably the cheapest available that will get you from point A to point B (assuming my calculation is correct), and should be kept if it is in running order. Same percentage of total income, radically different outcome.
Comment: What state do you live in?
Comment: @ChrisInEdmonton Why would currency matter? It's all proportional. A 48K car is the same percentage of total income whether it is USD or INR.
Answer: I think your plan is good.
The keys to your plan are:

Trying to get to a place where the only debt I have is the home

Credit card debt and Federal tax debt is some of the worst debt you can have. The quicker you can get rid of it, the better.

sell the car (48k) and get rid of my car note

A $48K car is not appropriate for anyone but the most wealthy among us in my opinion; certainly not for someone in debt. Sell the car and get yourself a $5-$6K car. Pay cash for it.

continue on a strict budget.... I have started living on a budget.

This is the real key. Once you have figured out how to plan your spending and committed to never spending more than you have, you have solved the problem and not just the symptom. If you don't figure this part out, you could sell enough stuff to get out of debt, but you'll find your way back in trouble again soon.

sell my home and use the equity (50k) to pay off some of my debt.... Selling because I'm ready for a new house and want to get a jump on the debt using the equity.

If you want to sell the house, then sell. It will certainly help you get out of debt quicker. You may want to consider renting for a short while before you buy another house, because then you'll be debt free and in a position to think clearly about what you can afford. With your income, it shouldn't take you long at all to clear the last $30K of debt. I would just hate to see you get close to being debt free, then buying a new house and having your self-employed income temporarily dip down to the point where you are in trouble again. If you can clear the debt, build up an emergency fund, and build up a good down payment before buying again, you might find yourself in a better position to buy and stay debt free except for your mortgage.

federal tax debt

It sure is easy to get in trouble with taxes as a self-employed person, isn't it? Make sure that you have learned what went wrong, and you've corrected what needs to be corrected, so you don't end up owing money to the government again. A good accountant is worth the expense.
Answer: Having just gone through the fun of buying a house, I would be cautious of selling your house to get out of your debt.  You are going to spend something on the broker's fees (I think our seller paid 7%, but another source I see says 6%, so let's go with the lower amount).  6% of your house is $17,400, not an insignificant amount when, assuming you get full price for it, you would be earning 70k before that fee (it's around 25% of what you'd make off the house).  Not ideal, and that's not considering other fees and things that will come up when selling the house.  I don't think this is the "magic bullet" for you.
The first thing you should do is make a spreadsheet that lists all your debts (similar to the list you made here, but include the interest rates, and calculate how much interest per month you are adding for visualization (debt owed * yearly interest rate / 12 for simplicity)).  This will let you get a clear idea of where the money needs to go.  The second step is to make a budget, and figure out what money you have to pay the debts (cutting as close to the bone on your budget as possible, since you have a lot of debt).
Once you have that information, start paying your highest interest adding debts first.  This will have the biggest impact in the long run.  This also gives you a priority list for renegotiating or eliminating the debts.
The first thing I would do is get rid of that car.  Get a nice used car that is reliable, but has already depreciated some.  You can most likely roll the difference between what you owe on your current car and its value into that car loan.  Pay cash if you can, but if you can't, don't worry too much about it, just make sure to update your debt spreadsheet and recalculate everything.
Next, I'd try to work towards an Offer in Compromise with the IRS (what form your tax debt takes may impact your eligibility). This may make it possible to reduce what you owe them, which will help.
I would also take a second mortgage/equity loan out on the house to pay down the higher interest debts, provided you get a lower rate for it.  Houses are GREAT for this, because they tend to retain their value and allow you to have lower interest rates.  That Credit Card debt is probably the highest interest bearing and needs to be gotten rid of as soon as possible.
Bankruptcy is also always an option, but since you owe so much to the IRS, I doubt it will help.


How to officially record a loan against my house deed (so the lender is guaranteed a repayment from the collateral)?

Question: I am going to receive a loan from my friend so that I can pay off my mortgage and some other debts.  I want to officially record the loan so that my friend is legally protected and guaranteed to be repaid from the equity of the house.  How do I record this kind of thing?
Comment: **WHY** are you doing this?
Comment: @paulj the forgiven interest payments would be a gift.  Almost certainly that would be less than $14K, and so unreported.
Comment: @DStanley that doesn't answer why his friend is loaning him the money when he already has a mortgage.
Comment: Ah OK I see what you mean now.
Comment: If your friend is not charging interest, or below market interest rate, this could be considered a gift.
Answer: You're replacing one loan secured by your house (aka "mortgage") with a different loan secured by your house (aka "mortgage").
You and your friend must write out an official loan contract (amount, interest rate, years, monthly payment, ability to pay early, fees -- if any -- for early payment, and description of the property).  Both must sign it in front of witnesses and then file it with the county where your property is located.
Whatever you do... no matter your financial circumstances, pay that note on time every month!!!
Comment: Agree with all of this, except that the "file it with the county" is US-centric and we don't know where the OP is. In the UK I think you'd file this with the land registry buyer I'm not sure. If the OP could update the post with a location I'm sure someone could clarify.


How can I delete duplicate albums from my photo library?

Question: Since I updated to iOS 5 I have 4 photo albums in the Photo App. Camera Roll, Photo Stream, Photo Library & iPhone.  Photo Library & iPhone are identical. How do I delete one or the other?
Answer: Camera Roll, Photo Stream and Photo Library are system albums and cannot be deleted. (Photo Library is a smart album and displays all your photos, regardless of where they actually are).
Your photos are probably only in the iPhone album, if you delete it, they're probably gone. However to delete it hit the "Edit" button, then the little red minus in front of the album you want to delete.
If you added the album to your phone by syncing it from your computer, you won't be able to remove it from the phone. In that case connect your phone to iTunes select the photos tab and uncheck the album you want to remove.
Comment: thnx. i'll try that
Answer: This worked for me after having the same issue after upgrading to iOS 6 from iOS 5 where photos were showing up twice in the Photo Library. Note that this was on a PC, not a Mac:

Moved all files in the My Pictures folder to the Recycle Bin.
Synced all picture folders with the iPhone using iTunes.
Unselected Sync Photos in iTunes and said yes to "Remove all synced pictures from iPhone?"
Restored all pictures from the Recycle Bin to the My Pictures folder.
Selected Sync Photos from My Pictures in iTunes and synced iPhone.

Now all photos show up only once in the Photo Library.  Note as stated above, the Photo Library is a system folder that provides a consolidated view of all pictures stored in the seperate folders.
Answer: That's how I do it:

On my PC desktop, I right clicked and created a new folder. I named it "Empty folder".
I plugged in my phone to computer, opened iTunes.
Clicked on my phone on the left
Clicked on "photos" on the top
Clicked the box "Sync Photos with"
Choose the dropdown and "choose folder"
Click "desktop" option
Click on the folder that you created and named whatever you named it.
Click "apply/sync"
After it finishes, it will have cleared the old cache completely.

Now you can go back and sync the folders you want and it will ONLY have those photos.
Comment: How does this solve the problem described in the question?


Onion weed and soil sourness

Question: Over the years I have had an ongoing battle with onion weed in my small front garden. I have poisoned and I have carefully dug out every bulb by hand (took forever), but to no avail. I tried using a weed mat, which worked for a while, but eventually the weeds made it through. I have a piece of old carpet which would cover the area, and I thought that if I put the carpet down, and then put gravel on top, that might work, but someone told me that it would make the soil go sour. I also thought about that black thick plastic you can get in Bunnings. Can you tell me if carpet or plastic would be a problem?
Answer: @June welcome to the group!  Black plastic is something I have use and it works to control weeds.  It basically stops light from going through and hence prevents unwanted growth.  Make sure you cover the black plastic with tan bark so it says on the ground securely.
Comment: Does anyone know if either (or both) the carpet and the plastic would cause sour soil?
Comment: Old 100% wool carpet is commonly used as a weed mat at the bottom of a no dig garden  pile.

Onion weed and soil sourness


Save Podcast on iPhone without Downloading

Question: I've been using the Podcasts app and I'd like to be able to mark in some way the episodes that I really like. I was saving them but I realized that they get downloaded if I do that, which causes space issues.
Is there a way to save a podcast without actually downloading it? I'm open to other apps that are a reasonable replacement and can achieve what I'm trying to do here.
Answer: You could mark as unplayed but there doesn't appear to be anything like the heart in Music.


How to remove the bottom panel of Gnome Classic in Unity?

Question: I switched to Unity environment and there is a bottom panel of Gnome Classic that is not natural of the proper Unity. How to remove it?
Answer: You are probably running gnome-panel.  Check with:
ps -ef | grep panel

and you can see its process ID in second column.  For instance, a running panel for me shows like:
john      2324  2191  0 07:09 ?        00:01:11 /usr/lib/unity/unity-panel-service
john     15587 15557  0 14:18 pts/25   00:00:00 gnome-panel
john     15607 15557  0 14:20 pts/25   00:00:00 grep panel

You'll want to keep unit-panel-service.  Kill gnome-panel using its PID.  For me it goes away with:
kill -9 15587

Where the -9 forces the kill, but is maybe not necessary for this case.


Suspension of a topological space

Question: Let $X$ be a topological space such that its suspension is a topological manifold. Can we prove that $X$ itself is a topological manifold?
Answer: It's not true. The Poincare sphere $P$ is a manifold, and its suspension is not. But its double suspension is homeomorphic to $S^5$ by Cannon's "Double Suspension Theorem".  I learned about this from Mark Grant in an answer to a different question of mine on MO.
Answer: As Jeff Strom said, the answer is no. For references to Cannon-Edwards theorem, see https://mathoverflow.net/a/316175/121665.
Comment: Another related MO question is [Is a map a homotopy equivalence if its supension is so?](https://mathoverflow.net/a/46939).

Suspension of a topological space


Being a monomorphism described as a universal property

Question: Is it possible to describe the property "being a monomorphism" as a universal property (with appropriate category/ies and functor)?
Answer: Well, it really depends on what you mean by "described as a universal property". Maybe you find this description acceptable:

A morphism $f : A \to B$ is a monomorphism if and only if the diagram
$$\begin{array}{rcl}
A & \overset{\textrm{id}}{\rightarrow} & A \\
{\scriptstyle \textrm{id}} \downarrow & & \downarrow {\scriptstyle f} \\
A & \underset{f}{\rightarrow} & B
\end{array}$$
is a pullback square.
Indeed, suppose $g, h : X \to A$ are morphisms such that $f \circ g = f \circ h$; if the diagram is a pullback, then there is a unique $k : X \to A$ such that $g = h = k$, and so $f$ is a monomorphism; and if $f$ is a monomorphism then $g = h$ so there indeed a unique morphism completing the obvious diagram.

This description is certainly useful. For example, it implies:

Any functor that preserves pullbacks (or even just kernel pairs) also preserves monomorphisms. In particular, right adjoints preserve monomorphisms.
Any functor that reflects pullbacks (or kernel pairs) and isomorphisms must also reflect monomorphisms. In particular, monadic functors reflect monomorphisms.

Or perhaps you would prefer something in terms of hom-sets:

A morphism $f : A \to B$ in a (locally small) category is a monomorphism if and only if $f_* : \textrm{Hom}(X, A) \to \textrm{Hom}(X, B)$ is injective for all $X$.

If you think about it, this is just the definition of 'monomorphism'. Amusingly this can be derived in a roundabout way by noting that $\textrm{Hom}(X, -)$ is a functor that preserves pullbacks, and the collection of all such functors jointly reflects pullbacks and isomorphisms.
Comment: Thank you Zhen Lin, I was aware of these descriptions, but I was hoping to get something along the lines of the general definition of universal arrow (as initial/terminal object in an appropriate slice category, given an appropriate functor).
Comment: There's no such definition that isn't tautological. For example, I could say that $f$ is a monomorphism if and only if it is equal to its own image... but the image of a morphism is defined to be the smallest monomorphism through which it factors.


Supremum and infimum of $\{x, y \ge 1 : \frac{xy}{3x + 2y + 1}\}$

Question: How to find supremum and infimum of $\{x, y \ge 1 : \frac{xy}{3x + 2y + 1}\}$? I suspect that $\frac{1}{6}$ is infimum and supremum does not exist, but I dont know how to prove it using only the definition of sup/inf.
Answer: Observe it as $$f(x):= \frac{xy}{3x + 2y + 1}$$ with parameter $y$. It is easy to see that $f$ is increasing for $x\geq 0$ (draw a graph). So $$f(x) \geq f(1)= {y\over 2y+4} =: g(y)$$
But $g$ is also increasing for $y> -2$ so $$g(y) \geq g(1) ={1\over 6}$$ So this infimum is actualy minumum.
Comment: @user376343 I see this is pointless conversation. Just follow the unstructions I wrote.


malleability of the Elgamal cryptosystem

Question: In bidding for a contract, a company might outbid its competitor by simply multiplying its rival company's encrypted bid by 0.9, without even knowing the bid. Now Suppose we are given the ciphertext c = (c 1 , c 2 ) of some unknown message m, where c 1 ≡ g k (mod p)
for some unknown random integer k ∈ Z p−1 and c 2 ≡ m · h k (mod p), where h is the public key of some unknown private key x, in the Elgamal cryptosystem. Let m 0 be a message that you know. Can you obtain a valid ciphertext of the message m.m' without knowing m?
How can I solve this problem?
Answer: Sounds a bit like coursework. (:
Some ideas to get you started:

Are you aware of how a ciphertext $C = (c_1, c_2)$ is constructed? That is, can you state $c_1$ and $c_2$ in terms of the message $m$, and the key pair $x, y$?
Can you then state what form a ciphertext would have to have, in order to be a valid encryption of $m \cdot m'$?
Once done, can you figure out how to construct such a ciphertext when you're given a valid ciphertext for $m$?


javafx in browser

Question: I've created a simple application from the JavaFX tutorial using netbeans and it works. But when I open the html file it says that I need to install the JavaFX in order to view the content of the page, though it is already installed which is proved by downloading JavaFX from the suggested link and trying to install it again: it writes "The same version of JavaFX is already installed". What's the problem?
Comment: Maybe the JVM of your browser is different from the netbeans JVM
Comment: The latest version is selected 1.7.0
Comment: I've had the same problem with Chrome 17.0.963.46 and JavaFX 2.0.2. JavaFX is definitely installed on my machine.
Answer: I had the same problem and just installed the 32-bit version of JavaFX. Now I can open the HTML file on Firefox, Chrome and Internet Explorer.
Answer: Like Mikera- Chrome doesn't like Javafx, if you got this to work please let the world know. I have heard that re installing Chrome after javafx is installed can work , but I've tried this and it didn't work. I also know that on my Chrome install I can run normal Java Applets, you can check your install  here on the java website
Also in Wwindows you might need to make sure the Mozilla Family check box is checked in the Java Control Panel -> Advanced -> Default Browser for Java...
In Linux this meant I had to simple create a symbolic link from my Java install  bin folder to the a Mozilla Plugin folder...
in chrome you can check the "chrome://plugins/" to see if Java Plugin is recognized....
If you have Internet Explorer installed run it in that, even if just to check, it seems to be the most compatible with JavaFX from what I have used it for

javafx in browser


Why did Pharaoh only order the murder of boys?

Question: In parashat shemote, Pharaoh explicitly commands the midwives to allow the females to live (וְאִם-בַּת הִוא וָחָיָה). What are the traditional commentaries explaining the order to allow the girls to survive?
Answer: Rashi to Exodus (1:16) quotes a Midrash that the Pharaoh decreed to specifically kill males since his astrologers predicted that a male would save the Jews. This Midrash is pretty old, and is present in Josephus' Antiquities of the Jews (2:9:2).
Hizkuni (1:16) and Hadar Z'kenim (1:22) suggest that Pharaoh was worried that males in particular would do battle against him.
The Midrash Exodus Rabba (1:18) explains that the Egyptians wanted to keep the girls to marry, since they were lustful.
Comment: **Pharaoh decreed to specifically kill males since his astrologers predicted that a male would save the Jews.** Don't they ever learn that no matter what you do, astrologer's predictions will always come true?
Comment: @Shmuel classical trope in Greek literature.
Answer: Commentaries available here:
Rashi (verse 16) - Pharaoh's stargazers had told him that a boy who would lead the Jews out of Egypt was being born.
Chizkuni (verse 16) - men were generally those involved in warfare, and Pharaoh was worried about the Jews joining in a war against Egypt. Note that in verse 22, he adopts the "Rashi approach", based on the context of killing all males, even Egyptians.
Ralbag (verse 22) - they assumed they could just marry the women and assimilate them (See Netziv)
Comment: Does this mean there is an authentic and true knowledge of astrology (somewhere in the world) that is actually reliable or did those wizards just happen to get something true by chance?
Answer: Why did Pharoah order the killing of only the Hebrew boys? It apparently was to be an act of genocide with multiple purpose:

Of terminating all Hebrew all lineages, both by nullify and interbreeding its genetic heritage, and
In the latter aspect, of usurping and taking inheritance of whatever Godly endowment of which the Hebrews had been observed, rumored, or purported to have been bestowed; a kidnapping by one almighty of a feared and yet admired, alien god, so to speak.
Comment: Welcome to  Mi Yodeya, and thank you for your answer!  Consider adding sources to your answers, so as to allow others to look up the solutions you offered.
Answer: Chatam Sofer: Pharao did want the Hebrews as useful servants for his construction work, and therefore he wanted strong servant women, so that he can marry of to Egyptians and let them give birth to strong servants. (The name "Shifra" is explained as expert in making a strong baby after delivery, and Pharao wanted this "strengthening" for the women.)
Also, the women wanted to resist this plan of the Pharao, since they wanted to have Jewish husbands only. Therefore, they were "making themselves ugly", appearing as if, in the eyes of the Egyptians, and also Hashem helped them in this respect (היו כקוצים בעיניהם).
This is why Pharao told the midwives to "make the girls live": see that they should look better and be more attractive in the eyes of the Egyptians.


Windows analog of _NET_WM_USER_TIME

Question: Is there an analog of <code>_NET_WM_USER_TIME</code> property in Win32 or other way to get list of windows sorted by last used time?
Answer: There's the EnumWindows call, which lists all of the windows on-screen at any given time:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms633497(v=vs.85).aspx
Secondly, GetActiveWindow will give you the top-level window currently active, and GetFocus the window with input focus:
How can I tell if a Window has focus? (Win32 API)
There's no way to get a list of focus history from the Win32 API - it's a pretty niche bit of information! - but you can run a process on a background thread which periodically iterates through the results of EnumWindows, compares the handle to GetActiveWindow and stores a log over time of windows and focus statuses. That way, you'll be able to interrogate your very own log whenever you want without additional overhead.
I used to do much the same thing from Visual Basic back in the pre .NET days, but the same should be perfectly possible from any other environment which can get to the Win32 API.

Windows analog of _NET_WM_USER_TIME


Running a server-side executable

Question: I'm making a prototype webserver that needs to be able to run an executable on the server side.  How do I get this to work?  Do I need to set some permissions on the executable/directory?  I'm stuck building this on a Windows XP machine with IIS 5.0.
Answer: You might be able to use Windows PowerShell. It has an XP version which can be used to script what you need to do.
Answer: You could use classic ASP, and "shell" out to run the executable.
(There are a myriad better ways, but ASP is built into IIS and may do what you want.)

Running a server-side executable


Learning Songs on Guitar

Question: What do you play as a guitarist on a song that doesn't have guitars in the original recording, if you're playing with a band and the parts from the original recording are already played by someone else?
Comment: Is it for a sole guitarist,? Are there  rhythm and lead guitarists? Is there a keyboard in the band? What sort of music is it? All these will have a bearing on the answer.
Answer: There's no hard & fast rule. Options include...

Work with one of the other players to 'share' a part; whether by 'time' or by 'part within the arrangement'.
Make something up that works even though it wasn't in the original.
Sit this one out.

The longer a band plays together or the better the players, the easier it is to make 1. work.
Anecdotally; I worked with a couple of guitarists who would only need one run-through to figure out what each of them would be doing. They never discussed it, they just felt it through & stayed out of each other's way. The keyboard player was similar. Between them, they worked every part of the arrangement out without doubling or clashing, or even speaking about it. It was a wonder to behold sometimes.
I was drums/vox & musical director for that band - I never had such an easy time of it ;)
Answer: You and your band mates are in a great position to explore the art of arranging songs.
The approach depends on the goal of the band.  Are you trying to play a cover exactly as recorded, or develop a new and unique version of the tune?  An example may be a bluegrass version of the dance hit "What is Love (Baby Don't Hurt Me...)".  If this is the case the only real "rule" if you can call it that is support the song.  Everyone needs to be on the same page with sound, key, tone, style.  It can be tough for two strong rhythm section players to complement each other.  In a jazz orchestra the guitar and piano can both comp chord progressions and that is the most likely situation to cause clashing if the players aren't reading each other.  Without knowing a specific song I'd guess there is a keyboard playing chords.  If you have a keyboard in the band get the chords and work out some complementary way to play the same changes.  The simplest choice would be to double the same chords and rhythm as the keyboard is playing but that isn't really interesting.  Back in the 80s keyboards would appear in a small percentage of Metal songs and we had a keyboard player in our band who would sit out until he was needed.  So, in some cases, not playing is an option.
Comment: It shouldn't be tough for strong rhythm section players to complement each other. If they're good, they'll work *with* each other as a team, or at least part of one. True about sitting out. Otherwise every number starts to sound the same. It's not easy to change sounds drastically, unless you're the keys player.
Comment: I still think a bluegrass version of What is Love would be great.

Learning Songs on Guitar


Ajax cross-sub-domain requests?

Question: Is there a way to make an Ajax request to
s3-ap-southeast-1.s3.amazonaws.com (to S3 API)
from
s3.amazonaws.com
(from where a JavaScript app that is hosted at)?
Answer: You cannot do cross-domain ajax requests. That includes subdomains. However, it is possible to use JSONP.
Answer: yes, you can cross domain ajax calls, check cross-origin resource sharing:
http://en.wikipedia.org/wiki/Cross-Origin_Resource_Sharing
Answer: Cross domain ajax requests are forbidden by protocol. And yes, subdomains too.
Read here: http://www.ajax-cross-domain.com/ It might help;
Answer: I know this is an old post, I provided a detailed example for cross domain ajax request using JSONP, hopefully it helps those who is in trouble:
http://www.shanison.com/2012/05/11/cross-domain-ajax-request/
Answer: shazmo said this in a earlier post:

Cross domain is entirely a different
  subject. But cross sub-domain is
  relatively easy.
More info here:
  http://www.tomhoppe.com/index.php/2008/03/cross-sub-domain-javascript-ajax-iframe-etc/
Answer: Shameless plug, but this may help:
http://alexn.org/blog/2011/03/24/cross-domain-requests.html
Answer: I guess I found the link that  @Patrick had posted and it had become broken
http://hoppeweb.blogspot.com/2008/03/cross-sub-domain-javascript-ajax-iframe.html
to avoid happening this again I will just try to re-post it)
The idea is setting up an iframe html on one domain and then calling that iframe from the page on the other subdomain. Both parent page and the iframe inside it should have the same document.domain.
document.domain = "example.com"

once done, those two pages act like they are on the same domain.
the rest, just copy-pasted ((

For example, for pulling in text, setup your page on
  www.yourdomain.com and set document.domain to yourdomain.com. If you
  are trying to pull in an html page using Ajax from img.yourdomain.com,
  setup a page that, will become the iframe, to do the ajax pull. After
  that pull is complete set the document.domain to yourdomain.com. In
  your page on www. create an iframe which has the src set to your page
  on img. Since document.domain is set, any functions on the parent page
  are available to be called via the iframe. Lets say you want to put
  your newly "ajaxed" html into a div on the parent page, you can do
  that via "parent.getElementById('yourDivName').innerHTML =
  Response.Text".
If you are pulling in XML, you can setup the page/iframe relationship
  the same as above. That iframe will make the ajax call to the XML on
  img.yourdomain.com and do something with it, lets say turn it into an
  array. Once that is completed, set the document.domain on the iframe
  page. At this point, the parent page can access that array on its
  iframe via "iframeName.arrayName". Alternatively you can have an array
  read on the parent page for this information and pass it to the parent
  from the iframe via "parent.arrayName = iframeArray".

originally by @Tom Hoppe

Ajax cross-sub-domain requests?


How can Rpi3 communicate with the HART GTD2000 Gas Sensor?

Question: I have a GTD2000-Tx fixed gas sensor with an output of 4-20mA DC. How do I connect it directly to a raspberry pi 3? The power supply is 24 volts and is supplied externally.
Comment: Could you explain what you have tried so far?
Answer: Short answer is "you can't" as the 4-20mA current loop is an analogue signal and the Pi does not have any direct analogue inputs. You can, however, add a device called an Analogue to Digital Converter (ADC) to your Pi that will let you then take analogue measurements.
Typically you'd "drop" the current loop output of you sensor across a 100 or 120 Ohm resistor and measure the voltage generated (V=I×R) with the ADC.

simulate this circuit – Schematic created using CircuitLab
Sometimes the sensor you're using is "loop powered", in which case you'd need to supply voltage in to one end of the loop and measure the output on the return path using your small resistor.

simulate this circuit


Find similar ASCII character in Unicode

Question: Does someone know a easy way to find characters in Unicode that are similar to ASCII characters. An example is the "CYRILLIC SMALL LETTER DZE (ѕ)". I'd like to do a search and replace for similar characters. By similar I mean human readable. You can't see a difference by looking at it.
Answer: As noted by other commenters, Unicode normalisation ("compatibilty characters") isn't going to help you here as you aren't looking for official equivalences but for similarities in glyphs (letter shapes). (The linked Unicode Technical Report is still worth reading, though, as it is extremely well written.)
If I were you, to spare you the tedious work of assembling a list of characters yourself, I'd search for resources on homograph attacks: This is a method of maliciously misleading web users by displaying URLs containing domain names in which some letters have been replaced with visually similar letters. Another Unicode Technical Report, on security, contains a section on the problem. There is also -- and that may be what you most need -- a "confusables" table. Here's another article with mainly punctuation marks, some of which ASCII, that have visually similar counterparts in the non-ASCII code tables.
What I do hope is that you aren't asking the question to construct such an attack.
Comment: Thanks for all the good links and explanations. I actually try to protect against such attacks. :-) And I guess I will find some further stuff with the keyword "homograph attack".
Comment: That is good to hear :) . Yeah, that's the keyword you need! I edited a link (it pointed to an obsolete version).
Comment: A legitimate use: for internationalization testing, I have a tool that generates fake foreign language text using similar-looking characters. An english-speaking tester can read the "foreign" text, but they can also clearly tell that it is not hard-coded English. Although it doesn't work if the unicode character is so similar that you can't tell the difference. I mainly do things like add accents to the vowels.
Comment: I'm using this to make an ircbot which does not highlight anyone if it mentions somebody in a channel :)
Answer: See the Unicode Database: http://www.unicode.org/Public/UNIDATA/UnicodeData.txt.
Each line describes a unicode caharacter, for example:
1E9A;LATIN SMALL LETTER A WITH RIGHT HALF RING;Ll;0;L;<compat> 0061 02BE;;;;N;;;;;

If there's any similar (compatible) characters for that symbol, it will appear in the <compat> field of the entry. In this example, 0061 (ASCII a) is compatible to the LATIN SMALL LETTER A WITH RIGHT HALF RING Unicode character.
As for your character, the entry is
0455;CYRILLIC SMALL LETTER DZE;Ll;0;L;;;;;N;;;0405;;0405

which, as you can see, does not specify a compatibility character.
Comment: The compatibility field describes a sequence of characters that'd mean the same thing as the character in question.  In your example, the compatible sequence would be `U+0061` (the letter 'a') followed by `U+02BE` (the 'right half ring' modifier).  For characters from different alphabets, it'd be pretty unusual for there to be compatibility sequences -- and that'd make what the OP is trying to do impossible without more info.
Comment: The OP stated 'similar to ASCII characters', not exact. If you're looking for an 'a' with a right half ring, you could settle for an ASCII 'a' if there's nothing else available.
Comment: Agreed -- in that case.  But if you're looking for an ASCII char similar to a Cyrillic ѕ, which is the very example the OP used, that won't work.
Comment: @cHao: You're right - as I stated in my answer, for the specific character the OP requested, the compatibility characters aren't a useful method.

Find similar ASCII character in Unicode