Does this wall tile's mortar contain asbestos?

Question: I have some missing tiles behind my sink cabinet and had to clean up some pile of crumbled material from this mortar. This is an old house but the bathroom tiles could have been remodeled since the 1980s. Does it seem to contain asbestos? I just found out it was used in some mortar mixes prior to the 1980s.
Comment: as far as i can tell it contains vermiculite, visible in the crumbled pile and in the darker patches of the mortar in the pictures.
Answer: There's really only one way to tell with a building that is old enough that it might be there (and it "might" be in many things, whether or not it was common in those things.)
That way is to take a sample and send it to a laboratory for analysis.
I once got curious and looked into what that involves, and it's essentially some fancy microscope work that does not look particularly likely to be easily replicated by the home scientist.
Comment: You can purchase a test kit like this to mail into a lab. https://www.homedepot.com/p/PRO-LAB-Asbestos-Test-Kit-AS108/202731785
Answer: No, The ads you see on TV are more about shysters and money than asbestos.


What's a phrase to capture traffic, road type, weather conditions?

Question: What is a short phrase that could be used to describe the conditions under which one is driving (traffic, road type, stop-and-go, weather)?  Our product provides a "rating" to consumers of how risky it is based on these factors (and others, for which we have good phrases to name them.  But this particular group of factors is stumping us.  "Conditions", "External factors", "Environment" are too boring and not good for a consumer facing product.
Comment: They're generally referred to as "travel conditions."
Comment: uncontrollables (noun) ~ [something that cannot be controlled](http://www.dictionary.com/browse/uncontrollables)... contingencies ~ [a contingent event; a chance, accident, or possibility conditional on something uncertain](http://www.dictionary.com/browse/contingency)
Comment: I would normally say "driving conditions" or "road conditions".
Comment: @Benjamin Harman & Hot Licks ~ She said that *conditions* was too boring and specifically wants a buzz word/phrase
Comment: @V0ight - Possible synonyms of "condition":  status, situation, state, standing, circumstance, character, outline, specification, disposition, prospect, influence, category, order, classification, quality.
Answer: contingency, contingencies
dictionary.com

a [conditional, uncertain, possible] event; a chance, accident, or possibility conditional on something uncertain

The Illustrated London News

"The smooth, six-cylinder engine gives ample power for any driving contingency. Steering, braking, acceleration are superb, owners say, and petrol consumption is surprisingly low. Springing is smooth, upholstery luxurious, the equipment for comfort and convenience splendidly complete."

Principles of information retrieval

"We could perhaps design a machine which drives (or learns to drive) a car with a standard transmission. We might not say this machine knows how to drive. it has no options for action. Every driving contingency has to be anticipated by its designer and planned for. There are no questions for it to ask, for it could not behave differently than it does."

Michigan Manufacturer and Financial Record

"These headlights adequately answer the demand for every conceivable driving contingency — country driving, country passing, city driving, city passing and parking. These five variations are available in the new Cadillacs."

Engineering and Mining Journal Press: Vol.114

"By the elimination of certain mechanical handicaps we can gradually approach an "ideal atmosphere"; at any rate, one in which less attention need be paid to car performance and more to road contingencies."

Diseases of a Gasolene Automobile: And how to Cure Them : a Practical Book ...

"Despite the fact that the space available for tools is usually limited, with a judicious selection of tools, nearly all emergencies or road contingencies can be successfully met."

Motorcycles from the inside out: and how to keep them right side up

"The enduro motorcycle saddle is usually large enough to allow significant fore and aft rider movement, to allow easy front or rear weight bias for off-road contingencies."

The Motor Car Journal, Volume 11

"The vehicle, which is painted a brilliant or-inge, is fully equipped to meet all road contingencies."

Zen Driving

"Natural-self, the experience and awareness needed to handle all driving contingencies, never gets acknowledged, much less fully developed. Instead of driving in control of all situations, we fall hostage to them."

The Autocar: A Journal Published in the Interests of the Mechanically Propelled Road Carriage, Volume 105

"...in front of the shiny, red bonnet is a picture which lights up to present various driving contingencies, so that pupils can take appropriate action."

Keystone Motorist, Volumes 26-27

"The reason for this generally accepted opinion is that the rear wheels are the ones that propel the car and should, therefore, have the best grip on the road to meet various driving contingencies, particularly in order to prevent skidding."


Can a Noahide persuade a non-Jew not to convert to Judaism?

Question: Can a Noahide rebuke and strongly and repeatedly persuade a non-Jew [a complete stranger] who is in the process of converting to Judaism, not to covert and rather remain a Noahide and keep the seven Noahide Laws because of their halacha obligation as mentioned in Melachim uMilchamot 8:10? I don't understand this because the Beit Din strongly discourages external factors like this that may interfere with anyone's conversion process or spiritual journey.
Comment: They should follow the Beit Din's lead. If the Noahide feels conversion is not for this person, they can approach the Beit Din. (Of course if the prospective convert is asking for advice, that's one thing. But otherwise ... why get involved?)
Comment: How are these mutually exclusive? One should keep the Noahide laws regardless of whether they will eventually convert.
Comment: I don't understand what connection you are drawing to 8:10. Can you please elaborate on your intent?
Comment: They claim that someone's conversion process doesn't nullify their halacha obligation to compel people [strangers] wanting to convert to Judaism to keep the seven Noahide Laws.
Answer: I don't know of any Noahide halacha about this type of situation. Even if there was, who's to stop him? The question seems to be asking for an opinion. "Can?" Yes, he can, in a free country.
The Noahide would need a legitimate and compelling reason to involve himself in someone else's conversion process. That's just not possible for a stranger.
If a Noahide met a total stranger, found out the stranger was in the process of conversion, I can think of no reason that would make it appropriate or acceptable for the Noahide to "rebuke and strongly and repeatedly persuade" the person to stop the process and just be a Noahide. It is none of their business and could cause emotional harm to the convert and their family.
Even if the Noahide assumed too much of a connection to the stranger he just met and thought good-natured teasing would increase camaraderie, he could be wrong. A sensitive person could take it seriously, and that changes the dynamic. Maybe he could do so with his Army buddy who after years, decided to 'take the leap.' This just isn't the type of thing to play around with a total stranger.
If the Noahide knows the convert, and has some reason to be concerned, or knows the convert is acting deceptively and feels compelled to 'do' something, he should talk with the rabbi. But really, even then, it's none of his business. It's between the person and the rabbi doing the conversion. Blowing the situation up with drama is not the way to go.
If it happened, and the convert told his rabbi, perhaps he would be advised to simply avoid the person and not engage with him? Or don't share with strangers he's still in the conversion process, just be a Jew in public and let it be? Seems best not to open oneself up to someone else's scrutiny if possible.


Create Force.com project from DE Org

Question: I have Eclipse Kepler (4.3.2) installed and the Force.com plugin installed.  I've been able to connect to a Development Sandbox from within Eclipse.  However, I cannot connect to my DE Org environment.  Is this possible using the Force.com plugin for Eclipse?  Or can you only connect to non-DE Org environments from within Eclipse?
Answer: The first "Environment" option when you create a Force.com project is "Production/Developer Edition" and using that yes you can connect to a DE Org.
Have you double checked the credentials you are using including the security token? What error are you seeing?
Comment: With "Production/Developer Edition" selected, I get back this error: Unable to connect to hostname 'www.salesforce.com': Invalid username, password, security token; or user locked out.  I don't see an option in my DE Org where I can generate a token, so I'm using a valid username/password that works when I log into the DE Org via my browser.
Comment: @MichaelSobczak Log in via your browser and follow these instructions to have a new security token emailed to you https://help.salesforce.com/HTViewHelpDoc?id=user_security_token.htm&language=en_US. You can't connect from the Force.com IDE without a security token because the underlying APIs used require a security token.
Comment: I'm new to the platform, so I hadn't realized where that option was displayed for a DE org.  Thanks for pointing that out!
Comment: @MichaelSobczak You can also whitelist your ip if your token changes a lot.  Might have to check with your admin to see if they will let you do that
Answer: If you are getting "Unable to connect to hostname 'www.salesforce.com': Invalid username, password, security token; or user locked out",
make sure Security Token Field is blank and the password field has YOURpasswordYOURsecuritytoken

Create Force.com project from DE Org


The difference between getString() and optString() in Json

Question: What is the difference between getString() and optString() in JSON?
Comment: `optString` can be useful in situations where you aren't confident that the JSON request format will remain the same... i.e., calling `getString` on a JSON request might work at first, but if it changes in the future such that the key no longer exists, an exception will be thrown and your app may crash.
Answer: As Diego mentions, it's a good idea to check the documentation (this link is now out of date - good thing we have the Wayback Machine!) before posting a question here, but now that you have:
The difference is that optString returns the empty string ("") if the key you specify doesn't exist. getString on the other hand throws a JSONException. Use getString if it's an error for the data to be missing, or optString if you're not sure if it will be there.
Edit: Full description from the documentation:

Get an optional string associated with a key. It returns an empty string if there is no such key. If the value is not a string and is not null, then it is converted to a string.
Comment: FYI: providing a second string as a parameter will be used as a default value if the key specified doesn't exist.
Comment: Upvoting cuz I got to know about the Wayback Machine. It's super amazing.
Answer: If you want to avoid NullPointerException you better make use of optString()
If you  are fetching the data from JSON at any time, you might have null data for a particular Key value, at that time instead of implementing Null conditions, better make use of this optimized method optString("<keyname>")
Answer: public java.lang.String optString(int index)
Get the optional string value associated with an index. It returns an empty string if there is no value at that index. If the value is not a string and is not null, then it is coverted to a string.
Parameters:
index - The index must be between 0 and length() - 1.
Returns:
A String value.
Answer: 1) getString (String name):- This method Returns the String value mapped by name if it exists, coercing it if necessary, or throws JSONException if no such mapping exists.
2)optString (String name):- This method Returns the String value mapped by name if it exists, coercing it if necessary, or the empty string ("") if no such mapping exists.
Answer:
optString() is used to overcome NullPointerException, which we get while using getString() when the required key doesn't exists in json it basically replaces with the default value.

example let the input Json be
{
"name":"abhi",
"country":"india"
}

now in java when you execute
String city = json.getString("city");

it will throw a NullPointerException.
by using optString(String key, String default) we can overcome the above problem.
String city= json.optString("city","default");

System.out.println(city);

Output: default


Does W3C validated CSS automatically mean cross-browser compatibility?

Question: I've finally completed a working version of my first ever CSS-supported site (thanks to some very helpful suggestions on this forum) and have validated the CSS.  Before I go out and find (buy?) another machine (I'm a Mac) to check IE on, is it remotely possible that the valid CSS is really truly valid on IE as well as Firefox, Safari that I have used to check my code so far?  Thanks, Patrick.
Answer: Nope, W3C validates against the CSS standard. Unfortunately popular browsers (read: MSIE 6.0) are not very standard compliant ;)
Comment: So... as a total IE-bug newbie, can anyone suggest the best place to start looking for ideas on how to fix, or even to know where to start thinking about what might actually need fixing?
Comment: Personally, trial and error is the best way to solve it. I hate it. This is why I mostly hire designers to do the hard work for me ;) I stick to ASP.NET MVC ;)
Comment: Thanks mate, now begins the slow trial and frequent error process... ;)
Comment: I wrote a pretty extensive cheatsheet for IE6: http://www.virtuosimedia.com/tutorials/ultimate-ie6-cheatsheet-how-to-fix-25-internet-explorer-6-bugs
Answer: I think it entirely depends on how complex your CSS and layout is - if its at all complex, then I wouldn't hesitate to say 'no'.  Your best bet is to check it on other platforms.
You might want to look into BrowserCam - they do screen shots of websites in all major (and some minor) browsers, and the more expensive accounts allow you to use VNC to actually go interactive on those platforms.
Comment: Thanks, that's a good suggestion and a nice concept. I'll give it a shot.
Answer: Not all browsers fully, correctly, and consistently implement all CSS features, especially when it comes to CSS2 or the upcoming CSS3.  W3Schools.com can help you, though, as it lists which features are compatible with which browsers—although I'm not sure how up-to-date this information is.
In the end, there's little substitute for testing on all popular browsers.  I would recommend installing Wine, Parallels, or VMWare and testing IE and Chrome.  It might be good to test Konqueror, as well, if that will run on OSX.
If installing one of these is too much a PITA (or if IE and Chrome won't run on Wine or Parallels—I'm not really sure—and you don't have a copy of XP to install on VMWare), you might have a friend running Windows that you could utilize.  Worst case scenario, most libraries have Windows machines you could test with.
Answer: Remember that the validator can only see if your syntax is correct. It can not understand what layout you are trying to achieve, so that your page validates will never be a sign of it working as you wish in all browsers.  It might do, but the validation itself can't tell you.
However, validating your pages will be a good idea nonetheless. If there are no syntax errors, the chances of everything working correctly grow.
Answer: To rescue the web designers from this aching job of testing browser compatibility in different browsers there are few websites which offer this service. On these websites you can check the compatibility of your website in all desired browsers. You can find these websites at http://www.bestpsdtohtml.com/7-awesome-resources-to-test-cross-browser-compatibility-of-your-website/
Answer: "is it remotely possible that the valid CSS is really truly valid on IE as well as Firefox, Safari that I have used to check my code so far?"
Valid?  As in accepted by a browser?  Yes.
Look the same?  Not necessarily.
If your page is simple enough and avoids all the known IE incompatibilities, you're good to go.  [We try to do this: just avoid the weird stuff, use tables, accept the limitations of one-size-fits-all-browsers.]
My suggestion is that you put a "Download Firefox" badge on your page and not worry about IE.
Comment: Thanks, what I'm not sure about is where I might find these known IE incompatibilities so I can get started fixing them - but I'll use BrowserCam (thanks Moo) and see what that turns up. Cheers.


Is it possible to mount on a PC an SD card that has been encrypted by an Android Marshmallow device?

Question: I have a Samsung Galaxy S5 duos with stock Android Marshmallow, and I'm considering encrypting my SD card to prevent access to its contents in case I lose my phone. The main reason of not doing this is that I'm not sure if there's a way to mount an encrypted SD card on Windows (or other desktop OS's)
When I encrypt the SD card on my Samsung Galaxy S5, is it using a known implementation of encryption, or is it something that only works on Android (or perhaps Samsung) phones?
I do not want to use USB connection to my phone to access my SD card, it's terrible. Mounting the SD card is much easier and faster and less annoying.
EDIT: just to clarify, I am NOT talking about adoptable storage. I want a portable encrypted SD card that can both be read on PCs and Android phones (i.e. I want to be able to remove the SD card from my phone, plug it into my PC, provide a password to decrypt and read/write it like any other SD card)
Answer: Marshmallow has two ways to treat the external SD card :

Portable Storage : In this the entire memory of the ext.SD card is available for use, if it is not encrypted (natively) and you can mount it on your PC to read/ transfer contents
Adoptable-storage: In this the ext. SD is treated as a part of the phone and when you encrypt the phone, the ext. SD card is also encrypted. Once it is encrypted, it can only be read through USB and cannot be read independently by using a card reader to mount on your PC. You can read more on this at adoptable-storage tag and it's wiki has questions to answer the common concerns. So, for all practical purposes encrypted ext. SD card cannot be read on PC independent the device. However, if your device is rooted, you can try the method suggested here How to decrypt Adopted Storage?
Full Disk Encryption details different encryption modes on Android Marshmallow. Whether OEMs implement it with additional security features is not known and surely won't be shared on public domain

Edit: Answering OPs query in comments and edit to question
See How does Samsung implement SD card encryption?

Samsung implements proprietary encryption as evident from the question and also this
Reasons for full disk encryption differences between Nexus & Samsung
Encrypted card cannot be read without the device as on the first question linked

So, it would be not possible to read the card on your PC, by mounting it via card reader on your PC as you propose to do. To clarify further, it can be read if you connect your device using USB
Edit: For a technical understanding, see the excellent answer here How does Marshmallow encryption work technically?
Answer: The encrypted SD card cannot be accessed in a PC unless you are connecting via a USB cable with the parent phone.
Android Marshmallow (6.0+) have a unique feature to format SD card as internal storage (I think this carries some encryption along with the formatting process). I have tried this, and after it is formatted to internal storage, the SD card is useless without mounting in the same phone in which it was formatted.(Edit: Unless you have root access.)
However SD card can be accessed from a PC, after formatting the SD card.
Comment: After formatting doesn't help much if the OP wants the data. But without formatting helps: [How to decrypt adopted storage?](http://android.stackexchange.com/q/145443/16575)
Comment: @beeshyams I think it can be applied to any rooted device.
Comment: @Izzy, that was a new knowledge for me. Thanks :)  But this works only with root access.
Comment: Sure – as most of the "interesting things" do. That's what they call "security" (keep the data securely off the hands of users ;)


What happens when you take a whole monthly dose of zinc just once per month?

Question: When it comes to Vitamin D3 supplementation there are studies that give a patient a big dose of 50,000 UI once per month. What happens when I take a similar approach to supplementing zinc?
Are there adverse effects from taking too much on a single day?
Answer: That approach works with some supplements and not others. Iron, for example, will be held in the small intestine until the blood level lowers enough for safe absorption by which time it might just be pushed out of the body.
Zing is regulated by secretions in urine and sweat. Any you ingest, or breath in (unsafe welding practices), will be absorbed by the blood stream in a rather reckless fashion. Then the body will filter it down to normal levels. Before your body accomplishes this task you might be subjected to symptoms of zinc poisoning.
https://en.wikipedia.org/wiki/Zinc_toxicity
Comment: might add that A,D,E,and K vitamins are fat soluble, so your body holds onto them longer.  Yes D can be taken like that, but that is not usually indicated unless there's deficiency.  Vitamins and minerals are cofactors and enzyme components and all sorts of things in your body. You CAN overdose on many of them.


Bypassing IsDebuggerPresent

Question: I am currently trying to attach a debugger to a program with a callback for IsDebuggerPresent. Normally, i would patch the program to pass over this check, but patching the program is not an option. How would I go about getting a debugger attached so dynamic analysis is possible?
Comment: Hi and welcome to RE.SE! For starters, what debugger is this? Your question is unclear. Mentioning `IsDebuggerPresent` indicates that this is on Windows, but even that may be a fallacy on my part. So what debugger, what OS? If this is `IsDebuggerPresent` on Windows, it's implemented by checking for some value in the PEB, IIRC. So presumably you could attempt to set a hardware breakpoint there and be notified whenever some code access this particular piece of data.
Comment: Why is "patching the program is not an option."? can you use breakpoints after attaching?
Answer: as I understand your question, if your binary doesn't have a packer / protector, and you can't use any way to hook the original source, try using a kernel hooke like TitanHide, and observe the behavior, now if not having anything so complicated check the sides of your debugger look for flags and find the "zero flag", and change your return, this is something simple, but if you specify better I can give you another answer, good luck.

Bypassing IsDebuggerPresent


Is there anything that determines the number of times a pokeball will shake

Question: When catching Pokemon, we all see the pokeball shake back and forth. Does more shakes actually indicate that I was close? Is there any useful information I can get from the number of shakes?
Answer: Like in the rest of Pokemon video games, it shakes up to 3 times when you catch it.
Each throw has an individual chance. If you throw and 2 shakes occur but the Pokemon escapes, that has no effect on your next throw -- you might catch it, or it might shake once and escape.
In other words, I don't consider you to gain any useful information about it at all.
Answer: It's in all games and just a design choice to build tension and excitement. Otherwise this would complicate game mechanics without any real benefit. There's no difference in luck no matter whether it escapes immediately or after shaking two times.
You basically roll the dice once: Do you catch the Pokemon or do you fail?
If you catch it, everything is done.
If you don't catch it, a second roll determines how many shakes are actually shown.


Game Center Simultaneous Turns

Question: I'm new to iOS (although I do have a lot of C++ experience) and I am working on a turn-based card game using gamecenter. Here's the catch - The player who's turn it is is the judge and waits for all OTHER players to play a card before the turn is over. Is there a way to do this in Game Center, so all players chose what to do simultaneously and once all have done so, the judge is notified, makes a decision, and then passes priority to the next player? For example, say we start turn 1. I ask the question, @"What is your favorite color?" to all players passing them a gamestate which has that as the question and them not having answered it. Then you respond, @"Green", and our friend Steve responds @"Blue". I then decide which is better, give one of you a point, and then whoever I gave the point becomes the new judge. My question is, how do I allow all players to respond simultaneously, rather than sequentially. I know that, worst case, I could sequentially loop around through players until it comes back to me, then judge it, but this would slow down my game and make it less fun. Is there a way to do this simultaneously?
Comment: If you notify the judge player as soon as a choice is made by any player, then code running on the judges side should easily know if they got all responses or not. Right?
Answer: The iOS API is built around the model of sequential turns. While the workaround you mentioned will work, there is no way to get GC to do real concurrent turns. Sorry ):
Comment: As an extension to this, as of iOS7 this is possible via exchanges - a mechanism that allows players who aren't the current player to transmit data to other players and update the match state.
Answer: I agree with NSSplendid about the API for turnbased games requiring sequential turns.  The only truly simultaneous method would be using the real-time matches from GKMatch, and that isn't really an option for games with more than a few players.
However, the sequential version could be improved slightly by using a programmatic approach to game center instead of the default view controller.
Ending a turn fires off a push notification through Game Center, and by using GKTurnBasedEventHandler's method handleTurnEventForMatch:didBecomeActive:, you can receive that in your app.  When the judge asks the question, have the users display that as part of the game, and have their responses stored locally until their turn.  Once it becomes a given player's turn, they receive the notification, even with the app in the background.
In the method, it can check the locally stored answer and end the turn immediately, if they've answered.  If they haven't, send the turn once the answer is complete.  It's not truly simultaneous, but the judge gets the answers as soon as everyone has responded, without the players having to wait for one player to finish before they can enter their own answers.
The players won't get the notification that the judge has ended their turn until they open the app, but they can't see the question anyways without doing that.  Another approach to this, though slightly wasteful, is after the judge ends their turn with their question, is to do a runthrough of all the players ending their turn as soon as they get the "Your turn" notification, so everyone knows a question has been asked, then doing the steps from the previous two paragraphs.

Game Center Simultaneous Turns


Draw a self intersecting polygon on the HTML Canvas

Question: I'm looking for a way to draw a self intersecting polygon with holes,  I'm using the HTML Canvas element.
So given 5 points,  I want to draw the red one below.

This question is essentially the same thing.
Note:  I don't want to do this using line intersections and adding more points, the actual paths I will be using will be curved.
Answer: You can't draw the first pentagram with a single path in Canvas 2D - the fill rule being used there is even-odd and Canvas fills shapes with the non-zero winding rule.
I think you'll need to compute the intersection points for the corners of the interior pentagon and fill it separately.  To achieve the drawing you use as an example, you could fill the pentagram (without stroke lines), fill the internal pentagon (again without stroke lines) then draw the pentagon outline stroke without filling.
Answer: I'm mostly sure you don't wanna draw it all yourself, do you ? http://gpolo.awardspace.info/fill/main.html shows it being done, but it is all manual work.


Can i write in the data field of a transaction?

Question: I read here Is it possible to insert some custom data in the DATA field of an Ethereum Transaction? that it is not possible to write in the data field of a transaction, even if it is a simple balance transfer.
But I was able send a transaction (with ethers io library with the method sendtransaction) after overidding the tx data field with data 0xcAdd..,
The transaction was send to Ropsten and it was mined and confirmed in a block and the data were shown in the dtaa field .
How is this possible? Can we write in data field whatever we want by overidding the tx before sending it to blockchain?
Answer: Yes you can but you should be aware of some things.
A simple ether balance transfer will still run some contract code.
Because code runs, there are ways a user can be tricked to run code that harms the user: for example, a user could be tricked to lose their tokens..


Javascript, node, Q promises, prototype functions, and "this"

Question: I don't really understand why "this" is undefined in my handleAuthSuccess function, but I imagine it has something to do with it being called by the promise.
Can anyone explain? What is the a proper working way to do something like what I'm trying to accomplish here?
Client.prototype.authenticate = function (email, password) {
    authenticationService.authenticate(email, password).then(this.handleAuthSuccess, this.handleAuthError);
};

Client.prototype.handleAuthSuccess = function (email) {
    console.log("Credentials verified. Proceeding with login.");
    this.session.auth.isAuthenticated = true;
    this.session.auth.id = email;
    var response = { Type: 'login success' };
    this.send(response);
};

Answer: You need to bind your callbacks so they have the proper this.
.then(this.handleAuthSuccess.bind(this), this.handleAuthError.bind(this))

You can also bind the functions in your constructor, like this:
this.handleAuthSuccess = this.handleAuthSuccess.bind(this);

and then call the function as you are doing now.
Comment: Perfect. Thanks! Opted for binding in the constructor.


Alternatives to Diffie Hellman

Question: Assume that Discrete logarithms can be solved in linear time over any group (hence factorization is also trivial by a result of Eric Bach), is there any other candidate public key exchange problem that will facilitate computationally secure key exchange?
Comment: There are candidates in [Lattice-based cryptography](https://en.wikipedia.org/wiki/Lattice-based_cryptography), for instance using the problem [Learning with errors](https://en.wikipedia.org/wiki/Ring_learning_with_errors_key_exchange).
Comment: @Bruno. Also, as the [Wikipedia article mentions](https://en.wikipedia.org/wiki/Lattice-based_cryptography#Quantum_algorithms_and_lattices), lattice based cryptography has so far resisted quantum attempts to break it.
Answer: The Wikipedia page on "Post-quantum cryptography" provides a list of proposals for PKE resistant to quantum attacks. Quantum algorithms can solve DL in finite abelian groups (as well as a few nonabelian and infinite abelian ones), so they get very close to the spirit of the question you are asking. The learning with errors problem mentioned by one of the commenters is on that list.
I do not know of a general answer to the question of "What is the power of DL in arbitrary (that is, nonabelian) groups?".
Comment: I think this is a pretty good attempt
Answer: Check Supersingular Isogeny Key Exchnage for some nice work on a Diffie-Hellman like Key Exchange based on isogenies between supersingular elliptic curves. This will compute computationally secure key. The authors mention that even though the key exchange is secure it will most likely be interesting purely for research/ pedagogical reasons.
There also is a cython implementation by De Feo SSIKE git. I would not rely on that for cryptographically secure key exchange but it is a good starting point.
Additionally to the wiki page mentioned Adam Smith you might wonna checkout this website for a good overview of literature: pqcrypto. On that page you will also find a link to this document: Post-Quantum Crypto Introduction. Thats the introduction to a book called ''Post Quantum Cryptography''. On pages 6-10 you will find a technical overview of three ''common'' post-quantum cryptosystems.
Comment: I dont understand.. I wanted to avoid DH and you are giving a special case of it
Comment: Can you explain why you expect the "supersingular isogeny.." scheme will remain secure even if the discrete log is easy in every group?  For instance, the paper doesn't try to make that kind of claim, from what I can see.  Can you explain why you think this might be true?
Comment: @Arul, my comment was not directed at you -- it was directed at Fleeep.
Comment: The SSIKE is not based on diskrete log but on finding isogenies between curves. The fastest algorithm for calculating such isogenies over a field $F_{p^2}$ is $\sqrt[6]{p}$ for quantum computers and $\sqrt[4]{p}$ for classic computers.
The scheme looks like DH though.

Take a look at page 5/6 of the paper, theres a sketch of the key exchange.
Comment: As stated in the answer, its is Diffie-Hellman LIKE, not Diffie-Hellman.
Comment: @D.W. What part of the words 'I don't understand' is not clear?

Alternatives to Diffie Hellman


Restrict Over Exposed images

Question: How to restrict overexposed images while I am using canon t1i and 18-55mm lens? Reception desk light is overexposed, you can see.
Comment: Can you clarify when to restrict, during take of photo, in post?
Answer: This is typical situation of high dynamic range in interior photography. You can avoid such situation using for example HDR. Take several photos with bracketing and in post combine them. But speaking in generally you do not need to care so much about overexposure of the light source. It's understandable light source will be (almost) always overexposed.
The other way is to switch off this light, take photos and add some light in post. A bit of cheating but in some cases work much better.
Comment: @Tanveer, and do not forget to use tripod

Restrict Over Exposed images


Key Agreement between two nodes of a Wireless Sensor Network

Question: Can there be a way to form a shared secret key between two nodes of a Wireless Sensor Network who are more than one hop away, simply on the basis of their IDs?
Comment: I edited your question to talk about "key agreement" instead of "secret sharing" because the latter is "you have a secret and you want to split it up so that a certain subset of people is needed to reconstruct" whereas "key agreement" is "you have a set of nodes who want to have a shared secret but only have a public channel available".
Answer: If you make the IDs of the nodes public keys, you can easily derive shared keys by only using node IDs. But the IDs themselves will be rather large like 32 bytes.
Answer: Yes, using identity-based cryptography; in particular the Sakai-Ohgishi-Kasahara non-interactive key distribution protocol, generalized in "Provably secure non-interactive key distribution based on pairing".
The downside is that it requires a "Private Key Generator", a trusted party which is able to compute the private key of any node. The private keys also need to be securely deployed in each node.
Using the protocol, each node will have and ID. They simply need to exchange IDs and will be able to compute a shared key.


"Install-Module -name AzureAD" fails with error on PS6 with MacOSX

Question: I was able to install Powershell Core on MacOSX and now I'm trying to administer an Azure AD instance from the same.
When I install the AzureAD module, I get the following error
<code>PS /Users/c> Install-Module -name AzureAD

Untrusted repository
You are installing the modules from an untrusted repository. If you trust this
repository, change its InstallationPolicy value by running the Set-PSRepository
 cmdlet. Are you sure you want to install the modules from 'PSGallery'?
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help
(default is "N"):y
PackageManagement\Install-Package : Unable to load DLL 'api-ms-win-core-sysinfo-l1-1-0.dll': The specified module or one of its dependencies could not be found. (Exception from HRESULT: 0x8007007E)                                           At /usr/local/microsoft/powershell/6.0.2/Modules/PowerShellGet/1.6.0/PSModule.psm1:2057 char:21                                                                 + ...          $null = PackageManagement\Install-Package @PSBoundParameters
+                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package], Exception
+ FullyQualifiedErrorId : System.DllNotFoundException,Microsoft.PowerShell.Commands.TestModuleManifestCommand,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage
</code>
I looked around for ways to get api-ms-win-core-sysinfo installed on Mac, but being it's a different OS, I didn't see any straightforward resolutions.
Answer: This module is not yet ported to dotnet core, so you cant use it on Linux\Mac.
You can take a look here:
https://www.powershellgallery.com/packages/AzureAD/18.104.22.168
also, you can use this search to confirm my statement:
https://www.powershellgallery.com/items?q=Tags%3A%22PSEdition_Core%22++azuread&x=0&y=0
Comment: Nice new user logo ;-)
Answer: As @4c74356b41 rightly says, the Azure AD module is not ported to PowerShell core yet.
Besides installing a VM with windows, and depending exactly what you wish to do, you could try the Azure CLI for OS X
If a browser experience is okay for you, the Azure Cloud Shell also offers CLI and even some Powershell commands (though this also runs on Core in the background):
Answer: If you look at the error message it is clear, that the error is not about the AzureAD module not being available on your platform, but more about the "PackageManagement"-Package not being supported. So you can try downloading the module directly from powershellgallery and unzipping it into your module path.
Answer: I've hit the same problem - it's frustrating that the AzureAD module isn't open-sourced on GitHub. While the Az module is, it lacks most of the functionality of the AzureAd module.
One option is to "copy" the version of AzureAD from cloud shell, as outlined here:
https://www.michev.info/Blog/Post/2339/azure-ad-powershell-module-with-support-for-powershell-core
Another option is to write your own Powershell core module that calls the Graph REST APIs directly.


Postgres psql command intermittently 'stalls' in powershell

Question: I'm in the process of moving a postgres database to a new server.
I have number of large tables, partitioned by month, each contains several 10's of millions of rows.
I have a powershell script to do the following....

Copy the backup file (for a single partition) from archive location
(using robocopy)
load the file back into the database using psql.
drop the backup file.
loop back to the beginning and move onto the
next partition.

Copying the file from the archive takes maybe 10 minutes, loading it typically 40 minutes, then it moves onto the next partition. The problem is that the PowerShell console seems to occasionally get 'stuck' after loading a partition. Occasionally, a partition seems to be taking too long (say an hour) I check the windows task manager, and none of the processes seem to be doing anything.  I check the dashboard in pgAdmin4 (no locks, most sessions idle). Then I check the record count for the partition being loaded - the record count seems to be static (still the same 5 minutes later). So as far as I can tell the partition has been loaded successfully, and the database is mostly idle. But the powershell console that's running the load session hasn't changed, then I shift focus to the powershell console, press return a couple of times and suddenly it bursts into life. The console tells me it's moved onto the partition, the task-manager indicates that the powershell process and postgres process are now running again, pgAdmin4 also indicates the database has sprung back into life.
The powershell script logs to screen using Write-host and the current time between each step, so I always know what the most recent step was. My conclusion is that the interaction between powershell and psql is somehow 'broken' - powershell hasn't worked out that psql has finished and doesn't know to move onto the next step.
Other info - there's no sign of any errors (that I can spot) all the tables seem to get populated correctly (eventually) and the script works fine on all the smaller partitions. This only happens on about 1 partition in 10, the only cure seems to be pressing enter a couple of times.
This isn't a critical problem, occasionally hitting enter a couple of times is a viable solution, but an understanding of what might be going on (or even a solution) would be much appreciated.
Answer: Ok - found a solution.
Need to alter the properties for the powershell console. untick both the boxes quick edit mode and insert mode


using particle system to cover hollow objects

Question: I want to use particle system to put particles on the inside of this hollow cylinder (to project from inner surface to the hollow cavity or lumen) but when i use particle system it automatically covers the outside of the cylinder with particles.
Comment: "..to put particles on the inside of this hollow cylinder"... which one? maybe will be better explain what kind of effect you are looking for, or attach some images to let people evaluate your problem.
Comment: @mike I edited the question.
Answer: Although you can give hair a negative length,

it is better to change normal directions

or solidify a tube and choose what faces to generate particles on.
Comment: very nice answer
Answer: The particle system is following the direction of the normals on the cylinder faces.  You can flip the cylinder face normals so they point in instead of out.
If you select the cylinder, switch to edit mode, select all with "A", and then do Mesh -> Normals -> Flip, that'll flip all the normals.  Go back to object mode, and your hairs should be growing into the cylinder (though you may need to decrease their length to keep them fully within the cylinder.
If you need faces with outward pointing normals on your cylinder, too (e.g., if you want to properly shade the outside of the cylinder), then you should give your cylinder both inner and outer faces.  The Solidify modifier can do this, and if you put it in the modifier stack after the particle system, the particle system will continue to grow only on the inside of the cylinder.
However, if you need to Apply your Solidify modifier at some point, you'll have particles growing on both the inside and outside, because they'll be coming out in the normal direction from all the faces.  To fix this, you can use a vertex group to define which faces should emit particles.  It's a little complicated, but basically:

Go into the Cylinder's Mesh Object Data pane.
Under Vertex Groups at the top, add a new group named "Inside".
In edit mode, select all  the inner vertices (or inner faces), and click "Assign" under the Vertex Groups panel.  Go back to object mode -- it'll still look the same.
Switch to the Particle Properties pane, and under the Vertex Groups panel, select "Inside" as the "Density Group"
Now, the hairs should only be growing from the inside.


UIGraphicsSetPDFContextURLForRect does not create clickable region on a Core Graphics PDF

Question: I am trying to create a rectangular region on my PDF that will go to a URL. The PDF is created in an iOS app using Core Graphics routines.
In a search to find anyone with a similar problem, I found this Stack Overflow question:
Embed hyperlink in PDF using Core Graphics on iOS
If I use the code provided in the answer of the above question, it sort of works for me. The text shows up and is a clickable link, but if I specify a rectangle that is much larger than the text, only the text is clickable. In addition, modified the code a bit so that I could provide a label and a URL separately, and when I did this and provided an empty string, there was nothing anywhere in the rectangle that was clickable.
However, if I use the UIKit routines for creating a PDF (basically UIGraphicsBeginPDFContextToFile and descendants), then the call to UIGraphicsSetPDFContextURLForRect creates a region in the resulting PDF file that is clickable, even if I do not provide any text.
Here is the method that I am using to create the rectangle link:
<code>+ (void)rectLink:(NSString *)urlString frame:(CGRect)frameRect cropBox:(CGRect)cropBoxRect sourceContext:(CGContextRef)context
{
    UIGraphicsPushContext(context);

#ifdef OUTPUT_TEXT_LINK_OUTLINE
    CGContextSetLineWidth(context, 5.0);
    CGContextSetStrokeColorWithColor(context, [UIColor purpleColor].CGColor);
    CGContextStrokeRect(context, frameRect);
#endif

    NSURL *url = [NSURL URLWithString:urlString];
    UIGraphicsSetPDFContextURLForRect(url, frameRect);

    UIGraphicsPopContext();
}
</code>
(The OUTPUT_TEXT_LINK_OUTLINE define is something that I am using for testing to make sure that the rectangle I am passing in is in fact where it is supposed to be.)
And here is a call I am making to the above method on the first page of my PDF generation:
<code>[self rectLink:@"http://stackoverflow.com" frame:CGRectMake(474,22,28,28) cropBox:cropBoxRect sourceContext:context];
</code>
The variable cropBoxRect refers to the crop box for the current page, and context is the value that I am saving from the CGPDFContextCreateWithURL call at the start of the document.
Answer: It is better to write your own writer for writing such annotations to pdf instead of using core graphics APIs, As Apple has not taken PDFKit to cocoa-touch,
- You can follow simplest "incremental update" approach for modifying the pdf which is mentioned in PDF reference 1.7.
- You need to search the page object number in pdf then get /Annots array in it add your annotation token, append its object number to /Annots array
- Make entries for newly added/modified tokens in xref table properly.
- Add trailer token..
 This is how you can add any types of annotations into pdf.


Should I use shielded RJ45 plug by the computers?

Question: If I have shielded cables, jacks and plugs and I ground the shielding properly, then should I use shielded plugs at the computer's site too? I mean if I do so, then the shielding will be connected to the motherboard or to the case, which I am not sure I want...
Comment: Welcome to the site. Please realise this is not a free design house, homework-answering service or an on-line technical encyclopedia, copied out to you on demand. People will help you take the next step if your question shows you've done as much as you possibly could on your own - which yours doesn't, I'm afraid. Please edit your question and greatly improve it, showing your work and findings in detail.The better the quality of your question, the better the quality of the answers you will attract. Again, a warm welcome to the site.
Answer: Shields are tricky, as the likelihood of introducing a ground loop when using them is rather high. This could lead to unpredictable performance issues.
Shields are optional on Ethernet, and the connection itself is galvanically isolated from the PC. The interface can tolerate more than 1kV difference between both sides and the cable common-mode is terminated, thus reducing EMI generated/accepted interference.
Common practice is to ground the shield only on one side of the connection, thus providing a path to ground while avoiding the potential ground loop.
Comment: I need a more direct answer. Can a connector like this: https://au.rs-online.com/web/p/rj45-connectors/3646390/ cause a ground loop by connecting the shielding to an electric device, e.g. a computer, switch, etc? Or can it damage the device? I am asking because I have patch cables with these shielded connectors on both ends. As far as I understand the concept it would be a lot better to have shielded connectors only on that end, which connects to the wall cable. I can connect the shielding of the wall cables to the rack, where I can ground the shielding on a single point and avoid ground loops
Answer: Shielding either protects the inner conductor from external fields or prevents the cable from radiating radio emissions. Another use for shielding is to shield the cables from static shock from a user or being dragged on the floor (which generates considerable charge). Most digital signals don't need shielding because they have ways of minimizing noise. For example, Ethernet, USB, SATA and many other buses use differential signaling to minimize noise. And most employ CRC or some kind of error correction/detection to reduce noise further.
For the cables that do has shields such as USB, the shield is tied to the motherboards ground or chassis ground. The shield only needs to be tied to a ground, and the closer to the cable input the better to minimize inductance that may prevent the shield from being effective at high frequencies. Cables that could experience large static shocks (from humans) should have the shield tied to chassis ground to route the current away from the products ground plane.
There isn't a 'best way' with electromagnetic compatibility engineering because it really depends on the application.


Why would an examiner decline demonstration of an invention?

Question: I received a final OA rejecting my application, and I will have my patent attorney do an RCE. The examiner clearly does not understand the mechanics of the concept. I have ten patents; this is nothing new. However, this examiner has no interest in further understanding. The examiner at first agreed to watch a video of the invention in operation. When my attorney was ready to present, the examiner suddenly declined. In the past, examiners were anxious to see an actual invention for clarity. Is this a new attitude in the USPTO?
Comment: If your invention needs a demonstration to show the invention, would that not indicate that the patent is not clearly written?   You are not mentioning the reason given on the rejection.
Answer: MPEP § 713.01 provides (among other things):

An interview should be had only when the nature of the case is such that the interview could serve to develop and clarify specific issues and lead to a mutual understanding between the examiner and the applicant, and thereby advance the prosecution of the application.

MPEP § 713.01 also provides, regarding video:

Attorneys or applicants wishing to show a video during an examiner interview must be able to demonstrate that the content of the video has a bearing on an outstanding issue in the application and its viewing will advance the prosecution of the application.

MPEP therefore allows an interview to be refused if it would not advance the prosecution of the application. The examiner may therefore be taking this view with regard to your video.
I can see the reasoning behind this. The application as filed must itself sufficiently and clearly describe the invention. Thus, if the video shows the invention in the same way as it is described, then it is unhelpful. If the video shows more than what is described, then it relates to something other than the invention, and is thus irrelevant.
However, there is an alternative explanation: the examiner may simply not wish to devote the time to an interview. While the MPEP does not really allow this in principle, the reality is that some examiners wish to make life as easy as possible for themselves.
Comment: As to possible solutions to this problem, if you really think the examiner is "making life easy", pushing him a little by talking to his superviser might (might!) be a good idea.


Filtering genes from cuffdiff results

Question: This question has also been asked on Biostars
I have run cuffdiff (with statistics turned ON) to compare two groups of samples: Control group and Late AD group.
This is the command I ran to be precise:
<code>cuffdiff -L Control,AD_Late_Braak -p 8 --total-hits-norm --frag-bias-correct ../References/ensembl.GRCh38.99.fa --multi-read-correct --library-norm-method quartile ../References/Homo_sapiens.GRCh38.99.chr.gtf Early_Braak_Control_1,Early_Braak_Control_2,Early_Braak_Control_3 Late_Braak_Sample_1,Late_Braak_Sample_2,Late_Braak_Sample_3
</code>
I'm looking at the output from cuffdiff and I see a gene_exp.diff file which contains the results of the differential expression testing. I want to know what is the best way to filter the results of this gene_exp.diff file so as to restrict the number of genes that are up-regulated and down-regulated to a list between ~50-850.
P.S My thoughts are to tweak the p-values and log2 fold change values, but seems like a trail-and-error method, so I was wondering if there was a more "formal" method/approach?
Answer: To filter your gene_exp.diff either you export it to excel and then filter because it is columns separated by tabs or use the command (awk and head -n) to filter and have the number of lines you want if you master Linux

Filtering genes from cuffdiff results


How do I interpret the between subject result in mixed ANOVA?

Question: We ran a mixed design repeated measures ANOVA for an RCT examining the utility of a specific treatment on knee range of motion (flexion). Our between subjects factor was study condition (treatment vs. control) and our repeated measure  was Initial Flexion vs. Discharge Flexion. We showed a significant effect for TIME, but not TIME*Condition. However, the between subjects test showed a significant difference for Condition. How can I interpret this?
Answer: Using a standard framework: your TIME main effect is about time collapsing over CONDITION. Your CONDITION variable is about condition collapsing over TIME.  Your interaction is simply stated as "the effect of time depends on condition" or "the effect of condition depends on time".  You are making an accept/reject decision about the interaction, but a more nuanced (and appropriate) approach would be to look at the effect size.  If the effect size of your interaction really is 0, then you only have evidence that A) there were differences (regardless of condition) as a function of time and B) control was different from treatment.  A is probably acceptable for you.  It is B without a Condition x Time interaction that is bothering you.  B indicates that there are differences between treatment and control, but that the effect of time is the same for both.  Therefore, there may have been baseline differences between those in treatment and control.  You should check for this using a between subjects test using only the Initial Flexion data points.  However, a better solution is just to plot the means for all four cells of your design.  This plot will show both your main effects and your interaction (or lack thereof).


Multiplexing CMOS Cameras

Question: How is it possible to multiplex 9 CMOS Cameras with raspberry pi to generate 9 images at a time?
Comment: Multiplexing.. inherently is NOT real-time. You will never get ALL the images at ONE TIME. You can cycles the data bus to each camera and download images one by one.. as fast as possible. This could be sub 100ms but it may well be sub 1000ms depending on the setup. And then the question is what is the BUS? Serial Data as in not USB but actual old school serial? Otherwise forget it. Just ust 8 USB cameras. That way you can get all 9 at the same time! Good luck, please poest an answer when you done!
Comment: Thank you for your comments. Sorry for the misunderstanding. I meant I have to switch among the 9 cameras and store one image per camera. The 9 cameras must be simply multiplexed and the 9 photos are taken one after the other. The cameras must stay on the same bus.
Comment: Great.. you can accomplish that using Serial / I2C (not USB) data transfer with any kind of multiplexer. You will have one bus to the multiplexer, from which all the other cameras will get connected to using a serial connection. You could get away with USB but it would require each time to reinitialise the device and OS's (LInux,Mac and Windows) don't like it when that happens allot.. trust me.. i tried with something else.. it just crashes too often.
Comment: Thanks a lot. I was seeing some multiplexer like arducam and IVport. Are those a good option?
Comment: Can you show me a tutorial video on this?
Comment: One more thing. I am new to raspberry pi. So if you can tell me how do I switch from one camera to the other.
Answer: If your looking for multiple pictures all being taken at the same time - You may want to check this guy out.
http://www.instructables.com/id/Multiple-Raspberry-PI-3D-Scanner
While he is not multiplexing multiple cameras into one Pi, he is triggering multiple cameras each connected to a separate Pi simultaneously.
He started out with 48 cameras and as of the latest update he was up to 168 cameras all firing simultaneously for his full sized 3D scanner.

Multiplexing CMOS Cameras


Split Lines with Points Layer Tool

Question: I asked a question a while ago to figure out how to split a line layer with a points layer using QGIS, but cannot, however, get the accepted answer to work due to limitations of my knowledge and the fact that i'm working on Windows 7. I noticed this feature request that dates from about a year ago, requesting a tool that accomplishes exactly what I need. I've been looking for it, don't see it, and am wondering if it is currently an available tool and i'm just not looking in the right spot or not.
Comment: I've got an algorithm I use for a similar procedure (splitting lines based on relative point positions), but I've written it in T-SQL.  Hopefully you can wait a bit for me to translate it.
Comment: Splitting lines with points can get a bit tricky if your points don't lie exactly on your line, as viewed by whatever process your particular computational device, software, and its operating system chooses to make that decision.  You may prefer for simple tasks buffering your points (something a purist should avoid, but a producer should embrace).  You may also wish to use ST_ClosestPoint, for points that lie within that buffer, a good compromise.  For best results you should try to understand where the points should be on the line without needing the point layer at all (if possible).
Comment: i had considered buffering points, but felt concerned about the tiny space that would remain between lines. I wonder if v.clean would be capable of correcting this in a second treatment. I would appreciate taking a look at your algorithm once translated as well.
Answer: The Networks plugin has a function called "Connect":
This tool allows you to connect node layer objects to a linear objects layer. Each point will be connected to the nearest polyline, if the shortest distance to the polyline is lower than the search radius, the polyline will be split in two parts from each side of the connection point, in order to preserve the network topology.
NB : Multilinestrings are ignored
Comment: Unfortunately, at 3.6.2, using the Networks > Network > Connect Nodes to Line tool causes QGIS to crash.
Comment: I am having the same issue of QGIS crash in QGIS 3.6.3

Split Lines with Points Layer Tool


Android WebApp storage size

Question: I want to know how many files I can save on the device from my own WebApp. So I need a size and can I save files on the device/sd card?
Thanx
newone
Answer: I don't think you can store file on disk / sd card from Web application which is running out of URL. You can create an HTML5 database though, which has a limit of 5MB.

Android WebApp storage size


What are the exact steps for requesting permission to quote and attribute a book excerpt for a novel?

Question: What are the exact steps for requesting permission to quote and attribute a quote of one sentence to one paragraph in length for a novel? I am self-publishing and on a limited budget.
Comment: This looks like it's answered by [How can I get permission to translate and republish a book?](https://writing.stackexchange.com/q/10504/34330), even though you would be using the original source differently. (If it doesn't answer your question, you should edit.)
Comment: I would be surprised if one sentence to one paragraph doesn't fall under "fair use". (But I am not a lawyer.)
Answer: There are no standard "exact steps". You can ask the copyright holder by amny method that you please. The holder can ignore this, say no, or refer you to some other person. Or the holw can say yes  under whatever conditions the holder chooses.
Many authors delegate such matters to agents. Some get their publisher to handle such matters. In either case, if you write directly to the author you should be referred to the proper person or office.
There is no standard information to provide. If your question is too general, the holder may ask for details, or may simply ignore the request, which has the same effect as an answer of "No". I would suggest indicating as exactly as possible the content you wish to quote, and how you intend to use it.
In some cases the publisher holds the copyright, although this is less common than it once was. If that is the case, the publisher would be the one to ask for approval.
The holder may impose conditions, such as a specific attribution statement, or a fee. The holder could also insist on a shorter quote, or a different one. If permission is refused, or offered under conditioins the asker dislikes, the asker can consider if fair use might apply.


Comparing different ways of specifying the same response variable

Question: I have a question about different ways of specifying a response variable in a model and what effect this could have on my results.
In my example, I wanted to model the number of times a bird visits a nest to feed its young during a set period of time. So the data would be a set of counts, let's call it Number of Visits. Now one thing that might affect how many visits an adult makes is the size of the brood (Brood Size). I have seen two ways of modeling this in the literature:

Have Number of Visits as the response variable and include Brood Size as an explanatory variable.
Have Number of Visits/ Brood Size as the response variable and include other explanatory variables as appropriate.

How would these approaches differ and is either superior to the other, would each approach give a different answer?
I can see that using each approach you might be modeling subtly different things. In option 1) you seem to be modeling the overall number of visits while controlling for brood size, whereas in option 2) you seem to be measuring the per capita number of visits.
Answer: Unless it is common practice, I would avoid working with ratios as a response.  You already have a response rate, visits/per unit of time.    This is a typical count regression response-usually but not always fit with Poisson regression.  I would build a model with brood size and the other explanatory variables.


"Specific People" showing up as guest user on SharePoint

Question: When I use my OneDrive and invite specific people, their email addresses show up in the comments, while in SharePoint it says "guest user" as it does with the anonymous link. Does anyone know how I can fix that? I'm transferring some shared documents over to SharePoint, but we aren't ready to add people to sites yet (very much a noobie to this, but need to get these shared documents out of my personal folder!).
Answer: If you share documents or folders via individual links by Share > Link settings > Specific people, the external user will not be added to the organization directory and will have access to the shared objects via the sharing links only.
Sharing a list/library or a site to external users is a different process. The external users will have to accept the invitation sent via Email and then sign in/register with a Microsoft or Organization account in order to be added to the organization directory, or as you put, to become a "guest user".

You can remove the guest users from this tenant via Microsoft 365 admin center > Guest users > Delete a user. It does not have influence on the links you have already shared in SharePoint lists or libraries.
Reference: External sharing overview.


MyISAM or InnoDB database for Prestashop?

Question: I make my first eshop using Prestashop and I'm not sure if is better use MyISAM or InnoDB. In eshop could be max about 3 000 items.
I think that most important for that question is how much items will be in eshop, but if I didn't write some other important information, please ask me.
Answer: This decision is dependent on read/write ratio. MYISAM uses table level level, so if a table is locked only one query can run on it hence MYISAM has serious performance issues. Also on prior version from 5.6 only MYISAM has support of FULLTEXT search. tables of MYISAM are really fast for SELECT queries and it takes less space on disk.
On the other hand, INNODB supports row-level locking hence concurrent select with insert is possible. It has support of doing ACID transactions hence each statement is atomic and durable in the event of crash.
So my decision is to use INNODB for application like eshop.
Answer: I would use InnoDB because it supports transactions and that's likely necessary for an eshop.  For much more detailed information, check out the answers to this question:
MyISAM versus InnoDB
Comment: As the accepted answer states, it's still better to use INNODB for the ACID support.
Comment: Prestashop does not support transactions


Write to file as Different User

Question: I am trying to write to a file that my local user account does not have access to, how can I open and write to the file as an administrator?
Answer: You need to launch another process that has admin rights. To do that call ShellExecute with 'runas' as the second parameter (this will open a User Account Control dialog). That executable may be separate or may be the same one that is calling ShellExecute.
Answer: A good wrapper class for impersonation in a using block is what I have used with success before:
<code>using (new Impersonation(domain, username, password))
{
   // <code that executes under different user context>
}
</code>
The Using statement is great for code readability as seen in this example and to ensure that the object used is properly disposed when the final } character is reached (running out of scope). Apparently there is no guarantee of garbage collection though (see first answer).
Two different sources for such a wrapper class:

This stackoverflow solution features good readability and usability.
Here is similar code from CodeProject: A small C# Class for impersonating a User.

See MSDN for more on the Using statement.
Comment: That's really cool. I suppose it could be compiled into a .dll and referenced.
Comment: I haven't tried this particular code, but similar code, but yes you can wrap it in a dll to the best of my knowledge (always new restrictions in newer versions of .NET though).
Comment: What I am referring to with .NET and Windows restrictions is Code Access Security, Windows Security, Digital certificates and similar constructs. As far as I know impersonation should work despite these security measures, but that cannot be guaranteed for the future.
Answer: You might want to look at PSEXEC from Microsoft, it allows you to execute files in elevated mode, and as a different user if desired.
You didn't say how the file is opened for writing, but PSEXEC can be used in conjunction in batch/vbs file to execute another batch/vbs/exe.
Comment: **psexec** is a great tool, but more suited for system administration than to be run from code in my opinion. You get better exception handling with code, less clunky deployment and overall better security.

Write to file as Different User


Where does elastic potential energy go after it is released?

Question: Say you have two objects colliding, and there is some elasticity between them. Some of the kinetic energy of the objects will change into elastic potential energy when they collide, but when they bounce off each other again, the energy does not return to being kinetic. What happens with it? Does it stay stored as elastic potential energy, or does it change to thermal energy? Or does it perhaps do something entirely else?
Answer: Sounds like you're getting at the "coefficient of elasticity," which is a value in [0,1] which represents what percent of the pre-collision kinetic energy is found after the collision. In homogeneous materials, the remainder of the energy is typically lost to deformation or heat (phonons) as you suggest.
you could imagine, for the sake of argument, a steel ball hitting an object which has a spring with a retention device (a locking lever of some sort).  In this specialized case, the steel ball does in fact transfer a decent amount of recoverable potential energy into compressing the spring.  It takes some other action, i.e. releasing the spring, to return that portion of the potential energy to kinetic.  To be clear: suppose the steel ball has N joules of kinetic energy  but the spring bottoms out at M
Comment: What if you have two rubber balls bouncing off each other in an isolated system. One starts stationary, the other one starts by moving. Could I say that the difference in kinetic energy before and after the collision is equal to the amount of thermal energy released by the collision? Or could there be other forms of energy that the "lost" kinetic energy turns in to?
Comment: @Threethumb as I mentioned, it can take energy to change the physical structure of material.  That get lost somewhere deep in the atom-atom (or molecule-molecule) bonding energies.  But we usually just say the nonelastic energy is "lost" or "dissipated."
Comment: @Threethumb If you do that computation in the CoM frame then yes the lost kinetic energy goes into other form (usually that ultimately means heat). Do it in another frame and you will over-estimate the coefficient of elasticity. Understanding why will make you a better physicist.
Comment: You mean understand why momentum is not conserved outside of an isolated system? If so, that should be fairly obvious.
Answer:
but when they bounce off each other again, the energy does not return to being kinetic

The potential energy actually does go back to kinetic energy. But often it only partially goes to the translational motion of whole body, while other part of the energy comes into internal motion of atoms. People normally call the latter thermal energy.


What do the work credits do in Dank Memer? Can you trade them in for gems or coins?

Question: I recently got the RPG Discord game bot, Dank Memer. I've been having fun, doing "work shifts" in the game, and getting work credits. I've been wondering what the work credits do. Can you trade them in for gems, coins, or what? Credits are also known by this symbol: ⏣
Answer: Work credits are not specific to work: ⏣ represents the currency as a whole. Claiming dailies and doing other commands such as /search will also give you money. Using the /shop view command, you can buy items from the shop with them.
However, you cannot obtain gems with the currency, you have to pay real money for those.
Comment: The currency cannot be used to buy things; you need use gold coins (real money bought) and gems (real money bought). I'm very confused
Comment: Coins are not real money bought. In this example image, I gain 3,333 ⏣ from a work shift and 50,000 ⏣ from /daily. Both of those add up to 53,333⏣ and translate to coins when I do /shop view.
https://media.discordapp.net/attachments/802176475230371864/1152635306370150410/image.png?width=385&height=671


Does disabling trigger also disables the index temporarily

Question: I have a standard table
 Column |          Type          |                     Modifiers
--------+------------------------+----------------------------------------------------
 id     | integer                | not null default nextval('users_id_seq'::regclass)
 name   | character varying(255) |
 email  | character varying(255) |
 active | boolean                |
Indexes:
    "users_pkey" PRIMARY KEY, btree (id)

Next if I execute
ALTER TABLE "users" DISABLE TRIGGER ALL

then when I execute
SELECT "users".* FROM "users"  WHERE "users"."id" = 1

should the index be used if I check explain ?
As per doc it seems to me that when the triggers are disabled then the primary key index is disabled too.

DISABLE/ENABLE [ REPLICA | ALWAYS ] TRIGGER These forms configure the
  firing of trigger(s) belonging to the table. A disabled trigger is
  still known to the system, but is not executed when its triggering
  event occurs. For a deferred trigger, the enable status is checked
  when the event occurs, not when the trigger function is actually
  executed. One can disable or enable a single trigger specified by
  name, or all triggers on the table, or only user triggers (this option
  excludes internally generated constraint triggers such as those that
  are used to implement foreign key constraints or deferrable uniqueness
  and exclusion constraints). Disabling or enabling internally generated
  constraint triggers requires superuser privileges; it should be done
  with caution since of course the integrity of the constraint cannot be
  guaranteed if the triggers are not executed. The trigger firing
  mechanism is also affected by the configuration variable
  session_replication_role. Simply enabled triggers will fire when the
  replication role is "origin" (the default) or "local". Triggers
  configured as ENABLE REPLICA will only fire if the session is in
  "replica" mode, and triggers configured as ENABLE ALWAYS will fire
  regardless of the current replication mode.
Comment: I tested it and found that disabling trigger does not disable indexes and explain still used the index.
Comment: Since the doc doesn't mention indexes at all, why do you think it supports your idea that the index should be disabled?
Comment: The only way to be sure is to test it. My guess - disabling triggers wont disable indexes.
Answer: Disabling triggers wont disable indexes (Why would it?).
As for plan for
SELECT "users".* FROM "users"  WHERE "users"."id" = 1;

It may or may not use indexes based on many factors. Mainly - the number of records in the table.


What does the work "An Efficient Quantum Algorithm for Lattice Problems Achieving Subexponential Approximation Factor" mean?

Question: In An Efficient Quantum Algorithm for Lattice Problems Achieving Subexponential Approximation Factor, the author claims they give a polynomial-time quantum algorithm for solving the Bounded Distance Decoding problem with a subexponential approximation factor on a class of integer lattices. What does this result mean? Will it imply the insecurity of lattice cryptography? Is it as important as quantum algorithm for factoring by Peter Shor?
Comment: @fgrieu One of the major selling points of lattice cryptography is quantum resistance. So the question is whether this new result invalidates that claim. Clearly there is no threat until a quantum computer at stage is built, if such a machine is ever built. However, the question remains as to whether lattice-based cryptography should continue to be a candidate for a post-quantum world.
Comment: There is now a [note](https://github.com/lducas/BDD-note/blob/main/note.pdf) by Léo Ducas & Wessel van Woerden claiming that classical LLL suffices to get pretty much the same result.
Comment: Before this work implies the insecurity of lattice cryptography, we'll need [Cryptographically Relevant Quantum Computers](https://media.defense.gov/2021/Aug/04/2002821837/-1/-1/1/Quantum_FAQs_20210804.PDF). [Late addition: this comments the obvious: the question's "Will ((this result) _imply_ the insecurity of lattice cryptography?" could only be with CRQC]
Comment: @YehudaLindell isn't it a threat if such a machine is possible? Since the eavesdropper can store the communication and break all. This is why we are using AES-256 not AES-128.
Comment: @kelalaka it really depends on the application. Some (like authentication) are mildly impacted in the near-term, with minor exceptions (perhaps OS updates or other *highly* security critical things).
Comment: @kelaka I agree that someone saying that they need privacy for 20 years may worry now. Personally, I doubt it will happen within 20 years but I can see the concern. In any case, meanwhile I strongly recommend using double encryption with both RSA/Lattices or ECC/Lattices.
Answer: There is no public paper available yet, so this answer is preliminary and based on what was presented in the talk and the follow-up discussion. A full understanding cannot be reached until there is a paper to verify, evaluate, and compare to prior work and known results. However, a good understanding of the situation already seems to be emerging.
The tl;dr is: the special problem the authors address is classically easy to solve using standard lattice algorithms (no quantum needed), as shown in this note. Moreover, the core new quantum step can instead be implemented classically (and much more simply and effectively) as well. So, the work doesn't show any quantum advantage versus what we already knew how to do classically, nor anything new about what we can do classically. Details follow.
The clause "on a class of integer lattices" is a very important qualifier. The BDD problem the authors address is one where the lattice is "$q$-ary" and generated by a single $n$-dimensional mod-$q$ vector (or a small number of them), the modulus $q \gg 2^{\sqrt{n}}$, and the target vector is within a $\ll 2^{-\sqrt{n}}$ factor of the minimum distance of the lattice. This setting is far from anything that has ever been used in lattice cryptography (to my knowledge), so the result would not have any direct effect on proposed lattice systems. Of course the broader question is whether the techniques could lead to stronger results that do affect lattice crypto.
Based on the description given in the talk, several expert attendees believe it's very likely that the special lattice problem the authors address is already easily solvable using known classical techniques (no quantum needed). UPDATE: this has turned out to be the case, and is substantiated in this note. In other words, the particular form of the BDD problem makes it easy to solve in known and unsurprising ways. The algorithm is merely the standard sequence of LLL basis reduction followed by Babai nearest-plane decoding, but showing that this actually works relies on some deeper (but previously known) properties of LLL than the ones that are usually invoked.
What about the broader question: could the main techniques lead to stronger results that we can't currently obtain classically? It turns out that what the core quantum step accomplishes, the "worst-case to average-case" transformation, can be done classically (and more simply and efficiently) using a well known randomization technique—what's called the "LWE self reduction" or "($q$-ary) BDD to LWE reduction." See Section 5 and Theorem 5.3 of this paper and the earlier works cited therein for details.
More precisely, $n$-dimensional $q$-ary BDD for relative distance $\alpha$ (the problem considered by the authors) classically reduces to LWE with error rate $\alpha \cdot O(\sqrt{n})$. While this reduction looks unnecessary to solve the original BDD problem in question, it shows that the core new quantum step can be replaced by something classical that performs at least as well (and likely even better in terms of parameters). This indicates that the main quantum technique probably does not hold any novel or surprising power in this context.
Comment: The use of approximate eigenvectors, whose eigenvalue has the "secret", was new to me. Is that a well-known technique in quantum lattice cryptanalysis, or is it possible it can find a more powerful application than a $n\rightarrow\sqrt{n}$ reduction?
Comment: I didn't really follow what they were getting at with that. But "approximate eigenvectors" (in a different, non-quantum sense) are a common tool in the latest generation of LWE-based FHE schemes, a la GSW.
Comment: Interesting... suppose my only concern then is that this might inspire someone else to discover something more genuinely novel. The general concern with current PQ candidates is that before QCs even exist we certainly have not explored anything close to the entire space of possible quantum algorithms.
Comment: In your second-last paragraph, I don't see the chain of reductions. Theorem 5.3 of the paper you linked doesn't seem to improve the approximation factor or the dimension, which is what the quantum algorithm does. Could you explain how it works? Once we reduce to LWE, can we reduce back to $q$-ary BDD with relative distance less than $\alpha$?
Answer: I created a website to crowdsource what is known about algorithms for lattice problems in NP intersect CoNP:
https://latticealgorithms.xyz
Our paper is up:
https://arxiv.org/abs/2201.13450
For the record, here was the timeline we followed:
Until 8/17/21, we went through the classical literature pretty throughly.  A classical algorithm would also have been fine so that we can feed it back into quantum algorithms.  But since the base case is a worst-case type of the well-studied hidden number problem, it seemed reasonable that nothing is known.
8/17/21-9/21/21: We asked a sequence of 5 experts what is known about the problem.  In one case we indicated the best classical approach we could find.  We received no responses with new information.
9/21/21: The decision was made to go with the special base case with one vector in the talk because (1) it will aid people in solving it, and (2) it's a colloquium talk in a quantum seminar and therefore needs to be accessible to a broad audience.  A talk with only lattices or only quantum is already a challenge, and to combine both, well, try it!
9/21/21: Lively discussion about possibilities during panel, but no algorithms.
9/22/21: We are contacted with a new classical algorithm for the special case, and after we made it clear what our algorithms can do, a revision outlining how to get a more general case by analyzing LLL.
1/31/22: No classical answer for our Schnorr bound has been received yet.
Sean
Answer: One could give a much longer answer to this question (and I would be quite interested in seeing someone like Chris's perspective), but the following two points probably suffice for a non-specialist.
Approximation Factors: The main way this attack should be seen as (potentially) threatening to lattice-based cryptography is via the possibility of future improvements.
The approximation factor this targets (which I believe is $2^{n^{1/2}}$) is large enough that even if LWE was classically weak in this range, one could still construct things like:

PKE
Digital Signatures
FHE

E.g. most of what you might care about would still exist. So the current attack itself does not really impact the main body of "practical" lattice-based cryptography, although future improvements to the attack are of course possible.
The Possibility of Dequantization: The attack has two parts:

A (quantum) dimensionality reduction step (from $n\to \sqrt{n}$)
Use standard classical techniques to solve the $\sqrt{n}$-dimension instance.

A number of people suggested the possibility of dequantizing the first step, via things like taking random linear combinations (say with Gaussian coefficients) of the basis vectors.
If this dimension reduction works, one gets BDD with approximation factor $2^{n^{1/2}}$ in polynomial time (I believe).
While this would make the algorithm itself stronger, it would also make it less concerning in a certain sense.
This is because we (classically) have a fairly decent idea of how hard lattice problems are.
By this, I am in particular thinking of things like:

The various "fine-grained" hardness results that exist (say under the Exponential Time Hypothesis, or variants of it),
the recent lattice sieving lower bounds, and
hardness results in the presence of pre-processing (for example CVPP hardness results).

Of course these do not rule out all possible attacks, but they should be mentioned as a growing body of formal evidence for the classical hardness of lattice problems.
This is to say that the main concerning thing about the linked talk is the existence of a non-trivial quantum speedup --- if this is dequantized, we are back in the setting of classical computing, where our understanding of the hardness of lattice problems is better.


what does the symbol "?" mean and how can i edit that page?

Question: I have a site I can't edit the page of it the page contains the following link
https://www.testsite.com/?booking
how can I edit my booking page
Answer: ? means the start of the variables that are accessable via PHP on the page called.  The page https://www.testsite.com/ will be called, and booking variable will be accessible globally throughout the PHP script.  In this case, the homepage script will be run.  The $_GET['booking'] index will be set (to NULL), and will (usually) be accessible also at $_REQUEST['booking'].
Now, this URI could very well be a dead link if you found it published somewhere in your code.  In the case that it does represent a post or page, you can edit it in the back-end admin panel by clicking on either "Posts" or "Pages" in the left hand admin column.  After doing so, you will get a list of the posts/pages on which you can click on its appearance in the table and edit its permalink.


When will ice melt faster?

Question: My question is, will ice melt faster if it is left in the water created from melting or will it melt faster if the melted water is drained off?
Comment: My opinion is that this can be solved by experiment by freezing 2 equal volumes of water and have one drained off while the other stays stagnant
Comment: as for homework and exercises the question arises as I was sin a pub I saw the barmaid drain off the water from the melting ice
Comment: In my opinion this is not a *homework-and-exercises* type of question, so I have removed the tag and replaced it with *everyday-life*, which is in keeping with your comment about what motivated you to ask.
Answer: This will actually depend on both the geometry of your problem and the environment conditions (e.g., is there an "unlimited" reservoir of heat surrounding the ice - in other words, can the environment provide as much heat as needed without cooling down; what is the temperature of the environment).
Energy-wise, it is clear that if the melted water is immediately drained off, the only energy which needs to be supplied is the melting enthalpy for the ice ($333.5 \textrm{ J/g}$ according to wikipedia). If the water stays there, it needs to be heated up before the ice continues melting. The heat capacity of water is ~$4.2\textrm{ J/K*g}$ according to my memory. So, depending on your environment conditions (i.e., environment temperature), the energy needed to warm up the water is only a small additional energy contribution. Still, energy-wise, it is a bad idea to also heat up the melted water if you could also just take it out of your system.
Time-wise, the question is - is the heat transfer from air to ice quicker than the heat transfer from air to water, the heat diffusion throughout the water and the subsequent heat transfer from water to ice? This of course depends on the geometry of the problem (i.e., the respective contact surfaces, the thickness of the water layer) but most of all on the surface transfer rate (if the heat transfer air-ice is quicker than air-water, it will always be good to get rid of the water). Unfortunately, I have problems finding good values for the latter. It might however imply that if you have an unlimited energy supply, it could in some instances actually be a good idea to actually keep the water - I will edit this post if I do find some reliable statement about the transfer speeds.
Comment: agreed the geometry is vital. as for the reservoir - ambient atmospheric temperature  around 40C keeping in mind that only about 10% of the ice is exposed to the atmosphere and this is covered by a thin layer of water that is a result from the melting

When will ice melt faster?


Wordpress Posts not loading through AJAX using WPML

Question: I have a news page where posts are dynamically loaded based upon which category in the menu is clicked. This is done through Javascript/AJAX. The site is multi language and I'm using WPML to switch between languages. This works absolutely fine everywhere on the site, but as soon as I try to exclusively echo posts from the other language through AJAX, it doesn't work.
It displays absolutely nothing even if the category ID is correct.
The code I am using in AJAX is as follows;
query_posts( array('posts_per_page' => $posts, 'paged' => 1, 'category__in' =>   $selectedCategory, 'lang' => $curLang));

Now I've tested if the current language was not being parsed correctly, but even statically putting in 'en' didn't change a thing, it still wouldn't echo the english posts through Ajax. The code however works fine in a regular old PHP file.
The javascript I'm using to fill the variables in to pass to AJAX is as follows:
var load_posts = function(postMax, category){
        $.ajax({
            type       : "POST",
            dataType   : "html",
            url        : siteurl + "ajax/?postMax="+postMax+"&numPosts=6&pageNumber="+page+"&category="+category+"currentLang="+curLang,
            beforeSend : function(){
            },
            success    : function(data){

                if(page <= 6){
                    content.empty();
                    content.append(data);
                    $('.more-link').each(function(){
                        var tempLink = $(this).attr('href');
                        $(this).parent().parent().parent().parent().children('a').attr('href', tempLink);
                    });
                    loading = false;
                    if(page === 3){
                        $('#nieuwsContent').css("padding-top", "10px");
                    }
                    page++;
                }
            },
            error     : function(jqXHR, textStatus, errorThrown) {
                alert(jqXHR + " :: " + textStatus + " :: " + errorThrown);
            }
        });
    };

I'm at a complete loss as to what I should be doing to fix this.
Answer: Could the issue be in the rendered URL for the AJAX request? Looks like it's missing a '&' symbol before the 'currentLang' field.
e.g '&category="+category+"currentLang="+curLang', should be '&category="+category+"&currentLang="+curLang'


flash external ExternalInterface call in as2

Question: I have an external interface call which should retrieve some text from the html that the swf is embedded in.
var name:Object = flash.external.ExternalInterface.call(
    "function(){return JSObject.get('Resource', 'name');}");

When I put the variable name into a textbox I get the correct text.
when I use geturl with a clickTag, under some circumstances it works (unencoded clickTag url). Sometimes it's undefined (encoded clickTag urls). If I use name.toString then it opens http://www.someurl.com/[type%20Function] or displays [type%20Function] in a textbox.
So I suspect that I'm having encoding issues when passing on the clickTag url. My question is, how do I convert this object to a string or assign the contents of the object to a string variable  to avoid all this?
Thanks
Answer: if you use name.toString you are referring to the function definition, that's why you're getting [type%20Function]. use name.toString() instead


Where to put database connection settings?

Question: Where do you put the connection settings for a database connection (things like host, dbname, user, password)? Is it placed in the database class or file, or outside in a config file, or somewhere else?
Comment: I usually put it in a file outside of web root, and then include it into whatever application I need it in. This makes it a bit more secure from being accidentally exposed to the web, and allows multiples applications to use the same settings where changing that one file will keep all apps db settings up to date.
Comment: It depends on your implementation...
You can put to a settings file so you can customize whenever you want.
or if you love OOP then you can use class also..
but probably used settings file.
Answer: Ideally, you should place it in a config file, which can be something as simple as a PHP array.
For example: db_config.php
$db_config = array(
  'host' => 'localhost',
  'user' => 'username',
  'password' => 'qwerty'
);

You should then place this file outside your document root for maximum security. This way, if your webhost fails you and begins serving PHP files as text files (happens), no one can get your DB credentials.
Comment: Hi thank you for your answer. Would this be implemented like globally or would there be something else.
Comment: @DaryllSantos You would have to include the file as and when you need it.
Answer: It can be done in many ways, but what is common is to put it in a settings file, and keep that file outside of the webroot, so that information about the database password can not accidentally leak into the web.
Answer: For PostgreSQL, I really like to use pg_service.conf. It allows me to put all connection specific settings (hostname, database name, username, password, etc) into ~/.pg_service.conf or to /etc/postgresql-common/pg_service.conf and give them common name (service name).
Now, any program (Perl, PHP, etc) that wants to connect to database can simply specify "service=name" as their connection string - nice, clean, secure and easily maintainable.
As far as I know, MySQL has similar mechanism for ~/my.cnf or /etc/my.cnf files - you may want to look into that.
Answer: There are a lot of ways doing it, but I do it this way by defining CONSTANTS:
Create a config/db.php

<?php
define('DB_INFO','mysql:host=localhost;dbname=test');
define('DB_USER','root');
define('DB_PASS','');


Is there a low cost way of reducing humidity?

Question: I'm currently living in a very humid room and so am looking for a cheap way of getting rid of some of that humidity, without having to purchase an expensive dehumidifier. Are there any plants, objects, salts or whatever materials that can help achieving a more comfortable, less humid environment?
Comment: Why is it humid in the first place? Is there anything you can do to mitigate that, first?
Comment: Start collecting the [Silica packets](http://en.wikipedia.org/wiki/Silica_gel) packaged with shoes, and electronics. Or you could try some of these [Damprid moisture absorber](http://www.damprid.com/product/unscented-disposable-moisture-absorber-105-oz-fg100). Though neither solution will solve the underlying moisture problem.
Comment: There are known [house plants](http://www.ehow.co.uk/list_5925724_house-plants-reduce-humidity-levels.html) that reduce humidity, but depending on how bad the problem is, it may not have the impact you are looking for.
Answer: I think the comment about finding the source is very important - there is a reason it is humid, and unless this is solved, you will never solve the problem, only band-aid it, which will cost more in the long run going against the "low-cost" part of this question.
The definition of low cost varies person-to-person.  Under $100 is low cost to me, but maybe not to you.  In any event, your best bet is a dehumidifier.  A quick search on Amazon found some small used ones for under $50.  You don't mention how large the area is so it's difficult to say if this will suffice, however it will most likely pull more water out faster than any plant or a bunch of silica packets will (I imagine you'd need thousands of these for even a small room).
You will likely require a dehumidifer that can be hooked up to a drain so you don't have to constantly empty it manually (hidden opportunity cost), which probably means a larger more expensive unit (still only a couple hundred dollars).
Of course you also need to consider electrical costs in this - at some point, it will be cheaper to properly solve the problem than to run the dehumidifier indefinitely.
Comment: Unfortunately I'm living in a small room (I'd say less than 20 square meters) only for just about 6 months. I'll have to buy that dehumidifier, then :) Thanks!
Answer: Just open the windows!  Most of the year the air outside will be less humid than the air inside.
Comment: That really depends on where you live...