Using Visual C++ with R

Question: I am wondering if there was a workaround for using the R package Rcpp within a Visual C++ project within Visual Studio. According to the Rcpp FAQ, this is not possible. I also came across another R package called R.NET. Can this only work with C# but there seems to be no examples from within Visual C++? Is there another option for this that I am missing? Even if I am forced to work with C#, can anyone envision latency issues with this for a high frequency trading environment?
Thanks for any feedback
Answer: We address this very question clearly in the Rcpp FAQ (which comes as vignette in the package, is on the CRAN site and its mirrors, and on my website).
In short, Rcpp supports the exact same toolchain which R supports.  And on Windows that is MinGW (the port of gcc to Windows) provided by the Rtools package for R.
R Core only support MinGW, and we do the same.  If one could compile R with Visual Studio, things would be easier, but as Rcpp sits on top of R we are playing the hand we are dealt with.
So sorry, the answer is a "No" to Visual Studio.
Comment: This sucks. Started writing native extensions for R in gfortran then got these errors where my R would crash. Spent two days trying to debug .. no luck. So I switched to C++ Visual Studio (because of the debugging capabilities) and now discovering R and VS don't play well together. So now what? Abandon R and go to Python?
Comment: Develop code in VS as usual, use the Windows toolchains that has been using for 20+ years (and which are a given for the Rcpp team as well -- we don't get tp pick either).
Answer: The question is what you really want to connnect with what. If you want to use R within C++ Rcpp seems to be the wrong decision as it connects C++ to R (and not the other way round as your question implies.).
If you want to connect R to C++ and use Visual C++ for creating your C++ code only (instead of linking R to C++), you might want to check this recent blog post (found via R-bloggers.com). It tells you a possible way of doing so.
Answer: Visual Studio works just fine with Rcpp. Has done for years. I disagree with Dirk Eddelbuettel.
This is an important fact - For example, there are very important libraries (Intels MKL, QT graphics framework) which are actually not compatible with minGW.
I maintain a (patched and cut-down) fork of Rcpp on github (https://github.com/rohan-shah/Rcpp) suitable for compilation with Visual Studio with cmake. The patch is something like five lines, I believe.
Disclaimer: It's fiddly to use, and you have to know what you're doing. If you do know what you're doing though, I've done quite a bit of the work for you. See https://github.com/rohan-shah/mpMap2 for an example of how to use patched Rcpp with Visual Studio.
Comment: This will always be very fiddly to use for as long _as R itself_ does not proprely support this compiler.  As such, "no support" from Rcpp either.  If you know what you're doing and are hell-bent, you know what to do.  Rest of your post here plain false as Qt can be used just fine with MinGW (and I have done so 10 years ago when I still work on Windows).  See RInside too.
Comment: I'm so happy that it worked ten years ago. What about today? MinGW is supported by QT only for 32-bit, which for all intents and purposes means that it's *not* supported. You can *try* and build it from source from 64-bit - I certainly couldn't make it work. To quote you back at yourself, *this will always be very fiddly to use for as long as QT itself does not properly support this compiler*. Why can you not accept that this is actually a legitimate solution to a software problem? Do you think I didn't consider the alternatives?
Comment: 1) Qt supports MinGW out of the box:  https://wiki.qt.io/MinGW.  2) As I said before, Rcpp uses what R supports as a toolchain, and as long as R has no support for VS you are barking at the wrong tree---talk to R Core.  3)  Your attitude is such that I have limited interest in engaging with you.
Comment: (And for what it is worth, yes, I did build Qt from source back then when to support an integration with R.  Painful, but possible.  But there are reasons people turn away from Windows as a development platform.)

Using Visual C++ with R


What is the subtle body?

Question: It is called "Sukshma Sharira", or "Linga Sharira", but what exactly is it?
Comment: You can read this answer: https://hinduism.stackexchange.com/a/31709
Comment: No it does not have .. that's why called Sukshma. But Indriyas (eyes, ears etc.) are also part of the subtle body but they have physical presence. Mind, on the other hand, is also a part but it does not have a physical presence.
Comment: @Rickross Thanks for explaining
Comment: Interesting. Does the subtle body have a physical presence like the gross body? @Rickross
Answer: It is called "Sukshma Sharira", or "Linga Sharira", but what exactly is it?
Brhama Sutra says;

तदापीतेः, संसारव्यपदेशात् ॥ ८ ॥

That (fine body lasts) up to the attainment of Brahman (through Knowledge), because (the scriptures) declare the state of relative
existence (till then).

In the text cited in Sutra 1 we have, "And fire (is merged) in the Supreme Deity". The opponent argues that as fire and the other
elements are merged in the Supreme Deity, whieh is the cause of these
elements, this is only the final dissolution, and so everyone at death
attains Liberation. This Sutra says that this merging is not absolute
merging, but the one we experience in deep sleep. Only the functions
of these elements are merged, and not the elements themselves. The
final dissolution does not take place till Knowledge is attained; for
the scriptures declare that till then the individual soul is subject
to relative existence: "Some souls enter the womb to have a body" etc.
(Kath. 2. 5. 7). If the merging at death were absolute, then there
could be no rebirth.

सूक्ष्मं प्रमाणतश्च, तथोपलब्धेः ॥ ९ ॥

(This fine body) is subtle (by nature) and size, because it is so experienced.

The body formed from the essence of the gross elements in which the
soul abides at the time of death is subtle by nature and size. This is
understood from scriptural statements which declare that it goes out
along the Nadis (nerves). So it is necessarily subtle or small in
size. Its transparency explains why it is not obstructed by gross
bodies, or is not seen when it passes out at death.

नोपमर्देनातः ॥ १० ॥

Therefore (this subtle body is) not (destroyed) by the destruction (of the gross body).

अस्यैव च-उपपत्तेः-एष ऊष्मा ॥ ११ ॥

And to this (fine body) alone does this (bodily) heat belong, because this (only) is possible.

The bodily beat observed in living animals belongs to this subtle body
and not to the gross body, for the heat is felt so long as there is
life and not after that.

Subtle body has following natures;

It combines with the god.

Leaves the body after death.

Can't be destroyed.

No one can see it.

The following characters are of Atman as given in Bhagwad Gita.

The Atman is neither born nor does it die at any time, nor having been it will cease to exist again. It is unborn, eternal, permanent, and primeval. The Atman is not destroyed when the body is destroyed. (2.20)

Just as a person puts on new garments after discarding the old ones, similarly Atman acquires new bodies after casting away the old bodies after death. (2.22)

It is said that the soul is invisible, inconceivable, immutable, and unchangeable. Knowing this, you should not grieve for the body. (2.25)

Shwetashwara Upanishad I-8: The Lord supports this universe, which consists of a combination of the perishable and the imperishable, the manifest and the un-manifest. As long as the self (Atman) does not know the Lord, it gets attached to worldly pleasures, and is bound; but when it knows Him, all fetters fall away from it.
Answer: Subtle body or linga sarira or sthula sarira forms part of human personality.

In this context, the analysis of the human personality according to
the Vedanta may be stated. The human personality has three bodies
consisting of five sheaths or Kosas. These Kosas are: Annamaya-kosa or
gross body; Pranamaya-kosa or Vitalistic sheath; Manomaya-kosa or
mental sheath; Vijnanamaya-kosa or intellectual sheath; and
Anandamaya-kosa or the sheath of bliss.

Srimad Bhagavad Gita translated by Swami Tapasyananda
These five sheaths are organized into three bodies - the Sthula sarira or the gross physical body, the subtle body consisting of the Pranamaya, Manomaya and Vijnanamaya Kosas. The Anandamaya kosa forms the karana sarira.
What does the subtle body consist of?

On the subject of the Asat or the body, one has to keep in mind the
distinction between the Sukshma-sarira (subtle body) and the
Sthula-sarira (the gross body). The gross body is the one that changes
from birth to birth. So it is compared to changing of dress. The
analogy is used to show the absolute discontinuity, the catastrophic
break that marks physical death. But the other body, the subtle body
or Suksma-sarira in which the Pranas (vital forces), mind, intellect
and the ego are integrated, survives, carrying all the
karma-efficiencies created in one life to the next. It is because of
the Suksma-sarira that re-embodiment becomes possible. So in respect
to of Suksma-sarira there is continuity from birth to birth.

Srimad Bhagavad Gita translated by Swami Tapasyananda
Suksma-sarira consists of sixteen parts: the five jnanendriyas (organs of knowledge like the eyes); the five karmendriyas (organs of action like the hands); the five pranas (vital airs like prana and apana) and the mind (including the buddhi or the intellect).
What role does the subtle body play in moksha?

But when the enlightenment comes and the Jiva realizes his real
identity as the Atman, the Suksma-sarira also perishes. This marks the
real death which is the door to Immortality. Death in this sense is
also catastrophic in that it brings enlightenment, whereas in physical
death it is catastrophic at the physical-level only; what follows is
only another embodiment.

Srimad Bhagavad Gita translated by Swami Tapasyananda

What is the subtle body?


Is there canonical reference linking the original Cyberdyne Systems research in T2 to Brewster's Skynet in T3?

Question: Is there canonical reference to show that the original Cyberdyne Systems research in T2 (which was presumably destroyed by teenage John and Sarah Connor, Miles Dyson and T-800) somehow helped or influenced Robert Brewster's building of military Skynet system in T3?
Comment: What would count? A reference or visual of the T-800's CPU?
Comment: Its was said by T-850 in T3 or, Marcus Wright saw it in Skynet information network in Salvation.
Comment: @JohnO - Anything (your example included) that references canon
Comment: @SachinShekhar I don't think his remark counts. Arnie seemed to be operating under the assumption that history from the previous loop still applied, he seemed to think Skynet might be de-activatable, for instance. Just as Connor himself believed. DVK: I can't even think of what might count, other than my first two examples, but despite not having recently watched the movie I'm pretty sure neither is there.
Answer: In T3, upon being asked how he exists, T-850 told:

After the destruction of the company's headquarters, Cyberdyne Systems patents are obtained by the U.S. Government, with another technological corporation Cyber Research Systems. Skynet continues to be developed by the company for SAC-NORAD,and ultimately, Judgment Day occurs, just at a later date than it would have originally.

In Terminator Salvation, it was displayed that Dr. Serena Kogan from Cyberdyne Systems convinced Marcus Wright to donate his body for research in 2003. In 2018, Marcus saw a news while connected with Skynet that Cyberdyne Systems was sold to US Airforce. And, Dr. Serena's visual from Skynet side says that Dr. Serena was also behind development of Skynet.
Comment: I think that this is a pretty concise treatment of what happened.  T:3 and T:Salvation do offer brief explanations of what happened to Cyberdyne after the events of T:2.  It's made clear enough in those movies that Cyberdyne's original research was picked up by the government - and it is the Air Force which developed the AI form that research.  How much of it was originally Cyberdyne's is still unknown.


Hot Swap Sensor

Question: Is there a way to have a sensor be hot swappable, as in it can be disconnected and reconnected without locking up the Arduino? I have an I2C sensor that I want to be able to disconnect and reconnect without having to restart the board.
Comment: The i2c bus is not meant to have sensors disconnect and connect, but I think it can be done. Poll the sensor a few times per second and if it is reconnected, then initialize the sensor. Why do you want to do that? Is there an other way?
Comment: I am making a sensor that goes onto a filter loader and just wanted to make sure if the sensor got disconnected that it could be reconnected without issue or having to reset it. This is for a remote device from my office and I won't always be the one dealing with it.
Comment: Please see https://arduino.stackexchange.com/questions/31924/how-to-setup-an-i2c-bus-which-stays-valid-if-a-slave-is-powered-down-or-fails/31940#31940
Answer: The I2C bus is not blocking the operation, if the sensor isn't there. Also the Wire library will not block in this case. It will just return an error code, which you should handle in your code.
But this doesn't mean, that every library, which wraps the I2C workload for a specific sensor, is doing the same. Depending on the sensor and the used library you will have to check yourself, if it is blocking in any way. (This part is not better answerable without information on what sensor and what library will be used)
So: Yes, this is totally possible, but you will have to deal with the errors from disconnecting the sensor and handle them in your code. By polling the sensor in a regular fashion (like Jot mentioned in the comments) will give you the information, if there is a sensor with this address on the bus. The Wire.endTransmission() method will return 2 (received NACK on transmit of address), if no device with the specified address is reachable on the bus.
Depending on the used sensor, you might have to initialize the sensor correctly after every reconnect. Especially, if the disconnect happend during a transmission. Refer to the datasheet of the sensor to find out, what happens in this case with the sensor.
If you plan to use different sensors, you have to check for their specific addresses (since different types of sensor often have different hardwired addresses/address spans) and - if the sensors are controlled differently - determine, what sensor is actually connected. The least may be possible by reading their status registers, which can work for many sensor types.

Hot Swap Sensor


Explanation for the final scene of The Machinist

Question: If Trevor finally goes to the police at the end of The Machinist to say that he did the accident and he goes to sleep in a jail cell, why does he drive again into a tunnel after a second?
Answer: First of all, the final scene showing Trevor Reznik (Christian Bale) driving down the road is a flashback. It is most likely something that occurred moments after the hit and run. This is evident from the fact that the windshield of Trevor's car is still cracked. Trevor himself looks pretty healthy at this point.
I went over the last few seconds of this scene a few times and I noticed that Trevor's expressions change in a very interesting way. The scene is probably intended to represent the transformation of Trevor Reznik. The scene starts out with Trevor looking extremely distressed. You can see the regret on his face and how he wishes that he could take everything back. Clearly this accident is something that he couldn't handle. He couldn't handle the fact that because of him, a mother lost her child. He feels devastated by the fact that his negligence cost the life of someone. This is probably when he realizes that his actions are going the wreck himself. He realizes that he can't go on knowing that he is responsible for the death of an innocent child and that the only way to cope from this incident is to forget it in its entirety. The scene ends with Trevor looking like he has decided to deceive himself into believing that nothing ever happened. The trauma made him block out his memories of the incident. The Trevor that drives out the tunnel into the sunlight is completely different from the one that we see going in.
Comment: Thanks dude,I thought that is more randomly there or just a symbol of freedom because he finnaly could sleep


How do I Transfer Bitcoins If I have a watch-only account with the Private Key

Question: How do I transfer bitcoins over from a watch only electrum account if I have the private key and its address?
Comment: Does this answer your question? [Can't spend Watch-Only coins, have I been scammed?](https://bitcoin.stackexchange.com/questions/95596/cant-spend-watch-only-coins-have-i-been-scammed)
Answer: Transfer control to a new Electrum wallet
If you have the private key you can, in principle, either import the key into a new wallet or sweep it into a new wallet.
Electrum supports sweeping and doesn't encourage importing.
Importing doesn't involve a transaction or transaction fees but is more vulnerable to subsequent loss. The recovery-words also known as recovery-phrase or seed-phrase, cannot be used to recover control over money associated with an imported key. You'd need to make regular backups and test recovery from backup.
Sweeping involves a transaction but is regarded as safer.

Transferring Bitcoins
Note that you are not really moving bitcoins. The record of who controls what money is recorded in the public Blockchain which every full-node wallet has a copy of.
A watch-only wallet lets you observe transactions relating to money controlled by other people (or by other wallets). So there's no sense in which your bitcoins are in a watch-only wallet. You could as well say that everyones bitcoins are in every full-node wallet.

Electrum account
Electrum is a wallet, not an account. Your money is not stored by, managed by or controlled by Electrum.org. You control your money using software you install on your own computer.

Watch-only
Watch-only wallets are a useful feature if you keep your private-keys in cold-storage - such as in a hardware wallet.
They are also a favourite method by which scammers trick people out of money.
Comment: +1 but I think the last part is the only relevant part.
Comment: I have one address in my wallet and one private key in a WIF format. Do I need multiple keys to have my regular spending wallet?, cause I only have one address.
Comment: You only need the key that corresponds to that address.
Comment: My Private Key is in a WIF Format, when I put it in it doesn't want to go with my address. Its 51 characters long. Is there a converter from WIF to a regular private key?
Comment: See the last sentence of my answer and the comments by MCCCS.
Answer: Based on some of your comments:

My Private Key is in a WIF Format, when I put it in it doesn't want to
  go with my address.

It sounds as though your wallet could be importing the wrong address type (ie legacy vs p2sh-segwit vs bech32).
With Electrum you can import your WIF and specify the address type.
Electrum can import private keys using the console and the importprivkey() command.
If you want to import p2sh segwit (address starts with a 3):
importprivkey('p2wpkh-p2sh:L5eaxGKPZZMnanjxDzBd82VaxnHAE6MmBojiEFAVTM9mWZEhMMqG')
Import as native(bech32) segwit (address starts with bc1):
importprivkey('p2wpkh:L5eaxGKPZZMnanjxDzBd82VaxnHAE6MmBojiEFAVTM9mWZEhMMqG')
Import as legacy p2pkh (address starts with a 1):
importprivkey('p2pkh:L5eaxGKPZZMnanjxDzBd82VaxnHAE6MmBojiEFAVTM9mWZEhMMqG')


This was my first time/ This is my first time

Question: Say I want to talk about myself cooking in my video, should I use "this is my first time cooking" or "this was my first time cooking"? I heard someone say something about using present tense when you are telling a story or describing something.
Answer: If you are speaking the words as you are cooking, you should definitely use the present tense. When speaking about something that happened in the past, you may use the past tense or the historical present tense. The historical present is not typically used throughout the entirety of the story, but rather used for effect. It is typically used for exposition or to describe background information. For example:

So I'm on the bus and this woman is just staring at me. Suddenly, the bus screeched to a halt and she tumbled right into me.

The historical present should not be used in formal contexts, but it can be useful in storytelling. It's a matter of personal taste and judgment. If you don't feel comfortable using it, you can put everything in the past tense.
Answer: If you're going to say that while you're cooking, then you should say: This is my first timeIf you're going to say that after you finish cooking, then:This was my first timeAs simple as that.


installing WPS-Reader in anbox

Question: i am in need of a word reader installed to my anbox running on ubuntu 18.4.
tried installing the download from ApkMirror but constantly gets the error bellow - bash: syntax error near unexpected token `('
is there a viable version working in anbox ... how to install it. thanks
Answer: You can't simply install an apk as you did installed on a real android device (Officially).
you can try this:
1)Go to www.apkpure.com and download your apk
2)Install adb-tools by  running this comment inside the terminal
sudo apt-get install android-tools-adb

3)Run the following command to install your apk
adb install /your_apk_folder_loaction/your_apk.apk

Comment: did that but got this error .... adb: failed to stat Sheet_v11.6.1_apkpure.com.apk: No such file or directory
Comment: check your if the apk is present in that folder

installing WPS-Reader in anbox


Efficient Collision Detection With Numerous Objects at Once

Question: I am developing a 2D game with very large levels in which two teams(around 200 objects per team) fight against each other in planes, tanks, turrets,...etc. With every entity shooting bullets at their enemy it is expected that there would be a numerous amount of objects at one instant. What collision detection algorithm could I use to support collision for a massive number of entities at once? The objects are simple figures(rectangles and circles). Would a brute force approach suffice or break up the level into a grid?
Comment: I would recommend a uniform grid if your levels are bounded. They are very simple to conceptualise, implement and fast to access. However, if your levels are too big, you should use a hash table to fill buckets. http://www.gamedev.net/page/resources/_/technical/game-programming/spatial-hashing-r2697
Comment: @DaleyPaley You should add that as an answer, even though there's already an accepted one. People can still upvote it and the one asking might change their mind and pick it as the better one as well. There's no need to hide in the comments. :)
Answer: Since your game is 2D, I would recommend using QuadTrees.
Here's a good tutorial to get you started: http://www.kyleschouviller.com/wsuxna/quadtree-source-included/
Another good one: http://gamedev.tutsplus.com/tutorials/implementation/quick-tip-use-quadtrees-to-detect-likely-collisions-in-2d-space/
Answer: If you have a bounded domain, then you can use a uniform subdivision. It is the simplest of all spatial subdivision systems.
However, if you have an enormous world, very sparsely populated then I would recommend spatial hashing. You simply use a hash map to fill buckets. It is fairly simply to implement, but you need a good hash function.
Answer: Other answers are surely worth a thought, but with just the tiny amount of 400 objects to test against, I would recommend you do profiling afterwards.
A simple brute force might turn out faster depending on your language and environment. Some runtime environments (like e.g. Java or Lua) might have blazingly fast array loops compared to very slow generic container like hashtables.
Of course, this is heavily dependend on how fast your collision tests with the actual objects are. Is some simple axis aligned bounding box checking or some sphere intersection enough? Or do you actually need to trace a 3D-ray against a mesh? (2D doesn't always means you don't have a third dimension where a bullet could go over some object..) *)
*) Edit: oh, I am sorry. You already mentioned that the objects are "simple figures", making my suggestion about a simple brute force even more interesting to try out.


Integral Farkas Lemma

Question: The context of this question is commutative algebra, however the question itself is more related to convex geometry. All necessary information is given.
In the proof of Lemma 3.1.1 in the book "Monomial Ideals" by Herzog and Hibi, the following situation arises: Let $i=1,\dots,m$ and for every $i$ let $a_i, b_i \in \mathbb{N}^n$. For the purpose of the proof, we want to find a $w \in \mathbb{N}^n$ such that the standard inner product $\langle a_i - b_i, w \rangle >0, \forall i$. Then the proof continues: "suppose no such $w$ exists. Then by the Farkas Lemma there exist $c_i \in \mathbb{Z}_+$ with $c_i >0$ for at least one $i$, such that the vector $\sum_{i=1}^m c_i (a_i-b_i)$ has non-positive entries."
The proof refers to a book by Schrijver on Linear and Integer Programming for the Farkas Lemma. I checked the reference and not only i could not find a discrete version of the Farkas Lemma, but the continuous versions (i.e. all vectors are in $\mathbb{R}^n$) that i found, do not seem to match the argument of the proof. So i wonder if anyone familiar with the various versions of the Farkas Lemma could explain to me which version is used and provide a reference or proof for it.
Answer: I might be a little late with the answer but here it is :
Let $Ax = b$ be a rational system. Then there exists an integral solution $x$ iff $y^Tb$ is integer for each rational $y$ such that $y^T A$ is integral.
I hope this helps.

Integral Farkas Lemma


Dual boot system Windows 10 and Ubuntu 12.04

Question: How to get the both of the systems to show correct time? As of now what I get is every time after using Ubuntu, Windows' time gets changed by +4 hrs. None of the solutions posted here are working.
Comment: I guess you know that [Windows 10 now supports Ubuntu 14 natively](https://msdn.microsoft.com/en-us/commandline/wsl/about) without any need for dual-booting, virtual machines etc.
Comment: @RedGrittyBrick that's not really the same thing, at all.
Comment: I have tried updating the windows registry as suggested it worked at first time but after installing the windows updates; this solution stopped working. I have tried all solutions listed below but nothing seems to be working.
Answer: Your computer contains a small clock, that has an own small battery, so it won't lose track of time, even when your pc is shutdown. Linux/Ubuntu expects this clock to give the time in the UTC timezone, which, depending on where you live, differs from your local time (also, UTC does not have daylight saving time). Windows on the other hand, expects this clock to give the local time. The solution would be to either set Windows to expect utc, or set linux so it expects localtime. Since the Windows solution involves messing with the registry, lets look at how to do it in Ubuntu:
Open the file /etc/default/rcS with root privileges and an editor of your choice, e.g.:
sudo nano /etc/default/rcS

Change the following line to look like this:
# Set UTC=yes if your system clock is set to UTC (GMT), and UTC=no if not.
UTC=no

Now you may have to set the clock to the correct time again.
NOTE: This method should only be used with Versions up to 15.04, since the introduction of systemd changed ways.
Comment: There is no such line rcS file. can you please post the exact line i need to add if UTC doesn't exist in rcS ?
Comment: Just write UTC=no, as stated in my post. Are you sure there is no such line?
Comment: yup, it's not there. hope this works.
Comment: Modifying registry worked for me, I just had to create a file named WindowsTimeFixUTC.reg with the following contents [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation] "RealTimeIsUniversal"=dword:00000001
Answer: Multiple Boot Systems Time Conflicts
Operating systems store and retrieve the time in the hardware clock located on your motherboard so that it can keep track of the time even when the system does not have power. Most operating systems (Linux/Unix/Mac) store the time on the hardware clock as UTC by default, though some systems (notably Microsoft Windows) store the time on the hardware clock as the 'local' time. This causes problems in a dual boot system if both systems view the hardware clock differently.
The advantage of having the hardware clock as UTC is that you don't need to change the hardware clock when moving between timezones or when Daylight Savings Time (DST) begins or ends as UTC does not have DST or timezone offsets.
Changing Linux to use local time is easier and more reliable than changing Windows to use UTC, so dual-boot Linux/Windows systems tend to use local time.
Since Intrepid (8.10), UTC=yes is default.
Make Windows use UTC
Note: This method was not initially supported on Windows Vista and Server 2008, but came back with Vista SP2, Windows 7, Server 2008 R2 and Windows 8/8.1.
To make MS Windows calculate the time from the hardware clock as UTC.
Create a file named WindowsTimeFixUTC.reg with the following contents and then double click on it to merge the contents with the registry:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation]
     "RealTimeIsUniversal"=dword:00000001

Note: Windows Time service will still write local time to the RTC regardless of the registry setting above on shutdown, so it is handy to disable Windows Time service with this command (if time sync is still required while in Windows use any third-party time sync solution):
sc config w32time start= disabled

Reversing the change
You can create a file with the following contents and then double-click it to merge in the original changes, as above:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation]
     "RealTimeIsUniversal"=-

If Windows Time service was disabled, enable it again with the command:
sc config w32time start= demand

Make Linux use 'Local' time
To tell your Ubuntu system that the hardware clock is set to 'local' time:
edit /etc/default/rcS

add or change the following section
# Set UTC=yes if your hardware clock is set to UTC (GMT)
UTC=no

For more details you can check the following link:
Multiple Boot Systems Time Conflicts
Hope, It will be work :)
Comment: Please quote the most relevant part of an link important for your answer, in case the target site is unreachable or goes permanently offline. https://askubuntu.com/help/how-to-answer
Comment: Thanks for the answer, modifying registry worked for me, I just had to create a file named WindowsTimeFixUTC.reg with the following contents [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation]
     "RealTimeIsUniversal"=dword:00000001


Dictionary<> Performance

Question: Im using a Dictionary, i will have around a million entries and i will be regularly be adding, removing, editing, and polling.. im wondering what the up/down sides of all the entries will be, and if there is a more efficiant way.
Comment: it might be helpful to explain what you are trying to do
Answer: It depends what you want to do. If you want a key-value pair store with fast insertion, lookup and removal, you can't get much better.
But if you want to get the smallest key, a dictionary won't help you much as you will have to search the entire dictionary. A SortedDictionary might be better in this case.
The most suitable data structure depends on what data you will store, and how will be using it. Since you haven't told us either, it's very hard to give a concrete answer to your question.
Answer: Would help a little bit if you could elaborate more the question. For example: Advantages and Disadvantages of Dictionaty over what other data-structure ? Linked lists ? B-Trees ?
As far as I can see, the biggest advantage of a dictionary data structure is the O(1) magnitude for searching a single item.
Answer: At the risk of repeating other people's comments, without more information about the specifics, it's hard to know what's good for your purposes.
But I will stress that if what you need is a fast add, remove, and lookup by key, DO NOT write your own dictionary-like data structure. Dictionary<> is incredibly well optimized and robust. You are very unlikely to improve on it without spending WAY more than your available resources.

Dictionary<> Performance


How to shim a doorknob latch plate

Question: I'm replacing all the doorknobs in my new house. The new knobs "latch plates" (not sure what the proper term is) are thinner than the old ones, so they sit a bit too deep in the space that was cut out of the door (see image below). Is there any easy way to shim the plate? This is purely for cosmetic reasons (it functions fine as is). Pre-made hardware would be ideal, and maybe I'm just lacking the right search term.
Answer: The shim is not visible, so you could make your own shim out of cardboard -- more than one layer, if needed.
Comment: As a mention, the cardboard does not need to be cut precisely. One piece for the top and bottom about 7/8" wide by 3/8" tall +/-. Sometimes its a trick to keep them in place while you are trying to get the latch back in place, but it will work, and if you get it the right thickness the first time, you only need to do it once.. It looks like 2 thicknesses are needed, Cut 2 pieces approx. 3/4X3/4" and score both squares partway through middle and fold on the score, then insert. The screws will readily go through the cardboard. My apologies Phil, just needed a little more detail.
Answer: If the latching mechanism is adjustable, then just a few washers behind  that plate will bring it out. Your home store will also have shim sets.
If the latching mechanism isn't adjustable and can't be moved out, then you have to find a round hole strike plate that will fit over your "latch plate" to fill in the space. You'll need something like the one below but you'll have to check dimensions.

How to shim a doorknob latch plate


How to use Swann's Immortality Protocol?

Question: In Starcraft II, when using Swann in Co-op, how do you activate/use the Immortality Protocol? I have earned it, but I'm unsure what I have to do to get it to work and I can't find anything on the internet.
Answer: To use Immortality Protocol, the unit needs to be destroyed.
When the Thor unit is destroyed, if you have the Immortality Protocol, you will have a 400 HP Unit that you can select, and rebuild the Thor.
Note:  Google Search for "Immortality Protocol" will tell you everything you need to know on the first hit.  The question is extremely poorly researched, and it seems like no attempt was made.
Comment: Actually, I did do fair amount of research, all the information I found talked about how the IP works in campaign but not in the Co-op. It seems to work differently between the campaign and the Co-op. I was looking for more for an answer like: research X, then when the unit is destroyed, select the wreckage and click Y. Perhaps I missed the button to click while playing, but I couldn't find the way to use IP on the battlefield.
Answer: Found the answer. Before the unit (Thor/Siege tank) is destroyed, the option will not be available, however it will alert you that it will be an option:

Once the unit is destroyed there will be a Repair button that can be selected to activate the repairs:
I think we may have been playing a mutation Coop game and it wasn't available because my unit was burning at the time. I looked everywhere but I wasn't able to find a repair button. The next time I played I the repair button was very apparent.


Shouldn't the King's Landing godswood have a weirwood tree?

Question: Is it not disrespectful of the people of the North for the King's Landing godswood not to have a weirdwood tree? I understand that there was some cutting-down of weirwoods south of the neck, but hadn't Faith-of-Seven-vs-old-gods conflicts died down by the time of Aegon I's landing?
Answer: tl;dr: There's nothing preventing King's Landing from regrowing a weirwood tree, but I doubt anyone in charge there is motivated enough to bother.

It's true that by the time of the series beginning, the Andals had made peace with the First Men, including a (grudging) acceptance of their religion. However, by that time, the damage had been done.
When the Andals invaded, they cut down almost every weirwood tree they came across, without fail. As far as we know, there are only a handful of trees left outside the North (Casterly Rock, Riverrun, and Storm's End, for example, plus a grove on the Isle of Faces). This means any weirwood trees in or around King's Landing were destroyed.
To replace it would require someone to intentionally plant a new tree, and we're led to believe that the trees are very old. So it would take years, possibly decades, before a new weirwood tree was in a condition to be carved up and used religiously. But King's Landing, while it may tolerate the Old Gods, is primarily populated, and run, by worshippers of The Seven. It's unlikely that anyone with both the authority and the desire to try to replace the weirwood tree even lives in King's Landing anymore.
Comment: I'm guessing it wouldn't have been a popular move: "Dear worshippers of the old gods, as a sign of respect, we're going to tear one of your sacred trees out of the ground and take it far away. Which one can we take?"
Comment: tl? 4 lines are tl? :-(
Comment: Also, King's Landing is a new city. They planted the entire godswood. Why not bring a Weirwood from the North as well?
Comment: The same reason that synagogues exist in many Muslim countries but no-one is building any new ones! People will tolerate what's always been there through inertia but object violently to something new.
Comment: @user568458: Ugh, not tear one - just plant a sapling. Or a seed, I'm guessing they have seeds, right?
Comment: @TheMathemagician: But what if you were building a space with worshipping spots corresponding to different religions? Why not a synagogue too?
Answer: The central focus of a Godswood is the heart tree. Typically, this should be a weirwood, but as you mention all the weirwoods south of the Neck we cut down.

In the south the last weirwoods had been cut down or burned out a thousand years ago, except on the Isle of Faces where the green men kept their silent watch. Up here it was different. Here every castle had its godswood, and every godswood had its heart tree, and every heart tree its face.
A Game of Thrones - Catelyn I

However, the heart tree does not have to be a weirwood to have the same purpose. A you mention the Kings Landing Godswood does not have a weirwood, but it still has a heart tree.

The heart tree there was a great oak, its ancient limbs overgrown with smokeberry vines; they knelt before it to offer their thanksgiving, as if it had been a weirwood.
A Game of Thrones - Eddard V

Which seems to be enough for Ned to feel the comfort of the gods he prays to

The heart tree was an oak, brown and faceless, yet Ned Stark still felt the presence of his gods. His leg did not seem to hurt so much.
A Game of Thrones - Eddard XII

So to conclude while every Godswood has its heart tree, but that heart tree is not 100% a weirwood.


node.js/everyauth: Maintaining session information with auth request

Question: Ok, so I'm banging my head against the wall trying to figure this out! I'm trying to authenticate via Facebook.
I've got node (0.6.13) running express on an amazon ec2 server. I'm using everyauth for auth, and I have mongodb (mongodb native and connect-mongodb) for persistence. Here is how I instantiate mongo:
var MongoStore = require('connect-mongodb');
var mongo = require('mongodb');
var mongoServer = new mongo.Server('localhost', 27017, {auto_reconnect: true, native_parser: true})
var mongoStore = new MongoStore({
    db: new mongo.Db('test', mongoServer, {})
  , reapInterval: 3000
});

I'm trying to authenticate through facebook using everyauth. So let's assume my app is running on port 3000, at http://ec2ip:3000/. My facebook app settings have the Website being redirected back to http://ec2ip:3000/.
Express is setup like so:
app.get('/', function (req, res) {

 if(!req.session.auth || !req.session.auth.loggedIn)
 {
    console.log("Not authorized!");
    res.redirect('/auth/facebook/');
 }
 else
 {
    console.log("Authorized!");
    res.sendfile(__dirname +  '/www/index.html');
 }
});

This was working locally, before I put it on the server. What will happen is that it will correctly authenticate with facebook, and redirect to my website, however req.session.auth will always be undefined, and it will redirect forever.  Even though I know it's successfully authenticated, it's just not passing the right session information.
It has something to do with setting up the redirect requests properly so session information is maintained, but I don't understand how it's working under the hood.
Any advice/help would be greatly appreciated. These are the related questions/problems I'm having, but I don't know how to apply it in my case: https://github.com/bnoguchi/everyauth/issues/189 and Node.js & Express session problem
Comment: did you manage to work it out Paul?
Answer: Check what is the value in "req.session". Then go get directly the value in object that you need.


while(past, past continuous), what's the difference?

Question: I'm learning the word, 'while'.

While she waited, he mended her shoes.
While she was waiting, he mended her shoes

Is there a difference?
thanks :)
Answer: (1) would usually imply that she was waiting for the shoes to be mended, perhaps so that she could put them on again afterwards.
(2) could mean that she was waiting for something else, and at some point during that time she got her shoes mended.
Answer: 'waited' means the whole process of the 'mending',and 'was waiting' means the state in which she was 'in the middle' of the 'mending'. The use varies by the situations.
BUT, apart from the second sentence, This kind of sentenses can also indicate a situation where the the verb of the main clause interrupted or occurred as if it had interrupted the verb of the subordinate clause if the 'main verb' occurs in a very short time.
Hope I helped, and glad to see my own kind on a foreign website.


Did Christians stop the practice of circumcision immediately?

Question: Did Christians stop the practice of circumcision (Berith, Brith, Bris?) immediately and based on which scripture?
Comment: This refers to [the Jewish circumcision ceremony](http://en.wikipedia.org/wiki/Bris), for those that didn't know. I had to google a bit myself.
Answer: This was a topic of dispute in early Christianity, between believers who had come from the Jewish faith, and gentiles. The issue relates to whether Christianity is part of Judaism - which would mean that converts had to be circumcised - or whether it is an independent faith. If it is not needed for adult converts, then it would not be applicable for children either.
Acts 15:1-21 records a council, held in Jerusalem, to decide. This probably took place in 50 or 51AD. Peter said (v7-11, NIV):

Brothers, you know that some time ago God made a choice among you that the Gentiles might hear from my lips the message of the gospel and believe. God, who knows the heart, showed that he accepted them by giving the Holy Spirit to them, just as he did to us. He did not discriminate between us and them, for he purified their hearts by faith. Now then, why do you try to test God by putting on the necks of Gentiles a yoke that neither we nor our ancestors have been able to bear? No! We believe it is through the grace of our Lord Jesus that we are saved, just as they are.

and the council agreed to write to Gentile believers, saying (v28-29):

It seemed good to the Holy Spirit and to us not to burden you with anything beyond the following requirements: You are to abstain from food sacrificed to idols, from blood, from the meat of strangled animals and from sexual immorality. You will do well to avoid these things.

That did not entirely settle the issue, since it says nothing about whether Jewish converts could or should observe the law of Moses, and in addition there continued to be many "Judaizing" Christians that required converts to be circumcised and follow the Torah. Historically speaking, the destruction of the Temple in 70AD, and the Roman slaughter and dispersal of Jews, dramatically reduced their numbers and influence. Though groups such as the Ebionites continued to exist for several centuries after that, "mainstream" Christianity no longer required circumcision at all.
Paul writes about circumcision at great length in his letters, especially in Galatians but also in Romans, 1 Corinthians, and elsewhere. For example, Romans 2:25-29 says:

Circumcision has value if you observe the law, but if you break the law, you have become as though you had not been circumcised. So then, if those who are not circumcised keep the law's requirements, will they not be regarded as though they were circumcised? The one who is not circumcised physically and yet obeys the law will condemn you who, even though you have the written code and circumcision, are a lawbreaker.
A person is not a Jew who is one only outwardly, nor is circumcision merely outward and physical. No, a person is a Jew who is one inwardly; and circumcision is circumcision of the heart, by the Spirit, not by the written code. Such a person's praise is not from other people, but from God.

His theological case is that circumcision is a sign of faith, but it is not the same as actually having faith. For Paul, the outward symbol is unnecessary. More generally, one of his major themes is that adherence to the Law does not guarantee salvation (see Galatians 5, for example).
Comment: Thanks for the good answer, but I'm not asking for me, so I would prefer a more neutral explanation. "If Christians truly believe, then they do not need ...". But this is a pattern of the whole place here, that people constantly talk about "we" and not about "Christians", as if everybody was a Christian.
Comment: Sorry - I was trying to paraphrase Paul, who is writing to Christians in his letters. I will try to reword the answer to make this clearer.


vacuum chamber and impact on various liquids

Question: I am hoping to do an experiment on "the impact of a vacuum chamber on various liquids".  What liquids would be the most interesting? Water, coffee, soda, gatorade? Would carbonated versus non carbonated make a large difference? I would like to know at what level of pressure they would boil? Do you have any suggestions or feedback. Thanks!
Answer: Water, coffee, and Gatorade are basically the same (water), but carbonated water might be interesting. For comparison, you might want to find a liquid (mostly) not based on water, like rubbing alcohol. Also, your liquids might not boil at all. You'd have to check a phase diagram.


What happens if biometric data is stolen?

Question: As we move toward a future where fingerprints might possibly replace passwords, I see one issue. While passwords can be stolen, they can be changed by the owner after being notified of the security breach. However, fingerprints can be stolen, but they can't be changed. In this future, what happens if someone's biometric data is stolen? You can't very easily change your fingerprints.
Comment: [Fingerprints are not the same as passwords.](http://www.cs.cornell.edu/courses/cs513/2005fa/nnlauthpeople.html) They cannot be changed, that's why we usually have multiple-factor authentication. Your wife recognizes you because of your face, what would happen if someone made a mask of it? She might go on to ask about your anniversary and he wouldn't know the right date. Oh wait...
Comment: [This](http://technet.microsoft.com/en-us/library/cc512578.aspx) is a nice article on this issue.
Comment: In addition, we expect people to do serious research on their own before asking, and to show us what they've done.  There's a lot that has been written on this subject; you should try doing some searching on this topic before asking.  For instance, have you tried Bruce Schneier's blog and books?  Have you read through Wikipedia? Have you read standard introductions to biometrics, e.g., in Ross Anderson's Security Engineering book?
Comment: Biometry can only be used as local authentication. Since it's not secret, it relies on the presence of trusted hardware which can tell apart a fake piece of hardware for real fingers/eyes/etc.
Comment: There has been some work where your biometric is used as your public key. Then it doesn't matter if your biometric data is stolen as that is your public key. It uses IBE under the hood and some other things to deal with the fuzziness of biometrics.
Answer: The answer depends a lot on your use case. Are you using a biometric to authenticate yourself to a remote HTTP server? Then if someone steals a binary representation of your biometric, they will be able to log in as you. This is why we like moving to 2-factor authentication instead of a single factor.
An example would be something you are (your fingerprint, or a digital representation of it) and something you know (your password).
If you are doing local authentication, the story is a little different. Attacker's options are: cut-off your finger and take it with them (see Minority Report where he used eyes instead of fingers), get a scan of your finger and try to replicate it on something the scanner will be able to read, or connect something between the reader and the computer doing the processing.
Even for local authentication, 2-factor authentication is often used. Your fingerprint scan might pull up a picture of you on the security guard's computer. Or a fingerprint and a PIN.
Comment: Thank you for your answer! I'm more confused on the use of fingerprints in general now, however. If they can be replicated and not changed and are stolen, two factor authentication seems to solve that problem, but then I do not see the point of the fingerprint at all. Why not stick with the current two factor authentication where if a phone or password is stolen or forgotten, it can be reset or replaced? Why use biometrics at all? Just one security breach would reveal your identity to the world. Why would we ever want to use an immutable factor in any type of authentication?
Comment: @TimDeng I think those are all valid questions that system designers should ask themselves. I think biometrics for authentication became popular because of how cool it sounds. Just scan your finger or eye and you get access. I see some use for them in local authentication with a tamper-resistant sensor (then you'd physically have to remove someone's finger or eye or construct a very good prosthetic).


Open video file if sensor reaches certain threshold value

Question: I am an ABSOLUTE beginner at Arduino and my first project I've proposed to my teacher is as follows: an Mq-2 smoke sensor will sense smoke and if the level of smoke reaches a certain value (only because I want the smoke to accumulate for aesthetics purposes) then a video file in whatever directory opens and plays. It seemed plausible at first, but as I search for pertinent info., I am faced with content and hobbyists whose instructions and "knowledge" are way out of my depth. Can anyone help me with this? If anyone knows a good website/tutorial videos/documents/books that a beginner like me should take to improve his programming and physical computing(?) skills, please let me know!
Answer: What I'm thinking is that you could make a conditional statement. Below is a little a bit of pseudo code on how to possibly open said video from an SD card because there's no way Arduino would be able to store a video on it's own, let alone play good quality videos:
<code>int dangerLevel = 500 (or however the shield reads the smoke level)

int smokeDetectorPin = A0

setup:

smokeDetected = analogRead(smokeDetectorPin)

loop:

if smokeDetected >= dangerLevel:

open video from SD card directory or computer.
</code>

So in order to get a "video" from the SD card, you should check this website. Like I mentioned before, this is really primitive and it's probably not what you're looking for.
I found something very interest about the Arduino that I never knew you could do before and using composite display from a TV. Interesting and you can find that info here.
And lastly, to get a video from your computer or laptop, there's really no easy way. However, I did find two solutions that might be able to do this. First of all, and this may sound ironic since we're on an Arduino Stackexchange, you could use a Raspberry Pi (and this is the easily solution I can think of) though I believe your instructor prefers if you use the Arduino instead. Second, and this took me forever to find on the internet, you could use a third party software called "Gobetwino" and you can check out what that does here. I saw on YouTube video of a quick little demonstration of what it does. When the button is pressed, the video is played. That's conditional and you can do the same thing but for the smoke detector.
Comment: You're welcome :) it took me a really long time to look all of this up and I actually learned a lot of stuff myself.


How to enable serial emulation through USB in a STM32F4 Discovery board?

Question: I've been searching for this and still haven't found anything about it. This board connects directly to the host PC with a USB bus. Is it possible to emulate a serial port in this case?
Answer: There are two USB connections on the board - the micro USB connector at the top and then the micro A/B connector for the USB On-The-Go support.  The first connector is the programming interface - this connects only to the programmer chip and not to the actual target microcontroller.  There's no way to use this connection as an emulated serial port.
As for the USB OTG connection I'm less familiar with it but judging by the Wikipedia page on the subject it seems that it's not really meant for that either - USB OTG is focused on acting as a semi-host for peripherals such as thumb drives or bluetooth adapters or something. Just doing a quick Google search yields no serial port emulators and from my assessment of how OTG works my initial reaction is that it won't work.
However, it is perhaps possible that you could configure the OTG device to act as a regular USB device and then code a serial port emulator to reside on the board, but that's a whole development effort on its own.  You're best off attaching a cable like this to the UART pins on the board and interfacing through the UART on the microcontroller that way.
Answer: You might want to check out my question (and answer): ST-LINK is serial communication possible? I managed to run serial communication over SWD.
Answer: This project implements CDC USB serial on the STM32F4 Discovery.
https://www.das-labor.org/trac/browser/microcontroller/src-stm32f4xx/serialUSB
Comment: Try using usbsnoop to debug the USB messages.
Comment: I've tried using this project but with the armcc compiler and it didn't work yet. Windows says it is an invalid USB device.
Comment: @TobyJaffey The link got expired! Can you please update the link or explain the key implementation? Thank you!
Answer: If there is a way to send serial data from the STM32F4 to the PC thought the programming USB connection, I have not seen how to do it.
I managed to get ( text type ) GPS data to the PC as follows:
(1) Adapt the USART software example for the STM32F4 at "Elia's" website
(2) Connect the STM32F4 TX and RX and GND pins to a USB-serial device  such as I use for serial communication between the Arduino and PC  or the  GPS device and PC.
(3)  Use PuTTY to display the serial data being received at the PC.
This seems to work but it rather annoying.  I also cannot make it work in both directions,  which I could do with the Arduino and other devices.


Top, bottom, charm, and strange?

Question: Of course I know about up and down quarks, but I cannot seem to find that much about the other four (of course being eight if we're including antiquarks).  Is mass the only difference between the quarks?  Can the other quarks form hadrons of their own?  Is there some interesting matter or reaction or anything that any of them can make or do, or are they really as boring as the Internet has been telling me?
Answer: Wikipedia does a good job of explaining the quarks, but really all you need to know is in the handy Standard Model particle chart:

Quarks come in three generations and two different electrical charges, $+2/3$ and $-1/3$. Like the up and down quarks, which differ in electric charge and therefore in how they can combine to make integer-charge baryons and mesons, the charm/strange and top-bottom quarks work slightly differently with respect to the kinds of combinations they can form. However, that is essentially it, and in particular the up / charm / top and down / strange / bottom triplets behave identically as far as which interactions they're able to take part in.
On the other hand, the masses are different from generation to generation, and that is not just some random property that you jot down and forget: the mass of a particle is (via $E=mc^2$) the energy that it can contribute to a reaction, and the more massive the particle, the more energy it can bring in, and the wider the array of reaction products that can come out.
Thus, if you start with, say, a Lambda baryon, you have enough energy to produce, say, a $\Delta^+$ baryon, which has $uud$ quark content with all their spins aligned (instead of two anti-aligned), and can therefore be seen, roughly, as an excited state of the proton system. On the other hand, if you start with a proton, you would need to provide some significant energy to excite it into the $\Delta^+$ state.
I should also mention that for each of the given quarks there is a quantum number known as flavour, or more specifically strangeness, charm, topness and bottomness, which can be used to characterize the particle content of the reaction at any given state. Unlike electric charge and baryon number, which are always conserved, the individual flavour numbers are only weakly conserved: many processes (and in particular strong-force and electromagnetic interactions) will respect them, but weak-force interactions don't.
Thus, as an example, the strong and electromagnetic interactions forbid the decay of the $\Sigma^+$ baryon (quark content $uus$) into a proton's $uud$, as that would decrease the strangeness of the state, so the process is relatively unlikely, as only weak-force routes can mediate the decay.
Comment: Perhaps you could say something about color charge too, and how it changes, unlike electric charge.
Comment: @PM2Ring You're welcome to add an answer with that content yourself.
Comment: Thank, that was quite helpful.  Another little question I had was this: so you showed the standard model of elementary particles - why are gravitons not on that model with the other gauge bosons?
Comment: @M.Lumsdaine Because the gravitons are not part of the standard model of particle physics.
Answer: First of all, where did you find those "boring materials on the internet" about the quarks? Quarks are not boring at all; in fact they are of a major importance in the Standard Model.
There are 6 types of quarks (plus their anti-quarks): up,down,charm,strange, top and bottom. Each one has different properties, such as electric charge, mass, color charge and spin.
There are so many materials where you can read about them, that I don't even know which one should I recommend, so I'll just go with a safe bet: wikipedia
And as you mentioned, they can form hadron of their own, and they participate in many processes.
I guess the best way to do it is to read about them, and then decide for yourself if they are boring or not.
Peace !
Comment: Thank you, this was quiet helpful.  I had been skimming Wikipedia but had not found that much that interested me - it was mostly just, definitions, names, and numbers.  So is the only difference between quarks their mass and charge?  The only other thing I found was their life span, but that seems like it would just tie into mass.  Thank you again for taking the time.
Comment: The only thing is not just the mass. It is the topness and bottomness ..., called flavor,  i.e. their specific individual quantum number that is  conserved or changes through weak interactions in a specific way, decaying into lower mass and different quark flavor : http://hyperphysics.phy-astr.gsu.edu/hbase/Particles/qrkdec.html
Comment: Anna v.... where in my entire answer you saw only the mass? I said "Each one has different properties, such as electric charge, mass, color charge and spin."

Top, bottom, charm, and strange?


Can we insert into external table

Question: I am debugging a Big Data code in Production environment of my company. Hive return the following error:
<code>Exception: org.apache.hadoop.hive.ql.lockmgr.LockException: No record of lock  could be found, may have timed out
Killing DAG...
Execution has failed.
Exception in thread "main" java.sql.SQLException: Error while processing statement: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.tez.TezTask.
    at org.apache.hive.jdbc.HiveStatement.execute(HiveStatement.java:282)
    at org.apache.hive.jdbc.HiveStatement.executeUpdate(HiveStatement.java:392)
    at HiveExec.main(HiveExec.java:159)
</code>
After investigation, I have found that this error could be caused by BoneCP in connectionPoolingType property, but the cluster support team told me that they fixed this bug by upgrading BoneCP.
My question is: can we INSERT INTO an external table in Hive, because I have doubt about the insertion script ?
Comment: Is this a question about an Oracle External Table?
Comment: no, about Hive external tables
Comment: Removing the oracle tag then.
Comment: Are you using Oracle as your  metastore?
Answer: Yes, you can insert into external table.
Comment: Please try to use - `set datanucleus.connectionPoolingType=dbcp;` before running the insert

Can we insert into external table


Do WAFs block base64 encoded inputs?

Question: Do WAFs block/trigger alerts when they just read base64/hex encoded stuff as suspicious input? Or do they decode the strings (the ones which can do that), analyze the result and just then evetually block/trigger some alerts?
Answer: That depends entirely on how the WAF is configured.
When you ask "Do WAFs do this thing?", you speak of them as if there were one and only one way to implement them.
In general, a WAF has to be configured for the application in question. For example, a WAF may be configured to block as soon as it sees bits of SQL syntax, as it may be indicative of attempted SQL injection.
This would be terrible in an SQL administration tool, which is used to configure queries in a database. But from the point of view of the WAF, both are just "SQL syntax in a POST request".
So the WAF needs to be configured for what is legitimate and what is not. If your application regularly transmits base64-encoded data, then that is legitimate and will likely not trigger an alert. If it doesn't then it might trigger one.
Comment: Thanks for your answer! Is it affected also the response from the web application? I mean, webapp X usually does not respond with anything in base64, could it trigger the WAF which protects that webapp?
Comment: Usually, WAF only blocks in terms of requests, not responses.

Do WAFs block base64 encoded inputs?


Encourage social media

Question: Is it possible to add new badges or introduce points for sharing links to questions? I think it would be good to encourage more social media sharing of the site - it would help to improve the profile of the BiologySE site, help garner new users, and increase the frequency of questions and (multiple good quality) answers. One way to encourage more social media usage would be to offer points and/or badges. As it stands there are no points available, and there is only three badges (depending on the number of unique IP addresses that read the post [25, 300, 1000]).
Comment: @fileunderwater you can propose network-wide changes here as well, you don't have to do that on MSO.
Comment: Shouldn't this be an issue for StackExchange in general? From what I've seen the badges are the same across sites.
Comment: is there a way to bring it up with SE in general? I think it is perhaps a larger issue for the smaller/beta sites which suffer because of low visitation rates etc.
Comment: Ask it at http://meta.stackoverflow.com/, which is used as Meta for all of StackExchange. As you say, its probably most relevant for newer sites, but there are many of those.
Comment: @MadScientist Ok, good to know.
Comment: @MadScientist so how do we get the attention of the necessary people to suggest network wide changes from within our own meta?
Comment: @GriffinEvo SE does monitor the per-site metas, and we moderators can point the SE community team to specific issues on our meta.
Comment: @MadScientist I see, thanks for the info
Answer: Increasing the rewards for specific behaviour also encourages gaming the system to get those rewards, one example are the review badges which were in part responsible for a whole army of robo-reviewers. So we need to take possible negative effects into account.
What could happen if the rewards for sharing were too large is that users start spamming high traffic sites like Reddit to get those rewards. This is fine in moderation, but we don't want to get a reputation for spamming and maybe even be blocked from some sites due to that.
I can guarantee you that giving out reputationn for sharing links won't happen. It doesn't fit with the existing SE philosophy, it would reward users for something that happens outside of the site, and it would likely be too tempting for some users to abuse.
Badges would not be out of the question, but I don't see any good criteria for new badges. The sharing badges already exist, and they span all three types (bronze/silver/gold). Of course one could add badges for sharing x links in total, but that would be rather boring and also not much incentive over the existing badges.
Some more creative badges could be to award them for bringing in a user that becomes a very active member on the site. So e.g. if a user registers after they visited the site via such a shared link, the sharing user would get a badge once the new user reaches x rep. Though I suspect that practical and technical issues would make this kind of badge very unlikely to be ever implemented.
I don't think we should add any substantially higher rewards for sharing links, I'd be too worried about possible negative impacts of such a change.
Comment: You're right, we don't want to encourage spamming or playing for points etc. (although the distinction between "gaming" for badges/points and doing good things for the site could be quite unnecessary if, at the end of the day, the net effect is an improved site) so perhaps some "one-off" rewards would be good to stop anyone overdoing it but make them aware of the activities that would improve the site - I really like the idea of a reward for bringing in new users!
Comment: perhaps a "suggest biology SE to a friend" button which is rewarded if someone registers as a result and goes on to make X points within 6 months... "Pyramid scheme" badge if they then get three people to sign up ;)
Comment: though a suggest a friend link could be quite susceptible to being spammed

Encourage social media


Repetitive actions in future tenses: "I will visit" or "I will be visiting"

Question: Which form is correct?
"I will visit you regularly."
or
"I will be visiting you regularly."
Comment: They are both correct, and they mean essentially the same thing.
Comment: In English, if you use a time/frequency word like "regularly" in a sentence, it typically doesn't matter whether you use a verb form that indicates frequent/repeated action or a plain form. You certainly don't have to use the future continuous.
Comment: They don't mean exactly the same thing; just like simple present and present progressive do not mean the same thing.
Answer: Both of these are correct.
With the verb "visit", the continuous tense adds a sense of an extended (but temporary) stay in each visit.  But the default form would be "will visit".  This form you would use, unless you specifically want to mention the fact that each visit will be extended in time.
Answer: COMPARE:
I'm visiting you this/next week, aren't I?
And
I'm sure I'll be visiting you in the future, right?
Can you see how the present progressive can become the future progressive?
The focus is on the action of visiting.
TO:
I visit you every time you ask me to. [present simple, habitual action, statement]
I will visit you every time you ask me to. [intention of habitual action in the future]
The focus is on the fact of visiting, not the action involved in it.
[The word regularly can be used without changing the demonstration.]
By trying to feel the difference between the progressive tense, the simple present tense and the future progressive and will+ verb is the way to see how these differ from one another.
Another example:
I'm playing soccer with my son this afternoon.
I'll be playing soccer with my son every Sunday.
I play soccer with my son quite a bit.
I will play soccer with him whenever we both have time play.


Relationship between simple Libor spot and forward rates

Question: How is the simple forward rate L(0,T,T+1) calculated given the spot rate L(0,T)?
Comment: You cant calculate a forward rate from a single LIBOR spot rate unless you make some (strong) assumptions
Comment: Thanks, sure, but how do you derive the forward rate(s) if i have 12x monthly spot rates?
Answer: USD Libor rates are quoted on a Act/360 basis.  You can determine USD Libor forward rates by application of the following formula.
$$ (1 + \text{SpotRate}(t) \times (\text{Act}(0,t)/360)) \times (1 + \text{FrdRate}(t,T) \times (\text{Act}(t,T)/360)) = (1 + \text{SpotRate}(T) \times (\text{Act}(0,T)/360) $$
where:
SpotRate(t) = the short term spot rate;
SpotRate(T) = the long term sport rate;
FrdRate(t,T) = forward rate from t to T;
Act(0,t) = Actual days from 0 to t;
Act(0,T) = Actual days from 0 to T;
Act(t,T) = Actual days from t to T
Note:  This is for USD Libor and most other currency Libor rates.  However, some currencies, such as GBP Libor are quoted on a 365 day basis.  For these currencies you would substitute 365 for 360.  Be sure to make sure you are using the appropriate daycount convention for the currency.


Subversion configuration related question

Question: I've got subversion installed on my Ubuntu server. I usually do my development work under an account separate from root. However, in order to check in code, I need to be root or use the 'su' command 'su svn commit ....'
How do I make it so I can check in code via my regular user account?
Comment: Just to clarify, so the svn repository is on the same machine on which you want to work?
Comment: Yes, the repository is on the same machine that the work is done on.
Comment: The repository probably has root only write access. Chmod 777 *
Answer: If the repository is on the same server, then just changing the permissions of the repository folder/files to allow your user to write there should be more than enough.
Better yet, you can create group(s), to which you give write permission(s) on the repo, and add your user to one of them.
Answer: Make sure your non-root user has read&write access to the directory (and everything below it) where the svn repo is located.
Then, as the non-root user, simply check out a new working copy. You should be able to commit with simply svn commit.
If you want to keep using the existing working copy for some reason, one thing you could try is giving the non-root user rw access to everything under all .ssh directories  with chown/chmod.
(Assuming here that the repository is on the same machine.)


What are some of the best practices for sharing data and models with colleagues?

Question: As a data scientist who recently joined a new team, I wanted to ask the community how they share data and models among their colleagues. Currently I have to resort to storing data in some central server or location where all of us can access (which means unix permissions etc). For models I also tend to send a weights file over to my colleague and share my github. Both I've found pretty cumbersome. What have some of you done?
Comment: file server + weights files here :p for non-data scientist colleagues I make models accessible through web APIs (mostly using cherrypy).
Comment: [cherrypy docs](http://cherrypy.org/) - interesting, never heard of that before
Comment: If you have a model / dataset you want to publish, I can recommend https://zenodo.org/
Answer: You can try using dvc, which stands for data version control.
https://dvc.org/
Answer: Honestly once you get to something serious (big or evolving) the main problem is about sharing and updating data. Once a solution is devised for data, it is not really hard to adapt it to models.
Depending on the volume and the usage, the data can be stored, exchanged and acessed in a wide range of solutions. It might be old historical/external solution with associated langages (SAS), internal data bases on linux server with a 'lab' interface, clouds solutions or just csv file for tinier data sets. Once this is arranged and the solution to access those data is devised is it rather easy to adapt the solution to models. Sometimes it demand a bit of involvment to handle the rights properly but it shouldn't be too much of a hassle if the architecture is set with that goal in mind.
So, regarding models, depending on the context, the solution might be sharing SAS programs on a shared workspace, pickled python models on a linux server or simply Excel files trough mail. More recently, new 'tools' appeared and result in new solution : share experiments
trough notebooks (Jupyter notebooks or R Markdown) and use Git for versionning models.
Answer: Listening to the podcast Partially Derivative Episode "Data Science On The Silicon Beach" the host interviews Maksim Percherskiy, Chief Data Officer for the City of San Diego.
Talking about the stack he uses for the City of San Diego: (08:50) "The way we move data around ... we use Airflow [...] and Airflow is just Python." Percherskiy continues characterizing the data sharing problem in the context of city government.
Comment: airflow is for moving data around computational pipelines, not the office :)
Comment: Honestly, I haven't used Airflow, and offered this because the interview explicitly discusses sharing datasets (~06:00 - 11:00). So, I if Airflow is not "the solution" then at least its in the ballpark.
Comment: No, it's not. Airflow is for sharing data between tasks, not people: _Use airflow to author workflows as directed acyclic graphs (DAGs) of tasks. The airflow scheduler executes your tasks on an array of workers while following the specified dependencies. Rich command line utilities make performing complex surgeries on DAGs a snap. The rich user interface makes it easy to visualize pipelines running in production, monitor progress, and troubleshoot issues when needed._ Does this sound like what you'd use to share your data or model with your coworkers?
Answer: For big files, I use cloud storage (Google, Amazon, Microsoft, or whichever ecosystem your company's on), with folders named after the issue/project ticket name/number. These services support file versioning, by the way. Small files I just attach to the ticket. If have to share something small and transient with a handful of people I can use email or our corporate chat application.
Comment: thanks! sounds like you use quite a few different approaches. Any reason you wouldn't just stick to one?
Comment: Because I'm at a startup and I'm empowered to do whatever I want to get the job done ASAP. And I think I don't use that many approaches; only two or three.
Answer: To store and share the data amongst colleagues, cloud storage is the option we use (s3, google storage) where you can just have a folder structure to store all your datasets. While there is no specific way to share models, it totally depends on the model type, one thing that's used is making a binary of model (pickle in python) and share that file which you can also encrypt in case you are floating around sensitive data.
In case it is an unsupervised learning model you can directly share the codebase.
Answer: I'd say this question is much broader, than simple sharing files. How do you perform research with team in agile fashion? Sadly, there's just a few solutions on the market. As mentioned before, most of the people hack it using already available services. Some time ago I've stumbled upon neptune.ml. It looks nice, though is quite pricey. Most of the time I'm doing something similar. I try to stick to git-flow convention and I have separate folder in repo named research, next to vanilla git-flow branches. Also keep your data in separate repo, so you know against which data version you ran your experiments.


Why does the scalar field still have a VEV in a vacuum state of a SUSY-theory?

Question: In a supersymmetric theory the vacuum state is Lorentz invariant, so all the vacuum expectation values (VEVs) of fields that transform non-trivially under Lorentz transformations should be zero. Thus, only the scalar field can have a non-zero VEV. But the vacuum is not only Lorentz symmetric, but also supersymmetric and the scalar field does not transform trivially under supertransformations. It gets mapped to a fermionic field. So why shouldn't the VEV. of the scalar field be zero as well?
Comment: Have you tried explicitly calculating the variation of the fermion field?
Comment: Do you mean the variation of the fermionic field under Lorentz transformations? Because that is zero for sure, by definition. Or do you mean the transformation of the scalar field under susy that becomes a fermionic field? That depends a bit on dimension and what kind of multiplet you're in but for example in 4d N=1 in a chiral multiplet the transformation is $\delta \sigma \propto \epsilon^{\alpha} \psi_{\alpha}$ where $\sigma$ is the scalar field, $\psi$ the fermionic field and $\epsilon$ the spinorial infinitesimal parameter. (See lectures by Bertolini on SUSY, 4.59)
Answer: Consider a single chiral multiplet with scalar and spinor components $\phi$ and $\xi$. Schematically, the SUSY transformations are
$$ \begin{split}\delta \phi &\sim \bar \xi\epsilon\\\delta \xi&\sim \bar \epsilon\gamma^\mu\partial_\mu \phi \,.\end{split}$$
(Note that I have neglected auxiliary fields and Hermitean cojugates.)
The key point is that $\delta\text{(scalar)}\sim\text{spinor}$ and $\delta\text{(spinor)}\sim\text{derivative of scalar}$. Hence, a vacuum configuration $\left(\phi,\xi\right)=\left(\phi_0,0\right)$ with constant $\phi_0$ is invariant under SUSY transformations.


Is it possible to know if a file is currently opened by someone else in Dropbox?

Question: My company has data for which we do not want to produce conflicted copies and deal with the hassle of merging.
Is there a way to tell if a file is currently opened by a team member?
Answer: Not as a direct feature* of Dropbox.
However, if you use a file editor that saves a temporary lock file to the same folder as a marker that the file is in use, then Dropbox will also sync that file to everyone. If another peroson then uses the same editor, the editor will notice the lock file, and alert that the file is in use.
(I seem to recall that Microsoft Word works like this, but I'm not sure.)
* - From a technological perspective, it would be a very silly thing for Dropbox to have as a direct feature. Dropbox syncs files in a way that the synced files are exactly like any other file on the local file system. It only monitors those files for changes. Therefore Dropbox can't really know if any of the files are being edited, since they are not in any way requested from Dropbox when opened, but instead they are opened directly from the local file system. This is also the strength of Dropbox compared to some other alternatives that have their own drivers to mount themselves as a special drive on the OS - while they can be accessed pretty much like regular drives, they require the software to be running for the files to be accessible. Dropbox files can be edited and accessed regardless of the Dropbox software, it only manages the syncing.
Answer: Or, rename something.doc to something_YOURNAME.doc before editing and put it back when you are done.
Voila.


Left-handed tremolo on a right-handed Jazzmaster

Question: I've developed the habit of having the trem bar under my wrist and pressing down on it with my wrist when playing my Mexican Fender Jazzmaster. The trem bar runs at a 45° angle across the strings and gets in the way of picking or strumming sometimes, and I think it would be easier if it were attached to the top of the trem system instead of to the bottom; which made me wonder: can you put a tremolo system from a left-handed Jazzmaster in a right-handed one? They look symmetrical, but maybe the body routing isn't? Are there any other reasons not to try this?
Answer: Looks like you are going to have to strip the mechanism off the guitar, and see for yourself if it's symmetrical. If yes, it's good to go. If not, then it's out with the router. No big deal either way, just extra work for the latter.
Answer: There are plenty of technical drawings for guitar routings on the Internet, and they all agree that the routing for standard Jazzmaster tremolo cavity is symmetrical. It might be worth it to check your guitar before ordering anything, but there's a good chance that left-handed tremolo will fit.
Answer: I am a lefty and done the same thing in reverse. I use a righthand tremolo on a lefty guitar. It works great. Plus no reaching to grab the arm. It fit just fine on mine, so should for you. It a 6 hole setup the same for either hand.


Looking for canon Quenya and Sindarin dictionary

Question: Are there any canonical English <-> Elvish dictionaries, that means with no added material? Some Grammar would also be useful.
Comment: @KRyan If Tolkien wrote it, it's canon. If he didn't, it isn't (my definition)
Comment: But I want to hold a real *dictionary* in my hands. There's enough stuff in the Silmarillion and HoME, but it's too much work for me to compile a dictionary:)
Comment: Tolkien died after writing many, many versions of Elvish. So there isn't so much of a canon as there are canons of Elivish. That's why people that are attempting to use it as a language tend to call it Neo-quenya. As for attempts to work out the grammar, Gateway to Sindarin loks most promising: http://www.amazon.com/Gateway-Sindarin-Grammar-Language-Tolkiens  Or an Ouija board for talking to Tolkien.
Comment: My understanding is that defining exactly what constitutes "added" material is difficult, because people argue about what is or isn't canon.
Comment: There's a fair amount in the LotR appendices
Answer: I think the best you're going to get are the Ardalambion wordlists. There are words in them that are obtained from compounds and such, but all are marked and their source given. If you're after grammar then (for Quenya) there is the Ardalambion course or Quetin i lambë eldaiva at Parma Tyelpelassiva. Parma Tyelpelassiva also has a Sindarin course. But again, all these sources extrapolated from the source material by necessity. The Ardalambion course does a good job of explaining where everything comes from and notes any ambiguities.
Answer: There are some good digital sources, but there is no complete dictionary that you can "hold in your hands"
Right now https://eldamo.org/ is probably the best resource for this. You can browse by language, or search the entire corpus.
It's not a great resource for teaching you the grammar rules of any of the languages, but it's probably the most reliable dictionary out there, including all the words that have only come to light in recent posthumous Tolkien publications and properly sourcing everything so that you can see where a word or its gloss came from. Words are also distinguished by the time period in which Tolkien made them, as his languages were constantly evolving throughout his life.
Eldamo's "Academic Word Search" will ignore any neologisms or fan additions people have made to the languages.
Comment: @杨Eugene - I meant that Eldamo is more of a reference site than a teaching site. They'll have a very good list of the various grammar rules, but if you're trying to "learn the language" you'll be better off with a set of courses.
Comment: The description seems to be outdated. Eldamo currently has IMO the best Quenya grammar, and the Sindarin grammar is almost finished.
Comment: Yeah, you're right.


how to create new user in Raspberry PI who has equal privileges as default user: pi?

Question: I am new to Raspberry PI. I need to create new user in Raspberry PI in Raspbian distro, but I would like to have different username but with equal or same level of privileges?
How could I do it?
Comment: wouldn't changing host names be a whole lot easier/safer? so you could SSH to applepie and blueberrypie with ssh pi@applepie or ssh pi@blueberrypie?
Comment: The problem would appear to be with your SSH toolchain and prompt, so why not address it with a custom prompt and better SSH tools, instead of creating a bigger attack surface for hackers. What are you using to SSH? What type of computer are you SSHing from? What command are you using that is confusing you? are you SSHing using a hostname or IP address?
Comment: @SteveRobillard: For consistency, I'd recommend one spelling of 'pi/pie' though ;)
Comment: Why do you want to do this, Is this login for someone else to use? if you are duplicating the permissions and you are the one using the account  I don't see the benefit. This thread https://www.raspberrypi.org/forums/viewtopic.php?f=91&t=37324  and particularly the answer from @joan (another user here) will get you started.
Comment: I have another Raspberry PI which also I need to ssh. Having same name in ssh is not helping me. But, I want to have same level of privileges for new user.
Comment: Hi Steve. My two PIs are connected to local network. I would like to ssh to them using terminal in my pc. So, while I ssh to both of them at once what I get is pi@raspberrypi in both terminals. So, I would like to have different users but with same or equal level of privileges of default user pi. Thanks.
Comment: @Jacobm001 fixed
Answer: Assuming a new name of username:
To create a new user account: sudo addduser username Follow the prompts, being sure to set a good password when prompted.
You also want to add the new user to the same groups that the pi user belongs to. You can view the groups the pi users belongs to with groups pi.

groups pi pi : pi adm dialout cdrom sudo audio video plugdev games
  users netdev input spi i2c gpio

Note that your new user will automatically have a group created matching their username. You do not need to add your new user to the pi group.
You can add your new user to each group individually using sudo adduser username groupname. For example:
sudo adduser username sudo
sudo adduser username audio

If you want your new user to have the exact same rights as the pi user, add the new username to all of the groups except the pi group that the pi user belongs to. You can save some typing by doing this in one pass:
for GROUP in adm dialout cdrom sudo audio video plugdev games users netdev input spi i2c gpio; do sudo adduser username $GROUP; done

Be sure to add your new user to the sudo group since that is what allows the use of the sudo command by the new user. netdev can be important for configuring network devices.
As others have noted, you're probably better off simply changing your hostname (can be done with sudo raspi-config under Advanced->Hostname) to accomplish what you're after. Also, don't forget the old pi account still exists, and possibly with a default password, so be sure to at least change the password for the pi user for security reasons.
Comment: Better (to avoid typing groups) `for GROUP in $(groups pi | sed 's/.*:\spi//'); do sudo adduser username $GROUP; done`
Comment: Better so long as figuring out the correct regexp doesn't take longer! Are you guaranteed "pi" will always be the 1st group listed after the username? I don't see anything in the `groups` manpage. I throw my new user in other groups (e.g. `sshusers`) as well upon creation.
Comment: I don't have any problem with RE, at least simple ones like this. If `pi` isn't 1st  it will fail to delete it.
Comment: Was thinking more of a new user such as the OP!
Answer: If you run adduser with the same group as pi this should work (I haven't tried this).
As per the comments above this is the hard way to solve your problem. Just give each Pi an unique hostname and they should be easy to distinguish.
It is preferable to have the same username on each machine if you want to move files around.


How can I discourage venomous snakes from living in my property?

Question: I noticed that a copperhead has made his home under my front porch.  He has been spotted two days in a row, and, yesterday, I nearly stepped on him.  I prefer not to mess with him as I have read that most incidence of snake bites come from disturbing/attempting to kill these animals.  Additionally, I have a three year old son, who loves the outdoors and, although I can teach him to not touch these things, he is typically unobservant and is liable to be bitten due to the proximity of our homes (the snake's and our's).  Now, I can certainly wait for him to be spotted outside his home and block the access back into his pit.  But, my question is, what about my property, in particular, my garden, can I change to discourage this fellow from being attracted to the premises?
Comment:  Snakes aren't poisonous, but they might be venomous :-)
Comment: Thanks for the warning.  Perhaps you should edit and get the +2.
Answer: Snakes generally hang out where they can find food and shelter.  To discourage them, you need to remove both incentives.  Blocking out the porch is a good first step.  You also need to remove any brush or wood piles, or anything in the yard that looks like a home to a snake.  If you have a fence, keeping the grass cut short around it is a good idea.  If you have shrubs, trim them up a bit off the ground so you can see under them and they won't be as attractive to snakes.  Rock piles are also an attraction.  Snakes in particular love to sun on them to warm up their cold bodies in the mornings and cracks and crevices in between make good nighttime spots to hide in.
By removing the items listed above, you will also discourage rodents and other small animals that make up the majority of a snake's diet.  This will help encourage them to move along to somewhere else besides your yard.  Other things you can do is remove any food that rodents might be attracted to, because like snakes, they tend to hang out where they can find food and shelter.  Pet food and seeds should not be left out where they can reach it, nesting sites in sheds and garages should be removed (no piles or boxes of rags or old burlap sacks, no wood piles on the ground or floor, etc.)  If you are comfortable with it, rodent bait can also be used to reduce their numbers, and at the same time reduce the attraction your home and yard has for snakes.
Doing these things will not guarantee you will not have snakes around your home, but it should reduce the chances of attracting them and encouraging them to hang around.  You will always need to very closely monitor kids and pets, and when your child is older, teach them NOT to turn over logs or rocks or reach into any area they cannot see clearly, or climb on anything where a snake could be sunning itself without looking to make sure the coast is clear, first.  Unfortunately, eternal vigilance is the cost of living in an area with venomous snakes.
Comment: Please remember that one disadvantage of "rodent bait" is its potential harm to predatory birds: http://www.nature.com/news/killing-rats-is-killing-birds-1.11824
Answer: We get copperheads here in central NC.  To discourage them, I do not allow wood or brush piles to accumulate on the property. I use a mulching mower to munch up fallen leaves in the woods where people are likely to walk, as well as on areas surrounding the house.  This eliminates cover prized by these fang-bearing pests.  Use this technique under the tall magnolias (southern variety) since snakes like living in their leaf litter.
Answer: Two things: First, I would hire a professional snaker exterminator to kill, or more likely, remove this particular snake. Second, I would do a "clean up" of my porch, lawn, and gardens along the lines suggested by Teresa so that other snakes don't find them attractive in the future. The snake exterminator would also have additional clean up recommendations.


How to add edges without changing the form ?

Question: Is it possible to add edges like in picture without affecting the smoothed geometry ? If i add in the edge ring with edge ring tool, it will deform the form but i need it to stay perfectly rounded.
Comment: Please explain more in depth. What do you mean with smoothed geometry (a subdivision surface modifier)?
Comment: I basically need to add  edges vertically(where the line is) without changing the roundness
Answer: Use To Sphere tool. After adding the vertical loop cuts select each loop with Alt+RMB, change the pivot type to Individual Origins, press Shift+Alt+S and drag the cursor outwards the mesh. Select the other loop and press Shift+R to repeat the process. Do the same with the other ones. Now you've got additional loops in your mesh and it's also perfectly smooth.

EDIT: If you need to add the horizontal loopcuts also you may subdivide your mesh (W-->Subdivide), then smooth the vertices (Ctrl+V-->Smooth Vertex) and increse the Smoothing value to 1.000. As you can see the objects look the same.
Comment: Thank you for very informative answer. That is how to add edge loops horizontally, but what about adding them vertically? I tried with spherizing tool but it deformed top and bottom of my mesh. But i had only selected one loop. would it work with all loops selected.That way is not good for that reason. Is there another way without using smooth modifier?
Comment: Thank you a thousand times ! That's what ive been looking for.


The sandbox is not in sync with the Podfile.lock

Question: MACPCHD95PC:homepage-hackdays-ios-master BBC$ pod install
Updating local specs repositories
Cloning spec repo bbc from firstname.lastname@example.com:bbc/map-ios-podspecs.git
[!] Unable to add a source with url firstname.lastname@example.com:bbc/map-ios-podspecs.git named bbc.
You can try adding it manually in ~/.cocoapods/repos or via pod repo add.
MACPCHD95PC:homepage-hackdays-ios-master BBC$
I am getting this error on trying to solve the below mentioned issue.
diff: /../Podfile.lock: No such file or directory
diff: /Manifest.lock: No such file or directory
error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.
How do the solve this ??
Comment: You should try to remove Podfile.lock file and Pods folder, then run pod install again
Answer: Try to remove Podfile.lock, and do another pod install.


javascript object creation for js remoting

Question: Hi I am trying to use a RemoteAction function from js remoting.The remote function accepts a custom object,so I need to pass it from javascript.For this I m creating a javascript object with all fields of custom object.
function my_object__c(){
   this.id = null;
   this.name = null
   ------------
   more fields here
   ------------
}

The values of id, name and all other fields are binded to vf page's inputFields like this :
<apex:inputfield value="{!myObj.Name}"></apex:inputfield>

is there a easier way to access these values and use them in js object my_object__c.I can only think of travesering the dom and get these based on ids.
Second,can the RemoteFunction accept multiple parameters ?
Answer: Mohith did a good job pointing you to the documentation for JavaScript Remoting for what is supported.
To get the values into your JavaScript object you can use jQuery to make it very easy.
Either put jQuery in a static resource or hotlink to one of the CDN hosted copies.
Here's how to do use jQuery with the static resources:
Put jQuery in your static resource, for example, in a zip called res in a subfolder called js and be sure to include it prior to using it.
Zip file with the structure /res/js/jquery-1.8.1.min.js is referenced from VF as follows:
<apex:includeScript value="{!URLFOR($Resource.res, 'js/jquery-1.8.1.min.js')}"/>

Then the JavaScript snippet:

<apex:inputfield value="{!myObj.Name}" styleClass="name" />

Here you can use styleClass instead of ID since the ID that you specify is not the ID that will get generated by Visualforce and then use the jQuery val function.  Just make sure that your styleClass is unique so that the jQuery selector works the way that you want it to.
Answer: Your method can take Apex primitives, collections, typed and generic sObjects, and user-defined Apex classes and interfaces as arguments. Generic sObjects must have an ID or sobjectType value to identify actual type. Interface parameters must have an apexType to identify actual type.
Your method can return Apex primitives, sObjects, collections, user-defined Apex classes and enums, SaveResult, UpsertResult, DeleteResult, SelectOption, or PageReference.
So answering your question
1)Yes remoting can take generic Sobjects with ID or sobjectType Value
2)Yes you can have multiple parameters without overloading
3)Yes i guess acessing dom will be the best practice to get those field values
Document link
http://www.salesforce.com/us/developer/docs/pages/Content/pages_js_remoting.htm