Physical characteristics of Explorer I whip antennas

Question: What was the diameter of Explorer I's whip antennas, and what material were they made of?  I am trying to write a simulation of the satellite's spin reorientation.  The Smithsonian lists antenna length as 22 inches.
Comment: nice footage: https://www.youtube.com/watch?v=kw_ulaECjSg
Answer: I can't tell you exactly, but I can suggest a methodology that you can think about applying to try to deduce the answer.
From the NASA page A Moment in Time: Explorer 1 I cropped the following image and played tricks with cropping further and zooming and estimating. I didn't pull up OpenCV in Python and do edge detection but that would be the next step.
Wikipedia gives the rocket diameter as 15.2 centimeters (six inches). I took three spots and estimated the antenna diameter at the midpoint of the sloped edges, then took the ratio to the rocket width at a nearby location at presumably a similar distance from the camera (camera is not at infinity).
I got <code>[0.61, 0.54, 0.43]</code> centimeters for the three estimates, median and average are 0.54 and 0.53 cm respectively, and I won't report a standard deviation for only three numbers. (okay it's 0.07 cm, i.e. big).
Since oscillators can drift in frequency and metal can expand and contract thermally, it is desired to have a finite bandwidth over which the antenna is impedance matched. Thin wire antennas have a very narrow low-SWR range. This is one reason why monopole, dipole, even Yagis are made with larger diameter tubing than they might need to be structurally. So the 5mm diameter may be related to both desired mass and SWR performance.
As they are so flexible, they are not solid metal but instead probably some kind of coiled or braided multifilament, but I don't know how they did that.

You could repeat the process with the following image from here but there's no guarantee it's the same antenna (unless you can track down that information).

Or this one from here

But don't use this one or this one.


How to create multiple dialog boxes with wx python and how to close all of them at once

Question: How would be able to open lets say 5 dialog boxes and have the last one open close all the dialog boxes.
Comment: I think you'd have to use multi threading for that to work. Check out the [documentation](http://docs.python.org/library/threading.html) for more information.
Answer: Each dialog will have to open the next dialog since dialogs tend to block the main loop when shown modally. You could use PubSub to send a message in the closing event of the last dialog to the previous dialog that it too should close and do the same thing in that dialog and so forth. Each dialog emits a message to its parent to close too.
Here's a PubSub tutorial: http://www.blog.pythonlibrary.org/2010/06/27/wxpython-and-pubsub-a-simple-tutorial/


How to find the transfer function of a differential pair(BJT)?

Question: I want to find the transfer function of a differential BJT pair. Like internally compensated op-amp can be assumed as a single pole system, is there any method to write the transfer function? I plotted bode plot in LTSPICE and I dont think it is a single pole(differential BJT pair).
enter image description here
Comment: Show the bode plot please (amplitude and phase).
Comment: Can you please check the question now? is the plot visible ?
Comment: Start the plot at 1 kHz (not a pointless low frequency) and indicate with different colours what the two lines are and, be unambiguous about those lines i.e. don't say something meaningless like V(vo+)-V(vo-) because that just wastes people's time trying to figure out what it is meant to mean. From what I can tell you haven't made the compensation correctly i.e. there does appear to be a dominant 2nd order effect. Also, use a white background.
Comment: Oh sorry for wasting your time, i will make the changes and update it here
Comment: @Andyaka I was unable to change the expression , so I have added two different images. Is this okay?
Answer:
I want to find the transfer function of a differential BJT pair

I've taken your graphs and merged/stretched them to align their x-axes so that I could then scrawl all over them to highlight where the poles appear to be. I have assumed that the magnitude plot is |output|÷|input| rather than some obscure and meaningless name that is used in the original plot.
Here's the result: -

Firstly, look at the black line I drew; it corresponds with a 1st order slope of 20 dB per decade. As you can see, between 100 MHz and 1 GHz (dark blue lines), it's starting to become more than 20 dB/decade (pale blue lines) and is strongly hinting at another pole (around where the blue circle is).
The phase response; see how it never levels out at a 90° lag (purse first order system) but keeps on dropping towards a 180° lag (a bit below 1 GHz) and then keeps on dropping even lower to hint at a 3rd order response.
Having said all that, if you navigate left to right along the horizontal green line on the magnitude plot from 0 dB to where it hits the magnitude curve, then project that point downwards to the phase plot and then across the phase axis, there is going to be a case for it having marginal stability but only just. There will likely be a lot of transient overshoot if heavy feedback is applied.
Regarding the orange lines I added; I began at a 45° lag on the phase response because this is synonymous with the lowest pole in your circuit. I then projected across to the phase curve and then upwards to the magnitude curve to check that there was indeed a 3 dB reduction in magnitude at this frequency. And, of course that looks good.
So, in summary, I believe your first pole starts around 24 MHz (orange circle) and, where the blue circle is (about 200 MHz), it turns into a 2nd order system. Somewhere in the high hundreds of MHz to low GHz, a third pole is beginning to emerge.
My recommendation is that you model it with a simulator using: -

a gain block of 26 dB followed by
an RC low pass filters at 24 MHz,
a unity gain buffer
an RC low pass filter around 200 MHz
a unity gain buffer
and finally an RC low pass filter around 2 GHz.

Then, you should be able to get a reasonable match and that modelled circuit, because it is mimicking your actual circuit is basically telling you what the TF is. Solve the TF of the above model (that mimics your circuit) and you have the result you want.
Comment: Ohkay , thank you @Andyaka
Comment: @HariKrishna maybe you should [take the 2 minute tour](https://electronics.stackexchange.com/tour) to find out what is expected from you when a question has received answer(s). Also, if there's anything else related to the question that you need clarifying, please leave a comment.
Answer: Other than what @Andy Aka has written, I want to write more about the mathematical steps. Like, how to get an approximate TF during design phase of simple amplifier circuits.
You want to calculate the TF of BJT Diff pair. The only way to do that is to take you actual circuit, replace every thing with s-domain high frequency model of them and then using network theorems and other mathematical concept find Vout wrt. Vin and that would be the TF (I wish you good luck for that ;)). Any thing other than that is approximation.
Now, what do you use a TF for? there are a number of reason and one of them is to determine the bandwidth of the amplifier and variation of gain with frequency. But do we really need a TF for that? Strictly speaking, yes! But during the design phase, we can use approximations to approximate and bottom down to some design parameters and then actually testing the amplifier circuits using simulations or making the practical circuits. If actual measurements are way off than approximation then people employ more sophisticated techniques to get better approximations. Right now, I might be sounding like as if we only need approximations, but this is not true. In simple amplifier circuits, it is easy to determine the whole TF, for example a source/emitter follower but in complicated designs it is good to first stick with approximations.
So if those approximations are good enough, then using those we can write approximate TF. for start and usually for relatively simple circuit, we assume that the bode plote of the TF looks like the following:

There is a lower cutoff frequency, higher cutoff frequency and a mid-band gain and usually we obtain a TF to get these parameters(However, if someone is working in a feedback systems, parameters such as gain and phase margins and variation of phase with frequency becomes important, but if someone working at such high level would be educated enough to know what assumptions to take in the beginning). But what if we have methods to determine those parameters before hand i.e. without finding out the TF and then use those values to approximately calculate the TF. And this is what I am going to write about.

In a differential amplifier, there are two curves(not the only two) (a) variation of common-mode gain (b) variation of differential gain and subtracting (a) from (b) gives you variation of Common mode rejection ratio(CMRR) with frequency. And for now, I am assuming that you are talking about variation of differential gain.
Now, in order to find the differential gain, Assume that you have the following circuit:

Note: I have not shown the signal source resistance in here, but it will be always present
C1, C2, C3, C4 are used to not disturbed the DC levels of this circuit, however, it is not necessary to have any of these. Infact in IC, you won't even find the resistor and the above mentioned caps. However, in discrete implementation they are necessary. So the problem that above mentioned capacitor poses is that they increases the lower value of frequency of the amplifier bandwidth and one good thing about them is that they do not affect the upper cutoff frequency of bandwidth. The upper cutoff frequency is determined by the parasitic capacitances of the bjt that is being used.
Now, in order to calculate the frequency response of this bjt diff pair, makes it's half circuit. That would look like as following:

Remember that,

The above differential half circuit (common emitter amplifier) can be
used to determine the frequency dependence of differential gain. The
gain function \$A_d(s)\$ of the differential amplifier will be
identical to the transfer function of this common emitter
amplifier [1].

For this half circuit calculate the mid-band gain which is normally the gain we calculate using low frequency hybrid-pi model and replacing all power supply with ground and replacing caps with short circuits and for a common emitter it is given by \$A_{mg}=g_mR_d\$.
How Determine the Lower Cutoff Frequency?
Method of Short Circuit Time Constants

Set the input signal source (V1) to 0
Take one capacitor at a time. Say you took \$C_i\$, so short circuit rest of the capacitors in whole circuit.
Find the Thevenin's equivalent resistance across the capacitor under consideration. This is basically the total resistance seen by that capacitor. Let it be \$R_i\$.
Calculate \$C_i\times R_i \$ for all \$ i\$

The lower cutoff frequency (\$f_L\$) can be estimated
$$f_L\approx\frac{1}{2\pi}\sum_{i=0}^{n}\frac{1}{C_i\times R_i}$$
How to determine the upper cutoff frequency?
Although one can easily use miller approximation to spilt any feedback capacitor in circuit and then can determine the upper cutoff frequency. But the following method gives better approximate answers and is more general in nature.
Method of Open Circuit Time Constants
First draw the high frequency model small signal model of the amplifier. Short circuit all the capacitors which were used in determining the lower cutoff frequency because we assume here that at higher cutoff frequency they will be acting as short circuit(this assumption allows us to make small signal model of the Amplifier …!). Now do the following for all capacitor in the small signal high frequency model of amplifier:

Reduce the input signal source to 0.
Select a capacitor \$C_i\$, replace all other capacitors with open circuit and find the Thevenin's equivalent resistance around \$C_i\$ and let it be \$R_i\$.
Calculate \$C_i\times R_i\$

Hence high cutoff frequency is approximated by the following:
$$f_H\approx \frac{1}{2\pi}\times \frac{1}{\sum_i C_i \times R_i}$$
Final words
now that you have 3 parameters, you can approximate the TF but that would be useless because it would be good only to get those parameters and don't try to get anything more out of that.
Again I am highlighting the fact that this is just an approximation. Sometimes, you can have a higher order response but that will depends in how much detail you want to analyze your circuit.
If you want to read more then go though chapter 6, 8 & 9 of the book 1.
[1] Microelectronics circuits theory and applications; Sedra Smith; 7th edition.


Dictionary doesn't work after upgrade to Catalina - why there is no reference sources here

Question: There are not reference sources under "Drag reference sources into the order you prefer", how can I drag them? and how to add these reference sources(dictionaries)?

Comment: What exactly is the question?
Comment: @Allan why there is no reference source here, i think that's the reason why i cannot use dictionary.
Comment: Yes, you should have a bunch of dictionaries listed with boxes to check before and after "wikipedia".  Something has broken with your install.
Comment: How can i fix this issue @TomGewecke
Answer: They are supposed to be added automatically as a part of post-upgrade updating process. The upgrade itself doesn't bring everything up to date, the apps that are not part of the OS and some nonessential components are updated later.
If you are stuck with the lack of dictionaries for a prolonged time (more than a day and a couple or so of restarts), and especially if you see the degraded overall performance of your Mac, most probably the updating process is broken. I had the same picture yesterday, so I've started investigating and solved it. Maybe you have the same bug that I have had, maybe not. Still, I hope my solution would help, and to make it more general, I will describe the process, too -- so that even if your source of trouble is different, you can find your own solution.
So, first I've opened the Activity Monitor to found that trustd and nsurlsessiond are eating up the CPU. I even had to kill trustd (nsurlsessiond went down after that, too) so that I could continue to work without lots of spinballs. It looked like trustd tries to verify some app, and calls nsurlsessiond for update information and/or update itself, which, in turn, fails.
Then I've opened the Console and started searching in logs for nsurlsessiond -- and found lots of records that __mkdir failed to create a directory, "not permitted". The directory in question was /private/var/folders/zz/zyxvpxvq6csfxvn_n00000y800007k/0 . I went to its parent /private/var/folders/zz/zyxvpxvq6csfxvn_n00000y800007k and I've found in the Get Info that while _nsurlsessiond as a user had Read and Write permission, as a group it had Read only permission. Now, /private/var/folders/zz/ is not a place to mess with, but adding a permission to a known daemon and creation of a new directory are not that dangerous, so I did both: changed the permission of group _nsurlsessiond for /private/var/folders/zz/zyxvpxvq6csfxvn_n00000y800007k to Read and Write (to do that you must first unlock it in the right-down corner of Get Info box), and created a new folder "0" in it, making sure it also gets Read and Write privilege for _nsurlsessiond.
Then I've restarted, and let the Mac idle for a while. Soon App Store showed updates for some apps that I didn't even remember. I let them all update, updated some other apps that could not auto-update previously (such as Chrome), and again let it idle or semi-idle while I was browsing the web etc. I intentionally avoided opening the Dictionary app at that time. Today I restarted the Mac again, opened the Dictionary app, and found that all its dictionary tabs  are back; when I've clicked on the German tab, it said "wait a minute for a download" and almost immediately showed me the dictionary. All the other dictionaries were back, too, after that.
Comment: thanks for your answer, i followed what you said, this doesn't work for me, i don't have cpu memory concerns after checking monitor.


Problem with Mint 18 and VMware Tools

Question: I just installed Mint 18 as a virtual machine using VMware 12. I have the problem that I can't install vmware-tools. At first I tried to install open-vm-tools as is recommended by Mint, but it didn't work, so I uninstalled it and then tried to install the default vmware-tools, but it can't be installed.
Answer: Forget VM tools, use:
sudo apt-get install open-vm-tools open-vm-tools-desktop

Then do a full restart and check that the client screen will resize when the host window resizes.
Comment: +1: This worked for me with Linux Mint 19.
Comment: This worked for me on Linux Mint 19.1 XFCE x64
Answer: You need to sudo or su at root first before running vmware-tools-install.
Answer: I installed Linux Mint 19.1 (Tessa) onto VMware ESX 5.5 in a virtual machine, allocating 30g HDD, 2g memory, (resource manager shows Mint using 10g HDD and 900k memory).
After installing the VMwareTools (to get a bigger screen), I got a message saying that "Cinnamon desktop has crashed, would you like to restart it".
If you say Yes, then it crashes again in few seconds, if you say No, then it reverts to a simpler desktop (not sure what).
So, I did some hunting and found "open-vm-tools-desktop" and installed it, (after disabling VMwareTools at startup), and now Cinnamon stops crashing.
Here's what you do - (you need to install the package in the "/" root directory as root) -

sudo su
cd /
sudo apt-get install open-vm-tools open-vm-tools-desktop
reboot

Problem with Mint 18 and VMware Tools


3rd party drive or standard in a new MBP?

Question: so I'm looking to buy a new 17'' Macbook Pro, but I'm having a hard time deciding if I should buy it with a solid state included, or buy my own and stick it in. I've heard that the Toshiba drives they put in (for $1100) aren't as good as some other drives you could buy for closer to $800. Is there any truth to this?  Any recommendations/links would be much appreciated. Thanks!
Answer: For something like this, I would always buy my own and put it in for two reasons:

cost
you get an extra drive to play with

You will find better deals on SSDs if you purchase your own. However, there is one reason you would want to go with the Apple-supplied drive:

TRIM support

That's about it. I guess, if you know and value what TRIM support is, you only have one choice. If you are fine putting in your own drive and don't value TRIM support, then you have other options.
Comment: Well, I've heard that there are ways to enable trim on third party drives.
Comment: I've heard the same, but I don't know if there is a reliable way to know if it is working correctly or not doing damage in some other way to the drive.
Comment: Well, what about the OCZ/OWC drives? They have TRIM built into hardware through the sandforce controller no?
Comment: Go for it. Honestly, that's what I would do. I'm already putting together the money to get an SSD for my MBP myself so I'm not being turned away.


Is there an alternative wet chemical method or electrochemical method to obtain precipitation of iron, nickel and silicon powder?

Question: There are many methods available to obtain powdered metals and alloys. Wikipedia show some of them. Another form is grinding with posterior removal of wheel particles. All these methods produce metal powder with the help of specific machinery. I am asking for an alternative wet chemical method (water solution) or electrochemical method (water or ionic liquid electrolyte) to obtain metal powder (specifically iron, nickel and silicon, in pure or controlled alloy form).
Comment: I want to obtain powder of those metals (pure, not alloyed) without an atomizing machine.
Comment: I need power of separate element or mixed in known proportion. Grinding will introduce impurities. ¿Will they be easy to remove? I need a small amount, big enough to be overpriced if I buy it from a laboratory supplier and small enough so that I can not import from a wholesaler.
Comment: Even after reading all the comments, I still don't understand what you are asking.  Could you revise the question?  Otherwise it might get closed as too vague.
Comment: Thanks for updating!  I'm still a bit confused by "obtain metal powder (specifically iron, nickel and silicon, in pure or controlled alloy form)".  Does that mean you are asking for (a) three separate wet electrochemical methods, one for Fe, one for Ni, and one for Si; OR (b) a single method to generate a Fe-Ni-Si alloy; OR (c) both?
Comment: @CurtF. (a) or (b) or both. As fewer restrictions are imposed, more likely to get a answer.
Answer: Both metal powders can be preapred electrochemically.
Iron dust is prepared using solution containing $\ce{FeCl3}$ with addition of $\ce{AlCl3}$ to make the solution more conductive. The process occurs at elevated temperature 60°C. Unfortunately exact process parameters are hard to find.  But following graph could help.

Nickel could be prepared electrochemically too and can be prepared by dissolving of Ni-Al alloy in hydroxide -Raney_nickel. The description of patent is here.
This is link to a study book PRÁŠKOVÁ METALURGIE, K. Skotnicová, M. Kursa
, unfortunately only in czech.
Comment: Nickel powder can be made by electrolysis as well. Raney nickel is a speciality for use as a hydrogenating catalyst, and is very pyrophoric!
Comment: Did you even read my answer? I am saying on 2 positions that the electrolysis is possible. Altough the powder is pyrophoric, it is a way how to prepare the nickel dust. What was actually the question.
Answer:
I am asking for an alternative wet chemical method (water solution) or electrochemical method (water or ionic liquid electrolyte)

Water will only be a efficient electrolyte to generate metals that are more weakly reducing than hydrogen gas.  Otherwise, attempts to produce the metal will just result in mostly water hydrolysis.  The chemwiki page at UC Davis has a good overview of this particular topic.  The standard reduction potential for iron is too low (too reducing; too negative) to be made efficiently via an aqueous electrochemical process.  Update: I softened the wording of this paragraph based on advice from Jaroslav Kotowski who noted that the original wording I used was wrong.  Iron dust can apparently be made via electrolysis, but efficiency is very low.
Nickel and silicon are less powerful reducing agents than iron, but are still slightly more powerful than water under standard conditions.  Some combination of pH and concentration adjustment could make it theoretically possible to generate these metals in a wet (aqueous) electrochemical process, but it would not be very efficient.  I dug up a 1908 paper that reports that nickel films (not powders) can be electrodeposited from a (presumably aqueous) solution of nickel ammonium sulfate.
Non-aqueous electrolytes such as ionic liquids do not necessarily have this problem.  You should read a review article on metal deposition from non-aqueous media such as this one.
Comment: Thanks Jaroslav -- I'll edit the answer to reflect this.


Detecting a user accessing our website with accessibility features

Question: We have implemented the responsive website with accessibility features. It's built in Angular 1.x. I would like to know whether the user is accessing the site through accessibility feature or not. How do I access device parameters in the javascript?
Answer: People using screenreaders use standard browsers (Firefox, Chrome, Internet Explorer/Edge, ...). They gives the screenreaders the information on the structure of the page through the accessibility API. But it's impossible to know whether or not the user uses the accessibility API.
Of course, you can track simple things like whether or not the user use a mouse by tracking the onmousemove event, or whether or not the user use the keyboard (through onkeyup event for instance). A screenreader will emulate certain actions like focus(), click() but not all the standard keyboard/mouse events. And you'll have to consider also touch events.
Comment: *_currently_ impossible. Standards evolve.
Comment: @TheDudeAbides Nope. It's an API. The browser provides it. They may use it or not. If you share a braille display with your wife, and you're using the same computer, you can't know if the user is currently using the accessibility API or not.
Comment: But is it naïve to imagine a future where the assistive device is cooperating with the browser to send a header, like, I dunno, theoretically, `X-Assistive-Device-Parameters`, which a remote web site can inspect and operate on?
Answer: There are a lot of extremely different realities among assistive technology users: various software and/or hardware, for various kinds of disabilities.
Thus your question is vague: do you want to detect screen readers ? screen magnifiers ? pointing devices for people who can't use their hands (driven with the voice and/or their eyes) ? reading helps for dys problems ? something else ?
As you can see, the universe of assistive technlologies is very wide, and there are often as many ways to customize them as there are users.
However, regardless of what you are trying to detect anyway, the answer will more or less be always basicly the same: there is no 100% proof solution, at most solutions which work in some particular cases only.
For example, if you make a search on stackoverflow or anywhere else on how to detect if the user has or hasn't a keyboard, a mouse, a touch screen, etc. you will see that there are a lof of different answers, but none of them are really 100% exact nor perfect in all cases.
You might get more or less obvious clues that he has or hasn't this or that, but you will never be 100% sure; and sometimes, you get a part of certainty only after a while.
For detecting screen readers or magnifiers, that's one step harder in terms of difficulty. What's a typical scren reader user ? keyboard, no mouse and no touch ? Perhaps not. What if I have enough sight to distinguish main zones, but not enough to be able to click precisely on a button having a small icon ?
What if I'm using a dictation software and can't use the keyboard for some reason, or just because right now my hands are busy  ?
On iOS there exist VoiceOver, so a screen reader may have a touch screen. And so forth.
And there is another problem with detection: I have a mouse, but it doesn't implies that I will necessarily use it. What about computers that can be switched between a laptop mode and a tablet mode ?
IN the opposite, I can be a screen reader user and may move the mouse a bit by misstake.
Your site will just make wrong conclusions about what I am, and will present me with an unappropriate interface.
Ah, and another final one: what if I'm blind, try to use your site, don't manage to do it, and finally call a sighted person to help me ? The person won't be able to help me because your site took the screen reader interface ?
Here is the truth: don't assume anything about what the user has or hasn't / who he is or isn't.
Think that the user may use all input means at the same time or that he may change them at any time.
D'ont be faoul: give alternative texts and make your components accessible all the time, not only when you know that the user is using a screen reader.
Design your thing in such a way that you don't need device detection as most as you can.
Comment: Asking for feature detection for screen readers and other assistive devices is a good instinct, though. Yes, it's a complicated issue. However, I think the OP has a valid, if initially poorly worded question, and the simple answer is "no, there is no simple way to programmatically detect that."
Comment: I think the feature detection is the way to go but instead of trying to detect accessibility users, try to detect users that move mouse normally, use default font size for `` element etc. That is, default to fully accessible content for everything (including focus indicators etc) and selectively make the content less jarring to visual users if heuristics or feature detect suggests that they do not need help. However, if you feature detect e.g. the default font size, do not assume that the user can use mouse – default font size probably just means that user is okay with usually sized text


Is there a way to encrypt disk without formatting it?

Question: When I was installing my OS, I didn't encrypt. Is there a way to encrypt it now without formatting and without losing any data?
I read a few guides how to encrypt and every one says that I need to backup all my data because I will lose it.
Is there a way to encrypt it all now without losing data?
Comment: This is for experts. If your system crashes during this procedure then all data can be lost. So if you insist on doing this without a backup then I assume the data is not important to you.
Comment: @HaukeLaging There's a difference between important (I must not lose this) and important (nobody else must know this).  It's a valid assumption that some people have data which would not be a catastrophic loss, but might be catastrophic if inadvertantly disclosed.
Answer: Yes, there is a way. The LUKS cryptsetup utility contains the reencrypt command that you can also use to encrypt your existing unencrypted root partition, i.e. without destroying the existing filesystem.
That said, before performing such a conversion you should still backup your data. Of course, one should always perform backups on a regular schedule, because of possible hardware failure etc. Thus, this is kind of redundant advice.
Switching an existing root filesystem from unencrypted to encrypted requires quite a few steps:

backup
make sure that the cryptsetup package is installed
make sure that your root filesystem has some free space (at least 100 MiB to be on the safe side)
identify the partition your root partition is located on: e.g. with df /, lookup the UUID of the filesystem with blkid and store it somewhere
boot into a rescue system where you can unmount your root filesystem (e.g. boot from an USB stick which contains - say - Grml)
locate your root partition (e.g. with blkid and look for the UUID)
if it's ext4 execute a filesystem check: e2fsck -f /dev/sdXY
shrink the filesystem to make some room for the LUKS header, e.g. if it's an ext4 filesystem: resize2fs /dev/sdXY $smallersizeinGiB_G (you need to shrink it by at least 32 MiB)
encrypt it: cryptsetup reencrypt --encrypt /dev/sdXY --reduce-device-size 32M
open it: cryptsetup open /dev/sdXY root
enlarge the filesystem to the maximum: resize2fs /dev/mapper/root
mount it to - say - /mnt/root
mount the boot filesystem on /mnt/root and bind-mount pseudo filesystems /dev, /sys, /proc under /mnt/root.
chroot into your system by: chroot /mnt/root /bin/bash
update kernel parameters in /etc/default/grub or some equivalent location, e.g. when your distro uses dracut (which is likely) you need to add rd.luks.uuid=$UUID_OF_LUKS_DEVICE (cf. blkid, note that this UUID is different from the root filesystem one), if you have selinux installed you should add enforcing=0 (and later remove it) because of all the edits
if your distribution has selinux enabled, configure a relabeling: touch /mnt/root/.autorelabel
regenerate grub config: grub2-mkconfig -o /boot/.../grub...cfg
regenerate initramfs (to make sure that cryptsetup support is included): dracut -f /boot/initramfs....img kernelversion
exit the chroot
unmount everything
cryptsetup close root
reboot

As you see these are many steps, i.e. there is some potential to introduce errors. Thus, arguably it might be simpler to just reinstall and restore your backup (e.g. config files and $HOME).
Also, in my experience as of 2020, cryptsetup reencrypt is relatively slow, thus it may be faster to just cryptsetup luksFormat the device and restore a backup.
If you have an XFS filesystem, you can't just shrink it, because XFS doesn't support this, as of 2020. Thus, you would need to fstransform it before being able to shrink it. With a transformed filesystem you have another uuid to take care of. That means either change the UUID of the new filessytem to the UUID of the old one. Or update the UUID of the filesystem in /mnt/root/etc/fstab.
With a dracut based distribution you don't need to create a /etc/crypttab, other distribution might require it (also before the initramfs update, because it might need to be included there).
Comment: @jonfornari something like `mount -o /dev/mapper/root /mnt/root` - i.e. unlocked luks devices appear under `/dev/mapper`. For the bind mounts something like https://gist.github.com/gsauthof/7c0b65ffe4da38b83c8c61d79b71c6d7
Comment: Hi, sorry to bother you. What do you mean on the steps 12 and 13? I'm following your tutorial/steps and got stuck at this part, since i'm not being able to mount or figure it out the right commands to do them.
Comment: Should i just do a ""mount /dev/sdXY /mnt/root"" ? this one command says it can recognize a luks filesystem. Also, how do I mount everything of step 13 (mount the boot on /mnt/root) and the bind-mount pseudos under /mnt/root (Thanks in advance and sorry again to bother you)
Comment: Note if you want to see how large your volume is, open parted with `parted /dev/sdXY`, then `unit MiB`, then `print`. You can subtract 64 from number and use that are your argument to resize2fs. For example if parted listed 243685MiB, then subtracting 64 you'd run `resize2fs /dev/sdXY 243621M`.
Comment: From https://www.pcsuggest.com/dracut-linux-ubuntu/:

> Dracut is a complete initramfs infrastructure with many capibilities. Dracut is already used by Fedora, Redhat and CentOS and openSUSE, but not in Debian or Ubuntu.
Answer: From the LUKS faq https://gitlab.com/cryptsetup/cryptsetup/wikis/FrequentlyAskedQuestions#2-setup

2.5 Can I encrypt an already existing, non-empty partition to use LUKS?
There is no converter, and it is not really needed. The way to do
  this is to make a backup of the device in question, securely wipe the
  device (as LUKS device initialization does not clear away old data),
  do a luksFormat, optionally overwrite the encrypted device, create a
  new filesystem and restore your backup on the now encrypted device.
  Also refer to sections "Security Aspects" and "Backup and Data
  Recovery".
For backup, plain GNU tar works well and backs up anything likely   to
  be in a filesystem.*

However you may want to look into https://johndoe31415.github.io/luksipc/usage.html#plain-to-luks-conversion "Plain to LUKS conversion" which could satisfy your requirement.  Disclaimer : I've never tried this, I don't know if it works, and the project doesn't appear to have been updated since 2015.
Comment: The luksipc author [nowadays recommends](https://github.com/johndoe31415/luksipc) the upstream cryptsetup reencrypt method. Note that as of 2020 the mentioned `cryptsetup-reencrypt` command is replaced by `cryptsetup reencrypt`.


How does one verify the density of states obtained using different smearing methods?

Question: When calculating PDOS for an atom in a system, the corresponding electron occupancy or other parameters like the highest band edge/dos value at Fermi level/band center is different when using different smearing methods. When there are no references for the material available how to confirm which smearing method is correct?
Comment: Usually I guess we refer to the basic theory of your system and see if it is matching the theoretical calculations. Here you can use TB method or Wannier orbitals
Answer: This paper "How to analyse a density of states" answers your question quite well I believe. Here's the "conclusion" of the paper.

The density of states reveals striking features of an electronic structure that are often overlooked. This mini-tutorial should serve as a guide for interpreting the DOS of a real material. Not only can important material parameters like band gap and DOS effective mass (which may be derived from Seebeck coefficient measurements) be seen from a DOS, but new, unusual phenomena such as reduced dimensionality and unconventional band shapes can be identified from the shape of a DOS. Such phenomena can also exist deeper in the band, revealing potentially novel behavior of complex materials.

Smearing methods in electronic structure calculations can obscure these essential features and instead introduce artefacts that can be misidentified. These shortcomings can be remedied simply by using the tetrahedron method when computing the DOS and looking for these essential features of a DOS when assessing convergence of the calculation.


why a Bezier curve is guaranteed to lie within the convex hull of its control points?

Question: why if Bernstein basis polynomials are non-negative ($ B_{k,n}(x) \geq 0 $) and also due to the Partition of Unity/sum up to one ($ \sum_{k=0}^n B_{k,n}(x) = 1, for\ all\ x \in [0,1] $) implies Bezier curve is guaranteed to lie within the convex hull of its control points $ CH=(\{p_{0},p_{1},p_{2},...,p_{n}\})$
Answer: Here are the facts:

A convex combination of the points $p_{0},p_{1},p_{2},...,p_{n}$ is a point of the form
$
\sum_{k=0}^n \lambda_k p_k
$.
where $\lambda_k \ge 0$ and $\sum_{k=0}^n \lambda_k = 1$.
The convex hull of the points $p_{0},p_{1},p_{2},...,p_{n}$ is the set of all convex combination of $p_{0},p_{1},p_{2},...,p_{n}$.
A point on a Bézier curve is a convex combination of its control points and so is in their convex hull.


treasure house ? treasure house city?

Question: What is a "treasure house" what is a "treasure house city"?
especially in this case: "One by one, the other great Muslim treasure-house  cities were annihilated "
Muslim treasure-house city?
Answer: A treasure house, according to Merriam Webster is following: (I believe the second definition defines treasure house city and requires no further specification)

a building where treasure is kept :  treasury
a place or source (as a collection) where many things of value can be found
Answer: The quote, "One by one, the other great Muslim treasure-house cities were annihilated" comes from the British (BBC) 2012 television program titled, 'Andrew Marr's History of the World'.  A bit more context from the script of the program:

Bukhara, like Merv, Baghdad, and Samarkand, was where the rich, optimistic heart of the Islamic world could be found. But Bukhara had never experienced anything like the Mongols. The combination of Chinese technology and Genghis Khan's disciplined, fearsome army of nomad horsemen produced a new kind of army, a new kind of threat. The siege of Bukhara raged for 15 days, until the city was finally scorched into submission. When Genghis went into Bukhara, his army showed no mercy. And Genghis himself was honoured, as always, with the first pick of the captured women.
Bukhara was only the start. One by one, the other great Muslim treasure-house cities were annihilated. By 1223, Genghis Khan's destruction of the Muslim empire in Central Asia was complete. Within 20 years, the Mongol empire stretched from Beijing in the East right through the land of the Rus', into eastern Europe, almost to the gates of Vienna. Genghis Khan's belief in strength through unity had resulted in the largest land empire in history.

See: http://www.springfieldspringfield.co.uk/view_episode_scripts.php?tv-show=andrew-marrs-history-of-the-world-2012&episode=s01e04
Andrew Marr is, I suggest, simply suggesting that the Muslim cities were wealthy, and rich pickings for the Mongol armies.  There was, again I'd suggest,  no reason to consider some Muslim cities  as 'treasure-house cities', and others as 'normal' cities.  Marr's script quickly moves on from the subject of the conquest of the Muslim territories and enters into speculation about Genghis Khan's other legacy.

In his homeland today, the great warrior Emperor is revered as a national hero and immortalised by this 40m-high steel monument.
But it seems as if Genghis Khan, a man of many concubines and conquests, may have achieved immortality of a different kind. In 2003, scientists discovered a specific genetic marker in men in Europe and Asia, which originated a little less than 1,000 years ago, in an area suspiciously close to that of the Mongol Empire. And they concluded that probably 16 million men alive today really did spring from the loins of Genghis Khan.

So given the shallow treatment of the subject I think it is pretty clear that Marr was simply indulging in some poetic word imagery, which was essentially meaningless.

treasure house ? treasure house city?


Oil level increase and in few days drops to nothing

Question: I have an 01  mustang gt . Two days ago I checked the oil level in the dipstick when my car was warm and it was way above the maximum level . I parked it and checked it again today the oil level was below the minimum with no mejor clicking noise in the engine . What is going one with my car ? Do I have a bad oil pump ? Or is it because of the oil sending unit?
Comment: Was the engine running/not during one or the other of these checks? You said it was warm one day, and then nothing about temp the next. What's the story?
Comment: Well .the first day when I checked the engine was warm . But the second check when it was below the minimum level  was not running and cold. And I've just checked it few minutes ago when the engine off was below the minimum so I turned the ignition on and checked again ,the oil  was above the maximum level .
Answer: Many dip sticks will have lines on one side for cold and the other for hot, and occasionally both will be on the same side. If the different marks are not available, refer to owners' manual for the temperature being indicated.
Regardless, check your oil with the engine off. When the engine is running, oil fills galleys, pumps, etc. and is moving around in the sump. This can lead to all sorts of anomalous readings.
The differing temperatures will have a bearing on your readings, but more than anything it's that you're checking with the engine in various states of non/operation.
If you have too little oil in the engine, this can obviously lead to oil starvation, etc. If you have too much, you can create an entirely different set of issues: shearing, windage, high oil pressure (which can burst lines and fittings), etc. Refer to your manual for proper lubrication in terms of the type/weight of oil, intervals, procedures, etc.
Answer: A few points worth mentioning when checking oil level:

Never rely on the first reading, especially when the engine has just been run
Always take out the dipstick and wipe it clean with a rag before reinserting the dipstick to check the level.
Never take readings with the engine running
The dipstick level markings are supposed to be used with the engine off.
Some engines need to be warmed up, others left cold
The owner's manual will usually clarify under which conditions the reading should be taken.


How to format characters in a custom eclipse editor plugin

Question: I'm writing a custom editor plugin in Eclipse and I'm trying to figure out how to format certain character sequences with symbols. So in the editor view typing <code>-></code> would be replaced with →. I don't want to modify the underlying document content, just how the characters are displayed. The TextAttribute class only allows me to change the style of the text, not what is actually displayed.
Answer: You would probably have to copy all of the Eclipse classes having to do with the editor into your own project so you could modify the method(s) that displays characters on the screen.


Simulate clicking "Ok" or "Cancel" in a confirmation window using enzyme

Question: How do you simulate clicking on Ok or Cancel in a window.confirm using jest and enzyme?
Comment: Can you return true/false on the mockup? Those are the returns for a confirm dialog
Comment: **[This might help](https://stackoverflow.com/a/38348235/6099347)**
Comment: @AniketSahrawat I don't use `sinon`, only `enzyme`, but thanks for the link.
Comment: @SterlingArcher yes, so I ended up doing the on in the answer. Thank you.
Answer: I'd advise against changing window.confirm, because this change "leaks" (i.e. it affects other tests). Instead, use jest's spyOn function to mock and restore window.confirm before and after the test:
let confirmSpy;
beforeAll(() => {
    confirmSpy = jest.spyOn(window, 'confirm');
    confirmSpy.mockImplementation(jest.fn(() => true));
});
afterAll(() => confirmSpy.mockRestore());

Answer: Before the test, use jest.fn to mock window.confirm.
// with jest.fn, you can pass a function as the mock's implementation
// so pass something that returns `true` for yes, or `false` for no.
window.confirm = jest.fn(() => true) // always click 'yes'

// run your test code here

expect(window.confirm).toBeCalled() // or whatever assertions you want

I use this trick all the time to mock out console.log to make sure errors/status is logged properly in certain conditions.
Comment: Yeah this is what I ended up doing anyway as I could not find any way to click on the confirm dialogue. Thanks.


Why would you use Bitwise operators?

Question: So I'm currently in the process of learning C++ via the book 'SAMS teach yourself C++ in 1 hour a day'. So far it's been great - I've understood everything that's said and I have managed to use all of them in simple programs to practice them.
However I just got to the section on the Bitwise operators and I am completely stumped. I understand that you have &, ~, |, <<, >> etc, and I understand that each one performs a different action upon a number in its binary form, for ~ flips the numbers over.
The problem I have is that I just can't get my head around how and why you'd want to use them. It's all very well me being to take an int, flip the binary digits over and have another number, but how exactly does this help me in any way shape or form? I'd appreciate an explanation as to why you'd use each one, and if possible maybe an example?
Thanks everyone!
Answer: There are a lot of applications, but here are two examples. Suppose you have eight one-bit values stored in a one-byte container. Bitwise-and with a power of two will access individual bits easily.
If you're scanning for high intensity pixels in an RGB image, you can use bitwise-and with 128 against the three color values; that's a faster operation than another Boolean expression like R>128.

Why would you use Bitwise operators?


What is the most efficient way to debug CANbus from a PC?

Question: I have several working and inter-operable boards using CANbus. I've shipped hundreds of products using these boards, with no problems. One of my customers is now saying that his fault log shows regular communication losses, indicating that messages are not being received for several seconds. I need to analyze what's happening on the CAN bus to diagnose this problem. What is the most effective way of doing so? I see many CAN/USB dongles, but it's difficult to tell what's useful and what's not without spending a couple thousand dollars buying every one of them.
Comment: I assume they have isolated it to your product and have detailed every device on the bus? Then I would ask if they can capture the last message on the bus before the pause with a logic analyser and captures of the wave forms in the last message on a digital scope. I have returned devices to engineers where they had "adjusted" the spi bus wait times. It's not quite the same but you get the idea.
Comment: I should clarify, the CANbus is internal to our product, and only runs between two of our boards.
Comment: I hope I'm not trying to teach you to suck eggs but from my experience of customers, engineers of all sorts and production manufacturing the first suspect is the physical connections between the boards ( cable assemblies breaking down, interference, bad solder joints etc...) It's amazing how people jump to the wrong conclusions. Then check with known working devices. If it now works the last changes made to the product need looking at. Of course this "feature" might exist in all products and is only now being reported...
Comment: We had this customer's exact unit in our facility, abused it horribly, and couldn't reproduce the problem. We built him a brand new unit, and it's having the same problem. Other customers don't report this problem. Tried multiple cable assemblies, built by different people. Not that I don't appreciate the debugging help!
Comment: The delay in the messages suggests that the start of a packet was detected but not completed and the packet time out reset the receiver state. Considering this with the other comment suggests the issue is site specific which indicates the most obvious reason to be EMI as Mr EMI's answer explains. The error logs should give an indication of it's frequency (10's or thousands of errors a day indicate how susceptible the comms is), grouped failures in certain time periods (Interfering devices being turned on / off etc) could help track it down.
Comment: Considered EMI. One of our abuse tests is to turn a hi-pot tester up to 3000VAC and shock the hell out of the chassis. (While saying "You have paid the price for your lack of vision!!") Not a single error. I don't know how to generate more EMI abuse than that, but that's probably more a comment on my lack of knowledge than anything.
Answer: I had a CAN Translator from DakotaSoft, which worked for a long time, then stopped entirely. Not sure why, could have taken a fall or a voltage hit. Excellent support, they sent me a replacement, which worked fine. I was pleased with the software, which did exactly what I'd expect from a product like this.
I got a CAN BUS Analyzer from Microchip, which hasn't worked at all; at best, it sees some garbled messages in one particular mode. The software responds poorly, and Microchip's tech support is difficult to reach and often takes a long time to respond.
Others include:

http://www.can232.com/?page_id=16
http://gridconnect.com/can-usb.html
http://www.esd-electronics-usa.com/CAN-CANopen-J1939-USB-2.0-CAN-USB-2.html
http://sine.ni.com/nips/cds/view/p/lang/en/nid/203382
http://www.kvaser.com/en/products/can/usb.html
http://www.phytec.com/products/industrial-network-solutions/can-adapters/can-usb-pcan-adapter/
http://www.systec-electronic.com/en/products/industrial-communication/interfaces-and-gateways/can-usb-adapter-usb-canmodul1
http://www.ixxat.com/usb-to-can-compact-interface_en.html
http://www.ifak-system.com/en/communication-automation/mobile-parametration/products/iscan-usb/
http://www.kanda.com/products/Lawicel/CANUSB.html
Answer: I bought a Chinese unknown dongle. I mainly use it for automotive applications, and it works pretty well. The only drawback is the software, but it came with source code and binaries for different environments so I'm trying to write something more suitable for my purposes.
Comment: If you post the link to your "chinese unknown" dongle which came with source code, that will make you answer a lot more useful.
Comment: Sure, http://www.ebay.com/itm/USB-CAN-USB-to-CAN-bus-Converter-Adapter-For-professional-/321133103506?pt=LH_DefaultDomain_0&hash=item4ac5064992 there are other similar versions.
Answer: You can use HUD ECU Hacker which also has a built-in CAN Bus Analyzer / CAN Bus Debugger / CAN Bus Terminal. In Sniff Mode you see all CAN Bus traffic in real time and can write it to a logfile. You can also set filters to see only the packets which you are interested in. HUD ECU Hacker can also decode ISO 15765 packets.
In the CAN Raw Terminal you can send commands to any device on the CAN bus and see the response.
HUD ECU Hacker is charityware, which means you can use it for free, but if you like the program you should give a donation to an NGO of your choice.
In contrast to other CAN Bus Analyzer software you don't need to buy an expensive proprietary CAN Bus adapter. HUD ECU Hacker works with a cheap chinese J2534 clone (approx $40 US). You can use the same adapter also to scan your car or motorbike with HUD ECU Hacker in case of a defect.


final concentration

Question: Cheers. I am doing a hands on lab for intro to Chemistry. I basically have to do something seemingly simple. I pour 8.0 grams sugar, weighed, into a volumetric flask that is volume of 25mL. I add 15mL of water in then shake it up. I then pour 10 more mL. They want me to weigh the volumetric flask empty without the stopper. I then add the 8.0 g sugar and then the distilled water. After weighing the full flask, I have to determine the initial and final concentration. I have been looking up this formula but I see three different units are being used. This is not in molars. I assume I did the total volume right, which was 25 mL, I assume I did the concentration right, as I basically divided 8.0g by 25mL, then multiplied by 100%, which gave me 32. I am flabbergasted ont his initial and final concentration though. Any feedback on this? I'd appreciate it.
Comment: Your procedure as you state it here is different from what you describe in our comments to the answer by LigninPauling, where you say after mixing sugar with 15 mL of water, you filled up the solution to 25 mL with a transfer pipette. So in the end, you have 8.0 g sugar in 25 mL of solution (not 25 mL of water).
Comment: You said you measured the mass of the empty flask and the full flask. What were the values?
Comment: Water is about 1.0 g/ml. 50.4 - 22.5 - 8.9 = 19.0 Thus you could only added about 19.0 ml of water into the 25 ml volumetric flask, not 25.0 ml.
Comment: empty it weighed 22.5 g. sugar was 8.9 g. full with the sugar and remaining water up to the 25mL, the flask weighed 50.4g.
Comment: @Karsten Theis: According to OP's answer to your comments, OP has 8.9 g sugar in 25 mL of solution or 35.6% ($w/v$) concentration (not 32% as OP calculated).
Answer: Let's try and break this down.
We will assume that the mass of sugar was exactly 8.0 grams and that the volume of water was exactly 25.0 mL. Weighing the flask before and after the addition of the water would infact give you the volume of water added. 1 mL of water has a mass of 1 g and so the mass of the flask should have increased by 25 g.
For the concentration, it is unclear from your question what units were requested. If it is percent by mass then 32% sugar looks reasonable.
If it is requested in mass units per volume then perhaps g/L will suffice. You can calculate this for yourself quite easily.
Lastly, if molarity is required for your answer, this is slightly more involved. 'Common table sugar' (presumably what was used in this practical) is sucrose and a quick search will reveal its molar mass to be 342.3 g/mol. Therefore 25 g of sucrose equates to 0.0730 mol. Using this, the molar concentration may be worked out, taking care to note the units of molarity.
Comment: Yes my bad. Basically, it was just a 25mL volumetric flask, I shook the distilled water and sugar til it fully mixed and then after entering the volume before and after adding the solution mix(8.0 g sugar and 25mL water) the final question is to give the initial concentration and the final concentration. The initial has a % sign next to it g/mL. The final has a percent sign next to it as well. I'm assuming later I will learn why they ask for an initial and final concentration but for now I guess idk why they would want the same thing written twice.
Comment: In your question you mentioned adding 15 mL first and then afterwards adding another 10 mL. Was this included in the lab instructions? If so then perhaps the first could be the initial concentration they are asking for?
Comment: They said 15mL because it would be easier to stir the solution before adding the other 10mL. I also thought that same thing but, the result was filling the 25mL flask with the 8.0g of sugar and then using the pipet to fill up to the 25mL mark after mixing the solution better.
Answer: Since it is a lab for intro to Chemistry, this may directing to find basic knowledge of density and/or concentration, % concentration, etc. However, what puzzled me was the asking of intial concentration and final concentration. After reading all of comments and OP's answers, I thought this (see below) may be the question:
Weigh empty 25-mL volumetric flask first without the stopper. Then weigh $\pu{8.0 g}$ sugar and pour into the volumetric flask. Then, add $\pu{15 mL}$ of water to it and shake it up. Then, pour more water to the $\pu{25.0 mL}$ mark. Weigh the full flask again without the stopper. Determine the initial (after addition of $\pu{15 mL}$ of water) and final concentration (after addition of water to the $\pu{15 mL}$ mark).
Comment: that is exactly right. Also, after I weigh everything, I pour the solution 0 into a 100mL empty beaker, then take my pippete serological and I take 2.5mL and put it into the emptied and cleaned volumetric flask, and then add 15 more mL of distilled water and re-weigh everything and then repeat the steps again with different denominations of distilled water. Then after, I make a graph and show the x and y axis for the mass and volume.

final concentration


How can the Gallilean transformations form a group?

Question: In class my professor said the Galilean transformations form a group of order 10.
$$
x'=x-vt\\
y'=y\\
z'=z\\
t'=t\\
$$
But how do these form a group? I don't see 10 things to interpret as elements. I also don't see what the group operation would be. What are the elements of the Galilean group and what is its operation?
Comment: Sets of transformations (if inversible) *always* form a group - they are the most canonical example of a group. Every group may be naturally interpreted as a set of transformations. In your 1-dimensional example, the transformations are labeled by 1 parameter $v$. The whole Galileo-group is 10-dimensional - you incorrectly reproduced what's the role of 10, it surely has more than 10 (infinitely many) elements. It's 10 dimensions parameterized as 3 components of $v$, 3 components of rotation $\Omega$, 3 components of translation in $\Delta x$ and 1 $\Delta t$.
Comment: The whole transformation identified by these 10 numbers - how much you shift the velocity, how much you rotate around which axis, and how much you move in space and time - is an element of the group. The composition of the transformations is the group operation. You just transform the spacetime twice and you get another transformation that may be identified as one of those I have already described, and parameterized by those 10 numbers. There is also the identity element - transformation that keeps $t,x,y,z$ fixed - and inverse transformations.
Comment: @LubošMotl that should probably be an answer
Comment: @LubošMotl Minor comment re. "sets of transformations (if inversible) *always* form a group," just for OP for avoid confusion (this is not directed towards you -- I know you know this even better than I): strictly speaking the set of transformations must include the identity transformation (which you refer to in comment 2), and must close under composition of transformations (if composition is chosen as the binary group operation), so it's not quite *always* the case that an arbitrarily chosen set of transformations forms a group.
Comment: This question shows no research effort, the [Galilean group](http://en.wikipedia.org/wiki/Galilean_transformation#Galilean_group) is easily found on Wikipedia and elsewhere.
Answer: It is slightly incorrect for your professor to state that the Galilean transformations form a group that is a Lie group of order 10. A group's order is the number of its elements. For example, a group of order 10 is a finite group. There are are two, and only two, possible groups with 10 elements.  It is correct, however, to say that Galilean transformation form a group of dimension 10. The order of the Galilean group is uncountably infinite. This is because there are an uncountable infinte number of elements in the group.
I'm not sure how much continuous group theory (Lie group theory) you have done, but what Lie group of dimension 10 means roughly is that any transformation "near enough" to the identity can be specified by exactly 10 independent parameters. In this answer, these 10 independent parameters are represented by  $\theta\,\gamma_x$, $\theta\,\gamma_y$,  $\theta\,\gamma_z$, $v_x$, $v_y$, $v_z$, $ X$, $Y$, $Z$, and $\tau$.
The easiest way to concretely represent the Galilean group is with a set of $5\times 5$ matrices as the group elements, with  matrix multiplication as the group operation. The group's elements act on $5\times 1$ column vectors called the homogeneous co-ordinates. The homogeneous co-ordinates are of the form:
$$\left(\begin{array}{c}x\\y\\z\\t\\1\end{array}\right)\tag{1}$$
where $x,\,y,\,z,\,t$ are the three spatial co-ordinates and one time co-ordinate of a point in one co-ordinate system. With the use of a Galilean transformation, this point is transformed to three spatial co-ordinates and one time co-ordinate in another inertial frame. The transform is done by one of the group elements.
We now sequentially consider three kinds of group elements. These group elements are Galilean translations, which we denote by $T$;  Galilean boosts, which we denote by $B$; and Galilean rotations, which we denote by $R$.
The translations are transformations between two frames that are not in relative motion and not rotated with respect to each other. The translations are represented by $5\times 5$ matrices of the following form:
$$T(X,\,Y,\,Z,\,\tau) = \left(\begin{array}{ccccc}1&0&0&0&X\\0&1&0&0&Y\\0&0&1&0&Z\\0&0&0&1&\tau\\0&0&0&0&1\end{array}\right)\tag{2}.$$
Please note these group elements are translations   in space as well as time. Try multiplying a column vector of the form (1) on the left by one of the matrices in (2). You will find that it represents a translation in space and time as the values in (1) transform by $x\mapsto x+X,\,y\mapsto y+Y,\,z\mapsto z+Z,\,t\mapsto t+\tau$.
The boosts are transformations between two frames that are in relative motion, but are not rotated with respect to each other. The boosts are represented by $5\times 5$ matrices of the following form:
$$B(v_x,\,v_y,\,v_z) = \left(\begin{array}{ccccc}1&0&0&v_x&0\\0&1&0&v_y&0\\0&0&1&v_z&0\\0&0&0&1&0\\0&0&0&0&1\end{array}\right)\tag{3}.$$
The rotations are transformations between two frames that are not in relative motion but that are rotated with respect to each other. The rotations are represented by $5\times 5$ matrices of the following form:
$$R(\theta\,\gamma_x,\,\theta\,\gamma_y,\,\theta\,\gamma_z) = \left(\begin{array}{c|c}\exp\left(\theta\left(\begin{array}{ccc}0&-\gamma_z&\gamma_y\\\gamma_z&0&-\gamma_x\\-\gamma_y&\gamma_x&0\end{array}\right)\right)&\mathbf{0}_{3\times2}\\\hline\mathbf{0}_{2\times3}&\mathrm{id}_2\end{array}\right)\tag{4}.$$
In (4),  $\mathrm{id}_2$ is the $2\times 2$ identity matrix, $\mathbf{0}_{3\times2}$ three rows of two columns of noughts and $\mathbf{0}_{2\times3}$ two rows of three columns of noughts. Equation (4) represents a rotation of angle $\theta$ about an axis with direction cosines $\gamma_x,\,\gamma_y,\,\gamma_z$. Please note that though there are four symbols that are used for a rotation element, there are only three parameters. These parameters are $\theta\,\gamma_x$, $\theta\,\gamma_y$, and $\theta\,\gamma_z$.
Any Galilean transformation can be composed by a product of the form $T(X,\,Y,\,Z,\,\tau)\,B(v_x,\,v_y,\,v_z)\,R(\theta\,\gamma_x,\,\theta\,\gamma_y,\,\theta\,\gamma_z)$. Please note that there are precisely ten independent real parameters needed to specify the transformation: three parameters for Galilean rotations (i.e., $\theta\,\gamma_x$, $\theta\,\gamma_y$, and$\theta\,\gamma_z$); three parameters for Galilean boosts (i.e., $v_x$, $v_y$, $v_z$); and four parameters for Galilean translations (i.e., $ X$, $Y$, $Z$, $\tau$).
Comment: I've heard them called "Galilean boosts" before.


Is the drafter of a contract that knowingly incorporated the terms of the offer in an inconsistent manner liable for damages?

Question: A party accepts an offer-to-lease (OTL) with negotiated specific terms for a commercial lease to startup its business. It included a 4-year rent abatement through a sub-lease back to the landlord.
Landlord incorporates terms inconsistently into the Lease in spite of a term of the OTL and disregards other party's legal counsel's feedback. Both sign. Can the other party sue the Landlord for inducement/fraudulent misrepresentation or otherwise for damages through loss of rent abatement?
Comment: Wouldn't the "other party's legal counsel" have the responsibility to detect the inconsistency and advise the client NOT to sign until the draft was amended? The whole point of having a written agreement with an "integration clause" is to avoid second-guessing later on.
Answer: The tenant is almost certainly bound by the document signed
If you sign something the law can (will) presume that you read, understood and agreed to it. During negotiations the parties will take and express many different positions and put forward and receive, verbally and in writing, many offers and counter offers. Consequently, what is legally accepted as definitive of the agreement is the document(s) that were signed or, if nothing was signed, the last document(s) exchanged.
The parole evidence rule prevents a party from even introducing evidence of the negotiations if the signed contract is complete enough to form a whole contract. Extrinsic evidence can only be used where the contract is silent or ambiguous on a matter, where the contract addresses it and is sufficiently clear, it is definitive.
One exception is where the party signed the document believing that it was something else, for example (and I've seen this happen) the parties read through the contract together and agreed that it reflected the agreement, one party copied it and (deliberately or accidentally) substituted different pages in the photocopy, both parties then signed the doctored contract: such a contract would be void for fraud.


How do I prevent my SQL statements from SQL injection when using CLR/C++ with multiple variables?

Question: I am having a major problem where I do not know how to prevent SQL injection when writing SQL statements in CLR/C++
Below is the code
String^ sqlstr = "SELECT * FROM ";
sqlstr += tableName + " WHERE " + field + " = " + fieldEntity;

I need to be able to input correct SQL Injection preventions to this statement.
Background code
class database
{
protected:
    string fieldEntity;
    string tableName;
    string field;
...
____
OleDbDataReader^ openData(String^ fieldEntity, String^ field, String^ tableName)
    {

        String^ sqlstr = "SELECT * FROM ";
        sqlstr += tableName + " WHERE " + field + " = " + fieldEntity;
...
___
OleDbDataReader^ reader2 = testData.openData(effectID, "effectID", "effectOnUser");
    while (reader2->Read())
    {
        Object^ dHealthptr = reader2["effectOnHealth"];
        Object^ dTirednessptr = reader2["effectOnTiredness"];
        Object^ dHappinessptr = reader2["effectOnHappiness"];
...

Comment: Parameterized queries.
Comment: could I have a quick example of how this would apply to my code using clr/c++
Comment: Something like: `"SELECT * FROM :table WHERE :field = :fieldEntity"` and binding value
Comment: @Jarod42, One can't use parameters for a table name or column name. Parameters can be used only in place of a single constant value — not an identifier, SQL keyword, expression, list of values, etc.
Comment: @L.A Is this question really about "SQLCLR" (i.e. creating stored procedures / functions / etc using .NET instead of T-SQL), or about CLR / .NET code that executes T-SQL?
Answer: There are two ways to prevent SQL Injection and the environment of SQLCLR does not change this:

The preferred mechanism is by using parameterized queries. Different languages and libraries go about this in different ways, but at the very least you should be able to use prepared statements. Please note that this does not apply to scenarios that could not accept a variable, such as with tableName and field in your code.
Please see:

Issuing a Parameterized Query
Using Stored Procedures

Sanitize the inputs:

Bare minimum, and by far the most common, requirement is to escape single quotes by doubling them (i.e. ' becomes '')
Additionally (below is a quote from a related answer of mine on DBA.StackExchange):

There is a lesser known type of attack in which the attacker tries to fill up the input field with apostrophes such that a string inside of the Stored Procedure that would be used to construct the Dynamic SQL but which is declared too small can't fit everything and pushes out the ending apostrophe and somehow ends up with the correct number of apostrophes so as to no longer be "escaped" within the string. This is called SQL Truncation and was talked about in an MSDN magazine article titled "New SQL Truncation Attacks And How To Avoid Them", by Bala Neerumalla, but the article is no longer online. The issue containing this article — the November, 2006 edition of MSDN Magazine — is only available as a Windows Help file (in .chm format). If you download it, it might not open due to default security settings. If this happens, then right-click on the MSDNMagazineNovember2006en-us.chm file and select "Properties". In one of those tabs there will be an option for "Trust this type of file" (or something like that) which needs to be checked / enabled. Click the "OK" button and then try opening the .chm file again.

So, be sure to properly size the string input parameters. You don't need VARCHAR(500) for a column that is declared as VARCHAR(25). Please see my answer on DBA.StackExchange for more details and examples:
Why does SQL Injection not happen on this query inside a stored procedure?
Answer: For tableName and field variables, those are being used as SQL identifiers in your query. You can't use either common method of query parameters or escaping. You just have to make sure to whitelist the values for those variables. In other words, check them against known identifiers of tables and columns in your database.
For the other variable fieldEntity, I suppose this should be used like a constant value in your SQL query. You can protect this from SQL injection by using a query parameter.
I don't know CLR, but there are lots of examples of using SQL query parameters in C++ or C#.

https://owasp.org/www-project-cheat-sheets/cheatsheets/SQL_Injection_Prevention_Cheat_Sheet.html


Landing Satellite via Hohmann Transfer

Question: I'm working on a project that is dealing with calculating the orbital motion of satellites around some given body and one thing I was wanting to try and study was the path that a satellite would take to land on the body it was orbiting. I'm wondering if it's possible to use the concept of Hohmann transfers to calculate the trajectory of the satellite as it lands. Do you all think that this would be an acceptable way to approach this problem or is there a more efficient way to do this? Thanks for any help.
Comment: It'd be helpful if you described your scenario in more detail. Does the planet the sat is landing on have an atmosphere? What is the altitude of the sat's starting orbit?
Answer:
I'm wondering if it's possible to use the concept of Hohmann transfers to calculate the trajectory of the satellite as it lands. Do you all think that this would be an acceptable way to approach this problem or is there a more efficient way to do this?

The answer is "no", and it has nothing to do with efficiency.
For simplicity, let's assume the target body is spherical. A Hohmann transfer to the surface of that body would result in an orbit just above the surface of the body. That orbital rate is inevitably going to differ markedly from the velocity at which a point on the surface of the target body is moving. You don't want to be orbiting the body centimeters above the surface. You want to be landing on the body, and that means making your velocity equal to the body's rotational velocity rather than that orbital velocity.
Comment: You can't treat landing as an impulsive process. If the target body doesn't have an atmosphere, instead think of it as the reverse of a launch. Things get dicier if the target body does have an atmosphere.
Comment: Thanks for your reply. What if when I fire my rocket the second time, instead of firing it so that my velocity matches a circular orbit velocity I fire it in such a way that my velocity matches the body's rotational velocity. That should be a lower value than the circular orbit velocity which should allow me to actually land on the body. Is this a possible solution or am I grasping at straws with the whole thing?
Comment: If aerobraking is part of the part of the EDL you'd want a small flight path angle as you hit the atmosphere. To get a low flight path angle you'd want a perigee near earth's surface.
Answer: To minimize gravity drag you want to minimize fighting gravity. I basically means that you want to transfer to an orbit just above the surface. Depending on you initial trajectory this might be a Hohmann transfer, or maybe a bi-elliptical transfer.
After this you would want to perform a constant altitude landing. I am not sure if this is the correct technical term, since I have only heard this being by Kerbal Space Program players, when I into this myself. This was also being discussed in this forum thread.
The amount of fuel/change in velocity this would require would depend on your (initial) thrust to weight ratio (TWR) and engine efficiency (since less efficient engine would burn more mass, making it lighter, thus its TWR will increase faster assuming a constant exerted force). For this I also assume that the rate at which the pitch/direction of the thrust vector of the satellite has to changes would not be a problem. So the thrust should be angled in such a way that all vertical "force" add to zero (using a rotating reference frame, thus also include the centripetal force). So the angle of the thrust with the vertical, $\theta$, can be calculated as follows,
$$
\frac{F}{m}\sin{\theta}=\frac{\mu}{r^2}-\frac{v^2}{r},
$$
where $F$ is the thrust, $m$ the mass, $v$ the orbital velocity (so not necessarily relative to the surface) and $r$ the radius of the trajectory of the satellite relative to the center of the celestial body, and $\mu$ the gravitational parameter of the celestial body. So when solving for $\theta$ yields,
$$
\theta=\sin^{-1}\left(\frac{m}{F}\left(\frac{\mu}{r^2}-\frac{v^2}{r}\right)\right),
$$
however $m$ and $v$ are time dependent, so a differential equation will have to be solved. Namely by using the rate at which fuel is burned,
$$
\dot{m} = \frac{F}{v_e},
$$
where $v_e$ is the effective exhaust velocity. And horizontal component of the thrust,
$$
\dot{v} = \frac{F}{m}\cos{\theta}.
$$
I do not believe this differential equation can be solved analytically, so numerical methods will have to be used.
How I currently formulated these equations would assume that you are landing along the equator of the celestial body, either against or with its rotation, since you would have to use a stopping criteria for $v$ when your relative velocity with respect to the surface is zero. I also assumed that there are no peaks and valleys in the terrain (the celestial body is completely in hydrostatic equilibrium). If there would be then you either would have to end up exactly on top of a peak, or drop down a bit into a valley and perform an additional burn to slow down from that.
Answer: Just to add some $\Delta v$ preliminary estimation in the case of a landing performed with a "Hohmann-like" 2-impulses manoeuvre.
Let's assume we start from a 100 km parking orbit and we want to land on the Moon (assumed as perfectly spherical).
$\Delta v_{tot} = \Delta v_{1} + \Delta v_{2}$
$\Delta v_{1} = \sqrt{\dfrac{\mu}{r_{park}}} - \sqrt{2 \mu \biggl( \dfrac{1}{r_{park}} - \dfrac{1}{r_{park}+r_{moon}} \biggr)} = 22.99 \ m/s $
$\Delta v_{2} =  \sqrt{2 \mu \biggl( \dfrac{1}{r_{moon}} - \dfrac{1}{r_{park}+r_{moon}} \biggr)} = 1702.40 \ m/s$
$\Delta v_{tot} = 1725.39 \ m/s$

The issues related to this manoeuvre are:

too tight trajectory
not vertical touchdown (the $\Delta v$ will not be directed in the vertical direction)

A better approach would be:

impulsive de-orbiting burn on an intermediate transfer orbit
coasting phase (ballistic)
powered descent phase

Landing Satellite via Hohmann Transfer


Why isn't the constellation of that month's zodiac prominent or even visible during that month?

Question: For instance, the month of October is called the month of Leo, but you will mainly see Aries, Taurus and the Southern skies during October, Leo isn't very prominent. So how is the zodiac decided?
Answer: The Zodiac sign of a month is decided by the month when the Sun is "in" that sign from the point of view of Earth.
(See Mike G's comment below - because of the precession of the Earth, Zodiac signs are now 30 degrees "off" from their original markings/associations with the months of the year.)
I believe that August is actually the month of the Leo, not October - more specifically, July 23 to August 23. (see here for more date info) If you look at the diagram, you'll see that the Sun is right in front of Leo from the point of view of Earth during the month of most of August, and thus we call that the month of the Leo. Some more examples - during October, the month of Libra, the Sun is directly in front of Libra, and during March, the month of Pisces, the Sun is directly in front of Pisces.
Comment: The signs are currently ~30° west of their namesake constellations due to ~2000 years of precession of the equinoxes.
Comment: @MikeG Ah, you're right - thank you for mentioning that, I'll point that out in my answer :).


Sorted vs Sorted out

Question: I'm an American and I refer to a situation which is settled as "sorted out."  My English family would just say that it's "sorted".  Which is the earlier expression?  Did Americans add the preposition or did the English drop it?
Answer: Sorted has a few specific meanings in British English that are extrapolations from the usual meaning of 'sort out', ie to put things in order. They are slang expressions and 'sort out' would still be preferable in formal or written English, although not for all the slang meanings below.
The slang meanings of 'sorted' are described by the Oxford Living Dictionaries:

sorted (adjective, British informal)

organized, arranged, or dealt with satisfactorily. 'And your social commitments?' 'They're well sorted' | he's working on that old car he's been trying to get sorted
(of a person) confident, organized, and emotionally well balanced. after a while, you realize they're not as sorted as they seem | a pretty sorted kind of bloke
(of a person) prepared for or provided with something (especially illegal drugs)

@Henry mentioned the more menacing usage above, described by Oxford Living Dictionaries:

sort someone out (informal) Deal with a troublesome person, typically by reprimanding or punishing them: 'if he can't pay you, I'll sort him out'
Comment: The question is "Which is the earlier expression?"
Comment: As a BrE speaker who grew up in the 1950s & 60s I have known 'sorted out' all my life but only heard 'sorted' from the 1980s onward, and then as part of youth culture with some drug connotations. It may have been around earlier in London or Merseyside but as an uncool provincial it was new to me. I believe that 'sorted out' is still more common in the UK particularly in serious conversation as in 'I'll sort out your hotel reservation', 'Tony will sort out your computer' or even 'If you're not careful son someone's going to come and sort you out!', the last of which could be a serious threat.
Comment: I said that the slang meanings are extrapolations from the usual meaning of sort out.
Comment: @Mari-LouA - thanks for pointing out. The last editor changed the sources.
Answer: Well, when I've spent time in England I frequently heard the term "sort you out" as meaning "get you what you need."

Person 1: "I need two tickets to the Man-United / Liverpool match tonight."
Person 2: "Well, just see me mate Archie then. He'll sort you out."
Comment: In this sense it is more "deal with the problem", either in your positive sense, or more negatively in something like "If he's been bothering her, I'll sort him out" which would probably involve (threats of) violence.

Sorted vs Sorted out


Black holes and time relation

Question: Why Is it said that if someone is being sucked inside a black hole then he/she may see that time is running slowly?
Comment: It isn't said. Perception of time would not change.
Comment: Say the incredible Hulk hurl Superman into Sagittarius A* at center of Milky Way. Hulk:"flying man not moving!" Superman:"ah...!"
Comment: 100 years later. Hulk:"flying man still not moving, Hulk going home!" 100 years went by for Hulk but only minutes for superman, no worry this guy always made a comeback I hope!
Answer: General relativity can be used to discuss, theoretically, what happens to objects as they approach the event horizon of a black hole; it all has to do with your point of view. Outside viewers, those not affected by the gravity of the black hole, would view an object approach the event horizon slowly and pretty much never enter past the horizon. For the observers point of view time stops for the object. From the point of view of the object, its own time runs as normal, and it is the time outside of the event horizon that runs faster than normal. For more general information at a really easy to follow format you might check out What is Relativity by Jeffery Bennett.

Black holes and time relation


Do single-party binding pledges exist in common-law jurisdictions?

Question: I have recently been asked to make a pledge to take actions in the future and I would like to have a legally binding and enforceable document to bind me to this pledge. Is there a means under U.S. common law to make a legal document that is binding upon a single party, but is enforceable?
Answer: You cannot be legally obligated to perform an act (or refrain from performing), unless required by law, or as part of a contract (the "common law" approach). One of the fundamental elements of a contract is that there must be consideration, an "exchange of promises". You can be held to do something, if someone gives you something of objective value in exchange. Otherwise, you don't have a contract, just a promise, which is not enforceable.
Answer: The law does not recognize a contract with yourself.
The simple way out of this is to enter a contract with someone else. In general, a contract requires valuable consideration on both sides: you are providing a promise, they are providing? How about they will give you $1 when you do the thing - this is valuable consideration and would create a legally enforceable contract. You can also enter into a deed with someone which only requires consideration on one side but deeds are more complex than contracts and have some additional formalities that can be easily stuffed up. The dollar contract is the way to go. You can even gift your friend the dollar without affecting the contract.
This contract will be enforceable: it doesn't mean it will be enforced. If you fail to honour your pledge you have broken the contract, however, there are no legal consequences unless you friend sues you - this may not be something that the are actually willing to do.
Answer: In some states of the United States, documents under seal are still recognized. Documents under seal do not require consideration. But relying on the distinction between a document under seal and a regular contract is so rare that I doubt anyone could say if it would ever be enforced in practice.
Answer: It depends upon the context and the reason, and it also begs the question of who would enforce it.
Some of the most common kinds of unilateral legal structures are single owner entities, declarations establishing condominiums and other covenant controlled communities, conservation easements, and trusts. Sometimes, the idea is that you establish legal rights with the idea that those rights will someday be enforced either by a transferee of an interest you create, or by a third-party fiduciary or protector whom you appoint irrevocably to enforce the terms of the legal arrangement. The fact that you have been asked to make a pledge certainly suggests that there might really be a counter-party even if you don't perceive it that way.
Certainly, not all binding arrangements require mutual consideration. For example, guarantees of other people's obligations rarely do, and neither do trusts.


How to disable SSL/TLS compression in Apache 2.2.16?

Question: I have one sever running on Apache 2.2.16. I run the VA scanner on the server. According to the VA report it is recommended that SSL/TLS compression should be off.
I tried to search google, but didnt find any helpful. Can anybody tell me how to set it off in Apache 2.2.16 without upgrading the version.
Comment: It's off by default unless you enable SSL and install the appropriate certs.
Comment: SSL is enabled, but now i want to disable the compression.How to do it???
Answer: Sometimes, even with the latest version of Apache, if the current openssl library is not enough recent,  the server returns the following error:
Invalid command 'SSLCompression', perhaps misspelled or defined by a module not included in the server configuration.

In this case you can disable the compression exporting the following variable before start Apache httpd server:
export OPENSSL_NO_DEFAULT_ZLIB=1

I have found the suggestion here:
Answer: You'll have to upgrade to at least version 2.2.24 to be able to do this.
From version 2.2.24 and up you can disallow SSL compression on the server level or for individual vhosts with the following directive:
SSLCompression off

So for a single vhost you can disallow it like this:
<VirtualHost *:443>
    ServerName      "my.example.com"
    DocumentRoot    "/var/www/html"

    SSLEngine on
    SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP

    SSLCompression off  # disallow for this vhost

    SSLCertificateFile      /etc/ssl/my.example.com.crt
    SSLCertificateKeyFile   /etc/ssl/my.example.com.key
</VirtualHost>

Reference: http://httpd.apache.org/docs/2.2/mod/mod_ssl.html
Answer: I don't have enough points to upvote or comment on other replies, so I'll chime in here.
As Mathias states, you need at least 2.2.24 to disable compression.
SSLCompression off

Just be aware, it DOES NOT work inside a virtualhost directive in 2.2.25, as my server just spat out:
This version of openssl does not support configuring compression within <VirtualHost> sections.

However, it works perfectly fine in the main httpd.conf file for server-wide effect.


Why does DSS have such formulas?

Question: I've learnt the formulas needed for the DSA (http://en.wikipedia.org/wiki/Digital_Signature_Algorithm).

But most importantly, I don't quite understand what represents those formulas and why they are the way they are. For example, why if v = r then the signature is verified, why do r and s have such formulas etc.? RSA digital signature is so much simpler.
Answer: The fundamental difference between RSA-groups and prime order groups is that in RSA groups the multiplicative order of the group is unknown (without knowledge of the factorization). This allows much easier constructions for unforgeable signatures (although hashing and padding are required to ensure existential unforgeability).
With knowledge of the group order, a forger has more possibilities to calculate "useful" group elements. This results in the DSA formulas (and the related ElGamals signatures) to be more complex.
Let's have a look at what these formulas actually calculate, and for simplification I'll leave out all the modulo operations (they are applied in the correct way). The goal is to get expressions which only depend on the hash $H$, the signing key $x$, and the (random) blinding value $k$.
The signature is:
$$r=g^k$$
$$s=k^{-1}(H+xr) = k^{-1}(H+xg^k)$$
Let's look at the verification algorithm backwards:
$$v=g^{u_1}y^{u_2} = g^{Hs^{-1}}g^{x \cdot r s^{-1}}$$
$$=g^{s^{-1} (H+xr)}$$
Here is the interresting part: A valid signature will solve like this:
$$= g^{(k^{-1}(H+xg^k))^{-1} (H+xg^k)}= g^k = r$$
For a forger, this is differently: He can choose $r$ and $s$ arbitrarily, but he does not know $x$ but only $y=g^x$. To forge a valid signature, it has to fulfill this equation:
$$g^{s^{-1}H}y^{s^{-1}r} = r$$
However, we can not solve this equation without calculating some discrete logarithms.
Comment: Probably a stupid question, but I presume 'prim order' was supposed to be 'prime order'? I know its only one letter, but if I'm wrong I'll set off to read about Prim Order groups (Seems a believable concept hence me asking)
Comment: In this context I'm sure that it is *prime order* (and in particular I think the point he wants to make is that we have *known order*), since then later in the sentence the part "multiplicative order of the group is unknown" follows.
Comment: you're right, I missed a character there. I corrected it.
Answer: In a sense, you are correct in not understanding where the equations in DSA and ElGamal signatures come from. To a certain extent, they are just (distinct) choices from a family of equations that all seem to work, and all for the same-ish reasons. See e.g. Meta-ElGamal signature schemes by Patrick Horster, Holger Petersen, Markus Michels, http://dl.acm.org/citation.cfm?doid=191177.191197
But briefly, these schemes are secure because a signature is a solution to a very non-linear equation. If you know the secret key, it is very easy to find solutions. If you don't know the secret key, it seems to be hard.
For pedagogical reasons, I prefer Schnorr signatures. The story begins with identification protocols, specifically the identification protocol you get from the Schnorr proof of knowledge. Then you make the identification protocol non-interactive using the Fiat-Shamir heuristic. Then you make some changes to the verification equation, which are ok under the Fiat-Shamir heuristic. Finally, since you are already hashing stuff, you include the message into the hash. And you are done, you have designed the Schnorr signature scheme.
Comment: Nice answer! I also think that this is a nice way of approaching this matter: proof of knowledge -> non-interactive honest-verifier proof via Fiat Shamir heuristic + message as additional input into the hash function = signature (of knowledge) in the ROM. And in the simplest case for proof of knowledge of discrete logarithm we obtain Schnorr signatures.

Why does DSS have such formulas?


How to get lighting like this in a photo?

Question: I absolutely love the dark, natural colors. Does anyone know what lighting works best, and how to get pictures to look like this?
Comment: @Calyth Or another window further away on the other side of the room.
Comment: I'm going to guess at least 2 light source.

The pot reflection, and the rim of the bowls and jar suggests a large window light.

The bowl suggests a second light off camera
Comment: The lighting itself is fairly pedestrian in this shot. The secret is in the exposure and in the color adjustments in post-processing.
Comment: Based on reflections and specular highlights, I would guess daylight through sheer curtains/drapes of some sort. Hard to say what time of day, though, and there's not enough detail in the out-of-focus reflections to see anything more regarding the light source...
Comment: Shoot with the white balance set to tungsten and using a daylight balanced source.
Comment: * how to get pictures to look like this?* The trick is to develop an eye for these things when you see them.  Many (most) do not notice ordinary things in favorable lighting that make good photos.  As it was put by the character Sherlock Holmes "You see do but do not observe.".
Answer: As previously mentioned, the exposure and postproduction are key in creating this look, but you have to start with lighting that contributes to the end goal.
Since many different combinations of light sources could help achieve this look, I'll point out some of the lighting techniques present in this image that you can try to emulate using whatever you have.
Lighting direction
The main light is relatively small and hard (not diffuse), casting somewhat well-defined shadows of the two bowls in the foreground. It's coming from a high position behind the subject and out of frame to camera left.
Hard light from behind reveals texture and shine, which is why it's often seen in food photography. Light from behind can also imply a sense of space beyond the frame, lending the image an environmental quality that further immerses the viewer in the setting.
There is also fill lighting originating behind the camera, illuminating the shadows to establish the desired ratio of highlight to shadow. The reflections of the fill light source in the pot reveal its origin and  relative size. It looks large, like a window. A large source produces soft-edged shadows and gradual transitions from highlight to shadow, as you can see on the towel. The fill exposure is kept low to avoid competing with the main, but there's enough to reveal detail in the shadows.
Mixing both hard and soft light also contributes to the image's natural look and feel.
Lighting ratio
The brightness value of the shadows compared to that of the highlights needs to be managed. Shadows that are too close to the highlight value de-emphasize contours that give objects shape, and make the lighting look flat (which is good for newspaper reproduction, for example, which introduces a lot of contrast in the printing process, so there is sometimes a reason to do it). Shadows that are too dark create too much contrast and hide shadow detail. The lighting ratio along with exposure have a huge effect on the mood that a photograph conveys. Be aware of it and experiment.
Chiaroscuro
Chiaroscuro is a lighting technique derived from paintings, that reveals form through the interplay of light and shadow. The dark surroundings in the background and at the edges of the frame contribute to a vignette effect that brings attention to the brighter table and the objects atop it. Within the central region, an even brighter spot next to the peppers highlights the point of focus, drawing the eye to the smaller chiaroscuro effect within the larger one.
Materials
The objects on the table are moderately to highly reflective, creating pops of highlights throughout the center of the frame that contrast with the darker tones. If everything was made of plastic, the image would have a very different feel.
Exposure
The dark exposure creates a somber mood that also helps bring attention to the highlighted areas, and leaves room tonally for your postproduction antics. Managing your ratio helps you achieve the low key look while preserving detail in the shadows.
"Lighting like this" is the result of several decisions that each complement the overall concept. These days a lot of the "magic" is done in postproduction, but starting with solid lighting that's as close to the end result as possible will save you a ton of work and give your images a richer, more organic feel.


Spatial coordinates (latitude and longitude) are non significant

Question: I want to use latitude and longitude as a feature for models like SVM or Logistic Regression (both for classification). What is the most common approach to use latitude and longitude values as features? I have tried to use decimal representation, I've also tried to scale it (for SVM) and the results were the same as without the latitude/longitude. These features are supposed to be significant in the performance of the model (according to my specific dataset of course).
Answer: I think representation of the data is less of a problem here. Although coordinate data are frequently used as predictors, the problem with those data is that they are autocorrelated eg Why does including latitude and longitude in a GAM account for spatial autocorrelation?
So the tricky part is correctly modeling this variance structure, a construct of which can then be used as a predictor. One possibility is Moran Eigenvector Maps (MEM). On a separate point, depending on your dataset size (if it is not extremely large), Random Forests may be a more powerful technique than SVM.