Minecraft: Allocating Ram

Question: I can't allocate more than Xms1G into Minecraft. I've looked at every tutorial and still, I can not allocate more. I have 8gb of ram and a 64-bit operating system. How can I allocate more? I've tried putting Xmx-4G but it crashes and says something about my Java Virtual Machine.
Comment: This isn't a bad question, but one thing you could add is what you have tried so the answers are not repetitive.
Comment: Edit to my question (commenting so you don't miss it): You also need to have "Advanced options" active in the "Launch options" menu.
Comment: And a second edit: You have to click on the three lines at the top right to get to the four tabs. Sorry, I forgot that was necessary, because it's always expanded for me when I start the launcher (because I did it before).
Answer: In the launcher, there are four tabs at the top. The right one has profiles, there you can select the profile you want to change. It should have a text box labeled "Java arguments" or similar. There you can enter it, save and (back on the first tab) play with that profile.
The tutorials you saw probably were for the old launcher, there the procedure was a bit different.
Next time you're asking a question on Stack Exchange, please give more details to why your attempted solution didn't work. Now I had to guess.
Keep in mind that setting the allocated RAM higher usually makes the game lag less, but at some point it can create lag spikes every few seconds. Try experimenting with different values between 1GB and your maximum if you experience that.
And finally: I think the Java argument for overall RAM allocation is Xmx, but I'm not sure.
Edit: First you have to activate "Advanced settings" in the "launch options" menu (before selecting the profile).
Edit 2: To even get the four tabs, you have to click on the three lines in the top right.
Answer: This works for me:

Open your minecraft launcher
Go to launch options
Make a new profile
click on java executable (little switch)
Click on JVM arguments
Write -Xmx4G

Thanks :)

Minecraft: Allocating Ram


Rhythmbox missing japanese/chinese/korean characters in the song titles

Question: I've got in the database several japanese/chinese/korean song that are shown with "random" characters (I think I should install a language package... but I don't know which one).
Comment: You should split this up into 3 questions, you'll be more likely to get answers that way.
Comment: I thought It was more clear in this manner, but if I should split the questions, I'll do.. :)
Comment: I'm splitting questions how suggested
Answer: If I understand the question correctly, you have correct representation of Japanese, Chinese, and Korean characters in your song database, but these are not being rendered appropriately in the display.  In this case, the most likely cause is missing font support.  To install the preferred fonts for these environments, install the following packages:

language-support-fonts-ko (Korean)
language-support-fonts-ja (Japanese)
language-support-fonts-zh-hans (Simplified Chinese)
language-support-fonts-zh-hant (Traditional Chinese)

If you happen to be running Ubuntu 8.04, the name of the packages for the Chinese fonts is different (I can't seem to find it just now).  These packages do not appear to be available for oneiric: I believe this functionality is being integrated with the language-support tool, and do not know precisely how it will be represented when 11.10 is released.
Comment: In that case, the issue isn't about fonts, but that the character isn't represented correctly in the tag.  You will need to convert the strings from the current representation to UTF-8, if sufficient information remains in the original files to do so.  You could try with iconv(1), for example `iconv -f SJIS-WIN textfile` to convert older Japanese files on Windows.  Unfortunately, this is more complicated when dealing with media metadata, as the tag informaiton is not a text file.  You may be able to extract the tags, but the process of extraction may corrupt the strings.  Best of luck.
Comment: I've installed the language support....... but files still shown with messed character... maybe is a problem within rythmbox or the tag of files itself..
Comment: Ok, I'll try with iconv :)
Answer: I got this problem too.
I usually use EasyTAG to fix my mp3 file info. But some of my korean songs were shown with "random" characters. I try to fix it several times in EasyTAG, but it didn't work (copy paste from google's results).
Finally, I have fixed this. You can directly change it from Rhythmbox.
Right click the song > Properties.
You can edit the field like title, artist, and more. Of Course with compatible encoding. And it works.


How can we edit a Program Stage Instance that is not marked as completed but DHIS2 doesn't allow to edit it?

Question: While being superuser of my DHIS2 Instance, sometimes my users (or even myself) try to edit a Program Stage Instance that is not marked as completed but the editing of the elements seems disabled (even after checking that the status is not completed).
Clearing browser cache and/or refreshing the page does not help.
Sometimes, it becomes available to be edited by itself the next day.
Answer: It would be great if you could add DHIS2 version and build date. The below answer is general, as there are slight variations in the different versions of DHIS2.
There are three main reasons why a program stage instance(event) is  locked:

The event was completed, and the program stage is configured to lock data entry after completion.
The program stage uses a period(monthly for example), and the month of the event is expired.
The event belongs to another organisation unit than the one the user currently reports for. If you are working on developing and testing a program this is often the reason why you would not be able to edit events, and do not have functionality to incomplete them. Even as administrator(ALL) you will have to select the same organisation unit that the event was originally captured for before opening the tracked entity instance dashboard.
Comment: Thank you Markus!
In fact i'm using 2.28 build 20aad4a 2018-04-24 06:22
and as a super user and root user, i have access to incomplete that instance and so i did incomplete it but still can't edit it.
The program stage we are using does not use period. and the event belongs to an org unit that i am in (in addition to the fact that i am super user and have access to all rights and org units)
The challenge is even if the instance is not complete, i can not edit that instance.
Comment: is there any other reason which renders that instance not editable? maybe because another user is accessing that instance?
Answer: The problem was that we were trying to edit that program instance while not selecting the proper org unit on the left panel.
As soon as the proper org unit on the left panel is selected and the program instance selected and incompleted we were able to edit it.
Thank you for your help.
P.S: the solution came through the email thread but thought to mention it here.


Why did 47 cut the back of his head?

Question: After the first mission, we see 47 cutting the skin on the back of his head, where the barcode tattoo is. I assumed he was trying to remove the tattoo (which would be an incredibly smart move, adding +100% to his non-descriptiveness), but in later missions the tattoo appears visible, if obstructed by an adhesive bandage. Why, then, did he hurt himself?
Comment: +1 - I haven't yet finished the game so can't say for certain, but I wondered the same thing. He obviously wanted to revoke his association with his former employers, but for the rest of the game the tattoo is clearly still there.
Comment: If it was about blending in, it would be a lot easier to just buy a good quality wig.
Comment: For reference - what system are you playing on, what graphics level? I've skimmed through some gameplay on Youtube, and it seems to be covered up pretty well, like here: http://i.imgur.com/s3fm6DR.png Maybe on lower detail levels the bandage is just misaligned with barcode texture? As a software developer, I absolutely believe such a mishap could go unnoticed :-)
Comment: Okay, no, do not believe. http://i.imgur.com/CNQwXXZ.png Either this is intended by a game designer for some reason, or this is a catastrophic screw-up by QA department.
Answer: If you have not played the first couple missions until this happens, please do not read on. Otherwise hover over the grey box.

He has a tattoo which identifies him as number 47. Once he realizes what his organization is doing to the girl and that they are betraying their original principles. He is cutting out the tattoo to show that he is no longer part of it and gives up his old identity (the number 47). He goes rogue, might be what you would call it?

I assume that the game designers wanted to leave a visible hint about the tattoo, and where it was, since it is so iconic. He obviously did not just want to hurt himself. There is just a small part left over.
I guess we have to keep in mind that cutting out a 3cm x 5cm patch of your skin cannot be fixed by a simple patch. You would need quite an amount of stiches, and on the back of your head where the skin it not as flexible, this would be an issue. Cutting out only the major part of it would also be a compromise for reality sake.
Comment: That is of course, totally not true, since in the even later missions, the patch on the tattoo is smaller than before and reveal that 80% of that tattoo is still there. At least. So, apparently he only made a single cut over it. No idea why.
Comment: @Cael Just cutting of a small bit at the right place would make the barcode unreadable for a machine. That might have been the intention, but I can only guess.
Comment: Although I can't fund any justification for this in the Hitman game itself, for a random movie plotline I'd assume he dug out a tracking chip. It seems appropriate that his barcode would also be the place to house a tracking chip, but if that is the case, it would've been unmentioned as far as I can recall.

Why did 47 cut the back of his head?


How do I save a helicopter?

Question: I tried flying a Buzzard to the airfield as Trevor but I couldn't figure out how to save it there, and ended up accidentally deleting it. Any suggestions?
Answer: Helipads are used to store purchased or stolen helicopters. In order to save a vehicle to a helipad, it must be landed on the helipad and left there for a short period of time. After it's been landed, it will be saved to that character's helipad. Each of the three main characters will have their own library of helicopters.
Unfortunaltey, this seems to be pretty buggy though. The only time you will consistenly have choices of helicopters to choose from at your helipad is if you purchase new ones the option to "choose" at the helipad by pressing "right" on the d-pad will show up and you can choose between the ones you purchased and the ones you stole and parked there before.
By default, Trevor has a helipad at his Sandy Shores hangar. He also has the most expensive purchasable helicopter in the game saved to this helipad.
Both Michael and Franklin can purchase helipads at Vespucci for $419,850 each.
Comment: Because Trevor's helicopter is always there, and cannot be de-selected, I couldn't figure out how to add a second helicopter.
Comment: Once you purchase your first helicopter from the Internet on your phone the menu to choose other helicopters will show up. It will tell you to press right on the d-pad to choose.

How do I save a helicopter?


convergence of a recursive sequence and calculate the limit

Question:
how to show that the sequence $x_{n+1}=\frac{x_n}{2}+\frac{5}{x_n}$, $x_1=2$ is convergent.
  I tried to prove using induction that it is bounded but couldn't work it out.
  Only thing i could figure out is that the limit of sequence is $\sqrt{10}$ so it is convergent.
Comment: @Salahamam_Fatima: That is wrong.
Answer: By AM>=GM we have that
$$x_{n+1} \ge 2\sqrt{(x_n/2)\cdot(5/x_n)} = \sqrt{10}$$
Now the sequence is
$$x_{n+1} = f(x_n)\quad\text{where}\quad f(x) = \frac{x}{2} + \frac{5}{x}$$
For $x \ge \sqrt{10}$ we have that $$|f'(x)| = \left|\frac{x^2 - 10}{2x^2}\right| = \frac{x^2 - 10}{2x^2}  \lt \frac{1}{2}$$
Thus the sequence is convergent.
An alternative is to use the fact that $x_{n+1} \gt \sqrt{10}$ (for non constant $x_n$) to show that the sequence is monotonically decreasing (show that $x_{n+1} - x_n \lt 0$) and bounded.


How to solve $\left|\frac{1 + z}{1- i\overline z}\right| = 1$?

Question: I have a problem with what looks like a very easy equation to solve $\left|\frac{1 + z}{1- i\overline z}\right| = 1$ . ($z$ is a complex number, $\overline z$ is a conjugate of $z$) I got stuck at the point when after replacing  $\overline z = a-bi $ and  $z = a +bi$ and getting rid of absolute value I end up with $a^2 +a-b =0$. I have no idea how to follow this up or wether I should take totally different approach from the begining. I'd be very gratefull if someone could guide me into the right solution.
Answer: You want $|1+z|=|1-i\bar z|$. The left side here is the distance from $z$ to $-1$. The right side equals $|i+\bar z|$ which in turn equals $|-i+z|$, the distance from $z$ to $i$.  So $z$ satisfies your equation iff it is equidistant from $-1$ and $i$.  These $z$'s form a straight line in the complex plane, whose equation you can find by drawing a picture.
Answer: Something went wrong in your evaluation.
After the substitution $z=a+ib$, you should have
$$(1+a)^2+b^2=|1+a+ib|^2=|1-b-ia|^2=(1-b)^2+(-a)^2$$
that is, after a few simplifications, $a=-b$.
Answer: Since $|1+z|=|1-i\overline{z}|$ and $|w| = |\overline{w}|$, you can rewrite like this $$|z-(-1)|=|1+z|=|1-i\overline{z}| = |\overline{1-i\overline{z}}| =|1+iz| =|i||-i+z| = |z-i| $$
So $z$ is at equal distance from $-1$ and $i$. So $z$ is on perpendicular bisector of segment between $-1$ and $i$.
Answer: Let $z=x+yi$ and then from
$$ |1+z|=|1-i\bar{z}| $$
it is easy to obtain
$$ (x+1)^2+y^2=(-y+1)^2+x^2, $$
So
$$ x=-y $$
and hence $z=(1-i)x$.
Answer: Hint: Let $z=a+ib$, then $|\frac{1+z}{1-i\overline{z}}|=\frac{|1+z|}{|1-i\overline{z}|}=\frac{|(1+a)+ib|}{|(1-b)-ia|}=\frac{\sqrt{(1+a)^2+b^2}}{\sqrt{(1-b)^2+a^2}}=\frac{\sqrt{1+a^2+2a+b^2}}{\sqrt{1+b^2-2b+a^2}}=1$
Now this equality is true if and only if $a=-b$ which gives us that if $z=a+ib$ then $iz=ai-b=a-bi=\overline{z}$
Answer: Take this
$$|1+z|=|1-i\bar{z}|$$
then square this babies
$$(1+z)(1+\bar{z})=(1-i\bar{z})(1+iz)$$
$$1+z+\bar{z}+z\bar{z}=1-i\bar{z}+iz+z\bar{z} $$
so
$$ z+\bar{z}=i(z-\bar{z})$$
$$2Re(z)=i(i2Im(z)$$
therefore $$Re(z)=-Im(z)$$


A celestial topology?

Question: I recently asked for natural topologies on the set of lines in $\mathbb R^2$. Now I'm aiming for a similar question on the set $S_p$ of conic sections in $\mathbb R^2$ sharing the same focus $p$ (but not necessary having the same major axis). The situation is an idealization of the ecliptic plane and all stuff in the solar system. Are there natural topologies on this set?
Comment: Plane conics can be parametrized by $6$ parameters $[a: ... : f]$. So it is naturally homeomorphic to $\mathbb P^5$, the set of lines passing through the origin of $\mathbb R^6$.
Comment: Sorry I didn't read your message correctly, you didn't want all the conics.  But conics having a given focus is a subset of $\mathbb P^5$ so you can give the induced topology to these conics.
Comment: @N.H. I think I got the idea.
Comment: @N.H. Though an anomali compared with the case of lines, since that space was homeomorphic to a *punctured* projective plane.
Comment: Yes. The space of conics is also not exactly $\mathbb P^5$ since there are double lines, and even the equation $(ax + by + c)^2$ was considered as conics, even if its set of points is simply a line. So you have to remove an hypersurface for only keep the smooth conics (i.e without double lines or pairs of lines).
Comment: ( And this hypersurface is given by the equation $b^2 - 4ac = 0$ where the equation of this conic is $ax^2 + by^2 + cxy + dx + ey + f = 0$)
Comment: @N.H. Why don't write an answer?
Answer: Consider as "conics" the zero set of equation $ax^2 + by^2 + cxy + dx + ey + f = 0$.
Since $(a,b,c,d,e,f)$ and $(\lambda a, \lambda b, \lambda c, \lambda d, \lambda e, \lambda f)$ define the same equation for $\lambda \neq 0$, a conic define naturally a point in $\mathbb P^5$, the real projective space of dimension $5$.
Not every point in $\mathbb P ^5$ gives you a conic, so you have to remove the points $(a,b,c,d,e,f)$ where $abc = 0$, and where $b^2 - 4ac = 0$. The last case gives you degenerate conics (union of two lines, or even a single line). Since you are in real coordinate I guess you have to remove some other points (for example the "conic" $x^2 + y^2 + 1 = 0$ has no real point).
Finally, $\mathbb P ^5$ has a natural topology (the quotient topology), so for a given point $p$, the conics with focus $p$ form a variety in the space of conics and has therefore a natural topology.
Comment: I have my doubts about your conditions for excluding degenerate conics. See my answer for the condition I'd use. The term $b^2-4ac$ looks like the minor one would use to [classify](https://en.wikipedia.org/wiki/Matrix_representation_of_conic_sections#Classification) a conic as a parabola, except that you have the roles of $b$ and $c$ exchanged in your equation (and I followed that example to make comparing answers easier).
Answer: It depends a lot on what exactly you want to call a conic. My first impulse was along the same lines as what N.H. wrote in a comment (and later in an answer): six numbers to describe a conic, but scalar multiples describe the same conic, so this looks like $\mathbb P^5$. But then N.H. went on to exclude degenerate conics, while I'd take the opposite approach of actually including degenerate conics. So in a first approximation, I'd say a conic is defined as a set of points $\{p\in\mathbb P^2\;|\;p^TAp=0\}$, described by a symmetric matrix
$$A=\begin{pmatrix}a&c&d\\c&b&e\\d&e&f\end{pmatrix}$$
(Some of my coefficients differ from the N.H.'s formula by a factor of two, but that makes no difference for the topology.) The matrix must not be the zero matrix, but apart from that I'd include everything else: the case of $\det(A)=0$ where the conic degenerates to a pair of lines, and $\operatorname{rank}(A)=1$ where these lines coincide to form a double line, and also cases like the identity matrix where the only solutions have complex coordinates. But that's my personal view, and the choice here will have a huge impact on the resulting topology.
Actually, the scenario just described is just half the truth. Via projective duality, it makes equal sense to describe a conic not in terms of incident points, but in terms of tangent lines. You'd say a line $l$ is a tangent to a conic if it satisfies $l^TBl=0$. In the non-degenerate case, $B$ would simply be any multiple of the inverse of $A$. But in the degenerate case, that definition breaks down. Instead one requires $(A,B)$ to form a primal-dual pair, i.e. $A\cdot B=\lambda\mathbb 1$ for some $\lambda$ which may even be zero. If $A$ has rank two, then $B$ can still be computed as the adjoint of $A$. But if $A$ has rank one (a double line), then $B$ can no longer be derived from it, since any pair of (real, complex, distinct or coinciding) points on that double line can serve as the components which make up $B$. I honestly don't know how to express this space of all conics in terms of topology.
I do know however how to express foci. A point $p$ is a focus if both the lines connecting it to the ideal circle points $(1,\pm i,0)$ are tangents to the conic. Since for the sake of topology the actual location of the origin is irrelevant, I'd consider $p=(0,0,1)$. Joining that to the circle points you get
$$t_{1,2}=\begin{pmatrix}0\\0\\1\end{pmatrix}\times\begin{pmatrix}1\\\pm i\\0\end{pmatrix}=\begin{pmatrix}\mp i\\1\\0\end{pmatrix}$$
Now it is easier to look at the dual matrix. In order to avoid confusion, I'll use different letters for its entries.
$$B=\begin{pmatrix}
g & k & l \\
k & h & m \\
l & m & n
\end{pmatrix} \qquad
t_{1,2}^TBt_{1,2} =
(\mp i,1,0)\cdot
\begin{pmatrix}
g & k & l \\
k & h & m \\
l & m & n
\end{pmatrix}\cdot
\begin{pmatrix}\mp i\\1\\0\end{pmatrix}
=(h-g)\mp i(2k)
$$
So if the point $p$ should be a focus, then the two equations above have to be satisfied. If all your coefficients are real, that means you need $(h-g)=0$ and $k=0$ for the dual matrix. So in this view, you are essentially imposing a restriction to the intersection of two hyperplanes in this space of all conics.
It is possible to translate the conditions back into equivalent conditions for the primal matrix, at least for the non-degenerate case. If $B=\operatorname{adj}(A)$ then you have
$$
0=h-g=
\begin{vmatrix}a&d\\d&f\end{vmatrix}-
\begin{vmatrix}b&e\\e&f\end{vmatrix}=
(a-b)f-d^2+e^2
\qquad
0=k=
-\begin{vmatrix}c&e\\d&f\end{vmatrix}=
de-cf
$$
This looks more complicated, but since the space of dual conics should have the same topology as the space of primal conics (unless you include degenerate conics but consider degenerate conics with the same primal matrix to be the same no matter the dual), this should still essentially be a restriction to two subspaces as in the dual view, at least topologically speaking.
If you want to exclude degenerate conics, you could express that using either of the following inequalities:
$$0\neq\det(A)=abf+2cde-ae^2-bd^2-fc^2\\
0\neq\det(B)=ghn+2klm-gm^2-hl^2-nk^2$$
Last but not least, if you want to exclude conics with no real points on them, you'd look at the eigenvalues of the matrix. If two of the eigenvalues have one sign and a third eigenvalue has the opposite sign, then you have a real and non-degenerate conic. If all three signs are the same, you have a non-degenerate conic with no real solutions. If one or two eigenvalues are zero, then you have a degenerate conic. I don't know how to translate these eigenvalue considerations into topology.

A celestial topology?


My coolant has oil in it could this be the coil?

Question: I have oil in my coolant. I don't have coolant in the oil. I got told it will want flushing out and a new coil. I have a Vauxhall Astra 2006 1.6 engine
Answer: I'm assuming that by coil they meant the oil cooler. These seem to be a weak point in these cars (based on this thread on the Astra Owners' Club site). Some of the folks there are suggesting bypassing the oil cooler claiming that it is only needed when towing.


Can I just replace the heating coil in my dryer, or do I have to do the whole element?

Question: My dryer heating coil in my heating element broke in two. It seems like it'll be simple enough to just put a new coil in and be on my way. The part is available and this move would save me about $40. Which is good; I'm not exactly rolling in it right now. The thermal fuse is still good and everything else in the dryer has worked fine; are there any reasons I should spend the extra money and replace the whole thing, or is just swaping to a new coil sufficient?
Answer: Yes. The coil[s] can be replaced. I've done mine twice. Coil failure indicates inefficient venting, so it's worth looking at the the vents while doing the job.


GDisk Hex Codes

Question: During the use of gdisk, there an option to specify the hex code. I want to know what it is and why it's needed, see below. So for example, if I am creating a software RAID on my drive, I assume I need code fd00. But why? What is it, and do I have to use it? Why can I not create my raid array using 8300 (whatever that means)?
Command (? for help): n
Partition number (1-128, default 1):
First sector (34-5860533134, default = 2048) or {+-}size{KMGTP}:
Last sector (2048-5860533134, default = 5860533134) or {+-}size{KMGTP}:
Current type is 'Linux filesystem'
Hex code or GUID (L to show codes, Enter = 8300): L
0700 Microsoft basic data  0c01 Microsoft reserved    2700 Windows RE
4100 PowerPC PReP boot     4200 Windows LDM data      4201 Windows LDM metadata
7501 IBM GPFS              7f00 ChromeOS kernel       7f01 ChromeOS root
7f02 ChromeOS reserved     8200 Linux swap            8300 Linux filesystem
8301 Linux reserved        8302 Linux /home           8400 Intel Rapid Start
8e00 Linux LVM             a500 FreeBSD disklabel     a501 FreeBSD boot
a502 FreeBSD swap          a503 FreeBSD UFS           a504 FreeBSD ZFS
a505 FreeBSD Vinum/RAID    a580 Midnight BSD data     a581 Midnight BSD boot
a582 Midnight BSD swap     a583 Midnight BSD UFS      a584 Midnight BSD ZFS
a585 Midnight BSD Vinum    a800 Apple UFS             a901 NetBSD swap
a902 NetBSD FFS            a903 NetBSD LFS            a904 NetBSD concatenated
a905 NetBSD encrypted      a906 NetBSD RAID           ab00 Apple boot
af00 Apple HFS/HFS+        af01 Apple RAID            af02 Apple RAID offline
af03 Apple label           af04 AppleTV recovery      af05 Apple Core Storage
be00 Solaris boot          bf00 Solaris root          bf01 Solaris /usr & Mac Z
bf02 Solaris swap          bf03 Solaris backup        bf04 Solaris /var
bf05 Solaris /home         bf06 Solaris alternate se  bf07 Solaris Reserved 1
bf08 Solaris Reserved 2    bf09 Solaris Reserved 3    bf0a Solaris Reserved 4
bf0b Solaris Reserved 5    c001 HP-UX data            c002 HP-UX service
ea00 Freedesktop $BOOT     eb00 Haiku BFS             ed00 Sony system partitio
ef00 EFI System            ef01 MBR partition scheme  ef02 BIOS boot partition
Press the  key to see more codes:
fb00 VMWare VMFS           fb01 VMWare reserved       fc00 VMWare kcore crash p
fd00 Linux RAID

Answer: kyodake's answer is correct, but it's also rather MBR-centric. Under GPT, the same principles apply -- that is, a partition type code identifies the intended purpose of a partition. The difference is that GPT type codes are 128-bit GUIDs, vs. the 8-bit codes used under MBR. The nature of GUIDs means that it's not necessary to register codes with a central authority to avoid collisions; two GUIDs are statistically very unlikely to be identical by accident.
AFAIK, there is no official repository of GPT type codes, but they are documented on the Wikipedia page about GPT. One disadvantage of GPT type codes is that, as GUIDs, they're long and awkward -- for instance, 0FC63DAF-8483-4772-8E79-3D69D8477DE4 for Linux filesystem data, vs. 0x83 for the MBR equivalent. Thus, most tools for partitioning GPT disks use some form of "shorthand" or "natural-language translation" in their user interfaces. I'm the author of GPT fdisk, and as my goal in writing it was to create something that was as similar to (MBR) fdisk as possible, I took the approach of using MBR codes as a base; however, because the correspondence between GPT and MBR type codes isn't 1:1, I multiplied the MBR type codes by 0x100 to get the GPT equivalents. Thus, MBR's 0x83 became 8300. This also enables related follow-on codes that don't exist in MBR, such as 8301, 8302, etc. These codes are easy to use for people who are already familiar with the MBR equivalents, but they're admittedly arbitrary for people who don't know the MBR codes. Internally, GPT fdisk translates these codes to GUIDs. You can see the actual GUIDs by viewing detailed partition information (via the i option in gdisk, for instance). You can also enter an arbitrary GUID rather than use the GPT fdisk four-character codes, if you like or if you need to use a code that GPT fdisk doesn't support.
Other tools use other approaches. The libparted library (and thus parted, GParted, and other tools based upon libparted) translates some type codes to "flags" and completely hides other codes. This helps simplify things for some users, but it renders some tasks impossible -- for instance, you can't set an arbitrary type code with anything based on libparted. OS X's Disk Utility translates known GUIDs to plain-text descriptions. (IIRC, when you create a partition it sets an appropriate type code based on the filesystem created in a partition, similar to what GParted does.)
For the most part, Linux doesn't use type codes, for either MBR or GPT. That is, you can put your standard Linux filesystem on a (GPT fdisk) 8300 partition ("Linux filesystem"), or use 0700 ("Microsoft basic data", as was common in the past), or assign your own random GUID. Similar comments apply to RAID, LVM, swap, and other partition types. There are a few exceptions to this rule, though. For one, distribution installers often look at and set type codes, so you may need the right type code on a partition before it will be used properly. Another exception is that systemd is starting to make use of type codes as a fallback if /etc/fstab isn't properly configured. (That's where most of GPT fdisk's 830x codes originate -- they're part of the Discoverable Partitions Specification, which is a Freedesktop/systemd initiative.) Currently, Ubuntu is just using the main Linux filesystem type code (8300 in GPT fdisk) for filesystems, plus the appropriate codes for LVM, RAID, swap, etc. One big exception to the "Linux doesn't use type codes" rules is the BIOS Boot Partition code (21686148-6449-6E6F-744E-656564454649; ef02 in GPT fdisk or the bios_grub flag in libparted). This type code identifies a partition used by GRUB, and when you run grub-install, GRUB will install part of itself to that partition. If you install GRUB on a BIOS-booting system with a GPT disk, a BIOS Boot Partition must normally be present. (There are ways around this rule, though.) More importantly, if you mistakenly set this type code on the wrong partition, that partition will be damaged when you install GRUB! I've seen quite a few people make that mistake in various online forums.
Where type codes become more important is when dealing with other OSes. Windows and OS X, for instance, tend not to touch partitions with type codes they don't recognize. Their list of type codes excludes common Linux-specific type codes, so using a Linux-specific type code helps reduce the risk that Windows or OS X will trash your Ubuntu installation. These OSes don't care if you use the GPT fdisk 8300 or fd00 code, though. Problems can arise if you use codes that are recognized by these other OSes. For instance, at one time the Linux filesystem type GUID (0FC63DAF-8483-4772-8E79-3D69D8477DE4) did not exist. I created it and pushed it into both my own GPT fdisk and libparted because the common practice of using the "Microsoft Basic Data" type code (EBD0A0A2-B9E5-4433-87C0-68B6B72699C7) was causing problems in dual-boot setups. Specifically, certain Windows tools would think the Linux partition was a damaged or un-initialized Windows partition and offer to repair it. User error at this prompt would be disastrous. See this page of mine for more on this subject.
Comment: Great explanation. For anyone else looking for the mapping of GPT fdisk codes to GUIDs, it's [here](https://sourceforge.net/p/gptfdisk/code/ci/master/tree/parttypes.cc#l70).
Answer: Lists of assigned partition types to be used in the partition table were originally maintained by IBM and Microsoft internally.
When the market of PC operating systems and disk tools grew and liberated, other vendors had a need to assign special partition types to their products as well.
Several industry experts in the 1990s started to research partition types and published partition type lists in order to help document the industry de facto standard and thereby reduce the risk of further conflicts.
It is up to an operating system's boot loader and/or kernel how to interpret the value. So the table specifies which operating systems or disk-related products originally introduced an ID and what file system or special partition type they mapped it to.
Partition ID: 83h. Type: file system. Origin: GNU/Linux. Description: any
native Linux file system.
Partition ID: FDh. Origin: GNU/Linux. Supported: Linux. Description:    Linux RAID superblock with auto-detect.

GDisk Hex Codes


On the rotation of an object accelerated by gravity with a moving base

Question: How could you describe the rotation/falling of an irregular object whose base/rotational point is being moved with constant acceleration to the left? How much will the angle between itself and the base change over time? Try avoiding using the moment of inertia of it on equations, as I don't have that information.
If I know the pattern between the distances of N cylinders, could I get the moment of inertia? I tried to equalize two torque formulas (distance *F * sin(x) and I*a) but I could not get the moment of inertia as a function of position.
Comment: You can always estimate the mass moment of inertia of an object from the shape and material. In fact, it is _required_ to know this value for any dynamics type of problem that involves rotations.
Comment: Please show us some effort. Any sketches, free body diagrams, and attempts to the solution would be good. Otherwise, the question might be closed as _do my homework_ type.
Comment: Sorry about that... I added what I have assessed so far.
Comment: Thanks for clarifying a bit more, but this raises more questions. It appears you have multiple bodies interacting here and not a single body as portrayed in the title. The concept of MMOI is valid for a single body, so unless you are willing to _assume_ that all bodies move together as a single body, your problem is far more complex now. Anyway, yes you can synthesize MMOI of a complex arrangement of bodies using the [parallel axis theorem](https://en.wikipedia.org/wiki/Parallel_axis_theorem).
Comment: Is the contact free-to-slip, with-friction or is it stuck together but allowed to rotate?
Answer: This is a very complex problem to solve especially from someone with a cursory knowledge of dynamics professing from the get-go that no mention of mass moment of inertia is to be made when the very concept of MMOI is crucial in solving such problem.
So I am just going to describe the problem here in hopes of getting the ball rolling, without actually solving this problem. In dealing with dynamics, one must follow very specific steps.

Initial Conditions - describe all the important arrangements, dimensions, and assumptions when the system hasn't gone through any movement yet. Typically all allowed degrees of freedom have a zero value at initial conditions.

In this case, the bundle of pipes is assumed to be glued together, and act as a single rigid body. The combined center of mass of the body is offset by $b$ outside of the base end and at a height $h$ from the bottom. These values remain constant throughout time. If initially, the center of mass is on inside of the end of the base, then $b$ would be a negative value. Put an immovable coordinate system where the corner of the base is initially. Note also the contact point A and the center of mass C.
Kinematics - describe all degrees of freedom of the system and show them with positive displacements, and assume their values as well as the time derivatives of their values completely describe the positions and velocities of all the parts in the system.

In our case, the base displaces to the right by a prescribed amount $x = \tfrac{1}{2} a t^2$, the pipes all tilt together from horizontal by an angle $\theta$, and slide away from the contact point A by $s$. So the system has three degrees of freedom $x$, $\theta$ and $s$ that vary with time and have zero value initially.
Track centers of mass - The center of mass of the bundle C has location, velocity and acceleration described in terms of the degrees of freedom only

Positions
$$ \begin{aligned}
   x_C & = x - (b+s) \cos\theta  - h \sin \theta  \\
   y_C &= -(b+s) \sin \theta + h \cos \theta \\
 \end{aligned} \tag{1} $$
Velocities
$$ \begin{aligned}
    \dot{x}_C &= \dot{x} + \dot{\theta} (b+s) \sin \theta - (\dot{s}+h \dot{\theta}) \cos \theta \\
   \dot{y}_C & = -\dot{\theta}(b+s) \cos\theta - (\dot{s} + h \dot{\theta}) \sin \theta
\end{aligned} \tag{2}$$
Accelerations
$$ \begin{aligned} \ddot{x}_C & = \ddot{x} + ( \dot{\theta}^2 (b+s) - h \ddot{\theta}-\ddot{s}) \cos \theta + (\ddot{\theta}(b+s) +\dot{\theta} (h \dot{\theta}+2 \dot{s})) \sin \theta \\
 \ddot{y}_C & = ( \dot{\theta}^2 (b+s) -h \ddot{\theta}-\ddot{s}) \sin \theta - ( \ddot{\theta} ( b+s) + \dot{\theta} (h \dot{\theta} + 2 \dot{s})) \cos\theta) \end{aligned} \tag{3} $$

I am sure we have reached a level of complexity at this point far beyond of what you expected, and this is just the beginning.
Free Body Diagram - describe all forces acting on each body

In this case, there is the combined weight of $W$, the contact normal force $N$ and any friction present $F$.
Contact Conditions - describe how contacts behave. In this case, the contact at A is allowed to slip, which means $x$ and $s$ are independent of each other, but the frictional force is dependent on the normal force $$ F = \mu N \tag{4} $$
If the contact wasn't allowed to slip, then $F$ would be independent and $s$ would be always zero. At least until contact was lost when $N<0$. More about this situation later.
Balance of Forces and Torques - describe the equations of motion for each body. Net forces and torques about the center of mass describe the motion of the center of mass as well as the rotation. Use the free body diagram and trigonometry to build these equations taking care of leading signs as positive for counter-clockwise sense and negative otherwise.
$$ \begin{aligned}
  m \ddot{x}_C & = F \cos \theta - N \sin \theta \\
  m \ddot{y}_C & = N \cos \theta + F \sin \theta - W \\
  I_C \ddot{\theta} & = (b+s) N + h F
\end{aligned} \tag{5} $$
Here $m$ is the combined mass of the pipes and $I_C$ the combined mass moment of inertia expressed at the center of mass C. How $I$ can be computed for a composite system of bodies is subject to a different question in [Physics.SE] and out of context for this answer.
Solution - count all equations and unknowns to see if the system is solvable.  The goal is to get the acceleration of the degrees of freedom at each time frame and use a simulation solver to integrate over time.
Here there are 3 equations of motion and 1 contact condition equation. The unknown variables are the degrees of freedom (accelerations) $\ddot{s}$ and $\ddot{\theta}$ as well as the two contact forces $F$ and $N$. So four equations with four unknowns.
Special Cases - The solution is valid for as long the situation can be described by the aforementioned degrees of freedom. But consider the case where the pipes fly off the base and lose contact. Then the contact condition is no longer valid, and an additional degree of freedom $y$ is needed to describe the center of mass of the system.

This happens as soon as $N<0$. Then the problem transitions to a free body undergoing projectile motion and rotation under the influence of gravity.
Comment: I'd appreciate a comment on the downvote considering the amount of effort put forth in this answer.
Comment: I know I am not supposed to do this here but, as I can't upvote yet, *thank you!* You have helped me very much!


Was Voltaire's house being used by the biblical society?

Question: Is there any valid source for the claim that Voltaire' house has been used by the Bible Society? I heard this many times, but I've never read a valid source for it.
Answer: Apparently it is not true:

There is an apocryphal story that his home at Ferney was purchased by the Geneva Bible Society and used for printing Bibles, but this appears to be due to a misunderstanding of the 1849 annual report of the American Bible Society. Voltaire's chateau is now owned and administered by the French Ministry of Culture.

Source: Wikipedia
Comment: Dang, I thought it would be a day without wholly wikipedia sourced answers.  Oh well +1, fearless and inventive.
Comment: I've read that voltaire owne two houses. One in Geneva, one in France. The one in Geneva would be the one used by the Geneva Bible Society.
Comment: @PeterTurner: I did it from memory. :)
Comment: Some of the details may not be true, but there appears to a be a kernel of truth from which the story grew that you have not uncovered.
Comment: -1 That snippet of text is no longer in that Wikipedia article. CTRL+F it and see.
Answer: While the exact details may not match the most popular versions of this story - the house being used (ie on an on-going basis) by an actual Bible Society - there is evidence of a kernel of truth from which this story came.
This evidence is found in the wikipedia article on Voltaire's* home in Geneva from 1755 - 1760 "Les Délices" (See in particular the paragraph:"After Voltaire"), which cites an article in reference to the question, by Rev. W. Acworth (1836) from "The Missionary Register." (mouseover reference 6 - which contains a clickable link to the full article in GoogleBooks.)
The article verifies some of the details used to the 'refute' the original story (that this home was never used or owned by a Bible Society per se and is currently being used as a museum dedicated to Voltaire's life and works). This source asserts that the home WAS owned by the President of the Evangelical society of Geneva and used during this period as a repository for Bibles:

I went through Geneva, and was much refreshed by meeting the Committee of the Evangelical Society ... The room where Voltaire's plays were acted ... had been converted into a sort of Repository for Bibles and Religious Tracts. - Rev. W. Acworth (1836). "Bible Notices in Switzerland and Italy". The Missionary Register (London: L & G Seeley) 24: 352

*a nom-de-plume; real name: François-Marie Arouet
Comment: You've found a good source - great! You're yet to write a good answer with it however - less about your search and more about what the actual supporting evidence is (as well as exactly what it supports).
Comment: bruised reed TKU! Will do...
Comment: To be honest, I think there was still a little lacking in your answer after you'd tried editing it. I've taken the liberty of editing to include the relevant evidence (as in actually quoting it rather than just linking to it) and it's actual implications. If you think this editing is too extreme and you'd like to roll-back to your previous version (to either re-work or leave as it is) you can access a "Roll-back" option by clicking on the [edit history](http://christianity.stackexchange.com/posts/35558/revisions) to return it to it's previous version.
Answer: I don't think we can determine the truth about one of Voltaire's houses being used to print Bibles, only what sort of website considers it a fact. Here is a reference that quotes wiki and explains that there was a second house -- actually in Geneva. Feel free to believe or disbelieve this version, as you prefer, since this site doesn't have any references.

The Voltaire home that the 'Geneva Bible Society' purchased

was the house in 'Geneva, Switzerland;
NOT the one in Ferney, France.

In Geneva, he bought a large estate (Les Délices) and this is the one
  used to distribute Bibles.
It is not known if the Wikipedia statement is to "to deceive
  intentionally" or by ignorance. We would have to think they know the
  difference between the Homes in France and Switzerland.
FACT: The French Ministry of Culture operates the house in France!
FACT: The Geneva Bible Society operates the house in Geneva.

Update:
The following article, by a non-believer, is mentioned at the link above:
http://www.nzarh.org.nz/journal/2004v77n1aut.pdf
(see toc for article about Voltaire's house)
This appears to be somewhat carefully researched, although I didn't check his references. If it is correct, none of Voltaire's houses were used by Bible societies. The article suggests the story may have originated due to a hotel Gibbon, from which many Bibles were sold, being mentioned in a book in the same sentence as Voltaire.
Comment: The same report that lists two houses says that Voltaire was driven out of Geneva by the Christian reformer Jean Calvin. That would be quite a trick since Calvin died decades before Voltaire was born. It does not aide the Truth to pass on false stories to make a true point.
Comment: @ken, thanks for the comment. The error you mentioned was within brackets and a quoted section, anyway, but I did look at the pdf file listed next to it. From that, I conclude the main point was probably NOT true.
Answer: Apparently, the house in Geneva was used for storage and distribution of Bibles.  The house in Ferney, France was not used for storing or printing Bibles, but the presses of the nearby printers who printed his works while he lived there were used to print Bibles.  That functions just as well for irony and poetic justice.  Here are two links to articles that give the sources.  https://crossexamined.org/voltaires-prediction-home-and-the-bible-society-truth-or-myth-further-evidence-of-verification/  also see this: https://bellatorchristi.com/2019/03/18/voltaires-prediction-home-and-the-bible-society-truth-or-myth/
Comment: Welcome to Christianity SE. Please see the Tour and the Help (both bottom left, below) as to the purpose and functioning of the site. +1 for a good reference.
Answer: The oft-repeated story goes that within fifty years after his death, in an ironic twist of Providence, the very house in which Voltaire once lived and wrote was used by the Evangelical Society of Geneva as a storehouse for Bibles and Gospel tracts and the printing presses he used to print his irreverent works was used to print Bibles.
An article "VOLTAIRE'S PREDICTION, HOME, AND THE BIBLE SOCIETY: TRUTH OR MYTH? FURTHER EVIDENCE OF VERIFICATION" was posted at crossexamined on 18th August 2019.  It was largely a result of the research done by a Pastor Dr Daniel Merritt. I give a few extracts of this article:

In August 1836, only fifty-eight years after Voltaire's death, Rev. William Acworth of the British and Foreign Bible Society saw with his own eyes Voltaire's former residence in Geneva, Switzerland, Les Delices, being used as a "repository for Bibles and Religious tracts." The house at this time was occupied by Colonel Henri Tronchin (1794-1865), who served as the president of the Evangelical Society of Geneva from 1834-39. The Tronchin family had long had associations with Voltaire that could be traced back to the 18th century.  One of Henri Tronchin's ancestor's, Francis Tronchin, [had been] Voltaire's doctor. The Tronchin's were prominent and wealthy residents of Geneva and even helped finance Voltaire in the publishing of some of his works.[7]

While the Tronchin family [were] prominent and wealthy citizens of Geneva, they were not predominantly spiritual. However, though it is not known exactly when, Henri Tronchin came to faith in Christ and embraced Protestantism. .....

A superb organizer and a great leader, he helped found the Evangelical Society of Geneva (c1833). He served as president of the Society from 1834 to 1839. Born 100 years after Voltaire, and occupying the former home of the infamous infidel, Tronchin used the spacious house to store Bibles and Gospel tracts. Rev. William Acworth of Queens College, Cambridge, appointed an agent of the British and Foreign Bible Society in 1829, was an eye witness to the stored Bibles and Gospel tracts.[8]

In The Missionary Register for 1836 of the BFBS, Acworth is recounting his travels in the spread of the Gospel. Having traveled over 2,000 miles in France on the business of the Society, in the summer of 1836 his travels took him to Switzerland in August of that year. Acworth recounts:

I went through Geneva, and was much refreshed by meeting the Committee of the Evangelical Society, with whose proceedings and objects I was so much gratified, that I wrote to this Society to make a liberal grant of 10,000 copies of the French Scriptures to promote the objects of that Society. Our committee have only granted 5,000; but I have no doubt they will, err long, send the other 5,000. Before I left Geneva, my friend observed. "Probably you will like to see the house where Voltaire lived, and where he wrote his plays." Prompted by the spirit of curiosity, so characteristic of an Englishman, to visit the house of the celebrated infidel, I was about to put on my hat to walk into the county, when he said, "It is not necessary you should put on your hat" and he introduced me over the threshold of one room to another, and said, "tis the room where Voltaire's play were acted for the amusement to himself and his friend." And what was my gratification in observing that that room had been converted into sort of Repository for Bibles and Religious Tracts. Oh! my Christ Friends, that the spirit of infidelity had been there, to witness the results of other vaticinations [acts of prophesying] respecting the downfall of Christianity! I know that Voltaire said, that he was living "in the twilight of Christianity" but blessed be God! It was the twilight of the morning, which will bring on the day of universal illumination.[9]

Only fifty-eight years after his death the former home of Voltaire in Geneva, Switzerland, was indeed serving as a storehouse for Bibles and Gospel tracts. While the Evangelical Society of Geneva did not actually purchase the house, Henri Tronchin, president of the Society, resided in the house, and used some of the rooms to store Bibles which Voltaire so vehemently opposed!.... Yes, an ironic twist of divine Providence.

Let it also be noted, only sixteen years after Voltaire's death, in 1794, the presence of the Bible began making in-roads in the town where he spent the last eighteen years of his life, Ferney, France. On the very printing presses which Voltaire employed to print his irreverent works was used to print editions of the Bible and which were printed on [the very] paper that "been especially made for a superior edition of Voltaire's works. The Voltaire project failed, and the paper was bought and devoted to a better purpose [of printing Bibles].

For the full article which contains several cross references to its sources see:-
https://crossexamined.org/voltaires-prediction-home-and-the-bible-society-truth-or-myth-further-evidence-of-verification/
Answer: in order to find a sufficient answer, please read the research from this article.
https://pastorbrianchilton.wordpress.com/2019/03/18/voltaires-prediction-home-and-the-bible-society-truth-or-myth/
Comment: Welcome to ChristianitySE, Minh. Link Only Answers are generally not acceptable at SE sites.  Please take the time to explain in a paragraph or two what it is at that article that you feel answers the question.  Also, please visit the [tour[, [help[, [ask[ and [answer] to get a better idea of how to get the most out of this format.
Comment: Welcome to Christianity! Whilst this may theoretically answer the question, [it would be preferable](//meta.stackexchange.com/q/8259) to include the essential parts of the answer here, and provide the link for reference.


What combination of BDD and mocking frameworks will work with Team Build gated check-in?

Question: I'm trying to implement BDD/TDD on my team as seamlessly as possible.  Gated check-in for Team Build only supports MSTest, and Microsoft Pex and Moles cooperate very nicely.  For BDD, I'm most impressed with MSpec, and the MSMSpec T4 Template will convert those tests to MSTest, but MSpec and Moles cannot work together, it seems. (See: Is there a workaround for setting [HostType("Moles")] when dealing with anonymous methods in MSpec?)
So:

MSTest is fine for unit tests, and works with Team Build, but is not
great for BDD.
Other mocking frameworks work with both MSpec and
MSTest, but Moles is being promoted to Microsoft.Fakes with VS 11,
and does things that I don't think are possible with other
frameworks.
Close substitutes I've found for MSPec such as NSpec
only generate NUnit tests, not MSTest.

What combination of tools works together?
Update: SpecFlow won't work with Moles, either, as the TestMethods are in generated code and I don't see a way to modify the code generator to include the necessary HostType attribute.  Trying out StoryQ next.
Update 2: It turns out that it's not terribly hard to extend SpecFlow to work with Moles, so I'm going with that for now, but I'd still be interested to hear input.
Answer: Have you tried MSMSpec?

MSMSpec is a T4 based tool that can generate MSTest code to extend your MSpec (Machine.Specifications) tests so that they can run under anything that runs MSTest.


A* (A-star) implementation in AS3

Question: I am putting together a project for a class that requires me to put AI in a top down Tactical Strategy game in Flash AS3.
I decided that I would use a node based path finding approach because the game is based on a circular movement scheme. When a player moves a unit he essentially draws a series of line segments that connect that a player unit will follow along.
I am trying to put together a similar operation for the AI units in our game by creating a list of nodes to traverse to a target node. Hence my use of Astar (the resulting path can be used to create this line).
Here is my Algorithm
function findShortestPath (startN:node, goalN:node)
{
 var openSet:Array = new Array();
 var closedSet:Array = new Array();
 var pathFound:Boolean = false;

 startN.g_score = 0;
 startN.h_score = distFunction(startN,goalN);
 startN.f_score = startN.h_score;
 startN.fromNode = null;
 openSet.push (startN);
 var i:int = 0

 for(i= 0; i< nodeArray.length; i++)
 {
  for(var j:int =0; j<nodeArray[0].length; j++)
  {
   if(!nodeArray[i][j].isPathable)
   {
    closedSet.push(nodeArray[i][j]);
   }
  }
 }

 while (openSet.length != 0)
 {
  var cNode:node = openSet.shift();
  if (cNode == goalN)
  {
   resolvePath (cNode);
   return true;
  }
  closedSet.push (cNode);

  for (i= 0; i < cNode.dirArray.length; i++)
  {
   var neighborNode:node = cNode.nodeArray[cNode.dirArray[i]];

   if (!(closedSet.indexOf(neighborNode) == -1))
   {
    continue;
   }

   neighborNode.fromNode = cNode;

   var tenativeg_score:Number = cNode.gscore + distFunction(neighborNode.fromNode,neighborNode);

   if (openSet.indexOf(neighborNode) == -1)
   {

    neighborNode.g_score = neighborNode.fromNode.g_score + distFunction(neighborNode,cNode);

    if (cNode.dirArray[i] >= 4)
    {
     neighborNode.g_score -= 4;
    }
    neighborNode.h_score=distFunction(neighborNode,goalN);
    neighborNode.f_score=neighborNode.g_score+neighborNode.h_score;

    insertIntoPQ (neighborNode, openSet);
     //trace(" F Score of neighbor: " + neighborNode.f_score + " H score of Neighbor: " + neighborNode.h_score + "  G_score or neighbor: " +neighborNode.g_score);
   }

   else if (tenativeg_score <= neighborNode.g_score)
   {
    neighborNode.fromNode=cNode;
    neighborNode.g_score=cNode.g_score+distFunction(neighborNode,cNode);
    if (cNode.dirArray[i]>=4)
    {
     neighborNode.g_score-=4;
    }
    neighborNode.f_score=neighborNode.g_score+neighborNode.h_score;
    openSet.splice (openSet.indexOf(neighborNode),1);
    //trace(" F Score of neighbor: " + neighborNode.f_score + " H score of Neighbor: " + neighborNode.h_score + "  G_score or neighbor: " +neighborNode.g_score);
    insertIntoPQ (neighborNode, openSet);
   }
  }
 }
 trace ("fail");
 return false;
}

Right now this function creates paths that are often not optimal or wholly inaccurate given the target and this generally happens when I have nodes that are not path able, and I am not quite sure what I am doing wrong right now.
If someone could help me correct this I would appreciate it greatly.
Some Notes
My OpenSet is essentially a Priority Queue, so thats how I sort my nodes by cost.
Here is that function
function insertIntoPQ (iNode:node, pq:Array)
{
 var inserted:Boolean=true;
 var iterater:int=0;
 while (inserted)
 {
  if (iterater==pq.length)
  {
   pq.push (iNode);
   inserted=false;
  }
  else if (pq[iterater].f_score >= iNode.f_score)
  {
   pq.splice (iterater,0,iNode);
   inserted=false;
  }

  ++iterater;
 }
}

Thanks!
Answer: Could you explain what's the purpose of these lines:
if (cNode.dirArray[i] >= 4)
{
 neighborNode.g_score -= 4;
}

A* is for problems where costs are always positive i.e. cost of paths is monotonically increasing.
Another thing to check, regarding optimality, is that distFunction() is returning always a value which is lesser or equal than the actual cost to reach the goal (i.e. the heuristic is required to be admissible so A* can guarantee it will find optimal solutions).
I don't know anything about AS3 at all - so I can't comment on the priority queue usage.
Answer: There is a fast implementation here: https://github.com/tomnewton/AS3AStar
Answer: Try out http://script3.blogspot.com/2010/04/star-path-finding-algorthim-in.html
you can find there powerful a* pathfinding class with smooth pathfinding option.

A* (A-star) implementation in AS3


Challenges faced while working in different time zones

Question: I am sure there are many developers out here who have team spread across different time zones. What are some of the challenges people face and whats the best way to tackle them?
Answer: I currently work in a different time zone than the rest of my team.  The biggest challenge is early in the morning and late in the afternoon when some of us haven't started work for the day or some have already left for the day.
It's just part of the work effort and we all respect each others valuable time.  If it's something critical (and that's a relative term) then we just call the team member or page/text the whole team.  If that happens then we all respond as needed.  No big deal.  Because of the respect factor, we know to only use this if necessary.
During the normal working day we just use the standard stuff like email, phone, and IM.
Answer: In all honesty, any company that has split development of a project across time zones is out of touch with the realities of engineering.  The MBAs, in an attempt to save themselves a buck or two, foist upon their engineers the unenviable position of altering the schedules of their lives - leading to high stress, longer work hours, lower morale, and higher turnover.  Quality suffers, ship dates suffer, feature lists suffer.  The only increase you'll see in your project is the bug count.
You can have engineering projects split up like this if you don't have any need for low-latency communication between project units.  In other words - if they are working on almost entirely independent segments of the system.
Answer: We have a team that is distributed or has to work across 3 or 4 different timezones. In the course of this we have faced several challenges primarily relating to communication.
Meetings are tough to arrange at a convenient time for all team members to attend, so there can sometimes be a need to have subsets of the team meeting, or to forego the team meeting approach for an individual update approach where one primary team member is responsible for a particular overseas team.
Another issue is work handover and communication. For example, we have a resource in India and if they have a problem that causes them to stop work, it can take 2 or 3 days out of their schedule if we don't respond quickly enough, all due to the time difference. Therefore, it is imperitive that we not only schedule diverse work to fill these delays but that we also respond to their queries in a timely manner. We often assign testing tasks to resources in this particular timezone as that is often an asynchronous task without an end.
In addition, you need to have a good change management system and code repository. The more asynchronous you can make the communication channels, the better, and this goes for information exchange as well (such as source and issue tracking).
There is no reason why you can't make distributed teams work, especially in the current age where we can work from almost anywhere as long as we have a link to the Internet. However, it's important to know where your bottlenecks are in a project and to ensure that work is distributed accordingly.
Comment: This is a good reminder of the impact that the magnitude of the time difference can have - techniques that work well for +/- 6 hours difference will probably be different than techniques that are necessary when handling times completely out of phase.
Answer: If you dont have a great process which has tuned exclusively for this kind of a scenario, then different time zone is going to kill your project deadline. Atleast one side should be very flexible to adjust their time for the meetings. But ofcourse that will eventually create frustrations among the team members.
Check out this SO thread which talks about Outsourcing and its practical issues, I think you will get some points from there too https://stackoverflow.com/questions/111948/outsourcing
Or Outsourcing Tag - https://stackoverflow.com/questions/tagged/outsourcing
Answer: We have these kinds of issues with support - we are using 3 commercial SDKs and the support teams are in distant time zones (8-10 hours difference). Moreover, not all work days overlap.
This fact had a big impact on my reverse engineering abilities :)
Answer: Plan, plan and plan some more.  A few other things to note:
1) Be aware of local holidays if the team is in other locales, e.g. different countries may have different holidays.  For example, some sects celebrate some Chrisian holidays 2 weeks later than most Christians,e.g. some orthodox sects I'm thinking.
2) Plan on meetings at a specific time that may be outside the normal work hours.  This was particularly true when there was a 13 hour time difference between the rest of the team and myself.
3) Be aware of "Core hours" with the time change, e.g. if I'm on Pacific time and want to update something in New Jersey on Eastern time and I do it at 5pm Pacific time, that is 8 pm Eastern time and there may not be anyone there to notice the change or test it before the following morning which may mean some support person gets up at 4:30am Pacific time as in the East some have started to show up for work and go, "Huh? Why isn't this working like it did yesterday?"
There is also the other obvious things of being aware if there are various alphabets involved, e.g. Latin, Cyrillic, Arabic, etc. and this may affect how a computer interprets some text entered.


I heard a message was encoded into the blockchain, how can I read it?

Question: I have been running a few full Bitcoin nodes for a long while now and I've decided to start learning how to interact with a node to get different information. Recently, Elon Musk's two messages were added to the Bitcoin blockchain. I wondered if as a starting pointI could directly interact with my BTC node and extract information like reading these two messages?
Answer: I saw this tweet in which it was mentioned that F2Pool included a message in coinbase transaction related to Elon Musk's tweet: https://twitter.com/zackvoell/status/1355152428903985157
Block: 668197
Use the below commands to get the message:
getblockhash 668197
getblock 000000000000000000023c31edf49adb2306d0db74e6f1f032ef76deaa7a464a 2
The first tx that you see in the JSON results will have a coinbase value which can be converted from hex to ascii using https://www.rapidtables.com/convert/number/hex-to-ascii.html
Or you can use this command on Linux which uses jq and xxd to make it easier:

bitcoin-cli getblock `bitcoin-cli getblockhash 668197` 2 | jq -r '.tx[0].vin[0].coinbase' | xxd -r -p

It was mentioned by Sjors Provoost in https://twitter.com/provoost/status/1345726239676489728
Can be verified by comparing with the things that you see for block 668197 on a block explorer: https://bitaps.com/668197
Comment: Excellent, That worked very well. Thank you. A quick question though: Why did we added the "2" after the blockhash when we called the block?
Comment: It's the second argument in [getblock](https://bitcoincore.org/en/doc/0.21.0/rpc/blockchain/getblock/) to define the verbosity. **2** returns an Object with information about block  and information about each transaction.


RSA vs. DSA for SSH authentication keys

Question: When generating SSH authentication keys on a Unix/Linux system with ssh-keygen, you're given the choice of creating a RSA or DSA key pair (using -t type).
What is the difference between RSA and DSA keys? What would lead someone to choose one over the other?
Comment: @Bhanu The default of `ssh-keygen` from OpenSSH 6.3p1 is 2048 bits. Read the answers below, and you will also find out that 2048 bits is sufficient.
Comment: Really, I don't see why the suggestion is to "choose the fastest key." I would think one would want to choose the slowest key, which would take the longest time to crack; given that authentication is really only done once and one can wait for authentication to complete for the "realtime" time that it takes for a function.
Comment: The reason we have DSA is that RSA used to have patents before. So DSA was implemented in open source tools. Now all the patents of RSA have expired. So no practical advantage to use DSA over RSA. tools retain the support for backwards compatibility and there is no reason to remove as it is also one of good crypto
Answer: Go with RSA.
DSA is faster for signature generation but slower for validation, slower when encrypting but faster when decrypting and security can be considered equivalent compared to an RSA key of equal key length. That's the punch line, now some justification.
The security of the RSA algorithm is based on the fact that factorization of large integers is known to be "difficult", whereas DSA security is based on the discrete logarithm problem. Today the fastest known algorithm for factoring large integers is the General Number Field Sieve, also the fastest algorithm to solve the discrete logarithm problem in finite fields modulo a large prime p as specified for DSA.
Now, if the security can be deemed as equal, we would of course favour the algorithm that is faster. But again, there is no clear winner.
You may have a look at this study or, if you have OpenSSL installed on your machine, run openssl speed. You will see that DSA performs faster in generating a signature but much slower when verifying a signature of the same key length. Verification is generally what you want to be faster if you deal e.g. with a signed document. The signature is generated once - so it's fine if this takes a bit longer - but the document signature may be verified much more often by end users.
Both do support some form of encryption method, RSA out of the box and DSA using an El Gamal. DSA is generally faster in decryption but slower for encryption, with RSA it's the other way round. Again you want decryption to be faster here because one encrypted document might be decrypted many times.
In commercial terms, RSA is clearly the winner, commercial RSA certificates are much more widely deployed than DSA certificates.
But I saved the killer argument for the end: man ssh-keygen says that a DSA key has to be exactly 1024 bits long to be compliant with NIST's FIPS 186-2. So although in theory longer DSA keys are possible (FIPS 186-3 also explicitly allows them) you are still restricted to 1024 bits. And if you take the considerations of this [article], we are no longer secure with 1024 bits for either RSA or DSA.
So today, you are better off with an RSA 2048 or 4096 bit key.
Comment: Sorry, you got it wrong on several points. DSA is defined in a finite field of size _p_ where _p_ is a big prime integer, _not_ a power of 2. With regards to discrete logarithm, a finite field of size _2^1024_ is weaker than a finite field of size _p_, with a specific algorithm (designed by Coppersmith) which is faster than Index Calculus. The current FIPS 186 is FIPS 186-3, and this one allows DSA keys longer than 1024 bits (and `ssh-keygen` can make 2048-bit DSA keys). In the case of SSH (client side) there is no question of encryption, only signatures.
Comment: Although FIPS-3 does allow larger key lengths, current ssh-keygen (Fedora 15) does *not* -> ssh-keygen -t dsa -b 2048 -> DSA keys must be 1024 bits. Although SSH does just involve signatures I think it's still relevant to point out the difference. You're right about DSA being defined on Zp, I will change that. Thanks for your remarks!
Comment: *DSA [...] is faster when decrypting* is not quite right: DSA can only sign/validate, there is no encryption build in.
Comment: The link to the article which explains why 1024 bits is insufficient appears to be missing. Can you please, provide one as I was interested in why?
Comment: @Thomas, it's called `openssl gendsa`. (The key format is the same.)
Comment: @emboss:I don't understand this answer.DSA is NOT an encryption scheme.It is a signature validation scheme
Comment: oh yes, `ssh-keygen` currently refuses DSA keys longer than 1024 bits. But there used to be a version (as integrated in OpenBSD) which allowed larger DSA keys.
Comment: @jayarjo Yes, DSA is not an encryption algorithm, only a signature one. (There are encryption algorithms based on related mathematics, e.g. ElGamal, but they are not DSA.)
Comment: Is this still true at the end of 2014?
Comment: @emboss If you are calling the  OpenSSL library directly in your program, you can actually get DSA with higher than 1024 bits.
Comment: @pablox pretty much yeah, the more paranoid will use 4096 bit RSA keys. ed25519 (see Shnatsel's answer) may be an option for some but it will likely be a few more years before one can confidently assume that every host they want to access supports it.
Comment: There's also the GnuPG about why RSA 4096 is not the default (https://www.gnupg.org/faq/gnupg-faq.html#no_default_of_rsa4096). It basically goes down to: "Because it gives us almost nothing, while costing us quite a lot.".
Comment: As for generating DSA keys bigger than 1024, PuTTY's PuTTYgen tool can also generate DSA keys of arbitrary size.  I just generated a 20480 bit SSH-2 DSA key.  Actually, I'm in the middle of doing so.  It seems to be taking a while (as in, about 20 minutes and still going).
Comment: @PaŭloEbermann what do you mean DSA can only sign/validate?
Comment: DSA can now be used for encryption: https://www.thesecuritybuddy.com/encryption/dsa-vs-rsa/
Comment: the 1024b limito n DSA keys (now deprecated in OpenSSH) is rooted in the protocol definition - see [Why OpenSSH deprecated DSA keys](https://security.stackexchange.com/a/175890/24330) written by one of the maintainers/developers.
Answer: Right now the question is a bit broader: RSA vs. DSA vs. ECDSA vs. Ed25519. So:
A presentation at BlackHat 2013 suggests that significant advances have been made in solving the problems on complexity of which the strength of DSA and some other algorithms is founded, so they can be mathematically broken very soon. Moreover, the attack may be possible (but harder) to extend to RSA as well.
The presentation suggests using elliptic curve cryptography instead. The ECC algorithms supported by OpenSSH are ECDSA and, since OpenSSH 6.5, Ed25519.
OpenSSH only supports NIST curves for ECDSA and according to this study those curves look really suspicious for NSA backdoors. And if NSA can already crack it, then it won't be as hard to crack for somebody else as a proper curve would be. Ed25519 is the same thing but with a better curve, so it's the safest bet against the underlying algorithm being mathematically broken.
Also, DSA and ECDSA have a nasty property: they require a parameter usually called k to be completely random, secret, and unique. In practice that means that if you connect to your server from a machine with a poor random number generator and e.g. the the same k happens to be used twice, an observer of the traffic can figure out your private key. (source: Wikipedia on DSA and ECDSA, also this).
The bottom line is:

Never use DSA or ECDSA.
Ed25519 is probably the strongest mathematically (and also the fastest), but not yet widely supported. As a bonus, it has stronger encryption (password-protection) of the private key by default than other key types.
RSA is the best bet if you can't use Ed25519.
Comment: The recent discrete logarithm advances were is small characteristic field. There is no obvious way to transfer it to DSA over prime characteristic fields or RSA. RSA and DSA over prime fields are probably closer to each other security wise that DSA over prime fields is to DSA over small characteristic fields. Advances in factoring or DL can happen, but they'll need to go far beyond the recent advances, so abandoning DSA and/or RSA over these is unnecessary alarmism. It's just as well possible that somebody breaks ECC.
Comment: Ed25519 doesn't use a random *k* (it derives it from private key and message instead), so you only need a PRNG to generate the key, but not to sign. With DSA and ECDSA many implementations fail is the PRNG is bad, but there are ways to implement it so it survives bad PRNGs, for example by using Pornin's deterministic variant.
Comment: Use [Ed25519](https://en.wikipedia.org/wiki/EdDSA) or else [RSA](https://en.wikipedia.org/wiki/RSA_%28cryptosystem%29) with 4096 bit keys.  See also the well-circulated [secure secure shell](https://stribika.github.io/2015/01/04/secure-secure-shell.html) writeup.
Comment: Yes, it bothers me to hear anyone say 'abandon DSA'. I'm not a mathematician, nor are most users of public key cryptography, but I'd only abandon something if there were a truly imminent threat to it, and certainly wouldn't adopt something relatively new until it had been extensively field-tested and proven to be secure. How do we know this user isn't the NSA saying that the NSA can more easily break DSA and ECDSA, so that we switch to algorithms they can break. Oh, those pesky intelligence agencies, they will blow your mind!
Comment: @bitsum The [RNG issue](http://meyering.net/nuke-your-DSA-keys/) is real and "imminent." OpenSSH can only generate 1024 bit DSA keys, which are too weak.  While it can use 2048 and 3072 bit keys [generated by OpenSSL](https://digitalelf.net/2014/02/using-2048-bit-dsa-keys-with-openssh/), that's a lot of hassle. Also, as of OpenSSH 7.0, [DSA is disabled by default](http://www.openssh.com/legacy.html). See also [my Stack Overflow answer](https://stackoverflow.com/questions/2821736/whats-the-difference-between-id-rsa-pub-and-id-dsa-pub/27855045#27855045).  Want tried-and-true?  Use 4096 bit RSA.
Comment: @AdamKatz Approaching a year later, I am inclined to agree with you. The possibility of a broken or otherwise inadequate RNG, being a prime target, is a definite concern for DSA. In contrast to my prior comment, I quit using DSA myself a few months ago.
Answer: In SSH, on the client side, the choice between RSA and DSA does not matter much, because both offer similar security for the same key size (use 2048 bits and you will be happy).
Historically, version 1 of the SSH protocol supported only RSA keys. When version 2 was defined, RSA was still patented, so support of DSA was added, so that an opensource patent-free implementation could be made. RSA patent expired more than 10 years ago, so there is no worry now.
Theoretically, in some very specific situations, you can have a performance issue with one or the other: if the server is a very small machine (say, an i486), it will prefer clients with RSA keys, because verifying a RSA signature is less computationally expensive than verifying a DSA signature. Conversely, a DSA signature is shorter (typically 64 bytes vs 256) so if you are very short on bandwidth you would prefer DSA. Anyway, you will have a hard time detecting those effects, let alone find them important.
On the server, a DSA key is preferred, because then the key exchange will use a transient Diffie-Hellman key, which opens the road for "Perfect Forward Secrecy" (i.e. if a bad guy steals the server private key, he still cannot decrypt past connections that he would have recorded).
Comment: @Paŭlo: actually, with SSHv2, DHE is always used, even with a RSA key. Using a DSA key is just an easy way to be sure of getting PFS, because it cannot be used otherwise.
Comment: Can you elaborate on the risk of using an RSA key on the server side?
Comment: Can't one use DHE with RSA-signature, too?
Comment: @jrdioko: when connecting, a session key is established, using a key exchange mechanism such as RSA (encryption) or Diffie-Hellman. A corresponding private key is used on the server. If that key is transient (generated on-the-fly, kept in RAM only, discarded after usage), then it is safe against subsequent stealing. When the server key (the one which is permanent, stored in a file) is for signatures only (e.g. DSA key), then you are sure that the key exchange key is transient (the public key is then signed by the server), and that's good.
Comment: OpenSSH stores SSH version 1 and 2 RSA keys in different files, and 1 isn't even enabled by default anymore. It would be difficult to accidentally use version 1 -- at least in OpenSSH.
Answer: Another important advantage of RSA over both DSA and ECDSA is that you don't ever need a secure random number generator to create signatures.
To generate a signature, (EC)DSA needs a value that has to be random, secret/unpredictable and can never be used again. If one of those properties is violated, it's possible to trivially recover the private key from one or two signatures.
This has happened before (once with a broken patch of the OpenSSL PRNG in Debian, and once with a bug in Android's SecureRandom implementation), and is pretty hard to completely prevent.
With RSA, in those situations only your ephemeral session key would have been compromised, if the actual authentication key pairs have been created using a properly seeded PRNG before.
Theoretically, there is a way to make (EC)DSA signatures depend on the message and private key, which can avoid total failure in case of a broken RNG, but until this gets integrated into your SSH client (there is no OpenSSL release version including the patch right now), I'd definitely go with RSA keys.
Comment: @rxt that's a tangential issue, it's the default RNG in a specific product sold by RSA the corporation, nothing to do with the original RSA public key crypto protocol.
Comment: That advantage you talk about - we all know now that the RSA random number generator is not that random. I don't know if it matters much, but anyway...
Answer: Not knowing much about cryptography, as a OpenSSH user I would stick to a simple fact: in http://www.openssh.com/legacy.html, which states that SHA1 is now disabled by default because it is considered weak:

OpenSSH 7.0 and greater similarly disables the ssh-dss (DSA) public key algorithm. It too is weak and we recommend against its use.
Comment: Tom Leek explained that in "[Why OpenSSH deprecated DSA keys](http://security.stackexchange.com/a/112818/66454)": simply put, it is a consequence of their own coding practice and inability to stay on par with the current standards.
Comment: Reading this in march 2017 gives a new light to this comment. SHA1 has been broken, so OpenSSH made a good decision deprecating SHA1. So i think i'll trust them on deprecating DSA.
Answer: The math might not matter. This thread seems pre-Snowden. Here is a Reuters article dated December 20, 2013:

(Reuters) - As a key part of a campaign to embed encryption software
  that it could crack into widely used computer products, the U.S.
  National Security Agency arranged a secret $10 million contract with
  RSA, one of the most influential firms in the computer security
  industry, Reuters has learned.
Documents leaked by former NSA contractor Edward Snowden show that the
  NSA created and promulgated a flawed formula for generating random
  numbers to create a "back door" in encryption products, the New York
  Times reported in September. Reuters later reported that RSA became
  the most important distributor of that formula by rolling it into a
  software tool called Bsafe that is used to enhance security in
  personal computers and many other products.
Undisclosed until now was that RSA received $10 million in a deal that
  set the NSA formula as the preferred, or default, method for number
  generation in the BSafe software, according to two sources familiar
  with the contract. Although that sum might seem paltry, it represented
  more than a third of the revenue that the relevant division at RSA had
  taken in during the entire previous year, securities filings show.

During this Science Friday podcast Ira asks Matt Green, Martin Hellman (inventor of Public Key Cryptography), and Phil Zimmerman (creator of PGP) what they think the NSA has cracked:
(around 17:26)

Ira: What are some of the things that we know that the NSA has broken into?
Matt: So we have heard a number of things that we can probably credit for real. … random number generators … we know
  that NSA through NIST … has very likely put back doors in some
  of those standard algorithms that allow them to essentially break
  those systems entirely.
Ira: You mean the NSA created those back doors?
Matt: That's exactly right. So NIST works with NSA --- and they're required to by law. We thought NSA was helping NIST by developing more
  secure standards for Americans to use. We now suspect --- and have
  strong evidence to believe --- that the situation was exactly the
  opposite; that NIST was being used to put out standards that the NSA
  could break.

Considering these recent revelations the strength of the algorithms seems largely irrelevant. RSA appears to have been a private company somehow bought by the NSA, and DSA was created by NIST itself, which, according to these experts is largely a front for NSA crypto research.
In other words, it really doesn't matter if you are using the random number generators that come with pretty much any modern computer, which OpenSSH and others do.
Pick the one that is the fastest for what you want. In my case, I reuse the same key for a lot of stuff so DSA's faster generation speed is less desirable. Also, maybe there is some wild chance that RSA was actually an independent entity from NIST and NSA, whereas we know DSA was created by NIST.
I personally just use 1028 bit keys because, as we've seen, it really doesn't matter unless someone is placing some requirement on you who still believes bigger keys will protect you. The whole thing is largely just an annoyance to anyone seeking to break in.
Comment: Your answer is not entirely consistent. You're mixing facts about a RNG developed by the company RSA which seems was tampered, and about the public/private key algorithms called RSA (developed by the founders of the mentioned above company). The RSA algorithm (with big enough keys) cannot be easily broken unless you have a monster optimised cluster or a quantum computer. As for DSA, this might be published by NIST (I haven't checked) but NIST publication are also peered reviewed by other independant cryptographers. For example they warned about the dubious RNG approved by NIST.
Comment: The fact that RSA Inc's BSAFE product used Dual EC DRBG as the *default* (not even the only one offered) random-number generator has *nothing whatsoever* to do with the security properties of the RSA *algorithm* or the security properties of any software that was not or is not built to use BSAFE. If you are going to throw conspiracy theories around, at least get your facts right. There's plenty enough to blame the NSA (and many other intelligence agencies around the world) for, and there's good reason to blame RSA for the default, without need for making claims that have no basis in reality.
Comment: Fair enough. I've added the relevant quotes and transcribed some of the audio. Thanks for the reminder.
Comment: Surely you mean 1024 bit keys?
Answer: RSA and DSA are two completely different algorithms.  RSA keys can go up to 4096 bits, where DSA has to be exactly 1024 bits (although OpenSSL allows for more.)  According to Bruce Schneier, "both DSA and RSA with the same length keys are just about identical in difficulty to crack."
Comment: FIPS 186-2 restricted the modulus to 512 to 1024 bits. But the revised FIPS 186-3, published in 2009 restricts the modulus to 1024, 2048 or 3072 bits.
Answer: The problem with ECDSA is not so much backdoors. Bernstein/Lange specifically mention that curve cryptanalysis does not attack specific curves, but classes of curves (see slide 6).
The problem with ECDSA is that NIST curves are hard to implement correctly (ie. constant time and with all proper verification) compared to Curve25519. OpenSSL has a constant-time P256 implementation, so OpenSSH is safe in that regard.
If you're still worried about NIST curves, OpenSSH recently added support for the Ed25519 scheme

RSA vs. DSA for SSH authentication keys


Resizing Photoshop CS6 from 30" Cinema display to 21" iMac (OS 10.8.5)

Question: I am using old Photoshop CS6 on 21" iMac (OS 10.8.5) with 30" Cinema display. When I take only my iMac on a trip, if I had Photoshop sized for the 30" display, the bottom right of the workspace runs outside the 21" active monitor. How can I resize it to fit without having the 30" to do it?
Answer: Long time since I've seen Mountain Lion or CS6... I'm presuming you can't see the red/yellow/green dots at top left of the window?
If you can, the green dot will resize it.
If you can't,  Opt ⌥   Shift ⇧  & drag any visible window edge will resize the entire window equally [I hope that functionality existed at 10.8]. Once you can see all 4 sides, you can then drag them out to the correct edges again individually if needed.
If that doesn't work, see if the window will just drag down the screen - I've known the title bar with the dots to hide itself under the menu bar, which most Mac Apps can't do.
Comment: Thanks. One more thing: I do not remember what I did, but I was able to shrink the workspace to the exact size of the drawing, but now it stays like that. I prefer being able to have the workspace larger than the drawing (how it originally was). Do you know how to undo what I did?
Comment: cmd/0 [zero not 'oh'] will size to viewport. btw - If the answer helped, please mark it as 'accepted' with the check/tick mark & give it an upvote too ;-)


"Insufficient Resources" general system error when starting ESXi VM through Vsphere client

Question: I'm trying to set up a CentOS installation on my ESXi host using VMware VSphere client, and despite my efforts, I continually receive an error. After creating the VM and attempting to start it for the first time, the startup bar fails at 20% and throws an error which states only "Insufficient resources" and checking the event log, the error is noted as a "General System Error."  I have worked through several online troubleshooting guides, the most relevant seeming to be (http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1006232), however to no avail. Any help or tips would be greatly appreciated.
Comment: How much free disk soace ram etc do you have? Also details of the host would be appreciated.
Comment: Yeah, not enough information.
Comment: The host has 16 GB of memory installed, 400 MB of which is not allocated to the guest. The disk has 28 GB free, all of which is allocated to the virtual disk. The host is an HP Proliant DL380 with 2 quad core Xeon 5450 CPUs. I'm not sure what else is relevant, so please inquire as necessary.
Comment: In case it is relevant, I face the same error when I reduce VM memory to 1 GB and the virtual disk to 10GB, so I am not inclined to blame those features.
Answer: Hope this one will give you a hint
"It happens because a VM is given a reservation that is larger than the free resources currently available"
here's the link
[book][1]
[here]http://my.safaribooksonline.com/book/operating-systems-and-server-administration/virtualization/9780071664523/resource-management/ch11lev1sec6
Answer: This one bugged me for a long time.  A lot of research, a call to VMware..eventually I found something (don't remember where) and kept bugging the VMware phone support until they escalated it and got some questions answered.
I blogged about it in detail here.  Hope it helps
"VMWARE cpu and ram reservations fixing insufficient resources error"
http://geekswing.com/geek/vmware-cpu-and-ram-reservations-fixing-insufficient-resources-to-satisfy-configured-failover-level-for-ha/


How would it be possible to have a singular island that is the only place suitable for human life?

Question: I've been mulling over a way to create a post-apocalyptic world where all plant life in densely populated areas have died off and caused humans to die from lack of oxygen. In this world I would like a few small islands that still support human life, I dont want to have to put it in a dome to keep the oxygen from being sucked into the atmosphere if possible. Im thinking a very dense jungle. I'm also wondering what the smallest size I can make this these islands for this idea to be plausible
Comment: Most O2 on earth right now is produced by plantlike algae in the ocean, not by plants in densely populated areas.
Comment: Larry Niven's world Plateau (in his *Known Space* universe) is a Venus-like world with a single habitable plateau raising up out of the inhospitable rest of the planet.  The colony that settled there is confined to the single small "island" (in a deadly fog, not an ocean).  http://larryniven.wikia.com/wiki/Plateau  This doesn't answer your question - but might offer some suggestions.  (*A Gift From Earth* is the novel it is featuered in.)
Comment: Gases will mix even without external influences due to brownian motion. But on Earth you have weather too. There is no way to have oxygen only on one island.
Comment: Oxygen grom plants does not contribute much (or is used in-place as well by the fauna). It's ocean algae that produce most of the oxygen.
Comment: How many humans are you trying to keep alive?
Comment: @Frostfyre I'd like to keep a few tribes here and there. Maybe about a total of 40-100 people in the larger tribes and maybe 12 or so tribes in the world. I dont want too many people in the New World but I'd like enough for there to be a territory war
Answer: You Cannot Survive on an "Oxygen Island"
Consider standing on an island, somewhere near the beach.  While the sun is a bit hot there is a wonderful breeze coming off the ocean to cool you.  Except this is your world where oxygen does not exist outside of the island except in trace quantities.  You breathe in, but your lungs are only sucking carbon dioxide and nitrogen.  Within two breaths you become very tired, and with another you fall to the ground.  And that's how you die... seemingly relaxing near the beach.
That's the problem with a lack of available Oxygen.  Having no available Oxygen is not synonymous with not having any atmosphere; you still have wind, and that wind is going to be lethal.  With a single good gust of wind (as occurs regularly on islands, and everywhere) your entire population dies almost instantly.  The problem would actually be made much worse by a lack of plants in other areas, as wind speeds would increase globally - driving more deadly wind your way.
Also, your jungle won't create an "oxygen bubble" that people can live in; trees are not THAT efficient at scrubbing oxygen for us, and are even worse at trapping it into habitable zones.  Trees aren't even the major contributor of oxygen to the world; look to grasses and algae for that.
Answer: You do not need to run out of oxygen in order to make people and plants die. Just dial up the atmospheric pressure and your good friend oxygen toxicity rears its ugly head.
You see, when you breathe too much oxygen, you die! Or more specifically, when atmospheric pressure is higher than 8 atmospheres, you are getting too much oxygen every time you take a breath. The resultant symptoms are nasty, and depending on the length of exposure, fatal. Your people won't drop dead as soon as they venture into a zone like this, but they will not be able to live there for prolonged periods of time.
High amounts of oxygen also increase oxidative stress on plants. This will interfere with their natural cycles and also kill them.
However, those living at very high elevations will experience lower atmospheric pressure, and thus avoid the effects of oxygen toxicity and oxidative stress. Your "islands" become tall mountain peaks, in an "ocean" of deadly oxygen.
Comment: @lolbutnah Probably best to have a set of new questions.
Comment: The only problem I have with this is the world I'm trying to create is for a young woman who travels across the barren area (whether it be ocean or now land since there may be no other option). So if I were to dial up the atmospheric pressure how much would I have to do this by and what would the effects be on the overall geography and evolution of life (Should i start a whole new question for this actually?)
Answer: If whatever event that causes this change, was either caused or could cause in increase in sea levels and/or a drastic change in temperature then a mini atmosphere around the island(s) would form because all other land would be too cold, or too hot to exhibit life, or simply underwater. There would need to be more oxygen produced that used because a lot of it would dissipate to the rest of the globe, however if the air around the island(s) was warmer than the rest of the atmosphere due to the energy releasing activity on the island(s) then the particles of air would be more likely to stay inside the mini atmosphere because they move faster that the other air particles. For this idea to work you would need to reason for all the humans everywhere else to die to be something different than lack of oxygen, more likely lack of food supply (due to the increase in water levels) or too hot/cold temperatures for life.
Comment: Would leaning more towards Nuclear War between America and Europe work? Or the only places untouched could be small islands close to the equator
Comment: Could the nuclear war cause any of these geographical changes?
Comment: Yes, a bomb big enough to kill off signs of life or maybe a chemical weapon meant to destroy crops to hinder some sort of war by ways of starving off countries with more manpower
Comment: Welcome to the site. A nuclear war could increase sea levels by destroying the permafrost. It could also decrease the temperature through nuclear winter so your options are possibly feasible in nuclear war.
Answer: You could have environments that improve with altitude.
You may have elevated temperatures and environmental conditions that wreak havoc on life except at very extreme altitudes. Maybe life forms that are able to survive at the most extreme altitudes. Adjust for as much of the Himalayas, Andes, .... that you wish to qualify.
Some hand waving is liable to be involved.
Answer: Heavier than air poison gas
Whatever the disaster was, it caused massive amounts of a gas that is heavier than air to fill the entire planet. That gas filled the atmosphere several miles deep and pushed the normal Oxygen-Nitrogen mixture we're used to upwards to float on top of it, like oil on top of water.
Therefore your "Islands" are actually the tops of mountains that are higher than whatever your desired limit is.
So you'll have to invent some sort of disaster that supplies copious amounts of extra gas to Earth's atmosphere. Maybe a collision with something in space? (Even if that something is a massive gas cloud, so the planet itself was left intact)


How can I set different  values for each template in ejs?

Question: I am using Sails.js and it comes with ejs-templates. There is a default view called layout.ejs which is always including the body parts from other templates. The title element is defined in the layout.ejs and is therefore always the same. Due to SEO I would like to change the title depending on the view that is included. Is there some way of knowing which view is actually called from Sails, in the .ejs file?
Answer: Update the <title> tag of your layout.ejs to
<title><%= title %></title>
and send a title value from your controller along with the other data, like
res.view('viewname', { title: 'YourTitle', data: data });
Hope this helps!
Comment: This solution works fine, if you set a page title in every controller. Otherwise it will be failing with `title is not defined at eval`.
I extended this solution here:
https://stackoverflow.com/questions/53520452/how-to-use-dynamic-page-titles-in-sails-js-v1-0/


What weapon is the strongest in Minecraft?

Question: In Minecraft, there are so many weapons, but which one is the strongest without any mods?
Comment: Would you count damage with modifiers such as critical hits, different enchantments, and different levels of the strength effects, or do you mean the strongest weapon with only base stats considered?
Answer: Bow. Base damage at full charge is 9, or with critical hit, 10. Enchanted with Power V (+150% damage) it will deal 23 damage on full charge and 25 with critical hit. Additionally, Flame enchantment will add 4 damage (distributing it over next 5 seconds), and if it's still not enough, you can used tipped arrows of Harming II for additional 12 points of damage, so the maximul total is a whooping 41 points of damage for a single critical hit with a fully enchanted bow with a tipped arrow of harming - or in regular game scenarios, any proper hit (non-critical) with a regular arrow from a fully enchanted, fully charged bow - 27 points, which is enough to kill most regular mobs with one hit.
To compare:
Netherite axe deals 10 base damage (15 crit), and enchanted with Sharpness V, 13 points. A critical hit with enchanted axe will deal 18 points of damage. The situation is significantly better with Smite V enchantment, 22.5 damage against undead, or 33.75 when dealing critical damage (hitting while falling down, e.g. after jumping). Still, against non-undead mobs it will be the same 10/15 points, so a dedicated axe against the Wither may be a good idea, but as general weapon it's rather so-so.
A netherite sword with Sharpness V and Fire Aspect II will produce a total of 18 points on a regular hit or 22 points of damage on critical hit. 27.5 or 37.75 with Smite V and Fire Aspect II against undeads, providing all the fire damage 'goes in'.
Then there's the matter of Sweeping Edge. It's a sword enchantment, which deals damage to all mobs within certain range of the one hit directly, and so the sword can deal thousands of points of damage per hit - distributed over a large number of mobs crammed into a small cell with vines protecting them from death from entity cramming.
Comment: Can we count Strength buffs and high level enchantments/effects like Power 20 or Strength 20?
Comment: @fasterthanlight: Strength I and II could be considered in extended analysis but with +3 / +6 damage, a critical hit with a sword barely exceeds regular hit with a bow, and Strength is *unwieldy*, either a potion or a beacon, potion of Strength II acting an awfully short time. Apples to apples, match it up against tipped arrows. We definitely shouldn't consider effects obtainable only through cheats, at that point all bets are off.
Answer: If you are counting on pure damage, then go with a strength 2, netherite axe w/ sharpness 5, and a critical hit.