Ubuntu ARM lacking /sys/devices/cape-bone-iio

Question: I'm trying to pull analog input from a beaglebone black using this tutorial. However when I go to /sys/devices there is no cape-bone-iio. I have spoken with several other programmers and one of them suggested that the cape-bone does not work with the newer versions of Linux. However downgrading could have negative impact on the rest of the project. Is there any other solution?
Answer: I believe I encountered the exact same problem that you are encountering. The short/easy fix is downgrade your kernel. The newer kernel version (later than  3.8.x) for UbuntuARM does not use device tree overlays and stores all of these ADC values in god knows where.
You'll also notice that your tutorial is indeed using kernel 3.8.13. One that still involves device tree overlays and stores ADC values in the cape-bone-iio.
While it might not be exactly what you want, on my github I have a step by step approach to getting ADC values (as part of using ROS) on the BBB. This includes how to downgrade your kernel and enable Device Tree Overlays and then where the file locations for these values will be. I would recommend taking a look at it for some guidance towards your specific solution.
My Github
The steps for accomplishing this are directly on this page. I cannot post them directly due to a lack of reputation and the number of links the guide entails.
Another helpful hint, would be to specifically search for the name Robert C Nelson alongside Beaglebone Black. He has worked extensively with them and is involved in a multitude of blogs and tutorials that might help you find your solution.
Hope all of this helps.
Answer: I found the files for the analog inputs on the Beaglebone Black here:
/sys/devices/platform/ocp/44e0d000.tscadc/TI-am335x-adc.0.auto/iio:device0/in_voltage#_raw
(where # is the pin number, 0 through 7)
Didn't downgrade my kernel. No enabling or setup needed. Those files are just continuously populated with the voltage readings from those pins. Values are 12 bit (0 to 4095, which corresponds to 0.0 volts to 1.8 volts).
Or at least this is how my Beaglebone Black works.


History of actions that occured on a table in SQL Server

Question: I am running a shell script that runs insert, update, delete queries on a table in an SQL Server DB. Is there a way to get a history of all transactions that happened on the table to validate that they occurred as expected. That is the number of updates, inserts and deletes that happened. And any errors that could have occurred.
Comment: Your goal is not clear. Does "number of updates" mean the actual number of update **statements** executed or the number of rows affect by update statements. I suspect that this goal may not end with any useful information. As example, say your code deletes all rows in a table that are prior to the first of the current month when run. How will you validate? Does "1 delete successful" or "356 rows deleted" have a useful meaning?
Comment: number of rows affected is more useful
Answer: Here's some out-of-the-box features of SQL Server that can help you accomplish your goal. You'll need to proactively enable / set one of them up before they collect the data you need.
For reference:

Triggers - Fire whenever data changes in a table, can implement logic similar to being in the context of a stored procedure.

Temporal Tables - System versioned copies of the user defined tables that track changes.

Change Tracking - Automated tracking of changes for your user defined tables.

Change Data Capture - Keeps track of DML changes to the specified user defined tables.

Audit - Automatically tracks a multitude of actions at the server level.
Answer: First of all I should mention that if transaction is applied, you may expect correct result. It is C in ACID.
Maybe transaction log is the feature that you are looking for. Please find a quick guide how to interact with it here.
Answer: You can try enabling tracing:
INSERT, UPDATE, DELETE operations will be saved in the file. I note that a lot of things that you don't need will be saved in the file. This is, after all, a diognastic tool.
Please note that the MSSQL user must have write access to this directory (C:\Temp\SampleTrace)
<code>DECLARE @RC int, @TraceID int, @on BIT
EXEC @rc = sp_trace_create @TraceID output, 0, N'C:\Temp\SampleTrace'

-- Select the return code to see if the trace creation was successful.
SELECT RC = @RC, TraceID = @TraceID

-- Set the events and data columns you need to capture.
SELECT @on = 1

-- 10 is RPC:Completed event. 1 is TextData column.
EXEC sp_trace_setevent @TraceID, 10, 1, @on
-- 13 is SQL:BatchStarting, 11 is LoginName
EXEC sp_trace_setevent @TraceID, 13, 11, @on
-- 13 is SQL:BatchStarting, 14 is StartTime
EXEC sp_trace_setevent @TraceID, 13, 14, @on
-- 12 is SQL:BatchCompleted, 15 is EndTime
EXEC sp_trace_setevent @TraceID, 12, 15, @on
-- 13 is SQL:BatchStarting, 1 is TextData
EXEC sp_trace_setevent @TraceID, 13, 1, @on

-- Set any filter. Not provided in this example
--EXEC sp_trace_setfilter 1, 10, 0, 6, N'%Profiler%'

-- Start Trace (status 1 = start)
EXEC @RC = sp_trace_setstatus @TraceID, 1
GO
</code>


What conditions do I need on a functional such that Euler Lagrange is consistent with boundary condition?

Question: Suppose we have a functional integral  between some end points and in order to find the function which optimizes it, I apply the Euler-Lagrange to the integrand. What I receive is a differential equation which I can put in the initial or final condition into. The doubt I have is, what conditions are required on the functional equation such that the curve I get in the end is consistent with both boundary condition?
Comment: The derivation of the Euler-Lagrange equation assumes Dirichlet boundary conditions.
Comment: what does that mean in English o_o
Comment: Ok I see, that regularity thing I said is there is assumed
Comment: It means boundary conditions of the form $y(a)=y_a,y(b)=y_b$. (I'm a little surprised you know anything about calculus of variations but have never heard of Dirichlet boundary conditions.)
Comment: My knowledge is basically from a physics context. Maybe I did hear of it before, but it didn't really click stick to me. @Ian
Answer: It seems OP is putting the cart before the horse. One cannot derive$^1$ the Euler-Lagrange (EL) equations without assuming appropriate boundary conditions (BCs) in the first place.
For a first-order Lagrangian, there are the following possible BCs:

Essential/Dirichlet BCs,

Natural BCs,

Combinations thereof,

cf. e.g. my Math.SE answer here.
--
$^1$ Of course one can always write down the EL equations, but without appropriate BCs, there is no guarantee that the EL equations are relevant for the variational problem at hand.


capturing echo into a variable

Question: I am calling functions using dynamic function names (something like this)
$unsafeFunctionName = $_POST['function_name'];
$safeFunctionName   = safe($unsafeFunctionName); // custom safe() function

Then I am wanting to wrap some xml around the returned value of the function (something like this):
// xml header etc already created
$result = "<return_value>" . $safeFunctionName() . "</return_value>";

Problem is, sometimes the function returns a value, but sometimes, the function echo's a value. What I want to do is capture that echo into a variable, but, the code I write would need to work either way (meaning, if function returns a value, or echo's a string).
Not quite sure where to start ~ any ideas?
Answer: Let me preface this by saying:
Be careful with that custom function calling business. I am assuming you know how dangerous this can be which is why you're cleaning it somehow.
Past that, what you want is known as output buffering:
function hello() {
    print "Hello World";
}
ob_start();
hello();
$output = ob_get_clean();
print "--" . $output . "--";

(I added the dashes to show it's not being printed at first)
The above will output --Hello World--
Comment: Just a minor point, do you know about the ob_get_clean method?
Answer: PHP: ob_get_contents
ob_start(); //Start output buffer
echo "abc123";
$output = ob_get_contents(); //Grab output
ob_end_clean(); //Discard output buffer

Answer: In order to use the output value, if present, or the return value if not, you could simply modify your code like this:
ob_start();
$return_val = $safeFunctionName();
$echo_val = ob_get_clean();
$result = "<return_value>" . (strlen($echo_val) ? $echo_val : $return_val) . "</return_value>";

capturing echo into a variable


pin request at the startup lock screen

Question: I was trying to set up a VPN connection and it asked me about medium and high level security and a password which I didn't understand well! I failed to use VPN but now each time I try to unlock the phone, it asks for that password/pin. I removed the created VPN connection to get rid of it but to no avail. How can I remove this pin request?
Answer: Go to Settings -> Security -> Screen lock, enter the PIN once more and select Slide (or what ever you had before).
Answer: If none of the other posted methods work, try the following solution, which solved this problem for me.
Open Settings and then navigate to More and then Security and tap Clear Credentials. After that you can navigate to My Device and then Lock Screen where you can change the screen lock to whatever you desire.
I'm not sure what other credentials it clears besides the screen lock but I haven't found anything so far.
I've tested this on a Samsung Galaxy S4 running Android 5.0.1. The exact locations and names of different settings may be located in different places depending on your device.
Hope this helps.
Answer: I had the exact problem for my galaxy note 2. I fixed it by following these steps:

Go to settings from the menu button on the home screen.
click "my device".
click "lock screen".
click "screen lock".
enter your passcode.
click whichever security setting you used before.

pin request at the startup lock screen


Overstayed in USA

Question: I was supposed to return to Canada on April 2, 2017. I was in a motorcycle accident during my stay in the United States and was unable to return until the 29th of May 2017. Will I be able to return to the USA in 6 months as planned or will I be banned for a period of time?
Comment: Less than 180 days no ban.
Comment: @ZachLipton The question they asked is fully answered. `Will I be able to return to the USA in 6 months as planned or will I be banned for a period of time?` The question is not about whether it will be easy or not. Let's keep it simple.
Comment: @Phantom most Canadian citizens do not automatically accrue illegal presence. Vanessa: are you a Canadian citizen? When did you enter the US?
Comment: I don't think the answer is nearly as simple as a flat out yes. There's no automatic ban, but an overstay of nearly two months combined with spending significant amounts of time in the US (presumably ~8 months already if she's a Canadian citizen, and another trip planned in 6 months) could easily lead to problems at the border.
Answer: Anyone of any nationality on any visa who overstays less than 180 days has no ban. It's that simple. So yes you will be able to enter the USA if you qualify, either via a visa or otherwise.
Overstay of Less Than 180 Days

If your overstay in the United States was for less than six months
  (180 days), then you are not legally inadmissible in the future.
  You can be granted another visa, or even a U.S. green card (lawful
  permanent residence). However, if you are applying for a temporary
  (nonimmigrant) visa, and it's one of the many that requires you to
  convince the U.S. consular official that you will leave the United
  States when your permitted stay is over, you may have a tough time
  making this showing if and when the consular officer becomes aware of
  your past overstay.

So we don't even need to know your nationality or what visa type you brought into the country or whether it was VWP or even if you simply sneaked in over the border without a visa and passport, you overstayed less than 180 days so NO BAN.
Of course it doesn't mean you will be allowed in next time, that's for the border immigration officer to decide.
Comment: We don't know the details, but, I believe, not being able to return due to being in hospital following a road accident may be considered an exceptional circumstance.
Comment: This answer needs severe correction: "So yes you will be able to enter the USA if you" -- if you *deal with the consequences of your overstay before you leave*.
Answer: The answer is complicated: while there is no ban you might need to get a visa or a waiver.
Unless you are Canadian, you will need a visa. If you are Canadian and do not have an I-94 record (paper issued if crossed on land, electronic for air and sea) then you are all good. If you are Canadian and were given an I-94 / stamp in passport with a date then you need a waiver.
Breaking it down:

If you were entering on ESTA then an overstay makes you lose your ESTA privileges for life and you must get a visa.   https://cz.usembassy.gov/visas/denied-entry/

If you have overstayed on the Visa Waiver program (VWP) or violated the terms of a previously issued U.S. visa, you will be refused entry to the United States unless you apply for a visa with full details of your overstay prior to subsequent entry. Violating the terms of the Visa Waiver Program or previously issued U.S. visa can render an individual ineligible for a visa and a waiver of this ineligibility may be required.

If you were entering on a visa then that visa is cancelled and so you need a new one. https://travel.state.gov/content/visas/en/general/visa-expiration-date.html

If you overstay the end date of your authorized stay, as provided by the CBP officer at a port-of-entry, or United States Citizenship and Immigration Services (USCIS), your visa will automatically void or cancel unless;
You have filed an application in a timely manner for an extension of stay or a change of status;
  That application is pending and not frivolous;

Canadians are a complicated case. Let's turn to 40.9 Section 212(a)(9) of the Act - Aliens Unlawfully Present after Previous Immigration Violations:

Non-controlled Nonimmigrants (e.g. Canadian B-1/B-2)
Nonimmigrants, who are not issued a Form I-94 , Arrival/Departure Record, are treated as nonimmigrants admitted for D/S for purposes of determining unlawful presence.

What does that mean? It means that Canadian visitors who are not issued an I-94 are admitted for Duration of Status (similar to F-1 student visas) and then this section applies:

Under current USCIS policy, nonimmigrants begin to accrue unlawful presence as follows: [...]
Nonimmigrants Admitted for Duration of Status (D/S):
If USCIS finds a nonimmigrant status violation while adjudicating a request for an immigration benefit, unlawful presence will begin to accrue on the day after the request is denied.
If an immigration judge makes a determination of nonimmigrant status violation in exclusion, deportation, or removal proceedings, unlawful presence begins to accrue the day after the immigration judge's order.

So unless either of these two happened you didn't overstay. Repeat: this only applies if you were not provided with a date until you could stay.
If you are Canadian and were given a date until you could stay then, as I already linked, you will need a waiver.
Comment: There is no ban but OP will **NOT** be able to return **UNLESS** they get a visa or waiver as appropriate if necessary. Updated to clarify this. A ban would mean their request for visa/waiver will be refused. But the lack of a ban doesn't mean they don't need to do paperwork first!
Comment: No ban does not equal no consequences. Is that simple enough for you to understand finally? Refrain from involving yourself in immigration questions as long as you believe anything of this is simple.
Comment: Finally, I was able to come up with a hopefully simple enough correction to your answer and an explanation to what you are missing: "So yes you will be able to enter the USA if you" -- if you *deal with the consequences of your overstay before you leave*. My answer details what this dealing needs to be.
Comment: Does staying past an "until" date mean that a visa or a waiver will immediately be necessary to return, or does the visa-or-waiver requirement come into play after the accrual of 180 days of unlawful presence?
Comment: "while there is no ban you might need to get a visa or a waiver" If there is no ban, then you cannot get a "waiver", because you have no ban to "waive". What would you be "waiving"?
Comment: "If you are Canadian and were given a date until you could stay then, as I already linked, you will need a waiver." This is wrong. If there is no ban (as is the case here) then there is no waiver.

Overstayed in USA


Is it possible to come close to complete anonymity for bittorrent traffic?

Question: Some ways I can think of is to use a VPN, disable DHT, PEX and local discovery of peers options in the BitTorrent client and to route torrent traffic through the Tor network (people say that it's not a good idea). If I want to use my home network, is it possible to make it almost completely anonymous? What other ways are there to improve anonymity?
Comment: You are correct that routing it over Tor is a bad idea. Not only does it harm the Tor network, but often BitTorrent applications will leak your real IP if you do that.
Answer:
If I want to use my home network, is it possible to make it almost completely anonymous?

Unfortunately, you cannot be completely anonymous if you use your own home network. Actions like disabling DHT and Peer Exchange do not improve anonymity, since you still need to send your real IP to the tracker in order to actually interface with the swarm. This is not something you can avoid, because the trackers are required to track your IP and distribute it out to anyone who asks in order to actually maintain the swarm. After all, how else does the torrent program know the IP addresses of other seeders so that they can connect to them and begin the download?
If you use a VPN, you will route your system's traffic through another server. The traffic is typically encrypted so that your ISP is unable to view the contents of the data. When you do this, you simply shift the trust from your ISP to the VPN's ISP. This is intended to make it a bit harder for law enforcement or anti-piracy groups to obtain your original IP. However, many, many VPNs are highly insecure or provide very poor anonymity. Good ones are usually enough to protect against the MPAA as an adversary, but are far from capable of providing "close to complete anonymity".
If you use a seedbox, you will be using a remote server to run the BitTorrent application for you, doing the downloading and seeding on its own without involving your ISP. When you wish to access the downloaded material, you are able to download it directly from the seedbox. This provides anonymity that a VPN does not provide in addition to allowing for faster speeds, since all your downloads are direct downloads, and the remote server is what becomes the BitTorrent peer.
Answer: As long as you accept a VPN tunnell as anonymous it's trivial.
Configure the following firewall rules:

Deny all on LAN.
Allow outgoing to VPN server on relevant port on LAN (VPN connection)
Allow outgoing UDP/53 to a relevant port (DNS)
(Optional) Allow incoming ssh/rdp/whatever on local network (Remote control)
Allow all outgoing on VPN interface from VPN subnet (e.g. 10.12.1.0/24)
Allow incoming on a port the torrent client is listening on, on the VPN interface.

All traffic not going over VPN will be dropped by the firewall rules. Bind the torrent client to the VPN interface, so it doesn't accidentally broadcast your LAN address.
You don't have to care if the client uses DHT, PEX or other broadcast protocols, as the firewall will drop such traffic trying to exit on the LAN interface. It'll be allowed to exit on the VPN interface.
If you're really paranoid you drop DNS also, and connect to VPN server by IP, without ever resolving DNS name. I don't see a big point in doing this, as anti piracy agents discover file sharers by looking at who announces for a particular torrent; they do not have capability to eavesdrop on traffic. Also, NS lookups doesn't really prove anything about what kind of traffic you have.
If you want you can also split the firewalling into a separate unit, by terminating the VPN on your router (for instance a pfsense machine), provide a separate VLAN for your torrent machine, and enforce rules in the router.


Could a dichromatic animal see red?

Question: So I'm not really sure whether I get it right or not, but apparently most mammals are dichromatic. Humans have three cones that detect light wavelengths, small for blue, medium for green, and large for red. Meanwhile, many other mammals have rods and tapetum lucidum, so they see better in the dark. From what I could find, mainly research based on dogs and cats, they both can't detect red. I'm not sure, but I'm somewhat assuming that since large wavelengths correspond to red, does that mean that most if not all dichromatic animals can't see them? So, if an animal were to have a better night vision (tapetum lucidum included), as well as a dichromatic vision, would they necessarily not be able to detect large light wavelengths (red)? I would much rather them not being able to detect small (blue) instead, and have a similar vision to tritanopia. Is that possible? If so how unlikely would it be?
Comment: Edits which invalidate existing answers are considered rather rude.
Comment: I'm sorry, I realized that I should have emphasized the last part (aka tritanopia) but thought that it would be too similar if I asked a different question about it. I'm still grateful for the answers before I changed the title, and commented explaining that I made a mistake. The question is the same as before though, I didn't change anything but the title.
Comment: The question about the possibility or probability of animals which cannot see blue wavelengths is interesting. You should ask it as a separate question. This question explicitly asks whether dichromatic animals *"would they necessarily not be able to detect large light wavelengths"* and whether *"most if not all dichromatic animals can't see [red]"*. Both questions are worth asking, and I have upvoted this one.
Answer: Yes, it is perfectly possible for dichromats to see red wavelengths. The number of distinct receptor types has essentially nothing to do with the range covered by those receptors.
Even in the specific case of dogs and cats, I'm reasonably certain they are still sensitive to red wavelengths--they merely lack the ability to distinguish them from green.
Comment: @Tanya Yes. You just need two sets of cones that cover the red and blue-green ranges, rather than two sets of cones that cover the red-green and blue ranges, and mutations that alter the sensitivity ranges of cone cells in both directions are clearly possible, because they've *happened*, resulting in the range of different vision types that currently exist between different species. The fact that tritanopia actually happens in real life is plenty of evidence that it is in fact possible.
Comment: I see, thanks for the help! Would a vision similar to tritanopia be possible though? That animal can't see uv light.
Answer: Cats and dogs can see red light just fine. What they cannot do is distinguish it from green light. At the red end of the visual spectrum their limit is very similar to the humans, extending to about 750 nm. But at the blue end of the spectrum they may see quite a bit into what for us is invisible near ultraviolet, because their lenses absorb ultraviolet light much less than ours; their visual spectrum may extend to about 350 nm, whereas ours ends at about 400 nm.
See the discussion on the visual spectrum of cats on Biology StackExchange.
Comment: Thank you! I think I didn't use a proper title, I know that technically dogs/cats/other dichromats can see colors, and just can't distinguish them. What I was mostly trying to understand is if it would be poddible to distinguish red and green but not blue and have a vision similar to tritanopia. The animal I'm trying to make can't see uv light, and dogs and cats were used as just an example.
Answer:
[Would a dichromat] necessarily not be able to detect large light wavelengths (red)? I would much rather them not being able to detect small (blue) instead, and have a similar vision to tritanopia. Is that possible?

Possible? I don't see why not.
AFAIU, the three flavors of human color blindness are caused by a lack of one of the three usual types of cones. Thus, an animal with two types of cones responding to similar frequencies as two of the three types of human cones would have vision similar to a person with color blindness. For the right set of cones, that would include tritanopia.
As far as possibility, this seems like a slam-dunk.

If so how unlikely would it be?

Well, here is where you have problems. At least in humans, the peak response frequencies of "red" and "green" cones are fairly close together. (I don't know offhand, but would suspect there is a biological reason for this.) One would expect that if an animal only has two types of cones, it would be advantageous for the frequency response of those types to vary as much as possible, i.e. we would expect blue and red cones, not blue and green.
However... it's also well known that rods are less sensitive to red light. This makes me wonder if there is a reason why animals with tapetum lucidum don't have red cones.
Anyway, the point is that you have an interesting question why your critter would have cones with similar frequency responses. Given that you are asking this question, you may already have an answer, but I would think you would want some reason why it is important that they can distinguish the colors they can.

BTW, while not directly related to your question, I should note that there are various software programs that claim to "simulate" color blindness, which may be of use to you. One (free in both senses) is KMag, although getting that to run on not-Linux might be a bit of a pain. I believe there are also online tools, though uploading pictures is a bit less convenient.
Comment: No need for special tools. The channel mixer of any half-decent raster graphics editor (e.g., Paint Shop Pro, Photoshop, GIMP) can easily do it.
Comment: I wouldn't bet on that. The better simulation tools are based on converting colors to and from a conceptual model of human color perception in order to strip out one of the channels. I think you can get sort-of close working in [CIELAB](https://en.wikipedia.org/wiki/CIELAB_color_space) space and dropping either A or B, but I'm pretty sure that's still not quite right. (For one, I don't know hot to separately simulate protanopia vs. deuteranopia that way, and yes, there *is* a difference. It's subtle, but it exists.)
Comment: If you're interested in doing it *properly*, check out [KMag's sources](https://github.com/KDE/kmag/blob/master/colorsim.cpp) and also look up the papers cited therein.

Could a dichromatic animal see red?


Meaning of 'not under active consideration' in APS peer review process

Question: I have submitted a paper to Physical Review E some 15 months ago. The criticism of the two referees was deep and serious so they suggested a major revision. The editor agreed to publish the paper if I can correctly answer their questions and implement their suggestions. In order to do so, I had to perform calculations which turned out to be lengthy and elaborate, but I have finally finished them. Now I see that the status of the manuscript is 'not under active consideration'. Any idea about the meaning of that? Does it mean that the paper is finally rejected or can it be 'reactivated' by the editor? In the case of the former, can I move the manuscript to another publisher without further communication with the APS?
Comment: My guess would be that it means exactly what it says. Given that the manuscript has been returned to you for major revisions, the journal is not actively considering the manuscript. I.e. they are going to completely ignore it until you return something to them.
Comment: When you received the reviewer's comments, you probably also received a deadline for the amendments. If you passed the deadline and didn't ask for an extension, the editor might have put on hold your submission and you might have to resubmit the paper. Anyway, contact the editor.
Comment: Thank You! There were no deadlines attached to the comments.  I will contact to the editor ASAP, but before disturbing him or her, I wanted to inform myself.
Answer: The APS system does not set a deadline for the authors to submit a revised manuscript.  However, after a certain length of time (I believe it is about one year), a paper is automatically moved from "with authors" to the "not under active consideration" category.  That is the same category used for papers that have been outright rejected, but categorical rejections from Physical Review journals are relatively rare.  The letter your received, inviting you to resubmit if you feel you can overcome the referees' criticisms, is boilerplate, sent out in the response to every letter that the reviewers offer mild rejection recommendations for.
So you can resubmit the paper, although processing will probably be a bit slower than it might be otherwise.  The editor will try to send the paper back the same referees, and they may not have have the clearest memories of your manuscript after all this time.  They may not want to review it again at all, which will delay the whole process.
Comment: Thank You for your valuable answer!  Your last sentences convinced me to publish the paper somewhere else.


Can I pair and use two microphones with my iPhone 6+?

Question: I want to connect two bluetooth microphones to my iPhone 6+ to record a conversation during a walk/hike.  I know the iPhone can handle up to 7 connections, but can only output sound to one device at a time (unless a splitter is used).  Can there be two inputs via bluetooth?
Answer: To my knowledge you do not need bluetooth microphones to record a conversation.
iPhones have a built-in app called voice memos which, assuming you have a relatively new iPhone, should be able to pick up the conversation fairly well if you just set the iPhone to record and put it in your pocket.


Is it true that a USPTO patent not safe from European companies?

Question: All feedback is greatly appreciated. I'm a very young inventor.
Answer: If you are not filing in other places, then your patent is not protected in those countries, which means that they will be able to produce products there and sell them in all other places where your patent was not filed.
If you file in the US only, you will be protected in the US, European companies will not be allowed to sell here. You will be able to sell everywhere - meaning competing without protection.


how to check touch point is content on the edges of an curve path in ios?

Question: I am working with an app which is drawing curve between two boxes. Once its drawn that I want to change shape of curve using starting, ending and other point(touch point) if that is on the edge on curve.
So how can i check that touch point is on the edge  of my curve path or not?
Answer: Well, your curve path must have an equation , am I right?
You can simply check if the touch point is a solution of the equation.
You can also add a threshold by checking for each point of the rectangle R.
Where R is a rectangle centered in the touch point and of the size = your_threshold


Why is the Bonferroni correction properly used with planned, and not post hoc, contrasts?

Question: The Wikipedia article on Post hoc analysis says "Bonferroni correction (This is properly used with planned, not post hoc, contrasts.)" but does not explain why the Bonferroni correction is properly used with planned contrasts and not post hoc ones. The Wikipedia article on the Bonferroni correction does not seem to explain or even mention this.
Comment: R help for function p.adjust::stats says, " The first four methods are designed to give strong control of the family-wise error rate. There seems no reason to use the unmodified Bonferroni correction because it is dominated by Holm's method, which is also valid under arbitrary assumptions. " If you are controlling family-wise error and doing significance test,
Holm's method is more powerful!
Answer: The Bonferroni correction can theoretically be used with post hoc contrasts, but you need to think carefully about whether it is the best option and how to use it correctly. It's usually not the best option for post hoc comparisons. One trap you can fall into is to look at the data (or the output), notice some things that look like they are or might be "significant", and only test those formally, with the Bonferroni correction computed just counting the tests you have formally done. But in looking at other comparisons, you have informally done other tests, and these need to be counted, too.
 One reference I have at hand: Dean and Voss, Design and Analysis of Experiments, Springer (1999), pp. 78 -92


Topologically equivalent metrics

Question: Can a topological vector space have two metrics both of which give rise to same topology as the space has, but one is translation invariant but the other is not?
Answer: Yes.
$\mathbb R$ with $d(x,y) = |x^3-y^3|$ has the same topology as with the standard metric.
Answer: Yes. Take $\mathbb{R}$ with $d_1(x,y) = |x-y|$ and $d_2(x,y) = |\arctan x - \arctan y|$.
Answer: A further condition you might want is that the identity map be uniformly continuous in both directions.  (For example, this will mean that you have the same Cauchy sequences in either case.)  For that, you could choose a uniformly continuous bijective map $f:\mathbb R\to\mathbb R$ with uniformly continuous inverse, like $f(x)=\frac{x^3}{x^2+1}$ or $f(x)=xe^{1/(x^2+1)}$, and then define a new metric on $\mathbb R$ by $d(x,y)=|f(x)-f(y)|$.
Comment: Ah..this seems a nice general way!

Topologically equivalent metrics


Do I need Microsoft Visual C++ 2010 Redistributable Package (x86) even when I install Visual Studio (Desktop development with C++)

Question: Do I need it? If I don't need, how can I install visual studio? I mean should I install visual studio then delete the package or delete the package first, then install visual studio? And can I really delete this? Can it cause any problems?
Comment: Install Visual Studio without installing the redistributable package first. Then check and see if the redistributable package was installed along with it. The only way to know for sure is to try it.
Comment: For some reasons, my windows 7 (32 bit) operating system has already installed Microsoft Visual C++ 2010 Redistributable Package (x86). That's why I am asking that should I delete the package, then install visual studio latest version freshly or I can install Visual Studio without any problems...
Answer: In principal, one version of the
Microsoft Visual C++ 2010 Redistributable Package (x86)
is enough, so you may install Visual Studio without it.
In practice, the versions, although named the same, may not be identical.
You may in that case see some problem when testing your compiled program,
although the chances for that happening are very slim.
If such a rare problem occurs, you may repeat the installation of
Visual Studio, this time including this package.
Note: I count 21 such packages of all types and versions
installed on my computer...
To understand more about the problem see the article:
Why Are There So Many "Microsoft Visual C++ Redistributables" Installed on My PC?.


Does anybody know what this electronic component is?

Question: I have an electronic component which has no letter or number on it. It has 2 legs and when you shake it there is something moving inside up and down. I am searching for it for hour still have no clue. Here is the photo I've just taken:
Comment: A size reference in the photo or just telling us the dimensions would help.
Answer: It's a tilt switch.
It has a ball in it which breaks a contact when it rolls away or moves away from contacts.
Try measuring the resistance with it in various orientations
The image below is copied from here

This page says about one similar:

Tiny tilt switch type BT411-2 has a built in rolling ball (instead of mercury) so it doesn't have the environmental health hazards that mercury tilt switches have.
These and similar types are used in vibration car alarms, sneakers that blink, toys, etc.

Many here

Re your link:

Strøm: 2mA maks.
  Størrelse: housing Ø5.2 × 14mm (leads + 15mm)
  Maks. temperature: 100°C
  non-active contact: 10 Mohm
  active contact: +/- 5 ohm

2 mA current rating.
10 megohm open circuit
5 Ohms operated.
5.2 mm dia x 14mm long with 15mm leads.
Maximum temperature 100 C.
Comment: thnx i guess it is
Answer: Looks like a crystal oscillator , probably the 32.768Khz. Where did you get it from ?
https://www.sparkfun.com/products/540
Comment: I think this is incorrect because crystals don't rattle when you shake them. Also, it looks like one wire is connected to the can, which would be very unusual for a 2-pin crystal.  In any case, a 2-pin device isn't going to be a oscillator.  At best is would be a bare crystal. I think Russell is on the right track, so -1 for this answer and +1 for his.


Unit vectors in computing line integrals of a vector field

Question: In surface integrals the process is to use the dot product of the vector field with the unit normal vector first and multiply that with the area element. In the line integral the process is to use the dot product of the vector field with the length element. Why isn't the unit tangent vector used in the line integral computations while in the surface integral computations the unit normal vector is used?
Answer: The unit tangent is used.  For a surface integral you have:
(field vector) $\cdot$ (unit normal) $\times$ ( scalar area element)
For a line integral you have:
(field vector) $\cdot$ (unit tangent) $\times$ (scalar length element)
often, however, the last product is combined into a vector length element.  So the unit tangent is hidden in there.
Comment: when i read the vector field line integral it usually says $F \dot \mathbb{r'}(t)$ without the norm brackets. The norm brackets remind me to cancel out with the unit normal in the surface integral case- in the line integral case then do i just assume it's the numerator of the unit normal left over after cancellation like i usually do with the surface integral case?
Comment: (unit tangent) x (scalar length) = $r'/|r'| \times |r'|$.
Answer: In both a line and a surface integral, one must take into account the elementary line element or the elementary surface element associated with the choice of coordinates that one integrates by.
For a line integral however: $\int \mathbf{F}\cdot d\mathbf{r}$, the line element $d\mathbf{r}$ is normally represented as a vector, and in general cannot be "nicely" factored to a constant times the unit tangent vector $\hat{r}$ that points along the path. For example, in cylindrical coordinates we have:
$$d\mathbf{r} = d\rho\hat{\rho} + \rho d\varphi\hat{\varphi}+dz\hat{z}$$
Of course, if for example you are only integrating along a radial path, without varying the angle $\varphi$ or the height $z$ then your integral will reduce to:
$$\int F_{\rho} d\rho$$
Similarly, with a surface integral $\int \mathbf{F}\cdot d\mathbf{s}$ the surface element is in many standard coordinate systems constant for each independent integration variable. For example, again taking cylindrical coordinates, if we're integrating along a fixed radius $\rho$ we have $d\mathbf{s} = dS_{\rho}\hat{n} = \rho d\varphi dz \hat{n}$ so that in this case our surface integral can be written as:
$$\int_{z_i}^{z_f}\int_{\varphi_i}^{\varphi_f} \left(\mathbf{F}\cdot \hat{n}\right
) \rho d\varphi dz$$
However, probably the real answer to your question, is that the difference here is that the "surface normal vector" $d\mathbf{s}$ is usually not written explicitly as a vector, although apparently it is possible to do so (see this interesting post for more details). The only reason I know of for that, is that it usually just complicates things, such as being extra careful about the orientation, and hence signs, etc. Hence the preference is as you said, whenever possible, to express the integrand as a constant times a differential area element, multiplied by the dot product $\mathbf{F}\cdot\hat{n}$.


Using Google Fit - If I get my heart points (from cycling), should I care about getting my steps in?

Question: Just started using Google Fit. I cycle fairly regularly, and quickly hit my target heart points per week - but I'm rarely hitting my steps goals per day. Does this matter? If I'm getting my exercise from cycling, can I just ignore the steps goal?
Answer: For health benefits, you can ignore the step count.
The CDC, American Heart Association, and Mayo Clinic simply recommend adults get a minimum of 150 minutes of moderate-intensity cardio per week (or 75 minutes of very vigorous cardio). The CDC itself shows one example of what is considered "moderate-intensity" as "brisk walking".

This is just an example though. There isn't a specification of what kind of cardio is necessary. The only important thing is to elevate your heart rate while exercising (as opposed to ingesting a bunch of caffeine pills or something).
Answer: 10,000 steps is am artificial goal invented as a pun in Japanese. Getting the actual exercise is the important part, with the caveat, of course, that minutes of higher heart rate is also a slightly artificial goal in that increased heart rate doesn't always correlate with increased exercise. That said, it's probably a closer metric.


wiring switch and plug to flourescent fixture

Question: I'm having a problem wiring a plug and a pull switch to a fluorescent fixture. The switch wiring is the problem. If I connect the hot lead to the ballast and plug  and the common to the ballast and plug  I blow the breaker. If I do not connect the common on the switch the switch will not work. My ohm meter shows the switch is good.
Comment: Draw us a diagram of take a photo of what you've done. Your description isn't clear (although I have my suspicions).
Answer: Because switches don't take neutral (which you call common).  Only hot wires go to switches.  That thing you think is "the other one from hot", is not neutral.  It's switched hot.
First, connect all the grounds/earths.
Second, connect the neutrals to each other.
Third, take the switch out of its retail packaging /shipping box. .
Fourth, you should have two hots left over, one from the cord, one to the ballast. Those two go on the switch.
If you want to get some colored tape and color-code (which normal wires are not), then put red tape on the black (non-neutral) wire from the ballast, and tape the two wires on the switch so one is black and the other is red.


PCB copper thickness with small pitch SMT components

Question: I typically use 2 ounce copper as rule for all my PCBs.  On a recent board I am using a 0.5mm pitch, relatively large micro, and noticed the pads aren't very flat.  Assembly went fine with the protos, but I'm wondering if 1 once copper would provide for a flatter landing service.  Does anyone have any experience with using 1 and 2 ounce copper with small pitch devices and/or any advice on assembly reliability related to copper thickness for such devices?
Comment: I try to use 0.5oz copper for home-made small pitch features (<15mil).
Comment: Why do you usually use 2oz copper? I know there are many valid reasons for using it, I'm just curious to your particular application.
Comment: I wish I had a good answer but basically because that's how we've always done it.  I've always been a schematic guy.  I'm just getting into actual layout side of things, and so am learning.  From the responses so far, it looks like using 2 ounce is not the norm, so I guess I should think about switching to 1 once unless there is a valid reason for 2, especially with small pitch SMDs.
Comment: 2oz copper also makes hand soldering and rework more challenging than it needs to be.
Answer: Unless you need high-current capability, 1 oz is the default thisckness. Line definition can  be impaired with increased thickness, so only use when necessary.
Comment: I've used 2oz copper several times for increased heat dissipation for components that sink heat to the ground plane.  Just as another reason (other than current) that one may need 2oz copper.  Never used it on a layer that wasn't a solid plane though.
Answer: 1 oz (35 um) copper is much more suitable for SMD. Most board suppliers provide it as standard.
Answer: You don't seem to have a good reason to use the 2 oz copper ("I wish I had a good answer but basically because that's how we've always done it.") The main reason to use it is for high currents. If you don't have that, use 1 oz, it's the standard thickness and should be a lot cheaper than 2 oz.
Answer: I summarize PCB fab capabilities at the
PCB manufacturers page.
(You can help -- it's a wiki).
Capabilities are different for every PCB fab, but they often publish "preferred" capabilities that look something like

0.30 mm track/gap on 2 oz boards
0.15 mm track/gap on 1 oz boards
0.10 mm track/gap on 1/2 ounce copper boards

and "minimum" capabilities that are a bit tighter.
Thicker copper makes it more difficult to properly fabricate footprints for fine-pitch SMT components.
If you don't need lots of copper to provide a good heatsink or to handle high currents,
you might be able to save a few dollars by using exactly the same board layout and specifying 1 oz or 1/2 oz copper instead of 2 oz copper -- especially if it results in the board being able to use one of their standard "preferred" processes rather than one of their more expensive "minimum" processes.
If you do need lots of copper to provide a good heatsink or to handle high currents,
then a single PCB with 2 oz copper will likely to minimize your net costs.
However, I've seen a few cases where designers were able to save a few dollars by re-designing the system to use 2 PCBs -- one small PCB with thin copper and narrow traces and multiple layers to support the fine-pitch SMT components, plugged into another PCB with one or two layers of thick copper and wide traces to handle high-current stuff.
Answer: If higher current handling is needed only in specific traces, I've often seen the use of a tin reinforcement on the copper. It seems to be quite effective, as explained here.


2 speed (double) shimano road shifter on triple chainring crankset?

Question: I would like to put a 2-speed Shimano road shifter on my bike.
The bike is 3-speed front crankset.  Could I put these two together?
Comment: I guess Criggies answer covers most of the bases but, usually, you need to give more detail than this. What actual components are you asking about? What kind of bike is it? (You highlight the fact that it's a road shifter which, along with the triple chainrings, suggests to me that it might not be a road bike.) What do you want to achieve by this? Why don't you just use an appropriate three-speed shifter?
Comment: By 'shifter' do you mean the lever or the front derailleur?
Comment: @Carel That's a good question. I recently was discussing bicycles with some acquaintances and became confused by their seeming lack of understanding.  It dawned on me that they were asking about aspects of a derailleur while using the term, "shifter." For a short while we thought each other damn stupid!
Answer: Yes, but....
If your shifter is a 2 position brifter (ie an STI lever) then it will only be in the right place on one chainring.   The second position may be acceptable, or it may be off enough to create clatter.   The third chainring will be unavailable to you completely.
If your shifter is a friction shifter, then the entire set of chainrings will be reachable and tuneable assuming you have sufficient range in the front derailleur.
I successfully shifted on a quad chainring using a thumb friction shifter on a custom bike.   You could also look at using a bar-end shifter in friction mode.
Since you mention road bike, its going on drop bars, and STI / brifters is where its at for roadies.  You'd be best off getting a triple-position left brifter (used shouldn't be too expensive)
The other option is to look into a compact double crankset, which will let you use a smaller inner chainring, paired with a wider range cassette at the back could approach or even equal a 1:1 ratio with an 11-32 cassette and a 32+48 chainring setup.

Depending on the age of your shifter, it may have a pseudo third position which is the trim setting.  This lets you do a sub-shift on the front mech so to avoid the chain clattering away on the cage as you ride in a sub-optimal gearing like big-big, or less often in small-small.   This Trim position should not be confused with a triple shifter.... when in doubt check the web for the part number.
Generally speaking a triple anything ends in a 3 in the Shimano world.


Muscle pain after workout

Question: Actually when I workout some day. Like lifted dumbles,or do sit-ups , then I feel everything is normal,I actually could do without any problem.. But the next day I always feel pain in my muscles of hand and also belly muscles...My question is that is it normal...Or am I doing something wrong....
I become unable to workout the next day due to the pain...after 2-3 days I start the workout again,but the same thing happens again.
Answer: In 99.9% of cases it's called DOMS or delayed onset muscle soreness. When you start working out again after a gap of non activity, your muscles will get really sore. However, in my personal experience and that of many others around me, the best way to deal with DOMS is to get back in the gym and keep moving around. You have to push through the pain and still try to hit those reps albeit at lower weights. Do some light cardio and active stretching around the area you feel sore in. Just don't sit around. Drink lots of water, get your protein/carbs to repair the fibers you tore and stay consistent with your workouts.
There is an unlikely chance you worked out so hard you got rhabdo. You can look that up for the symptoms and if you feel it might match you, see a doctor, don't consult an online forum.
Comment: Thanks mobcity zkore. It seems the 1st case is right for me..thank you very much for the answer..

Muscle pain after workout


Cluster analysis as a preliminary analysis

Question: I want to produce four groups (high/high, high/low, low/high and low/low) using two continues variables and compare these groups in terms of a few dependent variables. I know that cluster analysis (k-means and hierarchical) is a type of 'end' analysis which is the main goal of the paper to reach such clusters and then discuss the nature of the clusters. However, I am willing to use this technique (k-means by using k=4) as a kind of preliminary analysis to produce the groups. I know that scatter plot and means splits are other alternatives but they have their own disadvantages that cluster analysis may resolve. What do you think?
Comment: What disadvantages do splits have that CA will resolve? I can't think of any.
Comment: just wondered CA can be used for this goal?
Comment: I don't see why not, but I think it is likely to have the *exact same* disadvantages as splits.
Comment: do you have any suggestion for the best method? (among these three or one another?)
Comment: possible duplicate of [classification of the groups](http://stats.stackexchange.com/questions/130811/classification-of-the-groups)
Answer: If you have a predefined goal, such as your high/low splits, don't use cluster analysis at all. Instead, bin your data into your four predefined bins (maybe using quantiles such as the median to define the split)
You can also use more than two bins, e.g. low/normal/high this way easily.
The benefit is that the results will be easy to understand. With cluster analysis, you will likely need to perform another analysis to understand why it clustered the data the way it did.
Cluster-analysis should never be the "end" analysis. It's an interim step to understand your data, but it doesn't really return any further usable result except better knowledge of your data. If you run cluster analysis, you next need to analyze the clusters found, and most likely you will need to iterate through this a number of times.
Answer: It is fine to use cluster analysis as a preliminary analysis.  However, I don't see how using CA will resolve any of the disadvantages of using (say) median splits.  Unless the true data generating process is that there are four latent groups that are exactly identified by the clustering, and which differ on mean $Y$, but do not differ based on their $X_1$ and $X_2$ values, you will be better served by regressing $Y$ onto $X_1$ and $X_2$ (and possibly the interaction) directly.
Comment: I completely agree with regression. MY main hypothesis was based on the fact that one of these four groups will be better than the others. That's why I focus mainly on these four.
Comment: An interaction term can help with that. The clustering will only help if that is the true DGP.


double escape sequence inside a url : The request filtering module is configured to deny a request that contains a double escape sequence

Question: On my ASP.NET MVC application, I am trying to implement a URL like below :

/product/tags/for+families

When I try to run my application with default configurations, I am getting this message with 404.11 Response Code :

HTTP Error 404.11 - Not Found
The request filtering module is configured to deny a request that
  contains a double escape sequence.

I can get around with this error by implementing the below code inside my web.config :
  <system.webServer>
    <security>
      <requestFiltering allowDoubleEscaping="true" />
    </security>
  </system.webServer>

So, now I am not getting any 404.11.
What I am wondering is that what kind of security holes I am opening with this implementation.
BTW, my application is under .Net Framework 4.0 and running under IIS 7.5.
Comment: IIS is throwing on the "+" character, which is [Microsoft's default behavior.](http://blogs.iis.net/thomad/iis7-rejecting-urls-containing)
Comment: Is it possible to reach the desired resource using `/product/tags/for%20families` instead? Then you have a workaround for ids containing spaces. Or am I completely off here?
Comment: @atornblad a little bit off I guess. My question : **What I am wondering is that what kind of security holes I am opening with this implementation.**
Answer: The security holes that you might open up have to do with code injection - HTML injection, JavaScript injection or SQL injection.
The default settings protect you from attacks semi-efficiently by not allowing common injection strategies to work. The more default security you remove, the more you have to think about what you do with the input provided through URLs, GET request querystrings, POST request data, HTTP headers and so on...
For instance, if you are building dynamic SQL queries based on the id parameter of your action method, like this:
public ActionResult Tags(string id)
{
    var sql = "SELECT * FROM Tags Where tagName = '" + id + "'";
    // DO STUFF...
}

(...which is NOT a good idea), the default protection, put in place by the .NET framework, might stop some of the more dangerous scenarios, like the user requesting this URL:
/product/tags/1%27;drop%20table%20Tags;%20--

The whole idea is to treat every part of urls and other inputs to action methods as possible threats. The default security setting does provide some of that protection for you. Each default security setting you change opens up for a little more potential badness that you need to handle manually.
I assume that you are not building SQL queries this way. But the more sneaky stuff comes when you store user input in your database, then later displaying them. The malevolent user could store JavaScript or HTML in your database that go out unencoded, which would in turn threaten other users of your system.
Answer: Security Risk
The setting allowDoubleEscaping only applies to the path (cs-uri-stem) and is best explained by OWASP Double Encoding. The technique is used to get around security controls by URL Encoding the request twice. Using your URL as an example:
/product/tags/for+families --> /product/tags/for%2Bfamilies --> /product/tags/for%252Bfamilies

Suppose there are security controls specifically for /product/tags/for+families. A request arrives for /product/tags/for%252Bfamilies which is the same resource though is unchecked by the aforementioned security controls. I used the generalized term of security controls because they could be anything such as requiring an authenticated user, checking for SQLi, etc.
Why Does IIS Block?
The plus sign (+) is a reserved character per RFC2396:

Many URI include components consisting of or delimited by, certain
special characters.  These characters are called "reserved", since
their usage within the URI component is limited to their reserved
purpose.  If the data for a URI component would conflict with the
reserved purpose, then the conflicting data must be escaped before
forming the URI.
  reserved    = ";" | "/" | "?" | ":" | "@" | "&" | "=" | "+" |

                "$" | ","

Wade Hilmo has an excellent post titled How IIS blocks characters in URLs. There's lots of information and background provided. The part specifically for the plus sign is as follows:

So allowDoubleEscaping/VerifyNormalization seems pretty straightforward.  Why did I say that it causes confusion?  The issue is when a '+' character appears in a URL.  The '+' character doesn't appear to be escaped, since it does not involve a '%'.  Also, RFC 2396 notes it as a reserved character that can be included in a URL when it's in escaped form (%2b).  But with allowDoubleEscaping set to its default value of false, we will block it even in escaped form.  The reason for this is historical:  Way back in the early days of HTTP, a '+' character was considered shorthand for a space character.  Some canonicalizers, when given a URL that contains a '+' will convert it to a space.  For this reason, we consider a '+' to be non-canonical in a URL.  I was not able to find any reference to a RFC that calls out this '+' treatment, but there are many references on the web that talk about it as a historical behavior.

From my own experience I know that when IIS logs a request spaces are substituted with a plus sign. Having a plus sign in the name may cause confusion when parsing logs.
Solution
There are three ways to fix this and two ways to still use the plus sign.

allowDoubleEscaping=true - This will allow double escaping for your entire website/application. Depending on the content, this could be undesirable to say the least. The following command will set allowDoubleEscaping=true.
appcmd.exe set config "Default Web Site" -section:system.webServer/security/requestFiltering /allowDoubleEscaping:True

alwaysAllowedUrls - Request Filtering offers a whitelist approach. By adding that URL path to alwaysAllowedUrls, the request will not be checked by any other Request Filtering settings and continue on in the IIS request pipeline. The concern here is that Request Filtering will not check the request for:

Request Limits: maxContentLength, maxUrl, maxQueryString
Verbs
Query - query string parameters will not be checked
Double Escaping
High Bit Characters
Request Filtering Rules
Request Header Limits

The following command will add /product/tags/for+families to alwaysAllowedUrls on the Default Web Site.
    appcmd.exe set config "Default Web Site" -section:system.webServer/security/requestFiltering /+"alwaysAllowedUrls.[url='/product/tags/for+families']"

Rename - yes, just rename the file/folder/controller/etc. if possible. This is the easiest solution.
Comment: @paulsm4, as the post states, `with allowDoubleEscaping set to its default value of false, we will block [+] even in escaped form.` I tested this with `EscapeUriString` and `EscapeDataString` and an escaped `+` still does not go through.
Comment: To allowDoubleEscaping during development with IIS Express here's what I did: https://stackoverflow.com/q/56463044/381082
Comment: @user2320464 - excellent summary. CAVEAT TO READERS: Do NOT set "allowDoubleEscaping=true": that's just a bad idea. Alternatives include using [Uri.EscapeUriString()](https://learn.microsoft.com/en-us/dotnet/api/system.uri.escapeuristring) or [Uri.EscapeDataString()](https://learn.microsoft.com/en-us/dotnet/api/system.uri.escapedatastring)
Answer: I have made a work arround for this .
so when you want to put the encripted string inside the url for(IIS)
you have to clean it from dirty :{ ";", "/", "?", ":", "@", "&", "=", "+", "$", "," };
and when you want to decript it and use it again , you have to make it dirty again before decript it (to get the wanted result) .
Here is my code , i hope it helps somebody :
 public static string cleanUpEncription(string encriptedstring)
        {
            string[] dirtyCharacters = { ";", "/", "?", ":", "@", "&", "=", "+", "$", "," };
            string[] cleanCharacters = { "p2n3t4G5l6m","s1l2a3s4h","q1e2st3i4o5n" ,"T22p14nt2s", "a9t" , "a2n3nd","e1q2ua88l","p22l33u1ws","d0l1ar5","c0m8a1a"};

            foreach (string dirtyCharacter in dirtyCharacters)
            {
                encriptedstring=encriptedstring.Replace(dirtyCharacter, cleanCharacters[Array.IndexOf(dirtyCharacters, dirtyCharacter)]);
            }
            return encriptedstring;
        }

        public static string MakeItDirtyAgain(string encriptedString)
        {
            string[] dirtyCharacters = { ";", "/", "?", ":", "@", "&", "=", "+", "$", "," };
            string[] cleanCharacters = { "p2n3t4G5l6m", "s1l2a3s4h", "q1e2st3i4o5n", "T22p14nt2s", "a9t", "a2n3nd", "e1q2ua88l", "p22l33u1ws", "d0l1ar5", "c0m8a1a" };
            foreach (string symbol in cleanCharacters)
            {
                encriptedString = encriptedString.Replace(symbol, dirtyCharacters[Array.IndexOf(cleanCharacters,symbol)]);
            }
            return encriptedString;
        }

Comment: The string should be `base64` encoded instead of using this substitution technique. For example, Basic Authentication uses `base64` to encode the submitted credentials as it may contain special/reserved characters.
Comment: What is pntGlm?
Comment: @StuperUser just random characters
Comment: problem with base64 is / is a base64 character and can break the routes
Comment: This works 97% of the time.  If your initial string doesn't have "@" but has at9, the Make dirty will replace with @ and your decrypt will bomb.  This goes for any of the other replacement strings.
Answer: Encode the encrypted string separated:
return HttpServerUtility.UrlTokenEncode(Encoding.UTF8.GetBytes("string"));

Decode the encrypted string separated:
string x = Encoding.UTF8.GetString(HttpServerUtility.UrlTokenDecode(id));

Answer: So I ran into this when I was calling an API from an MVC app. Instead of opening the security hole, I modified my path.
First off, I recommend NOT disabling this setting.  It is more appropriate to modify the design of the application/resource (e.g. encode the path, pass the data in a header or in the body).
Although this is an older post, I thought I would share how you could resolve this error if you are receiving this from a call to an API by using HttpUtility.UrlPathEncode method in System.Web.
I use RestSharp for making calls out, so my example is using the RestRequest:
var tags = new[] { "for", "family" };
var apiRequest = new RestRequest($"product/tags/{HttpUtility.UrlPathEncode(string.Join("+", tags))}");

This produces a path equal to:

/product/tags/for%2Bfamilies

On another note, do NOT build a dynamic query based on a user's inputs.  You SHOULD always use a SqlParameter.  Also, it is extremely important from a security perspective to return the values with the appropriate encoding to prevent injection attacks.
Comment: +1 for recommending *NOT* disabling "allowDoubleEscaping", and for recommending *ALWAYS* using a SqlParameter when needed.  However, I would recommend using [Uri.EscapeUriString](https://stackoverflow.com/a/46338134/421195) vs. a 3rd party package list RestSharp.
Answer: I've just came across this issue with a Delete request. I didn't expect the below to work because it wasn't mentioned above, but I changed the request to instead pass the value as a querystring and it works fine, as long as you also encode the value (otherwise it treats the + as a space).
So from:
[HttpDelete("Example/{id}")]
public async Task<ActionResult<bool>> ExampleAsync(string id)

To:
[HttpDelete("Example")]
public async Task<ActionResult<bool>> ExampleAsync([BindRequired] string id)

If there is a reason you shouldn't do it this way, please let me know
Comment: Sadly this doesn't work for me with a `HttpGet` (.NET6)
Answer: This is just a joke from .net framework: by trying to url encode inside client using:
Uri uri = CreateUri(REPO_PREFIX + $"Name/{Id}/{WebUtility.UrlEncode(name)}/{WebUtility.UrlEncode(data)}");
client.PutAsync(uri, null);

cause indeed this issue with url including a '+'
however removing explicit url encode:
 Uri uri = CreateUri(REPO_PREFIX + $"Name/{Id}/{name}/{data}");

asp net core server receive query url encoded:
PUT localhost:10000/api/v1/xx/Name/8331/Backxxzzzzz%20afternoon/x HTTP/1.1

that i dump in logs via:
        request.AppendLine(Request.Method + " " + Request.Host + Request.Path + " " + Request.Protocol);


Normal TSH Levels in Hyperthyroxinemia

Question: When it comes to hyperthyroxinemia, how is it possible for TSH to be normal when there is an elevated thyroxine concentration? What I know so far is that it is caused by a mutation in the Human serum albumin (P02768)that carries normally around 10% of the thyroxine.The mutation apparently makes it have a higher affinity for thyroxine, but how does it allow the TSH levels to remain normal?
Comment: bound thyroxine in the plasma is different from the "free" thyroxine in the plasma - it is for the most part the free T3/T4 that is able to feedback to regulate TSH secretion
Answer: Since you're asking about hyperthyroxinemia with normal TSH serum levels, I suppose you're talking about euthyroid hyperthyroxinemia.
In euthyroid hyperthyroxinemia, the serum T4 and T3 concentrations are increased, but the TSH concentration remains normal. Besides that, there are normally no clinical signs.
The cause of that increase, as you explain in your own question, is a mutation in a transporter protein (like TBG), or an increase in their concentrations (which can happen in patients with hepatocarcinoma, for instance).
However, the free T4 concentration remains the same, and that is the important value for the negative feedback mechanism that regulates the concentration of TSH:

The euthyroid status of subjects with FDH has been
  confirmed by normal TSH response to TRH, normal free T4 concentration
  measured by equilibrium dialysis using appropriate buffer systems, normal T4
  production rate and normal serum sex hormone-binding globulin concentration.

Thus, without an increase in free T4 levels, there will be no drop in the TSH concentration.
Source: Impaired Sensitivity to Thyroid Hormone: Defects of Transport, Metabolism and Action.
Answer: Differential diagnoses of hyperthyroxinaemia with non-suppressed TSH levels include secondary or tertiary hyperthyroidism (e.g. due to TSH-secreting pituitary adenoma, resistance to thyroid hormone or paraneoplastic TRH production, respectively, all of them being very rare) and transient activation of the feedback loop in situations of type 2 thyroid allostasis1. In the context mentioned by you, elevated concentrations of T4 are most likely caused by increased plasma protein binding (which leaves free T4 normal)2.

Chatzitomaris A, Hoermann R, Midgley JE, Hering S, Urban A, Dietrich B, Abood A, Klein HH and Dietrich JW (2017) Thyroid Allostasis–Adaptive Responses of Thyrotropic Feedback Control to Conditions of Strain, Stress, and Developmental Programming. Front. Endocrinol. 8:163. PMID 28775711 doi 10.3389/fendo.2017.00163
Bianchi R, Iervasi G, Pilo A, Vitek F, Ferdeghini M, Cazzuola F, Giraudi G. Role of serum carrier proteins in the peripheral metabolism and tissue distribution of thyroid hormones in familial dysalbuminemic hyperthyroxinemia and congenital elevation of thyroxine-binding globulin. J Clin Invest. 1987 Aug;80(2):522-34. PMID 3112186.

Normal TSH Levels in Hyperthyroxinemia


How do I create a view to DISPLAY ALL EVENTS

Question: it looks like the Events Dashboard only shows upcoming events.
As I am using Civi to Manage membership and attendance to events, I would like to easily access all past events in order to edit participant lists, etc.
HOW DO I DO THIS?
And is there a reason why the events dashboard does not offer the choice of showing events?
Thanks.
Answer: Welcome to StackExchange Daniel. You are probably talking about this view: Events > Dashboard, which indeed only shows upcoming events and recents registrations.
There is another page, Events > Manage Events, that allows you to search and filter for events or show all events including past ones.

You could of course also create a report to list all (relevant) events and/or participants.
Comment: To make things more intuitive for your requirements, you could also disable some of the menu items (such as Event Dashboard), and have Manage Events at the top of the Events menu. They can be customized from Administer > Customize Data and Screens > Navigation Menu.


Rigid foam board expansion

Question: I'm installing extruded polystyrene rigid foam board over my exterior sheathing. I got a little behind schedule and now the temps have dropped to the 30s (Fahrenheit). Do I need to allow for the foam to expand in warmer weather? How big of gaps should I leave (if any) on the seams and the edges? I don't want it to distort my siding when we get back into the 90s next summer.
Comment: Great question. In many years of construction I've never encountered the requirement (or need) to do so. I'll wait for those with more technical knowledge of EPS to weigh in.
Answer: You should be safe to leave a gap of ~3/16", based on the coefficient of thermal expansion in the table here (https://insulationcorp.com/wp-content/uploads/2016/08/ICA-LITE_Spec_Sheet.pdf). With a value of 35x10e-6in/in per deg F, assuming a 100deg maximum temperature delta x 48" wide piece-> 0.000035*100*48=0.168". This would assume 100deg from your install temperature I believe... so 1/8" may be more appropriate @30deg (F).
You should look-up and find your particular mfr/model spec sheet to find a similar table for the product you plan to install, and perform the calculation for it.

Rigid foam board expansion


In Civilization V, I have iron but it won't let me build swordsmen

Question: I built a mine on iron and at first it let me build swordsmen, but now it won't. I have not traded it away and I do not have other buildings making swordsmen.
Any idea why?
Answer: In Civ V, certain bonus resources are limited in quantity -- Iron, Coal, Aluminum, Uranium, and Horses. Unlike in Civ IV where you either had the resource, or you did not, so-called "strategic resources" are a finite quantity -- if you only have one iron mine (and that iron mine yields a measly 2 Iron) you can only have 2 swordsmen, which are iron-dependent units.
If you don't have any more of the resource, you can no longer build units that require it, and if you drop into a deficit of the resource (due to war, end of a trade agreement, etc.) all units which require that resource take a hefty combat penalty until you accrue more of it (or they die, reducing the total draw from your civ's resources).
Comment: Not the answer I was hoping for :(  ps - thank you
Answer: If your iron is in a city that is not connected to others via road or waterway, you will find you cannot build swordsman in other cities until these trade connections are made.
A good way is seeing if this is true is the trade connection icon near your city name and that you can only build swordsman in the city with the iron.


Relating bin numbers to frequency non uniform fft

Question: I understand how to relate bin numbers of FFT output to frequency when dealing with a uniform FFT. How does this process work with a non-uniform FFT?
Answer: The magic of NUFFT is that you create a (oversampled) grid of equally spaced points by performing the interpolation and convolution of your unevenly spaced data. This is mostly done by using Gaussians. After that you apply the Fast Fourier Transform and minimise the effects of the filter you applied previously. Although this method was described by Dutt & Rokhlin in 1993. Currently you can find other, like ones based on Multiresolutional Analysis and Least Square Interpolation.
Nevertheless, you always end up with evenly spaced frequency bins - there are no unevenly spaced frequency bins due to jitter in the time domain.
If you wish to dig into math, then please refer to (among many others):
Particle Simulation Based on Nonequispaced FFT
NUFFT and MRI


Am I being underpaid by my employer based on my contract?

Question: I have a full time contract for $43.90 per hour, which was calculated to $91,300 annual salary. I am paid twice a month. We work a 9/80 shift, which means 9 hour days so we can have every other Friday off. When I look at my pay stub, the amount I am being paid divided by the number of hours shows a consistent $41.80 per hour. This is true for all categories, such as regular time and holiday pay, as well as recent bereavement hours. I am told the calculation for annual salary is based on 2080 hours. Am I being under paid by my employer?
Comment: Are you exempt (on a salary) or non-exempt (paid overtime). When you were hired, was it with a stated annual salary? or was it with an hourly rate? And per-chance is it $41.08 (not $41.80) on your paycheck?
Comment: What country is this?
Comment: Also: is the amount you're paid $3804.16 (gross) or something less?
Comment: If you're working 9-hour days, for 9 out of 10 days (2 weeks), then you're working 9/81, not 9/80 and your employer is probably getting a free hour from you every 2 weeks.
Comment: My experience with 9/80 schedules is that it's 9 hour days Mon-Thurs.  Fridays alternate between 0 hours and 8 hours (this gets you 9/80 instead of 9/81).  Holiday weeks can be weird depending on if your employer is paying 8 or 9 hours for a holiday.
Answer: It all comes down to what your contract says. If it states you should be paid $43.90/hr, then that is what you should expect to see on your pay stubs. If the hourly rate was agreed to, and the gross amount is not equal to the number of hours * $43.90 before any subtractions, then it's likely an error was made. In that case I would contact the HR or AP department for clarification.
Answer: There must be some missing information because 2080 hours divided by 81 hours per 2 weeks is 25.68 pay periods.  Therefore, some days are unaccounted for (unpaid holidays, alternate universe employer calendar, user error, whatever).
Rather than ask us to guess if you are being underpaid by your empoyer, you should speak to your employer and get clarification.
Comment: OP didn't say pay is bi-weekly, OP said twice monthly, so, there may only be 24 pay periods.
Comment: The  OP said  9 hour days with every other Friday off.  From that I assume that means  81 work hours per two week period.  Do the math from there and you'll see that it doesn't add up to 52 weeks, hence the missing days.  How they pay him (once per month) is merely a redistribution of the hours across months of different length. If it's not 81 work hours per 2 weeks then ignore what I have written.
Comment: If doing it that way doesn't compute for you then try this.  There are 261 weekdays this year. If OP was paid for  9 out of 10 of them  (some holidays) then that's 234.9 days worked.  At $43.90 per 9 hour day then he should be paid $92,809. Since he stated that he is due an annual salary of $91,300 then it's still the same answer - something is unaccounted for.  Throw out the odd day and it's exactly 26 two week periods which would mean exactly 234 days worked or a salary of $92.453.  Still means that some data is missing.  He should speak to his employer.
Comment: 2080*43.9 is 91,312. He is being paid twice a month. Every pay stub is different in total, but gives 41.8... They are working 81 hrs per fortnight instead of 80. Total hrs workable is 261 days, 2088 plus 26 hrs , one hr additional every 2 weeks. But this is not adding up. For 41.8, the working days are taken as 270.


Using ISAPI rewrite

Question: I am using IIS and HELICON ISAPI rewrite. Previoulsy I had one website on IIS but have had to add another. So I have one default website and one virtual directory.
My home directory setup is C:\Inetpub\wwwroot\
within wwwroot I have two sub folders C:\Inetpub\wwwroot\site1 and C:\Inetpub\wwwroot\site2
I have something similar rewrite rules:
RewriteCond %{REQUEST_FILENAME} !(/site1.*) [NC]
RewriteCond %{REQUEST_FILENAME} !-s [NC]
RewriteRule (/site2/.*) /site2/urlhandler.cfm\?404;http\://%{SERVER_NAME}/$1\?%{QUERY_STRING}
This works ok however I get a file not found for all sub folders in site2. Anyone have any ideas?
Answer: Please try the following config instead:
<code>RewriteBase /
RewriteCond %{REQUEST_FILENAME} !^/site1.* [NC]
RewriteRule ^(site2/.*)$ /site2/urlhandler.cfm\?404;http\://%{SERVER_NAME}/$1 [NC,L]
</code>

Using ISAPI rewrite


allow only one post in specific category

Question: I have a category called "best post". When the editor selects this category in a post and publishes the page, a PHP routine must check if other posts have this category, and if so, this category must be deleted from all posts except the current page...
Answer: After the post save (using save_post hook) you check if the saved post has your "unique" category, and if so remove the category from the other posts, keeping the one you just saved.
<code>
add_action( 'save_post', 'set_post_unique_category', 10,3 );

function set_post_unique_category( $post_id, $savedPost, $update ) {

    // Only set for post_type = post
    if ( 'post' !== $savedPost->post_type ) {
        return;
    }

    // Check if post has your desired category
    if ( ! has_category('best-post', $savedPost) ){ //use your category slug
        return;
    }

    // Get the best-post category term by its slug
    $term = get_term_by( 'slug', 'best-post', 'category' );

    //Now let's find the other posts with your category
    $args = array( 'category' => $term->term_id, 'post_type' =>  'post' );  //set the arguments for the query
    $postsList = get_posts( $args );

    foreach ($postsList as $post) { //Remove the category from the found posts
         if ($post->ID == $post_id ) //but skip the just saved post
              continue;

         wp_remove_object_terms( $post->ID, 'best-post', 'category' );
    }

}
</code>
I haven't tested it so you could encounter syntax errors or wrong property names, but the logic should be fine, at least to get you an idea of what you should do. A good google search plus a wordpress codex stroll are always your friends ;)
Comment: works well ! Small issue: when you do an "inline edit" , the front-end doesn't get refreshed even if everything goes well on the back end: so a refresh is needed
Comment: in that case you should find which filters are involved in the inline editing and hook similar code to them


3.3V signals to a shift register IC with a 5V supply

Question: I have an SN74HC595N shift register that I want to have output 5V on the Q outputs. If I power it with 5V on VCC, can I tie the SER, SRCLK, etc. pins directly to the 3.3V digital outputs on my microcontroller? I wasn't sure if I needed a transistor between each microcontroller pin, or if the lower voltage would be acceptable directly to the IC.
Answer: It is not guaranteed to work. You could use a level converter chip xx145, or you could use a 74HCT595, which will accept valid TTL levels at the inputs (and a 3.3V CMOS chip will give you that).
Edit: The margins are fine for 3.3V input, as alexan_e mentioned. See below.

Note that you should not connect any outputs form the HC595 or HCT595 directly to the 3.3V circuit.
A simple single-transistor level shifter was discussed here:
If you use a MOSFET you don't need the base resistor, so it can be even simpler.
Comment: You mention the 0.5v and 3.15v levels in a way that seems to suggest that they refer to the 74HCT595 ("the chip I linked to"). This was probably not the intention so I think it would be better to clarify this by mentioning that these refer to 74HC595 and to add the 74HCT595 transition levels ( <0.8v for LOW and >2v for HIGH ) that will work fine with 3v3 signals.
Comment: Thanks for the answer - the HCT version seems like it would be the easiest way to accomplish this. On the other method, instead of a level converter, could I use a transistor with the collector tied to 5V, the emitter tied to the '595 pin, and the base connected to the 3.3V out from the MC? Thanks again.
Comment: @alexan_e Thanks very much for catching that, I'll edit my answer appropriately.
Comment: @user38201 The HCT is the best and easiest way. I've edited the answer to include a reference to a single transistor level shifter.
Comment: Thanks - that link is helpful as well. I'll probably go with the HCT solution.
Answer: I tested this last night to see what would happen. Here was the set up I used.
5 VDC from external power supply to bread board positive rail.
Ground from same power supply to negative rail.
NodeMCU Dev board 2.0 powered via USB cable (HiLetgo brand).

GPIO14 (Pin 5)  (3.3 VDC) to SN75HC595 SER   (PIN 14)
GPIO0  (Pin 18) (3.3 VDC) to SN75HC595 ST_CP (PIN 12)
GPIO2  (Pin 17) (3.3 VDC) to SN75HC595 SH_CP (PIN 11)

SN74HC595

Connected to NodeMCU (Listed above)
VCC (PIN 16) to 5 VDC power rail
MR  (PIN 10) to 5 VDC power rail
OE  (PIN 13) to Ground rail
GRD (PIN 8)  to Ground rail
Q0 though Q7 to positive legs of LEDs (Resistors to ground.)

When pushing a simple loop (for int i = 0; i < 255; i++) the led output acted erratic. LEDs would light up out of order and with different results than what the micro-controller was instructing it to do.
I then started pushing the same value with a 100 ms delay. At first I was pushing the value 255 (b11111111). All the LEDs stayed on. I then switched to 0 (b00000000) with a 100 ms delay. Sometimes the lights would stay off, sometimes they would all come on, sometimes only a few would come on.
I'm not sure why the IC was reacting this way. When I removed the 5 VDC power supply from the breadboard and used 3.3 VDC the Shift register, LED outputs acted as expected. I got the proper results each time I latched the IC.
So the conclusion I came too was to use the same voltages for all inputs of the SN74HC595 shift register. If you need to up the voltage of Q0 - Q7 do so after via level shifting.
I hope this helped.
Answer: You might be able to make this arrangement work just by adding pullup resistors from the '595 inputs to +5V. However, you can only add these pullups if your particular microcontroller has 5-volt-tolerant I/O pins. The \$V_{IH}\$ level for the '595 is too high for a 3.3V processor output, but adding pullup resistors may allow this to work for you. I wouldn't recommend this for a production design, however.
Edit: I was assuming that you really had the HC version of the '595. If you have the HCT version instead then please see the comment by @alexan_e instead.
Comment: Thanks for the answer. My microcontroller is actually 5V tolerant, so I could do it this way. I guess it wouldn't be the best way though.


How to create a sort function that would automatically sort new incoming data

Question: I linked a form to google spreadsheets, so now all the responses on that form are linked, and they automatically are added as plain data in the spreadsheet. One of the columns is date-data, on column B, but the responses are added to the spreadsheets as data in ascending order of submission, so I wanted to know how to create a sort function that would automatically sort new incoming data in descending order according to Column B.
Answer: Try Insert > New sheet and this formula in cell A1 of the new sheet:
=query('Form Responses 1'!A1:A, "order by B desc", 1)
Alternatively, if you want to sort the Form Responses 1 sheet in place, it is better to use filter views to sort the sheet instead of using Data > Sort. A filter view definition can be saved and easily re-activated.
For additional ease of use, you can insert links in the frozen section of the sheet to easily switch between filter views, instead of having to go to Data > Filter views to switch. See the Filter views example spreadsheet for an illustration.


Asking Questions on Stackoverflow vs GameDevelopment stackexchange

Question: Since the new GameDevelopment stackexchange beta https://gamedev.stackexchange.com/ just came out today. When asking questions about game development should i only post them on the new website. I feel like it would be bad to double post. But since not everyone knows about the new site yet I feel as though I would get better responses here.
Answer: If your question has to do with actual code, like "Why is this piece of code only producing 2 enemey AIs at a time?", then Stack Overflow is the better choice.
If your question is conceptual in nature, like "What is a good algorithm for generating mazes?", then Game Developers seems to be the better choice.
Regardless, please don't post a question on both sites. If the wrong site is chosen, it is better to have it on only one site, because a migration is better than a migration and a merge, and centralizing answers is better than diffusing them.
Comment: @Matchu See [this question](http://meta.stackexchange.com/questions/52141/will-it-be-possible-to-migrate-questions-between-the-trilogy-and-the-stack-exchan)
Comment: Can we migrate from core sites to Exchanges, or are we talking about a manual migration? (Also, fancy seeing you here again xD)
Comment: One I recognize that I posted in the wrong place (*i.e.*, a "what's a good algorithm for...?" question on SO), how do I go about migrating it?  if I'm low-rep, do I have to solicit the migration from someone higher-up?
Answer: From a vague look over the GameDev Stack Exchange, I feel that it deals more with questions of concepts (how can I build random dungeons?) rather than questions of the nitty-gritty details of programming (why is my random-dungeon-building code not working?).
That said, the lines are blurry, and may or may not become clearer as the GameDev site continues to grow. I imagine you won't get in trouble either way, so post where you feel you'll get the best response. But try to pick one, since it likely is either concept or code, and the community will politely point you in the right direction if you quite obviously chose wrong :)
Comment: *"post where more appropriate... or on both,"* I would not suggest purposely cross posting "on both." Pick the site you think has the most appropriate audience. If you choose wrong, then it might be appropriate to bring your question to another audience.
Comment: @Robert Cartaino - meh. I didn't feel like being the one to set a hard-and-fast rule, especially since this is likely one of the first times when two communities *really* had potential to cross over, so I took the "only if desperate" stance, instead. But if a mod says it, that's different :)
Comment: @Robert Cartaino - Oh, and I also just noticed that you were responding to a version that had a slightly different tone, since I was probably editing at the moment you were commenting xD ESP wins the day, I suppose. Regardless, question moved to an even less wishy-washy version 3.
Comment: Your current wording sounds like a reasonable approach to me.
Answer: We had this discussion on the GameDev meta and the consensus (based on the votes) basically boiled down to:

Ask your question on GameDev even if its programming related if a game developer would give a different answer to your question than other programmers.

So if your question is about a specific game API or about something where priorities would be different for game development (in a game you might trade off some accuracy for performance, even though the "right" answer from a general programming perspective might be the more "accurate" one). But if your question is about a general programming question but it just happens to be for use in a game (say sorting an array), then SO is your best bet.
That being said, the community is still young, so if you find you don't get a satisfactory answer, then by all means fall back to SO (the GameDev community may yet evolve to a more purely theoretical one).
Answer: If it's both programming and game development related I feel you can do any of the following:

Post it only on stack overflow
Post it only on game development
Post it on both
Comment: is this the duplication that we're trying to prevent?


Extract bibliography from a PDF document

Question: I am trying to extract bibliographies from academic papers which are in pdf format, and I have to do this for 100+ papers. My goal is to create a network of citations amongst the authors and identify the communities.
Is there a way to do this with Mathematica instead of manually copying and pasting bibliographies, paper-by-paper?
Comment: Many journals already provide the list of references (in html format) on the web page for the article. Some also give a list of papers that cite the article in question.
Comment: check out Mendalay and Docear both programs will get bibliography data from files.
Answer: This is actually a complex problem because different journals and papers have different names for the bibliography (e.g. "Bibliography" versus "References") and different referencing formats that are hard to parse. Also some papers put other material (e.g. appendices) after the bibliography rather than before.
That said, here is something to get you started. I am using a working paper I happened to have lying around called "Clustering compositional data trajectories" by F Bruno and F Greco from the University of Bologna.
As long as the PDF is not password-protected you can extract the text like this:
Last[StringSplit[
Import["BrunoGreco.pdf", {"PDF", "Plaintext"}], {"References", "Bibliography"}]]

Specifying both tags means you do not have to check whether each paper uses "References" or "Bibliography", but there is a risk that someone uses the word "References" in the main text. Picking the Last of the split strings will deal with that. You will get output like this:
Abraham, C., Cornillon, P.A., Matzner-Løber, E., Molinari, N. (2003). \
Unsupervised Curve Clustering

using B-Splines. Scandinavian Journal of Statistics 30(3), 581-595.

Aitchison, J. (1982). The statistical analysis of compositional data \
(with discussion). J. R. Statist. Soc. B.,

44, 139-177.

Parsing the bibliography items is a separate issue and will depend on the format of the bibliographic entries.
Edit
Using Sjoerd's test file, I came up with the following partial solution:
test1 = FixedPoint[
  StringReplace[#, {"\n" ~~ Whitespace ~~ "\n" -> "\n",
       "  " -> ""}] & /@ # &, (StringTrim[#] & /@ (StringReplace[#, \
{"[" ~~ DigitCharacter .. -> "", "\[RawEscape]" -> "ff",
         "\.15" -> "\[Dash]"}] & /@
      StringSplit[
       Last[StringSplit[
         Import["13092561v2.pdf", {"PDF",
           "Plaintext"}], {"References", "Bibliography"}]], "]"]))]

{"", "J.W.Burby,J.Squire,H.Qin,Automationoftheguidingc enterexpansion,
  PhysicsofPlasmas20(7)(2013)072105.", \
  "Mathematica,Version9.0,WolframResearchInc.,Champ \
  aign,Illinois,2012.", \
  "J.W.Eastwood,ORTHOVEC:version2oftheREDUCEprogram for3-D
  vectoranalysisinorthogonalcurvilinearcoordinates,Co mputerPhysicsCom-
  munications64(1)(1991)121[Dash]122.", \
  "P.B.Yasskin,A.Belmonte,CalcLabswithMaplecommandsformultivariable
  calculus,fourthedition,Brooks/Cole,CengageLearning, \
  Belmont,CA,2010.", "B.Fiedler,Vectan1.1,manualMath.Inst.,Univ.Leipzi \
  g.(1997).", \
  "M.C.Wirth,Symbolicvectoranddyadicanalysis,SiamJ.Comput.8(3)(1979)
306.", "S.Liang,D.J.Jeffrey,Rule-basedsimpli.1ccationinvect \ or-productspaces,To-
  wardsMechanizedMathematicalAssistants,LectureNotesinArti.1c\
  cialIntelli-    gence(2007)116[Dash]127. "

This cleans up some of the text and deals with a few encoding problems. It should be enough to get you started. You probably only need to parse the authors not the rest of the bibliographic information, so splitting strings at dates and then parsing the first bit at commas should work.
Here is an example that works for the initials-dot-surname format of the second paper. It doesn't pick up authors like "Mathematica", which is in this bibliography list, but I suspect this is not fatal to your application.
  test2 = (Select[#, (StringMatchQ[#, (LetterCharacter ~~
    ".") .. ~~ (LetterCharacter |
    "-") ..]) &] & /@ (StringSplit[#, ","] & /@ test1)) /. {} -> Sequence[]

(*{{"J.W.Burby", "J.Squire", "H.Qin"}, {"J.W.Eastwood"}, {"P.B.Yasskin",
   "A.Belmonte"}, {"B.Fiedler"}, {"M.C.Wirth"}, {"S.Liang",
  "D.J.Jeffrey"}, {"H.Qin", "W.Tang",
  "G.Rewoldt"}, {"J.R.Cary"}, {"J.R.Cary",
  "A.J.Brizard"}, {"R.G.Littlejohn"}, {"J.D.Huba"}, {"Y.Wang"}, \
{"L.Parker",
  "S.Christensen"}, {"K.Peeters"}, {"J.M.Martín-García"}, \
{"D.Stoutemyer"}, {"J.M.Martín-García"}, {"L.R.U.Manssur",
  "R.Portugal",
  "B.Svaiter"}, {"J.Cunningham"}, {"E.Patterson"}, {"H.K.Wimmel"}, \
{"R.G.Littlejohn"}, {"D.Lovelock"}, {"S.B.Edgar",
  "A.Hoglund"}, {"J.M.Martín-García", "R.Portugal", "L.Manssur"}} *)

You can then get a mini graph like this (Squire, Burby and Qin being the authors of that paper):
links = Flatten@ Outer[#1 -> #2 &, {"J.Squire", "J.Burby", "H.Qin"},
  Union@Flatten@test2]

 (*{"J.Squire" -> "A.Belmonte", "J.Squire" -> "A.Hoglund",
 "J.Squire" -> "A.J.Brizard", "J.Squire" -> "B.Fiedler",
 "J.Squire" -> "B.Svaiter", "J.Squire" -> "D.J.Jeffrey",
 "J.Squire" -> "D.Lovelock", "J.Squire" -> "D.Stoutemyer",
 "J.Squire" -> "E.Patterson", "J.Squire" -> "G.Rewoldt",
 "J.Squire" -> "H.K.Wimmel", "J.Squire" -> "H.Qin",
 "J.Squire" -> "J.Cunningham", "J.Squire" -> "J.D.Huba",
 "J.Squire" -> "J.M.Martín-García", "J.Squire" -> "J.R.Cary",... etc *)

 Graph[links]

Comment: I was working with a different test file ("http://arxiv.org/pdf/1309.2561v2.pdf") using similar methods, but was less lucky. PDFs can be a mess.
Comment: Thank you so much for the help!!! I'm going to try it right now!!
Answer: I would use the approach suggested by Simon Rochester above. Just do enough PDF parsing to extract the DOI or URL of the web page for the paper, then use that information to either extract 'Cited by' information directly from the paper's publisher web page, or get the same information by passing the paper's details to Crossref, Google Scholar or one of the other academic databases which keeps track of 'Cited by' information.