Electron diffraction

Question: As we know electrons are charged particles, hence they have a field surrounding them, which has some energy. Now in electron diffraction the electrons have their influence on other electrons and themselves also get affected. So my question is that why this influence of an electromagnetic wave (because of electronic charge) not considered to explain this phenomenon, as that interaction of EM wave may lead to that pattern.
Comment: May be you want to read about the interaction between the electrons field and the quantised field of the obstacles edges in an elaboration of mine about [Deflection of electron beams at edges](https://www.academia.edu/27983554/Deflection_of_electron_beams_at_edges). It shows the historical development of this experiments.
Comment: There is a question about [Is diffraction affected by interaction between photons and electrons?](http://physics.stackexchange.com/questions/234527/quantum-field-theorys-interpretation-of-double-slit-experiment/280264#280264), you perhaps want to read too.
Answer: An electronic charge doesn't create a wave, it just creates a field. And in electron diffraction the electrons do influence other electrons and themselves. Diffraction occurs due to the wave nature of the electrons and this wave nature is not dependent on the charge of the electron. (To my knowledge)It's just that all particles have this wave nature described by De-Broglie wavelength.
The electronic charge is used to describe how the beam behaves/interacts with the material and some properties of the diffraction pattern do depend on that and they show a different aspect about the material than what light beam would show or neutron beam would show. Hence, you've actually answered your own question in a way I think. :)
Comment: Like your answer. A more radical [answer of mine](http://physics.stackexchange.com/questions/234527/quantum-field-theorys-interpretation-of-double-slit-experiment/280264#280264) of the question about Quantum field theory's interpretation of double slit experiment.
Answer: Actually, "this influence of an electromagnetic wave (because of electronic charge)" has been "considered to explain this phenomenon".
Let me note first that in the de Broglie-Bohm interpretation of quantum theory, the trajectory of the electron is defined by the "guiding field", which interacts with (or "feels") the diffraction grating.
On the other hand, I showed how "electromagnetic field, rather than the matter field wave function, can be regarded as the guiding field" and how quantum phenomena can be described in terms of electromagnetic field only (see here (published in Int. J. Quantum Information) and here (published in European Physical Journal C)).
To do this, I showed that the matter field can be eliminated from the equations of the Klein-Gordon-Maxwell electrodynamics and that the resulting equations for the electromagnetic field describe independent evolution of this field. Similar results were obtained for the Dirac-Maxwell electrodynamics. These results remain valid if conserved external currents are added to the right-hand side of the Maxwell equations, which is important for description of diffraction.
Of course, I cannot be sure that the idea described in your question was not considered in some form earlier.
@Sad_lab_rat wrote: "Diffraction occurs due to the wave nature of the electrons and this wave nature is not dependent on the charge of the electron. (To my knowledge)". However, if there is no electromagnetic (or some other) interaction, there is no diffraction.
Let me also add that the Couder's experiments emulating the two-slit experiment using a classical system feature diffraction caused by interaction of a "particle" with the slits via its own surface wave.

Electron diffraction


Can I update to OS X 10.8 from OS X 10.7 without doing all softwares updates?

Question: Do I have to perform all system updates to Lion before I update to Mountain Lion?
Answer: Yes, I was able to update from 10.7.3 to 10.8 without running software updates (10.7.4) and Mountain Lion runs great.
Answer: Yes since you are running 10.7.x you can update straight to Mountain Lion and not have to update to the latest version of OS X Lion first. This capability to jump from any version of Lion to Mountain Lion is noted in how to upgrade to Mountain Lion.

...
Step 2:
  Make sure you have Lion or the latest version of Snow Leopard ...
If you are running Lion (10.7.x), you're ready to update to Mountain Lion. Go to Step 3. If you are running Snow Leopard (10.6.x), update to the latest version of OS X Snow Leopard before you purchase OS X Mountain Lion from the Mac App Store. Click the Apple icon and choose Software Update to install Snow Leopard v10.6.8, the latest version.
...
Comment: Exactly. This cuts through the BS of link-bait journalism with non-advice advice such as "do all the updates", and "run a permissions repair". Time is money. And for a lot of computers out there still licensed just for Lion, it's great to save unneeded work when doing a fresh install/upgrade.


Can a Loxodon PC wield a 2-handed sword and a shield with one hand and their trunk?

Question: Could a Loxodon in full plate armor with tower shield in one hand, wield a greatsword with the other hand and their trunk?
Comment: Where are you getting a tower shield in 5e?
Comment: Hi Daniel, welcome to rpg.se! Take the [tour] and visit the [help] for more information. This is a good first question but it might help answerers if you identify which version of the Loxodon race you are using, I assume the version from Unearthed Arcana but it helps to be specific. Good luck and happy gaming!
Comment: I'm a bit confused here, what exactly do you mean by this? What makes you think that the rules might work in this way?
Answer: Nope, not by RAW.
From Guildmasters' Guide to Ravnica (p18), in the Loxodon's traits:

Trunk. ... Your trunk can't wield weapons or shields or do anything that requires manual precision.

Unless of course you have a generous DM who is willing to bend the rules, then that's their call.
Comment: Indeed! ...and yet ironic, since elephants in the real world take years to master using their trunks because of the sheer scale of muscle memory it requires to master them. I reckon Loxodon should be allowed to at least play darts with their trunks. :)


Hibernate Performance Tweaks

Question: In your experience what are some good Hibernate performance tweaks?  I mean this in terms of Inserts/Updates and Querying.
Answer: Some Hibernate-specific performance tuning tips:

Avoid join duplicates caused by parallel to-many assocation fetch-joins (hence avoid duplicate object instantiations)
Use lazy loading with fetch="subselect" (prevents N+1 select problem)
On huge read-only resultsets, don't fetch into mapped objects, but into flat DTOs (with Projections and AliasToBean-ResultTransformer)
Apply HQL Bulk Update, Bulk Delete and Insert-By-Select
Use FlushMode.Never where appropriate

Taken from http://arnosoftwaredev.blogspot.com/2011/01/hibernate-performance-tips.html
Answer: I'm not sure this is a tweak, but join fetch can be useful if you have a many-to-one that you know you're going to need.  For example, if a Person can be a member of a single Department and you know you're going to need both in one particular place you can use something like from Person p left join fetch p.department and Hibernate will do a single query instead of one query for Person followed by n queries for Department.
When doing a lot of inserts/updates, call flush periodically instead of after each save or at the end - Hibernate will batch those statements and send them to the database together which will reduce network overhead.
Finally, be careful with the second level cache.  If you know the majority of the objects you read by id will be in the cache, it can make things really fast, but if count on them being there but don't have it configured well, you'll end up doing a lot of single row database queries when you could have brought back a large result set with only one network/database trip.
Answer: Using caching, cascades and lazy loading appropriately.
Tweaks?  Hibernate generates SQL for you, based on the mappings you give.  If you don't like the SQL, then maybe Hibernate isn't the correct tool.
The rest of performance has to do with the database design: normalization, indexes, etc.

Hibernate Performance Tweaks


search outlook addressbook using AS3

Question: Is it possible to query outlook address book using AS3?
Answer: if you know C++ you could write a command-line application that extracts data from the outlook contacts list, and use the AIR NativeProcess class to import the data into flash. It does mean that you have to use AIR though; it will have to install as a desktop application before it will work.
Comment: If you know VB.Net or C# you will be able to do this too.
Answer: No.  Even using AIR/desktop applications, you wouldn't have access to a non-app-specific file on the filesystem unless you prompted the user to browse for it.
Answer: Using AIR and If you know VB.Net or C# you will be able to create a console app which accesses the Outlook application model (including the contacts database) Air can then connect to it using NativeProcess.
Have a look at this for info on connecting to Outlook on the .Net side...
and this on the NativeProcess side
As part of your installation, you will need to provide this outlook interfacing console app to your end users.

search outlook addressbook using AS3


Load specific functions PHP

Question: I have a single functions file for my entire site and given a single page 90% of the file is not even called. So i want to load only the functions which are called in the page and i am new to php.
Comment: Unless you have something in the magnitude of thousands of functions in the file, I wouldn't worry about it.
Comment: Related: [Autoloader for functions (19 Jan 2011)](http://stackoverflow.com/questions/4737199/autoloader-for-functions)
Answer: Group functions together into several objects with common traits, by making them static functions, and put each object in a separate file. Then use PHP5 autoloading functions to load appropriate objects only when they are used.
Comment: Objects, static functions, autoloading functions... I think that it is a little to much for a beginner.
Comment: @scia07: objects with static functions is quite an easy concept and actually comparable to standard functions in the global namespace. And autoloading is very friendly as well. Some code-example would probably make this more easy to understand however.
Comment: any links you can refer me to so that i can learn more about auto loading and how to acheive it?
Answer: You can split this file into many small files and include only that you need to use.
However if it is not a big file it will not decrease your performance at all
Answer: You could split up your functions file in multiple files, but mind that if you need more files, loading may even be slower, because you need more IO commands to load the different files.
Futhermore, you split files by functionality. If you feel all these functions belong together, keep them together in that file. It will not slow down your script very much.
If you like, you can put the functions in (static) classes and use an autoloader to load the file, but I'm not in favor of this solution. I think static classes are just an excuse to get functions (and vars) out of the global scope, and creating classes just for auto-loading is abusing the autoload functionality.
Of course, if you create a more object oriented script, using classes makes sense too, and auto-loading them might be convenient.
Answer: Actually it's not a problem to have a function available for use but you only use it in part of your application. It's more important you have everything when you need it at hand w/o actually caring about when to load.
If your system grows, what you might look for is an autoloader. PHP supports autoloading of classes but not for functions. However you can group your functions into classes (some will slap me for making such a statement) to make use of autoloading then.
Answer: If Your file size is not big then it will not decrease your performance at all.still if you want to achieve your goal then group related functions and place them in separate files and include only necessary files...

Load specific functions PHP


Isekai manga where the male lead gets help from a goddess and is given two female comrades (a vampire and an angel)

Question: I'm looking for an isekai manga with a male protagonist, who wears a jacket with a tower emblem on it, and two female comrades (one is a vampire with silver hair and moon clip on it and the other is an angel with golden hair and sun clip on it). Those two were given by a goddess to serve and help him. During the manga he upgrades a dungeon tower with various monsters.
Comment: What does ML mean? Do the emblems mean anything? Why were they given to help him? Was this like a tower defence as a manga? Was he defending against the monsters? What upgrades did he do? What was he protecting? When did you read this? If you have anything else to add you can [edit] that detail into the question itself.
Comment: ML:male lead and tower like symbol(emblem) & they were given to help him live in another world although he was also trained by godess but idk why and I read this between may to June and the dungeon which they capture was highest and strongest said by people of that world it was suggested by some merchant friend when her 2 female companion help them from bandits and monster attack
Comment: Please [edit] your question to include the extra information.
Answer: I believe this is Tou no Kanri o Shite Miyou, also known as Let's manage the tower.
The main character dies and is taken to a goddess, who gives him new clothes, including a cape that has a clasp with a tower emblem on it.  He then appears where two women are fighting, one is an angel, the other seems to be a fallen angel(she has black angel wings).  The angel has golden hair, though i don't see a sun clip.  The fallen angel has silver hair with a crescent moon clip in the front.  A little later he looks at their statuses and, at least in the translation i found, they are a part of the 'Sunlight Race' and 'Moonlight Race'.
The group then travels a bit and comes across a merchant, and the two women save him. Afterwards they travel with the merchant's group to town and register as adventurers. The spend a few weeks raising their ranks, then one of the adventurers who had been with the merchant mentions the towers to the group. There are towers that people conquered on other continents, but none on their continent had been conquered because they were too difficult. The group then decides to conquer the largest tower on the continent.
After they conquer the tower, the main character becomes the new master of tower.  They then spend their time managing the tower.  The eventually bring in various groups to reside on different levels of the tower, including a group of vampires.


How to remove Unity 7.4.5

Question: I have Unity and Gnome installed on my computer (Ubuntu 16.04.4). How can I remove Unity without making any damage?
When I search the Synaptic Manager (search unity), this results 500 rows and I cannot understand which packages to remove...
Answer: Try this:
Start in text-only mode
Switch on your computer. Wait until the BIOS has finished loading, and press and hold Shift, which will bring up the Grub menu.

Select the line which starts with Advanced options.

Select the line ending with (recovery mode)

Press Return and your machine will begin the boot process.

After a few moments, your PC should display a menu with a number of options, including Drop to root shell prompt. Press Return with this option highlighted.

The PC will start in a terminal.

Run these commands:
Mount partitions in read-write mode
mount -o remount,rw /
mount --all

Update repositories
apt update

Install aptitude and deborphan
apt install --reinstall aptitude deborphan

Eliminate the components of unity that are not necessary in gnome
aptitude remove '?and(?reverse-depends(unity),?not(?reverse-depends(?exact-name(gnome))))'

Reinstall gnome
apt install --reinstall gnome

Eliminate orphan packages
deborphan
apt --purge remove $(deborphan)
deborphan --libdevel
apt --purge remove $(deborphan --libdevel)
deborphan --find-config
dpkg --purge $(deborphan --find-config)

Remove unnecessary packages
apt autoremove

Remove downloaded packages
apt clean

Restart system
reboot

How to remove Unity 7.4.5


Parking in Prague center

Question: I have booked a hotel in the center of Prague. Unfortunately they don't provide parking. What is the best possible option (cost) for parking the car downtown? Where can I get parking tickets (machine/shop/app)?
Answer: It depends on where exactly you want to park, as Prague is subdivided into multiple sectors with different price levels. Recently, they also introduced a zoned parking system: http://www.parkujvklidu.cz/prague-parking/
In short, this means that when in a zoned area, you can only park in the street in the purple zones for a maximum of 24 hours at a time, or in orange zones for up to three hours. You can buy a ticket in a machine or pay through the app (the cost is the same). You can also park in the blue zone for up to three hours, but in that case you have to use the app to pay.
If you won't be using your car daily and need to leave it parked for a longer time, you would have to use one of the commercial parking lots: http://www.parkujvklidu.cz/mapa-komercnich-hlidanych-parkovist-v-praze/
However, if cost is the main factor, it would be much cheaper to leave your car somewhere outside central Prague (for example on one of the P+R parking lots) and use public transport.
Answer: Park and Ride (P+R)
Car parks, usually located on the outskirts of Prague (though some are closer) with good access to public transport (similar to e.g., Vienna). These are the most affordable parking options in the city.

Cost: See the price list.

Capacity: They usually have hundreds (some of them almost a thousand) of parking spaces. You can check the number of currently unoccupied parking spaces.

Regular on-street parking and commercial parking lots
Regular on-street parking in and around the city center falls within Paid Parking Zones (PPZ), primarily intended for residents and local businesses. While parking is possible for non-residents, it is usually limited to a few hours each day and requires payment of a fee (through a physical or virtual parking meter). The fee varies depending on the zone's color, the district (sometimes even the specific street), and the day of the week. See the online parking meter.
Alternatively, commercial parking lots are available. These typically cost the most.

Parking in Prague center


Why is the TP4056 IC called a "linear li-ion battery charger"

Question: Being new to electrical engineering, I'm wondering why the TP4056 IC is called a "linear li-ion battery charger" (emphasis on linear). Is it because the TP4056 is designed to work with a constant voltage/current input? Or is it linear as in "linear power supply vs switching power supply"?
Answer: The TP4056 uses a pass transistor to regulate the charging voltage / current to the battery.
That pass transistor is controlled in a linear way, meaning a gradual on/off control. So the pass transistor can be fully on, fully off or any state in between (having a certain resistance).
A different type of regulator is the switched regulator where the pass transistor is switched so it can be on or it can be off. There is no state in between (like a high resistance state).

Or is it linear as in "linear power supply vs switching power supply"?

Yes it is.
Comment: So if my understanding is correct buck/boost converter are switching regulators because of the on/off state of the transistor, right?
Answer: It is linear as in linear power supply. It works by using a pass element, whose resistance is modulated so either constant current or constant voltage is supplied to the battery, charging it correctly.
Update:
A pass element in a linear regulator is some form of a transistor, which is operated in its "linear"/"ohmic" region, so it is neither fully conducting ("on"), nor fully off. The magic is in the biasing circuit (the rest of the linear regulator) which provides suitable voltage or current to the gate or base terminal of the transistor, so the required amount of current is passed from input to output.
Comment: I'll update my answer.
Comment: Why do you mean by "pass element"?


How does Perforce deal with changes made after merge/integrate, but before submit?

Question: I have seen behaviour in Perforce that I am unable to explain. I took a branch of the trunk and worked on this regularly committing my changes and occasionally merging from the trunk to my branch to ensure there were not going to major conflicts when I reintegrated.
When this work was complete, I used the Perforce Merge/Integrate option to apply the changes to the trunk. After sending these changes for code review, I made some changes on the trunk. At this point, none of the changes had been committed to the trunk.
When I went to commit all of these changes, the diff showed the files exactly as I would expect. After submitting the changelist, the changes which were submitted were not the same as what was shown in the diff window. Instead, the changes that I'd made since the Merge/Integrate were not there. Doing a diff between the server and my local copy on the trunk had all of the changes to the same files made after the code review. As such, I had to do a second commit to mend the broken build.
I'm confused how this happened as I thought Perforce only kept one local copy of each file on the client?
Even if there is a flag showing the files have been tampered, where were the files it submitted? It definitely showed the trunk paths in the commit window, but I guess it could have got the files from the branch?
Another question would be, how should I have best dealt with the above scenario when using Perforce version control?
Answer: One mistake we've all made is to (a) integrate a file from one branch to another, (b) resolve it as "accept merged", (c) make local changes to the file prior to (d) submit. If you don't explicitly open the file for edit after step (b) and before step (c), the server has no knowledge of your local changes.
Comment: Doesn't "tamper checking" prevent this? (http://kb.perforce.com/article/964/tamper-checking)
Answer: You made your first mistake editing things directly on your copy of trunk. Always use a task branch. It probably didn't cause the issue you were seeing, but if you'd messed up your task branch it wouldn't have broken the build. When looking at your local copy of trunk, ensure you've refreshed it from the depot. You'll get little yellow triangles if your local copy of a trunk file is out of date, editing and committing an out of date file on your copy of trunk is bound to lead to "odd" behaviour.

I'm confused how this happened as I thought Perforce only kept one local copy of each file on the client?

One copy for trunk, one copy for each task branch.


Did Sasuke get all of Itachi's special abilities?

Question: Itachi had special abilities with his Susano'o: Yata Mirror, Sword of Totsuka and Yasaka Magatama.
Because Sasuke has Itachi's eyes, wouldn't he be able to use those abilities as well?
Comment: I'm pretty sure Susano'o is unique to each user as well as their abilities. Therefore Itachi's eyes shouldn't affect Sasuke's Susano'o.
Answer: Yes and No. Those accessories of Itachi's Susano'o were found by him. Sasuke is shown to have created his own weapon in this form. Sasuke just used Itachi's eyes for the Eternal Mangekyou Sharingan. A contrasting example would be how Danzo stole Shisui Uchiha's eye.He was able to use his technique of Kotoamatsukami. Maybe it wasn't as powerful as Shisui's but nonetheless, he used it. The same can go for Kakashi and Obito's Kamui. I believe that Itachi's accessories to the Susano'o were found by him because Orochimaru, who appeared during the Itachi vs Sasuke fight, stated his surprise in Itachi having the weapon. Orochimaru's knowledge of the sword probably means that he was trying to get it too. The same goes for the Yata and the Yasaka.
Answer: When sasuke met itachi as his reanimation form he used the Amaterasu against kabuto when itachi was trying to stop him too, but at the same time itachi used the forbidden jutsu the Izanami which sasuke did not know about. Sasuke still hasn't used it even after the fight between them too. This tells us that sasuke did not get all of itachi's ability. He used it as itachi said, to get his eyesite back. If someone get the eternal mongekyou sharnigan then the eyesight  of the wielder will not lose their eyesight anymore


How can you send idevicediagnostics restart -u command in appium to restart an ios device?

Question: How can you send idevicediagnostics restart -u command in appium to restart an ios device?
I can send this via the terminal manually, but I would like appium to trigger it during the end of each test suite run. My goal is to reboot my ios devices after each test suite run without having to do it manually everytime. Thanks.
Answer: Runtime.getRuntime().exec("idevicediagnostics restart -u "+udid).waitFor();
             Thread.sleep(60000);


Scrolling disappeared in angular ionic

Question: I have an angular project that I want to make mobile.  I am trying to add Ionic to the application, but when I do, I can no longer scroll within the app.  I don't want to use any Ionic-specific components, I just want to build the app for android/ios.  I don't understand where my scrollbar went.
Answer: Actually your issue could be fixed by wrapping the content in <ion-content>.
However, since you don't want to use any Ionic specific codes, I recommend you wrap it in a
 and just copy the predefined css of the ion-content, below link should help:
https://ionicframework.com/docs/api/content
Answer: not sure if this will help you, but I had an app that scrolled on desktop browsers and not on some mobile and seemed to fix it by adding this to the css: 'overflow-y': 'scroll'.
Comment: I just gave this a shot and the scrollbar panel showed up, but there was no scrollbar itself, and I still couldn't actually scroll

Scrolling disappeared in angular ionic


Could the Large Hadron Collider accelerate one kilogram of protons at once?

Question: Is it possible to accelerate a very large number of protons in a particle accelerator as opposed to only a few as is regularly done? What's to keep someone from accidentally dumping too many particles into an accelerator and destroy the facility with its kinetic energy and enormous thrust?
Comment: It's not possible. The space charge would blow such a large cloud of protons apart. It is, indeed, fairly hard to accelerate beams with more than a few amperes of beam current efficiently because the space charges make focusing difficult.
Comment: Lhc uses a lot of fuses :) the protons come from a devices chain , each one with its own limits , that can't deliver too much material. To get the targeted collisions ratio, all is fine tuned
Comment: interesting to compute the kynetic energy needed to accelerate 1kg until 99.99% of c . Note that the time at this speed is very short at the collision node
Comment: a summary of the process : [How the Large Hadron Collider Works](http://science.howstuffworks.com/science-vs-myth/everyday-myths/large-hadron-collider4.htm)
Comment: You could rule it out just by considering the energy required to accelerate 1kg to 0.9c
Comment: It's called a "rail gun" or "mass driver"
Answer: The LHC cannot accelerate 1 kg of particles at once, and neither the experiments would be able to cope with such a big number of collisions. I have already partially answered here: How many particles can a particle accelerator accelerate at once?, without further details (just to allow you to google them up), the limiting effects at the LHC are (in order of importance): electron cloud, beam-beam, impedances-wakefields, space charge. but I would like to focus on your last question:

What's to keep someone from accidentally dumping too many particles into an accelerator and destroy the facility with its kinetic energy and enormous thrust?

This requires to understand how particles are "dumped" (or better: injected) into an accelerator. You always need to start with a source or gun. In case of protons it is a bottle of (high-purity) hydrogen gas, which is extracted and ionized for instance by an electric discharge. As the electrons leave you are left with protons which can start to gain energy for instance by a DC voltage (a capacitor). While the protons are at low energy, they are very susceptible to external perturbations, including the ones coming from the nearby protons. Therefore if for some reason the proton production is strongly increased at the source, you will start to see odd behaviours right after the source, where the low energy makes the beam much less destructive.
Before being injected into the LHC the protons have to reach 450 GeV, going through an accelerator chain (see Particle colliders: why do they need an accelerator chain) which means that the beam is prepared and transferred between many intermediate accelerators where there is plenty of time to monitor it and eventually abort the injection if the required parameters are not met.


How to make a little money, fast?

Question: This question has been asked many times by many people and when I google it i usually find glitches to make millions. But oftentimes I find glitches sometimes just outright don't work.
I'm pretty poor in GTA Online because as soon as I get money, I spend it on a car I'm working on or a garage I've wanted for a very long time. I want to find a easy way to make a little money, fast, a quick 20,000 or so without trouble.
Anyone found a few money-making strategies in GTA Online?
Answer: Heist.
No other "easy" way than heist.
Case closed.
Comment: Quick and short answer but is right.

How to make a little money, fast?


Is there a paper/manuscript explaining the theory behind AnyDice?

Question: I am using the AnyDice website to calculate probabilities on any number of dice with any arbitrary number of sides. May I please have a link to a formal discussion of this very elegant subject?
Comment: I'm voting to close this question as off-topic because it is not within the scope of RPGs.
Answer: There have been hundreds of books written on this topic, and there's even a whole branch of mathematics called Probability that studies this in detail.
This following link discusses the theorems behind it very clearly, written in formal mathematical language:
http://mathworld.wolfram.com/Dice.html
Answer: This essay specifically looks at how dice are used in RPGs and how to calculate probabilities for them. It might be more helpful than some other resources because it is written with a focus on RPGs.
This playlist on YouTube has some good video tutorials on probability theory.
If you want to really dive into probability, you could also download this 520 page textbook from Dartmouth.


Install 64bit Python on Rapbian with aarch64 Kernel

Question: I enabled the aarch64 kernel with arm_64bit=1 in /boot/config.txt on Raspbian.
After that I tried to upgrade python to its 64-bit version.
Fist with "apt upgrade" then with building python from source, but with the command python3 -c 'import platform; print(platform.architecture())' I still get the output that my version is 32-bit.
Has anyone an idea how to do it properly?
Comment: Have you tried switching out to the 64-bit version of RaspiOS https://www.raspberrypi.com/software/ that has python3 pre-installed.
Answer: It is not just the kernel which determines what software you can run.  Applications such as python depend upon certain system libraries and facilities. Those are part of the OS userland -- everything that isn't the kernel -- which for Raspbian/RpiOS also comes in two flavours, 32 and 64 bit.
The 64-bit version is still considered "beta" and you may have problems with things like the camera, but that is what you will have to install if you want 64-bit python.
Comment: Thanks for your fast response!
If I get it right you say, that it's not possible to install a 64-bit programm on RpiOS 32-bit version even if the kernel has been upgraded to aarch64?
So the only solution would be to download a fresh 64-bit image of RpiOS.
Comment: Yes.  It probably isn't worthwhile unless you have some specific reason to *need* 64-bit python.  I doubt the general performance will be significantly better.
Comment: You would only see a benefit if you are using the 8GB Raspberry Pi 4. Since your software would have more available RAM. Programs wouldn't necessarily run faster on a 64-bit OS. They might even run slightly slower.


When did "c" before "e" or "i" start to be pronounced as [ts] (in contrast to classical [k])?

Question: In Classical Latin, "c" was always pronounced as "k". Since Renaissance Latin grammar reform, the correct pronunciation of "c" before "e" or "i" was codified to [ts]. So in Renaissance the true Classical pronunciation must have been forgotten. My question is: when did the pronunciation of "c" before "e" and "i" start to change, and when was this change complete? Did this happen in late or medieval Latin? And in which centuries did these changes take place?
Comment: As a quick aside, the current Ecclesiastical pronunciation of c before "e", "i", "ae", and "oe" (at least of the Italian flavor) is [ʧ]
Comment: @brianpck: the most common one, though there are regional differences. For example, in  (most?) Slavic countries its pronuntiation is the same as in Renaissance Latin, though some priests prefer the Italian pronuntiation. Or even switch the two, which is quite irritating, especially when using both ways in a single sentence.
Comment: It's been a while since I've listened through the whole talk, but [this video](https://www.youtube.com/watch?v=_OyhWKTmJBo) by Luigi Miraglia includes a humorous "confession" at the beginning concerning this pronunciation. The whole thing is worth listening to if you understand spoken Latin.
Answer: This pronunciation change was underway by the fifth century, but perhaps not finalized until the sixth or seventh.
Paul M. Lloyd, in From Latin to Spanish, writes:

There is no inscriptional evidence of [the palatalization of /k/ and /g/ before the front vowels] until the fifth century, although it may have begun long before, and it continued to be an active process after the Visigoths reached Hispania. (page 137)

In Vox Latina, page 14, W. Sidney Allen indicates evidence for the use of both the [k] and [ts] sounds in the fifth century:

[The hard c] was preserved in words borrowed from Latin by Celtic and Germanic between the first and fifth centuries A. D. [...] It is true that in the course of time a 'softening' took place before e and i [...] but there is no evidence for this before the fifth century A.D.

In Spanish Phonology, page 104, MacPherson writes:

Before the front vowels E and I the tongue position for k was also palatal. [...] By the sixth or seventh century the pronunciation ts, already established in other words, had become standard in this position.

Thus we can suggest a transition period in and around the fifth century, with standardization following in the sixth or seventh.
Answer: Sturtevant, The Pronunciation of Greek and Latin, says of the change in pronunciation of C before front vowels (p. 167): "The epigraphical evidence of this change is not abundant enough to inspire confidence before the sixth century". He doesn't discuss the evidence any further, unfortunately.
Note that the change is a little more complicated than just "C became [ts]". The outcomes of Latin C before front vowels in the Romance languages are varied: e.g. French and Portuguese have [s], Italian and Romanian [tʃ] (the sound in "church"), Peninsular Spanish has [θ] (the sound in "thin"), while Sardinian retains [k]. It seems plausible that [ts] was an intermediate stage on the way to the French and Iberian outcomes.
Something similar happened to G before the same vowels: it first became [j], with later specific developments in the daughter languages. Sturtevant thinks the change to [j] occurred by AD 500, so it seems likely that the C change would have taken place at about the same time.

When did “c” before “e” or “i” start to be pronounced as [ts] (in contrast to classical [k])?


Is there a difference in usage of "Klassenkamerad" vs. "Schulfreund"?

Question: Both "Klassenkamerad", and "Schulfreund" are used for a classmate in school. Are there different connotations, regional differences, or social differences when using one or the other?
Answer: Oh yes, there is quite a distinction to make between these two words.
"Klassenkamerad" indicates a person who shares the same class with the person speaking. However, it doesn't say anything about the relationship between these two persons! They might be friends, but they also might be archenemies. It simply indicates the share the same class(es).
"Schulfreund" on the other hand clearly implies a friendship that is related to having spent some time together in school. In most usecases Two "Schulfreunde" don't even have to be in the same class, it's enough that they spent some time together in the same school, so it refers to the place where you met. But there is another subtle distinction: A "Schulfreund" might also be a friend that you got to know at an age where you both went to school, so it doesn't even have to be the same school you two went to.
Answer: For me, a Klassenkamerad is somebody in the same class, where I get along with (so, we have a friendly relationship. I wouldn't use it for somebody I do not like - apart form sarcastic usage).
A Schulfreund is a friend from schooltimes, not necessarily in the same class. The relationship is closer then a Klassenkamerad.
A Klassenkamerad is defined by random - somebody else (the school) put us together., A Schulfreund is selected by me amongst my Schulkameraden.
Answer: Both Klassenkamerad and Schulfreund is used by third people to refer to someone who just went to the same class, but Schulfreund is also sometimes used in the narrower sense of specifying that this is a friend you know from school.
Note that it is not uncommon to falsely use friend like this, compare the joke:
Wie steigert man Feind?
Feind, Todfeind, Parteifreund
(How to you form the comparative and superlative of enemy?
enemy, archenemy, "friend" from the same party)
Here, again Parteifreund is an euphemistic term to denote someone from the same party, it is practically always used by third people and often with an ironic connotation.
Comment: `"Feind, Todfeind, Parteifreund, ich kann deine Fresse nicht mehr sehen"` ;)
Comment: Is this euphemism also true for *"Schulfreund"*?
Comment: @Takkat: It can be. It depends on context.
Comment: @Takkat: I've often heard the "Freund -> Feind > Parteifreund" series but I've never heard it with "Schulfreund".
Answer: I think "Klassenkamerad" is very close to "Mitschüler". Both meaning just someone who happened to be in the class in school as someone else, nothing said about the relation between both.
"Schulfreund" is used to denote some positive relations, and spending time together out of school.
Answer: "♪♪♪ Ich hat' einen Kameraden ♪♪♪ ..."
Kamerad has associations to military, so I would would expect it more often in older contexts, where the school was more authoritative than today, and I would not use it for female class mates, since female soldiers are very rare in Germany.
Comment: Interestingly this seems not to be the case (I checked this before asking): [Google Ngram](http://books.google.com/ngrams/graph?content=Klassenkamerad%2C+Schulfreund&year_start=1800&year_end=2011&corpus=8&smoothing=3)
Comment: Ich verstehe nicht ganz - inwiefern zeigt die Grafik was? Seit 1920 nimmt die Verwendung von "Klassenkamerad" zu, aber von welcher Zeit handeln die betreffenden Textstellen?
Comment: Here's another [ngram](http://books.google.com/ngrams/graph?content=Klassenkamerad%2C+Klassenkameradin&year_start=1800&year_end=2008&corpus=8&smoothing=3) in regard to the female aspect ;)
Answer: I suppose user is right insofar as Klassenkamerad has a slightly old fashioned feel to it. Very young people probably wouldn't use it. The military connection is not very strong, though. Also, "Klassenkameradin" for a girl is absolutely acceptable as far as I'm aware.
The distinction is exactly like the others said - similar to "classmate" vs. "friend from school": despite the "-mate", the former is not necessarily a real mate of yours, the latter is.


How to calculate SNG push/fold range using JAVA/C++?

Question: Is there an open source code somewhere?
Any good source to learn the math of push/fold strategy in SNG so I can code it myself?
Comment: Don't you dare do it!
Answer: There used to be charts available if you didnt mind doing the data entry, but since it got shut down in the US, they dissappeared and only proprietary ICM + PB calculators were left.
Also, PokerStars had banned PB tools during play so that might also explain why they're not available anymore.
Edit to add:
I'm sorry that I may not have been clear in my original reply.
To create a push/fold calculator, regardless of the language, you need to create 3-5 calling ranges that are optimized for different calling/isolating scenarios. Then you need to run 169 hand vs range calculations using an equity calculator such as Poker Stove for each of your calling ranges and save those all results which is very labor intensive.
Why these need to be run ahead of time is because hand vs range equities can only be solved using Monty-carlo or complete simulations just as Poker Stove does it. Running so many simulation passes every time is too slow and impractical and using a DB lookup instead is much more efficient.
I was therefore referring to push-bot charts that had already done those calculations for you and you could input the results into some kind of DB saving you quite a bit of work.
To program the rest of the problem you need to look at it like an EV calculation, i.e.
Odds of no call * blinds+antes
Plus
Odds of a call * pot * hand equity (From DB)
Calculating for a second or third caller is probably insignificant in most situations.
However, this can only provide a CEV calculation.
To get a $EV calculation for a sit-n-go there is also an ICM calculation which is a different problem and only practical for sit-n-goes.
Answer: To calculate the whole thing, you need some input, that is:

your hole cards
player stacks

After this, you perform a lengthy procedure that is called ICM. This will transform your stacks into real money. Then based on real money won/lost on the action of push/fold, you select the one that increases your real money.
As you see, it's hard and the answer would be really lengthy to put up on poker stackexchange (i did that in the past, so i know). It can take a lot of time. There are many resources on Internet on ICM calculation but i really recommend reading Phil Shaw's book to get a solid grasp of this first. And this is only for calling a push.
For pushing yourself, you additionally need the calling range of your remaining opponents and the calculation is dragging even more. Good luck.


Savings Question, how to invest

Question: I have about $20,000 just sitting in a TFSA, I do plan to spend it (on a vehicle) in about 12-16 months, so I don't want to lock it away, is there anything better then the TFSA?  I am Canadian.
Answer: A TFSA is probably the best place to hold your money for a short-term savings like that. The issue is that a TFSA is essentially just a bucket that can hold assets-- you can have stocks, bonds mutual funds, GICs etc... inside your TFSA. I believe the question you're asking is what should you invest in that will earn you some interest over that period but still keep your money liquid enough to use.
For short-term savings like that I'd suggest a money-market fund or high-interest savings account. Something that's going to earn you 2-3% interest annually. Which will save you about $510 -- these are comparable to rates you'd achieve with a GIC and have the benefit of not being a fixed term -- i.e can be withdrawn at any time.
You'd probably be better off buying a cheaper car though and parking your savings in something like an index fund which will earn closer to 10% annually (e.g. if you bought a $5000 car instead and invested the remaining $15000 you'd have ~24K 5 years later minus whatever extra you spend maintaining a cheaper car)
Comment: "which will earn closer to 10% annually" is a bit ambitious, requiring one to be 100% in volatile growth stocks.
Answer: You could do a 12 month GIC and try to match inflation
Comment: Please add more information regarding why somebody should do this.

Savings Question, how to invest


Why does my bike vibrate when going down?

Question: When I go down the mountain that is approximately 6% descent riding on a road, stop pedaling and remove hands from steerer (please save me from the comments about how that's a bad thing :p ) and reach the speed of, I'd say around 40 km/h, my steerer and entire fork start to vibrate. Do you know what could be possible reason for this? Is it something I should be very worried about? Same thing happens to some of my friends. I have a new fork (it happened with the old one as well), wheels are centered and cones are properly set both on wheels and fork.
Comment: [Here's what Jobst Brandt had to say about speed wobbles](https://www.sheldonbrown.com/brandt/shimmy.html).
Comment: Can you add **why** you and your friends want to go no-hands at 40 km/h on a descent?
Comment: This is fairly common, and it tends to happen at certain speeds, where wheel rotation rate matches the "resonant frequency" of the bike frame and load.  If you have bags, making sure they are strapped down tight usually helps.  And sometimes having "low rider" panniers on the front can actually be helpful.  A handlebar bag, on the other hand, can make things worse.
Comment: Do you have reflectors on your wheels? I found that they vibrated horribly, though I'd have to do more like 55km/h to trigger it.
Answer: Vibrations can have multiple causes.
Common sources of vibration is a wheel or tire being out of round, a wheel being out of out of true or a wheel being out of balance. If the tire was mounted in such a way that it is not an equal distance from the rim, this can cause the wheel as a whole to be out of round (i.e., a  "hop"), which will be felt as vibration, especially at speed. Similarly, damage to the rim (e.g., striking a curb) can cause a similar hop and vibration. A wheel that is out of true can also cause vibrations as it will move laterally through the wheel rotation, which will shift the bike and rider laterally and will feel like a "vibration" to most riders. Finally, if the rim is substantially unbalanced in terms of weight (i.e., one part of the wheel is heavier - e.g., reflectors) then the wheel can vibrate at speed. Some speeds can hit the resonance frequency making the vibration particularly more noticeable at a certain speed (e.g., 40 kph). Most people do not balance bike wheels, as the effect is typically small.
None of these problems are as serious as the final type of "vibration" which is typically referred to as a "shimmy." This is essentially an unintended steering oscillation and if it gets out of hand (i.e., hits resonance frequency), it can easily cause riders to loose control. The cause of bicycle shimmy is not fully understood, but tubing flexibility and bicycle geometry seems to play an important role (i.e., some geometries produce more stable designs, and a stiff top tube can reduce the likelihood). Tire size can also contribute (i.e.,  pneumatic trail). This problem is typically rare in modern bikes.
Even though shimmying is rare, I would suggest spending some time to rule it out. For example, put the bike on a stand and spin your wheels up to speed and look to see if the wheels is spins true, the outside diameter is round (i.e., no hops), and the wheel otherwise does not exhibit excessive vibration. If the wheels are fine then you may be experiencing shimmy, which is a concern. This would largely be the result of the bike design (typically not enough trail or weight in front of the steering axis), that said, there are options to lessen the effect, such as dampening the steering response through the use of roller bearing headsets. Again this type of issue is rare, and usually associated with more boutique bike geometry, such as the low trail randonneur bikes from the 1950's.
Comment: @Carel Agreed. Did a minor edit to make this point more clear.
Comment: The two most likely reasons: an unbalanced wheel, or both, or badly seated, wobbling tyres.
Comment: A poorly installed tube can cause lumps while riding too, either pinches or folds when the tube is overly long/wide
Comment: Speed wobbles used to be a problem in the 1970s on motorbikes with poor geometry. It is mainly a geometry and weight distribution affair. On a bicycle it may be countered by leaning forward (more weight on the front wheel) and putting both knees to the top tube.
Comment: @Carel in my first revision I had mentioned weight in front of the steering axis as a factor, but removed for simplicity. I didn't want to get too far down the shimmy rabbit hole as we don't know that this was the source of "vibrations".
Comment: Thanks for the detailed explanation, it is definitely shimmy that I experience. Wheels seem to be completely fine and the bike is relatively new, 10 years old Kona. Anyways, If I put my hands on the steerer, the shimmy stops, so I guess I will have to believe It's due to bike's geometry. I was primarily asking to see what could be all the possible causes, but none of the mentioned above are (except bike geometry itself which can't be fixed), so thank you
Comment: it looks very similar to this https://www.youtube.com/watch?v=xODNzyUbIHo


Teleoperated arm trouble

Question: I have built a robotic arm with the lego Mindstorms ev3.  My goal is to control its motion via teleoperation, that is , to have a gyro sensor strapped onto my arm and have the robot mimick the up and down motion of my forearm.  However, I am completely stumped concerning the programming.  I need a reliable way to read the gyro sensor readings while taking into account any bias in the sensor.  Second, I would also like the sensor to read the rate of change in my arm and translate that into power for the large motor.  If anyone can show me how to do this with the ev3 programming environment, the help would be greatly appreciated.
Comment: Are the robotic arm (motor) and the gyro sensor connected to the same EV3 brick? If two EV3 bricks, the programming is more about the communication protocol between the bricks.
Comment: Yes, the gyro and the motor are on the same brick.  I am considering getting another ev3 brick, as I could easily see how to program that setup.
Answer: Disclaimer: I have never used the EV3 interface, only the text based programming languages for the NXT. Therefore I might be proven wrong.

I need a reliable way to read the gyro sensor readings

I think the gyro sensor should have come with the appropriate instructions to do that. If not, you can find many tutorials online, such as this: http://robotsquare.com/2014/06/25/tutorial-gyro-ultrasonic-sensor-ev3-home-edition/

while taking into account any bias in the sensor.

Bias can be accounted for by using a previously known position to calibrate the sensor. You could start your program with the gyro (and your arm) in one of the extreme positions and measure movement relative to that.

Second, I would also like the sensor to read the rate of change in my arm and translate that into power for the large motor.

This sounds like a simple differentiation task. You measure the angle and store it along with the current time (in milliseconds or whatever the most precise measurements available). In the next iteration you make another measurement, take the difference of the current and the previous angles, and divide it by the difference of the current and previous times. The result is the rate of change. This can be translated to motor speeds by using either trial and error, or calculations based on the characteristics of the motor, the gearing and the gyro.
However, I would rather use a command to turn the motor a specified number of degrees to match the measurements of the gyro.

Teleoperated arm trouble


kitchen sink plumbing hook up

Question: I am remodeling and I have to replace kitchen cabinets and sink, I was thinking if I had a set up like I do for my washing machine,-in wall faucets and drain it would make it easy to disconnect and move sink out to replace the bad floor then put it back until the new cabinets come in.   do they make something like this, is it a good idea?
Comment: Are you asking if you can install shutoff valves under your sink? If that's the case, then yes. There should be shutoff valves under the sink.
Comment: no I am asking if I can mount the drain and water supply in the wall just like the washer hookups
Comment: It is fine to have plumbing in walls.  Can you give a picture or diagram?
Answer: If you really want to go through this effort (rather than just capping off the lines), then you should just install the lines into the walls (if they aren't already).

Normally you'd just cap the lines off until you're ready to hook everything up (as seen in my picture above), but there's nothing stopping you from putting valves on instead of caps, which is a great idea anyway (it makes it easier to hook up, service later, etc).
With the pipes in the walls, you can freely work on the floor and install cabinets without worrying about them (and as you can see in this photo, it was before I had flooring or cabinets in).

Here's the same connections (with valves) after installing cabinets and the new sink:

Nothing stops you from using valves instead of caps, though it does require cutting a bigger hole in the cabinet to install. Depending on your cabinet style you may or may not like this -- in my case these are pretty cheap cabinets installed in a laundry room in the basement, I wasn't too worried.
Just be sure you don't accidentally knock the vales open while you're working, or you'll ruin the floor that you're not even finished installing yet!
Answer: It is not advisable to have an inaccessible trap for a kitchen sink. That probably violates code for the clean-out somehow. Yes, it will work, however there will also be an air gap where you shoved the drain into the standpipe leading to bad smell if the trap has goo in it. It's OK for washing machines because there's no food waste and a good dose of soap every time.
Answer: Not really necessary.  There should be shutoff valves under the sink.  Usually those can be turned off (verify that once they are no water comes out of the faucet) and the pipes up to the faucet can be disconnected.  The same is true with the waste lines.  They normally have screw fittings that can be removed and reassembled.
A wall box like a washer uses won't work for a sink.  A sink has the trap under it, a washer box has the trap hidden in the wall.  A washer pumps water up and out, a sink relies on gravity.  There can be no openings in the pipe after the trap, doing so will allow sewer gases into the home.
In commercial spaces and in some countries it is common to have a drain (with trap) on the floor, and the fixtures have pipes that empty out above the drain.  This can be messy and is rarely done in residential.
Comment: Talk to your plumber about this. The water supplies should have shut offs and the drains must have traps and proper venting.  All drains are similar, but some washer drains are open stacks over a trap and definitely not appropriate for a kitchen sink.
Comment: If that is the case I would highly recommend before going much further with the renovation you make a priority to install proper water controls in the house. There will be a shutoff valve at the water meter which requires a special tool (typically) to turn. Imagine you're working on something and a pipe being old gets hit and breaks now you have to wait until someone has the tool to turn off the water supply to the house to arrive to stop the flooding. *speaking from experience at a rental, it REALLY sucks*
Comment: There are no shut off valves under the sink, it is old copper pipe and all joints are soldered,  there is a cold water shut off in the cellar but it is frozen open, and there is none for the hot water pipe to the sink.
Comment: I have a plumber coming in soon to replace some pipes I am just trying to figure out how to have a sink to use, the floor is being taken up on Feb 24 so the sink has to be out, then it will be 2 weeks before cabinets come, then after the new cabinets another couple of weeks before the counter, so I would like to be able to sit the old sink and counter on top of the new cabinets and hook it up to use while I wait.  I can shut off the whole house by shutting off the pump.

kitchen sink plumbing hook up


avoid view when opening keyboard from a UITextView inside a UITableView with custom cell

Question: I have a UIViewController that contains a UITableView with custom cells, inside the cell are UILabels, a couple of uneditable UITextView and one editable UITextView. Now, when I tap on one of the UITextView that is near the bottom or the bottom part of the table, the UITextView is covered by the keyboard. I've tried http://cocoawithlove.com/2008/10/sliding-uitextfields-around-to-avoid.html which works great for textfield/textview but not working on the table with custom cell. Any help or suggestions how to go about this?
Answer: When your table view contains data entry fields like a UITextField or a UITextView and the table view is long enough to cover the screen, you will have a problem accessing data entry fields that are hidden by the keyboard.
To overcome this problem two solutions are:

The easiest and recommended way is to use a UITableViewController instead of UIViewController, which automatic make sure keypad won't hide the editable field (If possible use this approach to avoid U.I. adjustment inconvenience)
If you use a UIViewController and a UITableView as its subview. You can scroll your UI's frame by observing the UIKeyboardWillShowNotification and UIKeyboardWillHideNotification
- (void)registerForKeyboardNotifications
{
        [[NSNotificationCenter defaultCenter] addObserver:self
                                                 selector:@selector(keyboardWillShow:)
                                                     name:UIKeyboardWillShowNotification object:nil]; //Posted immediately prior to the display of the keyboard

        [[NSNotificationCenter defaultCenter] addObserver:self
                                                 selector:@selector(keyboardWillHide:)
                                                     name:UIKeyboardWillHideNotification object:nil]; //Posted immediately prior to the dismissal of the keyboard.
}

- (void)keyboardWillShow:(NSNotification *)aNotification
{
    CGRect keyboardBounds = [[[aNotification userInfo] objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue];

    [UIView beginAnimations:nil context:nil];
    [UIView setAnimationBeginsFromCurrentState:YES];

    self.tableView.contentInset = UIEdgeInsetsMake(0, 0, keyboardBounds.size.height, 0); //when keyboard is up, that time just bring your text filed above the keyboard
    self.tableView.scrollIndicatorInsets = UIEdgeInsetsMake(0, 0, keyboardBounds.size.height, 0);

    [self.tableView scrollToRowAtIndexPath:[self findIndexPathToScroll]
                          atScrollPosition:UITableViewScrollPositionTop
                                  animated:YES]; //findIndexPathToScroll implementation not shown
    [UIView commitAnimations];
}

- (void)keyboardWillHide:(NSNotification *)aNotification
{
    [UIView beginAnimations:nil context:nil];
    [UIView setAnimationBeginsFromCurrentState:YES];
    self.tableView.contentInset = UIEdgeInsetsZero; //Once keyboard is hidden then bring back your table into your original position.
    self.tableView.scrollIndicatorInsets = UIEdgeInsetsZero;
    [UIView commitAnimations];
}

registerForKeyboardNotifications - call this method when you load the UITableView, ie: viewDidLoad
findIndexPathToScroll - (Implementation not shown) Its your business logic to prepare IndexPath where table view should scroll
removeObserver 'UIKeyboardWillShowNotification' and 'UIKeyboardWillHideNotification' both in dealloc and viewDidUnload
Answer: I fixed the issue. Please see my solution below:

1. First declare a global varibale called "activeFileld"
@property(nonatomic,strong)id activeFiled;

2. Create a method called "registerForKeyboardNotifications"
- (void)registerForKeyboardNotifications
{
        [[NSNotificationCenter defaultCenter] addObserver:self
                                                 selector:@selector(keyboardWillShow:)
                                                     name:UIKeyboardWillShowNotification object:nil]; //Posted immediately prior to the display of the keyboard

        [[NSNotificationCenter defaultCenter] addObserver:self
                                                 selector:@selector(keyboardWillHide:)
                                                     name:UIKeyboardWillHideNotification object:nil]; //Posted immediately prior to the dismissal of the keyboard.
}

3. Called the above method in viewWillAppear:

-(void)viewWillAppear:(BOOL)animated{

  [super viewWillAppear:animated];
  //Register kryboard Notification
   [self registerForKeyboardNotifications];
}
4. Call the Delegate method for UitextFieldd Or UitextView

- (void)textFieldDidBeginEditing:(UITextField *)sender {

        self.activeField = sender;
}
- (void)textFieldDidEndEditing:(UITextField *)sender{
        self.activeField = nil;
}

- (void)textViewDidBeginEditing:(UITextView *)textView
{
    // save the text view that is being edited
    _notes = textView.text;

}
- (void)textViewDidEndEditing:(UITextView *)textView
{
    // release the selected text view as we don't need it anymore
    _activeField = nil;
}

5.

- (void)keyboardWillShow:(NSNotification *)notification
{

    if([_activeField isKindOfClass:[UITextField class]]) {

        NSDictionary* info = [notification userInfo];
        NSLog(@"Dictionary %@",info);
        CGRect kbRect = [[info objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue];
        kbRect = [self.view convertRect:kbRect fromView:nil];

        UIEdgeInsets contentInsets = UIEdgeInsetsMake(0.0, 0.0, kbRect.size.height, 0.0);
        self.tableView.contentInset = contentInsets;
        self.tableView.scrollIndicatorInsets = contentInsets;

        CGRect aRect = self.view.frame;
        aRect.size.height -= kbRect.size.height;

        UITextField *textField = (UITextField*)_activeField;
        if (!CGRectContainsPoint(aRect, textField.frame.origin) ) {
            [self.tableView scrollRectToVisible:textField.frame animated:YES];
        }
    }else if([_activeField isKindOfClass:[UITextView class]]) {

        NSDictionary* info = [notification userInfo];
        NSLog(@"Dictionary %@",info);
        CGRect kbRect = [[info objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue];
        kbRect = [self.view convertRect:kbRect fromView:nil];

        UIEdgeInsets contentInsets = UIEdgeInsetsMake(0.0, 0.0, kbRect.size.height, 0.0);
        self.tableView.contentInset = contentInsets;
        self.tableView.scrollIndicatorInsets = contentInsets;

        CGRect aRect = self.view.frame;
        aRect.size.height += kbRect.size.height;

        UITextView *activeTextView = (UITextView*)_activeField;
        if (!CGRectContainsPoint(aRect, textField.superview.superview.frame.origin) ) {
            [self.tableView scrollRectToVisible:activeTextView.superview.superview.frame animated:YES];

       }

   }

}

// Called when the UIKeyboardWillHideNotification is received
- (void)keyboardWillHide:(NSNotification *)aNotification
{
    UIEdgeInsets contentInsets = UIEdgeInsetsZero;
    self.tableView.contentInset = contentInsets;
    self.tableView.scrollIndicatorInsets = contentInsets;
}

Answer: A simple solution. Implement the heightForFooter method, and let it return a value of (say) 100, and when you select the a cell in UITableView, they will simply slide up by that height, and the keyboard will not cover the view.
Answer: Two solutions:
Preferred: use a UITableViewController instead of a UIViewController as that one will automatically make sure that your keypad won't hide the editable field.
Hacky: How to make a UITextField move up when keyboard is present?
Comment: well, I cannot use UITableViewController since I got a lot of stuff inside this view and not just UITableView. I'll try the other one. i'll get back here later.
Answer: I've always used a two fold solution for this.

Resize table so it now fits in the smaller area.
Scroll to the cell we want visible. (we needed to re-size the table for this or you'd still wind up being unable to get to the last couple of cells in the table.)

To do this, I register keyboard show/hide events and act accordingly when they get called.
- (void)keyboardWillShow:(NSNotification *)note {
    [self updateForKeyboardShowHide:note appearing:YES];
}
- (void)keyboardWillHide:(NSNotification *)note {
    [self updateForKeyboardShowHide:note appearing:NO];
}

- (void)updateForKeyboardShowHide:(NSNotification *)note appearing:(BOOL)isAppearing {
    // ignore notifications if our view isn't attached to the window
    if (self.view.window == nil)
        return;

    CGFloat directionalModifier = isAppearing?-1:1;
    CGRect keyboardBounds = [[note.userInfo valueForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue];
    CGFloat animationDuration = [[note.userInfo valueForKey:UIKeyboardAnimationDurationUserInfoKey] floatValue];

    // figure out table re-size based on keyboard
    CGFloat keyboardHeight;
    UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation];
    if (UIInterfaceOrientationIsPortrait(orientation))
        keyboardHeight = keyboardBounds.size.height;
    else
        keyboardHeight = keyboardBounds.size.width;

    [UIView animateWithDuration:animationDuration animations:^{
        // resize table
        CGRect newFrame = table.frame;
        newFrame.size.height += [self calculateKeyboardOffsetWithHeight:keyboardHeight] * directionalModifier;
        table.frame = newFrame;
    }  completion:^(BOOL finished){
        // scroll to selected cell
        if (isAppearing) {
            NSIndexPath *indexPath = [NSIndexPath indexPathForRow:textFieldInEdit.tag inSection:0];
            [table scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionBottom animated:YES];
        }
    }];
}

- (CGFloat)calulateKeyboardOffsetWithHeight:(CGFloat)keyboardHeight {
    // This depends on the size and position of your table.
    //   If your table happen to go all the way to the bottom of
    // the screen, you'll needs to adjust it's size by the whole keyboard height.
    // You might as well ditch this method and inline the value.
    return keyboardHeight;

    //   My table did not go to the bottom of the screen and the position was
    // change dynamically so and there was long boring calculation I needed to
    // do to figure out how much my table needed to shrink/grow.
}

Comment: You forgot to include your method "calculateKeyboardOffsetWithHeight:", without which this won't work
Comment: @Adam I didn't think the method was needed, but in I can see how it could cause confusion and so I added it in and explained it. I hope that helps.


Calculating Torque With a Second Arm Attached to the Main Arm

Question: I am working on some code that will handle the arm of a robot, and I want to be able to hold the arm in place against the force of gravity.  The arm is in 2 parts just like a human arm and I intend to hold the arm in place by setting a certain power to the motor that controls the main arm (equivalent to a human shoulder).  Both arms can rotate in any direction around their respective attachment points, but I have code implemented that will keep the second part of the arm from falling down due to gravity.   My problem is that I do not know how to calculate the torque of the shoulder part of the arm when the second part is added.  So how would I calculate the torque of the main arm at angle 1 with the added force of the second part of the arm at angle 2?
Comment: the torque at a0 is always the force (wherever it is) times the distance from a0.
Answer: there is a big difference if you are considering the static or the dynamic case.
static case
In the static case the simplest way is to add the torque from all the forces. (Although this might sound weird) because you are working in a 3D problem the simplest way would be to use the cross product form of the moment (for all load in the system including self weight). I.e.
$$\vec{r}\times \vec{F} = \left|\begin{matrix}\vec{i} & \vec{j} &\vec{k} \\
r_x & r_y & r_z \\
F_x & F_y & F_z
\end{matrix}\right|$$
where:

$\vec{r}= \begin{bmatrix}r_x\\r_y\\r_z\end{bmatrix}$ the position vector from the position you are calculating the torque to the application of the force
$\vec{F}= \begin{bmatrix}F_x\\F_y\\F_z\end{bmatrix}$ the force vector (in the same coordinate system as above).

UPDATE for Rameez Ul Haq and DKNguyen comments
The result of the bending moment can be intimidating (As Rameez Commented). So - as DKNguyen suggested - to find the actual rotor torque you need to:

find the axis of the motor. In the image above both motor rotate about the z-axis, so the motor would be  $\vec{\epsilon}_{motor}= \begin{bmatrix}0\\0\\1\end{bmatrix}$
perform a dot product on the result of sum of moments. I.e.:

$$\left(\sum_{i=1}^{n}(\vec{r}_i\times \vec{F}_i\right)\cdot \vec{\epsilon}_{motor}$$
(The remaining moments are relevant for the structural dimensioning of the joint and the arm )

Dynamic case
In the dynamic case (i.e. when there is rotational and translational motion) things are much more complicated.
The distribution of the mass is space plays a role, so if you were to carry a ball and a pipe  of the same weight, the torque on the motors could be significantly different (The faster the motion the bigger the differences).
So you would need to account for the moments of inertia of the

load
both the robotic arms and their accessories.
Comment: I think this answer does not consider the OP's claim: "Both arms can rotate in any direction around their respective attachment points." In such a case, the weight of the arms will have significant roles/effects.
Comment: The cross product that you have given for the static case, IMHO, it would be difficult to judge for a beginner that which moments will result in bending and which moments will result in torsion. I don't know if the motors used for robotic actions need to know this information (or we just scalar sum the moments to find eqv. torque), because for sizing of the arms, the distinction between these moments become important.
Comment: @RameezUlHaq Wouldn't you just dot product the result of the cross product against the arm to remove the torsion component?
Answer: "I want to be able to hold the arm in place against the force of gravity... Both arms can rotate in any direction around their respective attachment points."
Your system is unstable, which is caused by the fact that there is no fixity against rotation. Note that the "probable force" in the lower sketch can be induced by the deflection shown in the first sketch, and can occur in both X & Z directions. Once the motion starts, the vertical arm 2 will act as a pendulum in the free swing. The resultant (demand on) torques are not predictable without modifying the connection joints or taking into consideration of the kinetic motion and dynamic effects.
Comment: Sorry, I didn't make my question clear enough.  Both arms have the ability to rotate, but it is easy enough for me to make code that will hold the secondary arm in place.  So you can assume that the secondary arm will always be at the same angle unless I told it to move.
Comment: Your secondary arm will move with or without code. Unless you provide adequate friction force to restrict the incidental move due to the deflection of arm 1 due to gravity or make both arms weightless, or issue a code to adjust/control arm 1 to be always in the horizontal position. For the last case, the sketch already shows you how to calculate the torque/moment. Finally, your system will not have Tz if the arms are stationary, because there is no gravity force acting. All I want to point out is there are many issues with your design that deserve attention, especially for a sensitive robot.


Great circles on a unit sphere

Question: Any hints as to how I can find the equation of all great circles passing through a given point (polar angle $\theta$, azimuthal angle $\phi$) on the surface of a unit sphere? Thanks.
Comment: Possible duplicate? http://math.stackexchange.com/questions/74963/can-you-formulate-a-phi-theta-restriction-in-spherical-coordinates-for-a?rq=1
Comment: Doesn't that question assume you know more than one point on the suface? I was hoping for an answer for just one point.
Answer: How do you want to index all of the possible great circles?
For this answer I assume that we index them by the tangent vector, because given $(x_0, y_0, z_0)$ and a vector $\vec{u}$ in the tangent plane to the circle at $(x_0,y_0,z_0)$, there is a great circle going through $(x_0,y_0,z_0)$ whose tangent vector is $\vec{u}$. Note that the set of tangent vectors is not in one to one correspondence with the set of great circles--in order to have that we could have to only consider vectors of unit length and then consider vectors which are negative of each other as equivalent.
Now we find an equation of the unit circle through $(x_0, y_0, z_0)$ in the direction of $\vec{u}$. The plane containing the vectors $<x_0,y_0,z_0>$ and $\vec{u}$, when intersected with the sphere creates the great circle we want. This is because $<x_0, y_0, z_0>$ is normal to the sphere at $(x_0, y_0, z_0)$. This plane has the equation
$$(\vec{u} \times <x_0, y_0, z_0>) \bullet <x,y,z> =0.$$
So that
$$(\vec{u} \times <x_0, y_0, z_0>)_x \cdot x + (\vec{u} \times <x_0, y_0, z_0>)_y \cdot y + (\vec{u} \times <x_0, y_0, z_0>)_z \cdot z =0.$$
We can solve for $z$ (assuming the coefficient on $z$ is nonzero) and substitute back in to $x^2 + y^2 + z^2 =1$.
$$x^2 + y^2 + \left(\frac{(\vec{u} \times <x_0, y_0, z_0>)_x \cdot x + (\vec{u} \times <x_0, y_0, z_0>)_y \cdot y}{(\vec{u} \times <x_0, y_0, z_0>)_z}\right)^2 =1$$
Which is an implicit equation for the circle that you seek. You can convert to spherical afterwards if you like. I did it this way so I could work with planes in cartesian coordinates instead of spherical.
Here is a little image I created of the setup, if my words were not clear. The point $(x_0, y_0, z_0)$ is the black point. The green plane is the tangent plane. $\vec{u}$ is the red arrow. The pink plane is the one whose intersection with the sphere carves out a great circle.
Comment: Thanks. Excuse my hopeless vector algebra but how would that work with, for example, a point on the "north pole" $=<0,0,1>$ and with a tangent vector $\vec{u}=<1,0,0>$ along the $x$ axis, which should give a great circle on the $xz$ plane? I can't see how that great circle pops out of your equation.
Comment: Find the equation of the plane containing those two vectors. In this case it is $y=0$. Plugging $y=0$ into $x^2+y^2+z^2=1$, we get $x^2+z^2=1$. This is the equation of the great circle.
Comment: Bravo! The final equation in your excellent answer confused me. I've just worked out the equation for a point on the equator with a tangent vector along the $x$ axis and out pops the equation for the equatorial great circle.

Great circles on a unit sphere


Windows Server 2012 64bit R2 Datacenter programs RAM usage

Question: I host an online game on a machine thats operating system is Windows Server 2012 R2 64bit. Its a single executable that is constantly running. I used to host this very same game on a Windows 7 machine and the ram usage of the game was around 350mb and didnt raise or drop down no matter how many days the game was running without a system restart. But now at Windows Server 2012 R2 the RAM usage of that online game seems to be raising all the time. It is going up day by day, hour by hour. After 9 days it has already gone up to 1GB and will most likely be going up (no restart has been done in these 9 days). So is this some feature or way how Windows Server 12 handles memory usage of programs because this did not happen when I hosted the game on a Windows 7 machine?
Answer: Most likely an incompatibility between the game and the new Windows version.
Windows Server 2012 R2 uses a Windows 8 kernel. (post Windows 7)
Alright, Server  2012R2 is very much like Windows 8. But not much changed between the two versions.
Except we got the Lego Duplo interface, even on Server.
You can, however launch a Windows 7 VM via Hyper-V and run the server there.
Of course this is not ideal for game servers.
If you can, switch to Linux. It would eat less memory, cost less money (a lot less). Of course, this is only a viable solution if your games (the ones you host) have Linux binaries.


Issue with encrypted lvm during setup

Question: How can i access a different form of partitioning, like in old alternate cd's or debian's installer, where i can choose to create a partition, make it encrypted, then add a LVM group to that encrypted partition and add swap, home, root partitions under it, so there is one luks process and all partitions are unlocked via same key?
Comment: what version of Ubuntu?
Answer: From See https://help.ubuntu.com/community/EncryptedFilesystemsViaUbiquity -
The Desktop CD installer (ubiquity) currently does not provide support for setting up LVM or encrypted partitions. With the recipe below, the Desktop CD can be used to install Ubuntu on a previously created (optionally encrypted) LVM.
Boot desktop CD, open terminal, and install missing packages:
apt-get install cryptsetup lvm2
sudo modprobe dm-crypt

Now set up the LVM and crypto partitions with the command line tools. If you already have Ubuntu installed on a standard LVM-on-LUKS, this is as easy as:
sudo cryptsetup luksOpen /dev/sda4 sda4_crypt

or whichever partition is the encrypted LVM PV. This should automatically create the LVM LVs in /dev/mapper/.
Start ubiquity with manual partitioning, and use the existing partitions; keep /home etc. as they are, and reformat the root partition in the LVM. Do not reboot immediately, your system will not boot!
Mount the newly installed target system:
sudo mount /dev/mapper/ubuntu*-root /mnt
sudo chroot /mnt mount /proc
sudo mount --bind /dev /mnt/dev
sudo chroot /mnt mount /boot

Create an appropriate crypttab:
echo "sda4_crypt UUID=`sudo blkid -s UUID -o value /dev/sda4` none luks" | sudo tee -a /mnt/etc/crypttab

Reboot

Issue with encrypted lvm during setup


Borderlands 2 in True Vault Hunter Mode, does Madame von Bartlesby always drop a legendary weapon?

Question: I'm playing in TVHM and just finished the first part of the Tiny Tina quest "You Are Cordially Invited: Party Prep" where you have to retrieve Sir Reginald from Madame von Bartlesby.  I blasted her from a distance, using a sniper rifle from the Tundra Express map entry area, instead of dealing with her directly on Skittering Mound.  Her body dropped at the foot of the mountain, and there was no loot at all.  I was expecting some sort of legendary item, specifically the Baby Maker.  Did I mess up by not killing her on Skittering Mound?
Answer: No. Drops in Borderlands 2 are almost always chance-based. In particular, legendary item drops usually only have about a 1 in 30 chance of actually dropping.
Gearbox Software have actually blogged about the drops recently. See this article, and its follow-up.
Comment: @Alan, or just keep killing her. Once you turn in the quest, she'll respawn every time you save and exit. As a rule, all bosses generally will.
Comment: Thanks for the article links.  Looks like I'm going to have to restart from a recent save and try again -- maybe up to 30 times.  :-)
Comment: Thanks for the tip, that will save me hours of replay!  Turns out the last game save I had offloaded to my USB drive was after completing the Mighty Morphin' quest, and I had spent a lot of time in Tundra Express locating and deactivating Tiny Tina's mines.


SharePoint online Unable to share wiki pages

Question: I want to create a SharePoint wiki where site members and external users can contribute. when I create a wiki page even site members are not able to access wiki pages while site pages under the same directory are working fine even external users are also able to edit site pages. My main issue is that site members or visitors are unable to access wiki pages. they get following message on the browser.
Comment: Are you able temporarily enable Access Request features (if they are disabled) and use that to attempt to diagnose the issue?  Have the user request access and see where and who the requests come from.  Maybe user names are in an unanticipated format or maybe the location to which access is being granted is not what you thought?  Both of these has happened to me.
Comment: members are able to access whole site but wiki pages are not being displayed on member's end
Answer: Per my test I could access wiki page with external user or site members.
Make sure the wiki page inherits the permissions of the entire site.

Browse to the site and edit the URL by adding the following string
to the end of it: <code>/_layouts/15/people.aspx?MembershipGroupId=0</code>
Select the person from the list, and then on the Actions menu,
select Delete Users from Site Collection.
Grant the user permissions back to the site.
Comment: Thank You for your response, It is highly appreciated. I have tried this one but failed. I have started to work with site pages instead of wiki pages. As per my practice site pages provide more functionality as compared to wiki page. please correct me if I am wrong.
Comment: Yes, site pages are in modern experience, it will be more compliance with SharePoint Online.


What all does founder-status entail?

Question: If you activate a paid subscription to Elite before November 13, 2011, you gain "founder status".  What all does this entail?  Does it affect the game in any way (even just vanity wise)?  Or does it only affect interactions with the Elite service?
Answer: From Activision (you have to scroll to the bottom and click on BECOME A CALL OF DUTY® ELITE FOUNDER), becoming a founder, awards you with the following (all listed as exclusive) items:

Founder Weapon Camo
Clan XP Boost - Level Up Your Clan Even Faster
Founder In-Game Player Title
Founder In-Game Emblem
Private Group
Founder Call of Duty® ELITE Profile Skin
Competitions & Prizes

There is no mention of future iterations and what that may affect.

What all does founder-status entail?


Convert MATLAB code to R

Question: Is there a tool for converting MATLAB code to R?
I have a lot of code that needs to be converted from MATLAB to R. It doesn't have to be accurate, but it will be helpful in giving a head start.
Comment: For simple programs you can try this new package: https://cran.r-project.org/package=matconv
Answer: Paul Gilbert provides a rough Bash script that could get you started (he claims it will convert about 80% of the way) on the R mailing list:
<code>#!/bin/csh
cp $1 $2
ex -s $2 <<eof
   g/%/s//#/g
   g/function\(..*\)=\(..*\)(\(..*\)/s//\2 <-function( \3 { \1/
   g/end/s//   } #/
   g/for\(..*\)=\(..*\):\(..*\)/s//for ( \1 in \2 : \3 ) {/
   g/_/s//./g
   g/;/s///g
   g/==/s//@@/g
   g/=/s//<-/g
   g/@@/s//==/g
   g/zeros(/s//matrix(0,/g
   g/ones(/s//matrix(1,/g
   g/eye(/s//diag(1,/g
   g/\/s//solve(,)/g
   g/fsolve('\(..*\)'/s//ms(~\1 /g
   g/param(\(..*\))/s//param[ \1 ] /g
   g/var(\(..*\))/s//var[ \1 ] /g
   g/mod1(\(..*\)/s//mod1[ \1 /g
   wq
eof
</code>
Answer: No there is no easy conversion. Some will translate nearly exactly, some will translate only with great pain and suffering. At least you'll be using R though! Start here to work out analogous functions and syntax:
http://cran.r-project.org/doc/contrib/R-and-octave.txt
http://cran.r-project.org/doc/contrib/Hiebeler-matlabR.pdf
When you get stuck please ask specific questions here. This is really too vague as it stands, though those reference cards will help with getting started.
Answer: An alternative to translating the code would be to call MATLAB from within R, using the RMatlab package.
I have not tried RMatlab, but the package description states:

This package provides methods to read
  and write MAT files. It also makes it
  possible to communicate (evaluate
  code, send and retrieve objects etc.)
  with Matlab v6 or higher running
  locally or on a remote host.
Comment: I think that `R.Matlab` package will read Matlab `.mat` files, which are basically data files, but it won't help you with translating code from `.m` files.
Comment: @user236215 both R and RMatlab run on windows.
Comment: For Windows, see this answer: http://stackoverflow.com/questions/6695105/call-r-scripts-in-matlab/6933492#6933492
Comment: @GeekOnAcid you are correct, but it provides an interface to MATLAB, so that MATLAB can evaluate the code.
Comment: The correct name is R.matlab, this is de rcran URL:

http://cran.r-project.org/web/packages/R.matlab/index.html
Answer: Please see the comments on this issue:
URL:https://mandymejia.wordpress.com/2014/08/18/three-ways-to-use-matlab-from-r/
She mentions several options:
Option 1: Run a single MATLAB command at a time using system()
Option 2: Use R.matlab to send code to the MATLAB server
Option 3: Write an entire MATLAB program using writeLines() and run using system()

Convert MATLAB code to R


How to determine similarity score of new manuscript against own yet-to-publish manuscripts?

Question: Considering the ethical and professional implications of self plagiarism, it is very useful to check new manuscript against old ones (which are under review and not yet published) to decrease self plagiarism. In a white paper by ithenticate (download from http://www.ithenticate.com/self-plagiarism-free-white-paper), one way to avoid self plagiarism is to significantly paraphrase those text which are need to be used in new article. However, I have difficulties in identifying the similarity percentage of my current work against yet-unpublished works. Online tools (that I know) check the manuscript against published works. I have 3 journal papers, 1 is published, 1 is under review, and 1 is under preparation. Now, I need to check the third one to see the similarity score. Any suggestion?
Comment: Thanks all of you for your fruitful suggestions. However, I need to check now, because I am in a situation where I need to check what is the similarity score. I checked recommended tools in sourceforge, but no clue. They are just not working. thanks for help.
Answer: First suggestion: Never copy-paste material from earlier works, always write everything from scratch.
This prevents you from moving critical passages from one paper to the other. It is of course still possible to end up with a similar or even identical sentence by accident, particularly if you describe a method or something similar. If you end up using the same method for several papers it is also possible to simply reference your original description in subsequent papers. The Ithenticate white paper mentioned by you provides good advice. Yuo can slso visit the COPE (Committee On Publication Ethics) web site and search for self-plagiarism.
Second suggestion: Use the softwares such as iThenticate,  turnitin or the like depending what you are looking for. But, I would not blindly just look at percentages of overlap but focus on where the overlaps occur. If it is in the methods section describing a series of steps ina  process it is clearly not as critical as if it is in the discussion or conclusions. If you find overlap and you can identify what it is, then go to my first suggestion and critically review if you need to say it again.
Answer: Does the paper make an original disciplinary contribution to scholarly knowledge?
Has any reused material been rewritten from scratch?
Has the reused material been cited in relation to the paper under review?
If so, it should be fine.  The first one is the big one, I assume that people with a doctorate in their discipline should know whether this has been achieved.  One nostrum I use is meeting at least one of the three: new evidence set, new theoretical tools, new analysis.
As an example of this nostrum: Case A organisation demonstrating with Marxist class analysis concept Q.

Case B with Marxism demonstrating Q is novel
Case A with Patriarchy analysis demonstrating Q is novel
Case A with Marxism demonstrating R is novel
Comment: Certainly new manuscript are logically providing original contribution, however, it is time consuming to write some general text from the scratch, so people just copy and paraphrase it. It is good idea to support the text with reference to the under review paper. However, having a tool as Anthony mentioned to check the score would be fine.
Comment: @T.F. I've expanded the answer and hope this assists.
Comment: _it is time consuming to write some general text from the scratch, so people just copy and paraphrase it._ — But of course **you** didn't do that.  Right?
Comment: Short Question: "One nostrum I use is on of the three" <- do you mean 'one' or like 'on all'?
Comment: @JeffE, No, I DID Not. If I did, I could not publish in top journals (though you are not really fan of journals). I am fast in writing (Though English is not my first language) and do not need to copy & paste text from old papers. I dislike to copy and paraphrase old sentences since every time I write, the texts are more cohesive and interesting. But (my) brain sometimes generates similar sentences. That's why I need to make sure such identical sentences do not impact on my writings.
Answer: Sourceforge offers a few free tools aimed at detecting plagiarism (see http://sourceforge.net/directory/os:linux/freshness:recently-updated/?q=plagiarism) for various platforms.
Comment: Some of these tools also include a hidden agreement in the registration process, that uploaded papers can be used by the company that owns that tool. This is for example true for the 'Viper' tool. Be cautious!
Comment: I check these tools and found them useless in the domain I need. They are not free and their plagiarism is checked against published papers in the literature. Not what I need.


Inequalities in probability theory

Question:
I got stuck while solving this problem. First of all, i tried to prove directly from definition, but this doesnt led anywhere. Perhaps Jensen inequality may help? But we dont have convexity of f or of g. Any ideas on how we can tackle this problem?
Answer: Let $X$ and $Y$ be iid, then we have
$$E[(f(X)-f(Y))(g(X)-g(Y))] \ge 0$$
$$E[f(X)g(X)+f(Y)g(Y)-f(Y)g(X)-f(X)g(Y)] \ge 0$$
$$E[f(X)g(X)]+E[f(Y)g(Y)]-E[f(Y)g(X)]-E[f(X)g(Y)] \ge 0$$
By independence,
$$E[f(X)g(X)]+E[f(Y)g(Y)]-E[f(Y)]E[g(X)]-E[f(X)]E[g(Y)] \ge 0$$
Since $X$ and $Y$ are identically distributed
$$E[f(X)g(X)]+E[f(X)g(X)]-E[f(X)]E[g(X)]-E[f(X)]E[g(X)] \ge 0$$
$$2E[f(X)g(X)]-2E[f(X)]E[g(X)] \ge 0$$
$$E[f(X)g(X)] \ge E[f(X)]E[g(X)]$$
Answer: For every real number $x$, $(f(X)-f(x))(g(X)-g(x)) \geq 0$, thus $\mathbb{E}[f(X)g(X)] + f(x)g(x) \geq f(x)\mathbb{E}[g(X)] + g(x)\mathbb{E}[f(x)$.
Then integrate wrt $dP_X$.

Inequalities in probability theory


Is there a difference between "working environment" and "work environment"?

Question: Are working environment and work environment interchangeable, or is there a difference between them? If so, what is the difference?
Answer: I'd say that people might associate work environment more with a job, the working conditions and the people you have to work with. And working environment can mean "the place where you get some work done" - which could be a job, or regular studying, or performing a task fixing something... or even something more abstract like the way you have your computer set up for your workflow. But it's a very subtle thing!
Answer: I fully agree with the answer by @cactustictacs about the real but subtle difference between "work environment" and "working environment". I would add that "work environment"can include not only the physical circumstances, but includes the social and psychological situation in which work is to be performed. Indeed one form of on-the-job harassment is called "creating a hostile work environment", and this does not mean poor placement of furniture.
Comment: Thank you! I suspect this is what @cactustictacs has in mind too, when (s)he talks about "working conditions and the people you have to work with" – still having the same answer from two people is better than one :)
Answer: They are equivalent.
They all mean the environment in the surroundings of your workplace.
Just the "working environment" might be misunderstood, they might think that it is meant to be the "environment that works" :-)
If I were you I might say:

workplace environment
Comment: @Hannah they do **not** refer only to the physical surroundings. See my answer.
Comment: Thank you so much for your answer! So both these refer only to the physical environment? Is there another expression that covers psychological aspects as well?


Something adding an excessive meta description

Question: I have a WordPress running with Woocommerce and a commercial theme. My problem is that something is adding an extra meta tag(og:description) and it is getting on my nerve since it's content which is completely irrelevant displays on social media while sharing our links. Here's the web address: http://pay4games.ir/ and here's the code :
<code>meta property="og:description" content="[rev_slider alias="index"] جدیدترین محصولات تومان۵۷۶,۰۰۰ STAR WARS JEDI FALLEN ORDER نمره ۴٫۰۰ از ۵ افزودن به علاقه مندی ها مقایسه افزودن به سبد تماس بگیرید Watch Dogs Legion افزودن به"
</code>
If you view source the home page, you can find this string. I tried disabling all the plugins one by one and It got disappeared when I disabled the woocommerce! I tried using the String Locator plugin and I looked up "og:desc" and it gave me two strings from Yoast SEO but when I disable Yoast SEO, the main meta description tag disappears and the excessive one remains!!! I contacted the theme author and they came up with no resolution. I would be grateful if someone could help me finding this string's source. Best,
Answer: Resolved!
Had to disable the Open Graph option on the Theme control panel!


Are these coefficients swapped in this example, or am I wrong?

Question: I believe I'm staring at an error here. Attached is a screenshot. Am I right in understanding that the author swapped the coefficients around in solving q using the quadratic formula? I can see why the mistake was made, if I'm right about the mistake, because of the name of the coefficients in the differential equation. The issue is that 0.1 was used as a in the quadratic. It should be used as b?
Answer: The solution of the quadratic equation $\frac{dP}{dt}=0$ is correct, taking into account that the choice of coefficients runs counter to the 'usual' parametrization. Note that the denominator in the 'usual parametrization' is $2a$, double the coefficient before the quadratic term. This is the same here, where it is called $2b$, again double the coefficient before the quadratic term.
If the differential equation is correct with using $a$ and $b$ as it did I cannot say, as those values miss units, they are just numbers.  If you think that the coefficient of $P^2$ should be $-a=-\frac1{10}$, then the differential equation is incorrect, but the step from differentioal equation to finding the equilibrium points is OK.
Comment: +1 I was going to say that, but I'm late by 5 minutes. Yes, the symbols $a$ and $b$ are swapped compared to usual polynomial of degree $2$, but they are consistently swapped both in the polynomial and in the whole solution, hence the solution is correct.
Comment: Thanks, it confused the hell out of me for some reason. But I see now that there is in fact nothing wrong here. Thanks again!


When to implement WCF Rest Service and WebApi

Question: I have gone through many articles to understand why we need WebApi's when we can create restful architecture using WCF rest services but could not find some solid reason. Can we use these interchangeably? Are these just two approaches to solve similar type of problems.
Or else there are some things/features which each of these can do but other can't. Please help me to understand, how I can decide which one to use based on given scenario.
Answer: From here

Although WCF provides some support for writing REST-style services,
  the support for REST in ASP.NET Web API is more complete and all
  future REST feature improvements will be made in ASP.NET Web API

So for REST services it's preferable to use Web API, not WCF
That link also provides some useful info (like whether they are interchangeable, features of technologies)