How is the inplace modification of a file being done?

Question: What does the "inplace" modification of a file e.g. via sed -i or perl -i mean?
My question is about how this inplace modification is done. Is the file copied the modification is done
in the copy and then replace the original? Or is the original file somehow being modified in place?
Comment: Have a look at http://backreference.org/2011/01/29/in-place-editing-of-files/ for a detailed explanation of this topic.
Comment: For that matter, how is it done with `ex` or `vi`?
Comment: @Wildcard - each of those has a whole system in place. `ex` maintains a mailfile *(like, `dead.mail` or something in ~you, and another somewhere near to your mail spooler, usually)*. check the specs - each of them has state defined to great lengths... `ex` has its own binary format in most cases *(look at your `-rescue` file)* and this is used to prezero separate temporary buffer files *(possibly as many as six)*. so these copy out blocks of input to edit buffers ans sync writes into offsets per changes `:!written`?
Answer: sed creates a temporary file, writes the output into that file, and then renames the temporary file over the top of the original.
You can watch what happens using strace:
$ strace -e trace=file sed -i -e '' a
execve("/usr/bin/sed", ["sed", "-i", "-e", "", "a"], [/* 34 vars */]) = 0
<...trimmed...>
open("a", O_RDONLY)                     = 3
open("./sedxvhRY8", O_RDWR|O_CREAT|O_EXCL, 0600) = 4
rename("./sedxvhRY8", "a")              = 0
+++ exited with 0 +++

This logs all the file operations sed makes: it creates a new file (safely with O_CREAT|O_EXCL), writes the data into it, and then moves it back over the top of my original file a.
sed -i accepts a suffix to use for a backup, and in that case it moves the original out of the way first (rather than renaming over the top). That argument is mandatory in most BSD seds. In this case, there's a brief time when there's no file by the right name in the directory at all.
perl in recent versions opens the input file, then deletes it and creates a new file with the same name:
open("a", O_RDONLY)               = 3
unlink("a")                       = 0
open("a", O_WRONLY|O_CREAT|O_EXCL, 0600) = 4

When you delete (unlink) a file you already have open you retain access to it for as long as you keep the handle around, so it can keep reading the data out of the deleted file. In this way perl writes directly into the output file, rather than into a temporary file: no additional file is created, but if you read the file during the process you'll get partial content, unlike with sed's approach. There's also a brief time when there's no file with the right name, which is at the start of the process rather than the end (as in sed -i .bak).

Both sed and perl will:

Replace a symbolic link with an ordinary file.
Break hard links.
Preserve group ownership if possible.
Create the file with your default group (or the group of the parent directory if that directory has the setgid bit) if it was owned by a group you're not in and you're not root.
Preserve file ownership if you're root.
Preserve basic permissions.
Preserve setuid and setgrp bits, if the resulting group is the same as the group it started in.
Preserve the sticky bit.
Not preserve xattrs.

sed will:

Preserve ACLs (On Linux; I don't know about others).

perl will:

Not preserve ACLs.

The above is true on Linux with GNU sed and Mac OS X with its (FreeBSD-derived) sed.
Answer: In additional to @Homer's answer, from perldoc perlrun:

specifies that files processed by the "<>" construct are to be edited
  in-place.  It does  this by renaming the input file, opening the
  output file by the original name, and  selecting that output file as
  the default for print() statements. The extension, if  supplied, is
  used to modify the name of the old file to make a backup copy,
  following these rules:
If no extension is supplied, no backup is made and the current file is
  overwritten.
If the extension doesn't contain a *, then it is appended to the end
  of the current  filename as a suffix. If the extension does contain
  one or more * characters, then  each * is replaced with the
  current filename.

And remember that, no soft link or hard link is preserved:

Note that because -i renames or deletes the original file before
  creating a new file of  the same name, UNIX-style soft and hard links
  will not be preserved.
Finally, the -i switch does not impede execution when no files are
  given on the command  line.  In this case, no backup is made (the
  original file cannot, of course, be determined)  and processing
  proceeds from STDIN to STDOUT as might be expected.

This also explains why you must use -i with -p option, or use a explicit print statement if you want to edit inplace with perl:
# Opps, file will be truncated, becomes empty
$ perl -i.bak -ne 's/123/qwe/' file

# Right way
$ perl -i.bak -ne 's/123/qwe/;print' file

# Or
$ perl -i.bak -pe 's/123/qwe/' file


error on lens or camera?

Question: i brought a brand new d5300 50mm 1.8g and tamron 18-200 about 10 months ago. everything is fine. the camera and the 2 lens. i borrow a d300 for testing. i put 50mm to d300. everythings fine. it autofocus smoothly. i tested the front botton beside the cap. and all the sudden it doesnt autofocus. i put it back to my d5300 and also doesnt  autofocus. i tried the tamron 18-200 to my d5300 and still doesnt focus. what the hell happened? please help me.
Comment: @Marc This isn't a discussion forum, please don't ping people for responses - instead add your clarifications to your question so they're easy for everyone to find.
Comment: Going out on a limb here... is the "front button beside the cap" a "depth of field preview" button? If so, look in the front of the lens - is the iris stopped down and possibly stuck there? Most AF systems don't operate well beyond say f/5.6 or f/8 - that's why lenses focus wide open and only close the iris in conjunction with opening the shutter...
Comment: Hi sir thank you for the quick response. Its already 2:28am here and i cant sleep thinking. Yes i google it. This is depth of view button. I remember i hold this button(DOV) and take picture. I check and click the DOV several times. At first the iris closes to very small. After maybe 30 clicks its stuck to its widest aperture. But when i take the lens to the body and click DOV its ok. What should i do. Why also my tamron lens doesnt autofocus to my nikon d5300. Very very wierd. :(
Comment: And also when i try to shake the 50mm 1.8g lens there is something inside. A very little shaking
Answer: Interesting question. I bought the 50mm f1.8G a few months back. It went on and off my old D70 with no issues, but on my D810 it felt stiff when turning into the bayonet fitting. The lens release button also felt stiff, and autofocus didn't operate. When I took it off and tried another lens, there was still a problem with autofocus, but when I took that lens off, looked at the mount and contacts, and put it on again it operated as expected.
The cameras and lens seem to be fine ever since and I've also had that lens on a D3200, but now I've read your question I'm wondering whether the 50mm f1.8G mounts or electrical contacts are stiff when new. It's worth checking the electronic contacts on both the camera and the lens to see they're not misaligned or damaged - it looks like I got away with it.
Hope it works out for you.

error on lens or camera?


Tikz for large files

Question: I have a question regarding the use of TikZ. I have five large sets of data (15000 points) and I want to use TikZ to plot my data, but obviously the amount of memory isn't sufficient. Can anyone give me any suggestions on how I can solve this problem? I have tried using epslatex with gnuplot but the thing is, I prefer to use TikZ since that way I don't have to worry about the fonts etc.
Comment: What kind of plot is that? Can you show us an output obtained via other software MATLAB, Mathematica, R etc. ?
Comment: If this is for a pseudo colour plot, or a scatter plot, then perhaps [this](http://tex.stackexchange.com/a/34447/9043) or [this](http://tex.stackexchange.com/a/39997/9043) may be useful. In both cases, the plot canvas is a PNG, and pgfplots is used to wrap it in nice axes etc.
Comment: On another note, if this is a line plot(s) then pgfplots can be configured to read every nth point, effectively reducing your data set and the memory needed to contain the resultant plot.
Comment: I recently had a dataset that was too large for pdflatex to handle. I escaped to lualatex where those memory limitations don't exist (afaik). I set the page margins to the one I use in my document, plotted the dataset and then used pdfcrop to create a pdf-picture of my plot. The upside is a small file-size, the downside is obviously the work you have to put in. Another option is, plot it with another software, remove the axis and include the picture in the plot, pgfplots supports graphics
Comment: @Nil: [Welcome to TeX.sx!](http://meta.tex.stackexchange.com/questions/1436/welcome-to-tex-sx) I converted your "answer" post to a comment. Your initial session seem to have expired and your second post was therefore under a different unregistered account. This stopped you from adding a comment. I merged both accounts together now. Please consider registering your account to avoid such things in the future. Happy TeXing!
Comment: @Nil: You should now be able to add an image because you have now over 15rep.
Answer: First off, if you are plotting 15,000 points one has to wonder what exactly you are trying to visualize. With so many points the "signal" or "point" of your graphic is likely to be lost in all the "noise".
Have you considered applying some sort of statistical analysis to your data in order to identify and emphasize trends? For example, this plot (produced using ggplot2) uses hexagonal binning to visualize a dataset containing 53,940 observations in a way that is much, much more effective than a scatterplot:

I want to use tikz to plot my data, but obviously the memory isn't enough.

If you absolutely have to plot a large dataset, don't use pdfTeX or XeTeX as your typesetting engine. Use the newer LuaTeX engine which is able to dynamically allocate memory.
LuaTeX can handle a scatterplot of 15,000 elements with no memory problems but it will take ~half a minute to typeset the plot. If you go this route, keep your graphics in external .tex files and include the .pdf images to keep the compile time low for your main document.
Comment: You can also just let R do the binning into hexagonal bins and let pgfplots do the actual plotting: http://tex.stackexchange.com/a/42442/2552
Comment: Thanks for your answers! :) the picture is the result from 5 different simulations,I am performing a simulation on a transient process and each point on my figure represents a step in may calculations. the calculations go on for 15000 steps and therefore there are 15000 points of data, ...
the result from gnuplot is a simple line graph, stress vs. strain Thanks in advance
(P.S. apparently I cannot attach a picture as I don't have enough reputation points! :( )
Comment: @FedericoPoloni See [the vignette](http://cran.r-project.org/web/packages/hexbin/vignettes/hexagon_binning.pdf) for the R package hexbin. Specifically, the "Theory and Algorithm" section explains why hexagons are superior to squares.
Comment: Pgfplots is a great package. When working with R, another alternative is to save plots directly to TikZ using [tikzDevice](http://cran.r-project.org/web/packages/tikzDevice/index.html)
Comment: Apart from the eye-candy, what's the motivation for using hexagons rather than squares (easier to code/understand/turn into numbers)?
Comment: @Sharpie: thanks for the link, good explanation. For those too lazy to look it up, essentially the argument is "hexagons are visually less biased [...] [W]ith squares our eyes are drawn to the horizontal and vertical lines of the grid."
Comment: I've added some [explanation how to produce a hexbin plot](http://tex.stackexchange.com/a/114577/5645) in another answer

Tikz for large files


Will the TP-Link TL-WR941ND wireless router work with Ubuntu 11.04?

Question: Will the TL-WR941ND work with Ubuntu 11.04?
Answer: Basically, the router has nothing to do with your OS, except some rare cases (for example, Broadcom drivers in 10.04 LTS acts strange with the 40Mhz channel width configured in the router).
But if it helps you, I have exactly the same model, and it works like a charm.
Answer: I can't see why not. Generally the problems with Linux and networking are:

on the other end (the network adapter - does it have drivers that work, etc.); and
are almost exclusively regarding wireless devices.
Comment: Then I'm worried. The usb adapter is not from a well known brand, and the router is wireless.
Comment: What I mean to say is, a wireless router shouldn't be a problem *per se*. Perhaps there may be some issues with the USB adapter but not necessarily. We'd need to find out what chipset is in the USB adapter. Can you give me a model number for that part? Googling TL-WR941ND only turns up the router itself for me.
Comment: The USB adpter chipset is the Ralink RT2880U. The router chipset is the  Atheros AR9132-AC1E.


How do you document your interaction flows?

Question: For many years I've been using an evolved version of Jesse James Garrett's Visvocab diagramming style for documenting information architecture and interaction design concepts.

Today though we're doing a lot more in-page transformations in lieu of navigating to individual pages: things like accordion views, light-boxes, overlays, AJAX inclusions on demand, etc. JJG's Visvocab is coming up to being 10 years old, and thus wasn't designed to cater to all the new interaction modes we have today.
What diagramming style or notation do you use to map out your interaction flows?
Comment: woo interesting! would you think that a flow diagram is an appropraite tool to show things like accordion views, light-boxes, overlays, AJAX inclusions on demand, etc. would an interactive prototype be more helpful?
Comment: This should be a comment rather than answer
Comment: For me, the interaction flow comes before the prototype. If you look closely at the diagram you can see that instead of a single box representing a whole page, I sometimes have a stack of boxes - each is a chunk/object. This approach lets me play around with whether I'll have terms & conditions on the same page, or separated into it's own page (for example). It is so much easier to work out the full process flow at this abstract level, before we get into wireframes and prototypes.
Comment: To your question though: it isn't about the particular elements or widgets, it's about the flow. For example: an order system might have a 3 step wizard including a confirmation step, terminating on an Order Confirmed view ... which could implemented as a separate page, or be done as a lightbox overlaying the previous screen.
Answer: For starters I recommend looking at this excellent article from UX Matters which talks about how to extend Jesse James Garret's visual vocabulary to reflect rich interactive applications which recommends highlighting the interactions as synchronous  (requiring a page load)and asynchronous  (happening within the page). To quote the article

For user interactions that do not require a page reload, asynchronous
  interactions—whether implemented in JavaScript, CSS, Ajax, or another
  RIA technology—use an arrow with a dotted line like that shown in
  Figure 3.
Figure 3—Arrow representing an asynchronous state change

Synchronous State Changes For user interactions that require an entire page to reload, synchronous interactions, use a single-line
  arrow, as shown in Figure 4. This is the standard arrow Jesse James
  Garrett uses in his visual vocabulary.

The article further gives an example of how the visual vocabulary could be extended and used to show a login process for a site.

That said, I generally find it useful to create interactive prototypes using axure which allow users to walk through the different interactions and I use an interaction flow diagram to highlight key interactions in the page which will be of interest to the development team. Other options which we have exploreed are

Creating a walk through video of the interactions to show clients the different functionalities
Doing a live product demo to show the different use cases and documenting the important work flows
Creating story boards for important user flows to show the different interactions
Treating it like a flow design where I use flow charts to map out the flows.

Here are some articles which you might find interesting
Interactive Wireframes: Documenting RIAs
Stop designing pages and start designing flows
Wireframes and Interaction Design Documents
Answer: This is a good question. I've been wandering if there is a better way to document interactions for over a year now and have been trialling a few different things. I've taken inspiration from a lot of different places and below are the different types of methods I've created/trialled in the past with some success. The images below show interaction with an image gallery for a retail tablet app.
Abstract diagrams

The grey panels represent a state (not differentiating between a page reload and asynchronous loading.) Only the elements that are involved in this interaction are illustrated and each interaction is depicted with a symbol to explain what input is used or in this case, gesture.
State Diagrams
Another attempt was using some inspiration from state diagrams.

I like this method because it's more methodical so quicker to create, but the downside is it takes more time to digest. I'm yet to try it with more elements, at the moment it only concentrates on the interaction with one element.
From this I've now been wondering if it's possible to draw some inspiration from how acceptance criteria is written within an agile team. Using the same example as the image zoom it would look a little like:
GIVEN, WHEN, THEN
<code>Scenario 1: Opening image gallery

GIVEN that product page is open
WHEN user taps on product image
THEN resize image to viewport
AND show thumbnails and close button

Scenario 2: Swiping between images

GIVEN that the image gallery is open
AND zoomed out
WHEN the user swipes left or right
THEN the next image slide into the viewport
AND the selected thumbnail will update to the image in view

Scenario 3: Zooming in and out of an image

GIVEN that the image gallery is open
AND zoomed out
WHEN the user double taps on an image
OR pinches out
THEN the image zooms in
AND the thumbnails disappear
WHEN the user pinches in
THEN the image zooms out
AND the thumbnails reappear
</code>
I find writing like this easier to read and write but you do have to create a lot of scenarios to cover all the interactions and you soon start repeating yourself.
Either way I don't think any of these methods are substitutes for talking with people in your team and accompanying prototypes or videos of certain interactions.
Answer: It depends on the project, but I tend to merge the user flow with whatever stage of design I'm at. For example, if I'm getting down the use cases, I put those into a flow. If I'm figuring out the sequence of screens, I use those to depict flow. If I'm in wireframing, I assemble the wireframes into a flow. This approach usually requires me to escort the team through the flow once but after that the documents make a one-stop place to get a sense of what is to be built and how it fits together.
Answer: Balsamiq and Axure have tools for diagraming ajax interactions.
However,  I simply write functional specification and diagram static states.
Comment: I wouldn't say Balsamiq Mockups (for desktop at least) has tools specifically for ajax interactions as such. But of course, being a little creative with color, arrows, opacity, multiple pages and linking you can get pretty far.
Answer: After two years I'm sure you have found your system. But I'd still like to mention this link I tripped over a few weeks ago.
The author uses a spacious template, integrating wireframes and work-flows. Every transition is annotated with a link to a video describing the transition between frames in detail.
Large Canvas Flows + with references
Answer: I think it depends on the particular project.
These days I tend to sketch flows with the UX team and Dev's and iterate the building process. When we're happy with a solution, we then get it documented as test cases for our Q&A teams.
Comment: For your sketch flows, have you developed an ad hoc notation to indicate which things are done via a lightbox vs a new page (etc) ?
Comment: If we're going off of wireframes, it's usually drawn as a lightbox. Otherwise, we try to be informal and iterate through development so a lot of it is verbal.
Answer: I don't think interaction design changes. Just the way it's implemented.
Ajax may help you design something that doesn't need a new page, but you still need to understand the context of what the user is doing.
Now, this doesn't make your job easier, but more options on how to implement an interaction need, you have more ways to provide a solution.
Answer: Balsamiq for simple wireframes.
For Advanced UI flows, I prefer to use UI flow that is constructed from actual designs/screenshots (see attached). This greatly reduces any miscommunication with developers, as they are very clear on how to code the app.
Answer: This technique has helped my company to make a User-Interface-Flow document that is:
Fast to make,
Fast to read,
Full fidelity.
https://youtu.be/ykqIcO7btRg
It helps quickly make an analysis of competitor's UI in which screens can be referenced precisely by the pdf page number.
There's an augmentation to this using powerpoint, which enables inter-linking in the UI flow document but we have not made a video for the quick way to do that yet!


'Custom Action' on SharePoint 2010 List, Ribbon etc

Question: What are the situations when we must use 'Custom Action' on SharePoint 2010 List, Ribbon etc.
many times same functionality can be achieved by other means also. Why 'Custom Action' is must in that situation?
Answer:
It is common when customizing SharePoint 2010 to want to extend the user interface. Fortunately, this is easy to do by using the ribbon menu. You can add new functionality to the SharePoint 2010 ribbon as custom actions. Custom actions enable you to expand or extend the standard behavior of SharePoint 2010 core components such as using a custom action to email the details of a list item.

From the article Adding a Custom Action to a Display Form for List Items you get a general answer on the topic, but I'd like to add a case. Consider a scenario where you have an editor group of users who need to access all site content in 60 different markets on an external web site powered by SharePoint. It's very hard to keep track on where you are, at all times, and how you can (quickly) access other site contents. Then a custom action in the Site Actions menu would be a quick way to point to a an admin page containing all these 60 markets All Site Content links, with the proper label. No need for editors to start fiddle with url's.
There's a bunch of other cases where you can make life easier for SharePoint users by improving the way we navigate in SharePoint.
Answer: As with many things in SharePoint, it is often to your advantage to adhere to the packaging and deployment architecture that is there instead of "achieving it by other means." You can usually get away with doing things your own way in a small scale deployment, but you are much more likely to run into issues eventually in a large scale deployment with multiple front ends and an atypical topology or configuration.
On top of this, a CustomAction (as most items of this sort) has a lot of nice built-in features that you get for free that would take considerable time and effort to develop on your own. Simply because you don't need these features now doesn't mean you won't in the future. A few examples are Rights, ShowInLists, RootWebOnly, RequiredAdmin and RegistrationType.
I'd urge you to look at the site below and consider the code you'd have to write to implement some of the functionality on your own.
http://msdn.microsoft.com/en-us/library/ms460194.aspx
As a general rule, if the SharePoint framework provides a way to do what you want to do, then you should leverage the framework.


Unity Lens Google Chrome Icon Will Not Go Away

Question: I was watching a youtube video, and quit chrome. For some reason, chrome saved itself as the youtube video name as in instead of Google Chrome, it is saved on the unity lens as "Three Main reasons War Is Going Away Youtube-Google Chrome" and I have tried to get rid of the Icon by updating chrome, updating ubuntu, and uninstalling chrome, but the icon stays there. I cannot open chrome, since it is obviously not installed anymore, but the icon is still there.
Answer: Open System Settings, Choose Privacy (Security and Privacy in 14.04), There you can delete history as well as turn off maintaining history for certain items. In 14.04 this is under the Files and Applications tab


What's the difference between EIP and public IP in AWS?

Question: Anything different between EIP and Public IP in AWS?

If launch an instance in EC2-Classic, EIP = Public IP?
If launch an instance in EC2-VPC, the public IP of an instance can be the NAT address?
Answer: An Elastic IP address, is an address that you request from AWS and is allocated to you until you choose to release it back to AWS. This means that only you can use this IP address.
The benefits of an Elastic IP address over an auto-assigned Public IP address are:

It's constant, meaning it won't change.
It's movable, meaning you can move it from instance to instance as you need to.

It's constant
If you don't use an Elastic IP address for your EC2 instance, then either it won't have a Public IP address, or it's Public IP address will change if the instance is stopped.
When using an Elastic IP address, then your EC2 instance can keep it's internet-facing IP address forever.
If you need to put your EC2 instance's IP address in DNS, the use an Elastic IP address.
It's movable
If your instance fails, you can move the Elastic IP address to another EC2 instance and your users and DNS entries won't have to change anything. They will simply start working with the new EC2 instance.
To address your questions:

If launch an instance in EC2-Classic, EIP = Public IP?

No. An Elastic IP is never the same as an auto-assigned Public IP.

If launch an instance in EC2-VPC, the public IP of an instance can be the NAT address?

If your EC2 instance is in a public subnet in your VPC, it can have it's own IP address (Elastic IP or Public IP) for internet connections through your VPC's Internet Gateway.
If your EC2 instance is in a private subnet in your VPC, then it can use your NAT to make outbound connections. The outside world would see it's IP address as your NAT's IP address, but the NAT's IP address would never "be" the Public IP address of the instance.
Comment: 6 years later, still a great answer.
Answer: EIPs are portable between EC2 instances. The auto-assigned IPs are not.
Due to obvious reasons, you should use an EIP for any system that needs to be reachable by other systems.


folder and files selection in .net

Question: I want the control component which can provide access to all file sistem like a folder browser dialog but with supprot of which i can select many folders and file. whether there is already such a component in VS 2008 or made by third parties or should I create it myself?
Answer: I am decide to use System.Windows.Forms.TreeView

folder and files selection in .net


Lossless Compression using rsync

Question: When using the -z mode to compress data when running rsync, is the compression lossless?
sudo rsync -az /path_to/A /path_to/B

How can one ensure that any compression would be lossless?
Comment: Uhh, yea... otherwise it would be destroying your data.  You might want to figure out what lossy compression is before asking such a question: http://en.wikipedia.org/wiki/Lossy_compression
Answer: From man rsync:
CREDITS
       ...
       This program uses the excellent zlib compression library written
       by Jean-loup Gailly and Mark Adler.

From the zlib homepage:

zlib is designed to be a free, general-purpose, legally unencumbered -- that is, not covered by any patents -- lossless data-compression library ...

Beyond verifying zlib, which is a very well-known, widely-used compression library, there's nothing much you can do.
Answer: The short answer is yes.
The long answer is that all generic data compression is lossless, and almost all media encoding is lossy.  I'll try to explain why below.
There are two types of compression, lossless and lossy.  In lossless compression no information is lost and so the original data can be reconstructed perfectly from the compressed version.  In lossy compression, some information is lost, and so the original data cannot be reconstructed perfectly from the compressed version.  In this case, the reconstructed version is an approximation of the original, but the file size will be smaller than would ever be possible with a lossless algorithm.
Lossy compression is commonly used for media such as JPG (images), MP3 (audio), and MP4 (video).  Using lossy compression results in much, much smaller files because we can get rid of data such that the human eye or ear doesn't notice its absence. This is actually pretty interesting, and usually involves a frequency transformation such as the Discrete Cosine Transform (DCT), but that's beyond the scope of this question.
In the case of generic data compression, when you might be compressing text files or executables, as far as I am aware lossy compression is NEVER used.  If you compressed a text file in a lossy manner, you would lose some information, and thus you would forever lose some of the text.  If you compressed an executable file in a lossy manner, it would not work the same way (if at all) after you uncompressed it.
Taking it a step further, let's say you have an MP3 file.  The audio inside has already undergone lossy compression.  However, the MP3 file itself is organized in a very specific manner so that audio players understand how to play its data.  If you were to lossy compress an MP3 file, you would lose information, the organization would be destroyed, and in all likelihood it would be unplayable.

Lossless Compression using rsync


An example of adding points on an elliptic curve in Elliptic Curves, Number Theory and Cryptography by Lawrence Washington.

Question: This question addresses an example that appears in Lawrence Washington's book, Elliptic Curves, Number Theory and Cryptography on page 16. Example 2.1.
The author asserts that the following statements are true on the elliptic curve $$y^2 ={\frac{x(x+1)(2x+1)}{6}}.$$
$$(0,0)+(1,1)=({\frac{1}{2}},-{\frac{1}{2}}),$$ and $$({\frac{1}{2}},-{\frac{1}{2}})+(1,1)=(24,-70).$$
I understand how to work these calculations out by using the chord and tangent process on this elliptic curve-as we worked out when we studied Chapter 1. And while I get the observation that $(x,y)$ is a rational point on this curve if and only if $(x,-y)$ is as well (as the left hand side is $y^2$), I am not clear why these formulae hold as a consequence of the addition laws given on page 14 of the book because this curve (which arises in the context of the Lucas Pyramid Problem) is not in short Weierstrass form. In fact, we write it as $$6y^2=x(x+1)(2x+1),$$ wouldn't we have to multiply both sides by $(6^3)(2^2)$ and change variables to convert it to generalized Weierstrass form? Wouldn't this then affect the formulae for and the addition laws that we derive? They may not be the formulae we use when we apply the chord and tangent process-the points themselves will be transformed by the change in variables. I guess I don't feel that these calculations are applications of the group law-as they clearly are for the congruent number elliptic curves in the book-these curves ($y^2=x^3-n^2x$) are in short Weierstrass form. Is there something obvious that I am missing? Sorry if I am nit picking! Just trying to understand what is happening.
Comment: I am not familiar with this book, but if you have a smooth projective plane cubic curve with a fixed point $O$ (i.e., an elliptic curve), then the "chord and tangent" process for adding points is a group law - so you don't need your curve to be in Weierstrass form, just go ahead and do the operation.
Answer: Let us explicitly add $P_1=(0,0)$ and $P_2=(1,1)$ which are ($\Bbb Q$-rational) points in $E(\Bbb Q)$ for the elliptic curve $E$ with affine equation:
$$
E\ :\qquad
y^2 =\frac 16x(x+1)(2x+1)
$$
that appears on page 16 in the cited book.
Strictly speaking, the above equation is not in the shape considered in the the previous pages of the book, where the most general equation considered so far was $(2.1)$:
$$
y^2 +a_1xy + a_3y = x^3+a_2x^2+a_4x+a_6\ .
$$
(And there is no definition of an elliptic curve in the previous 15 pages, so take $(2.1)$ as a "working definition".)
But there is a simple change of variables $y=3Y$, $x=3X$, to put the equation in such a shape, for instance by dividing both sides with $3^2$to get:
$$
\begin{aligned}
\left(\frac y3\right)^2
&=\frac x3\left(\frac x3+\frac 13\right)\left(\frac x3+\frac 16\right)\ ,\text{ i.e.}\\
Y^2 &= X\left(X+\frac 13\right)\left(X+\frac 16\right)\ .
\end{aligned}
$$
We tacitly pass from the curve $E$ with equation "in the $(x,y)$-world" to the equation "in the $(X,Y)$-world" as needed, and let $E'$ be the latter corresponding curve. For $E'$ we are in the setting of $(2.1)$, so we proceed as there. The corresponding points are $P_1'=(0,0)$,
$P'_2=\left(\frac 13,\frac 13\right)$.
To compute $P_1'+P_2'$ we have to solve a system of equations (given by the equation of the line $P_1'P_2'$ and by the equation of $E'$). But with the given substitution, we may want to solve the corresponding system in the $(x,y)$-world, since there are no denominators. (I hate denominators when typing.) Then we proceed as follows.
The line through these points is the line $y=x$ (with slope $1$) and in order to get the intersection point, we solve the system with the two equations:
$$
\left\{
\begin{aligned}
y &= x\ ,\\
y^2 &=\frac 16x(x+1)(2x+1)\ .
\end{aligned}
\right.
$$
We expect two solutions to correspond to the given points $P_1$, $P_2$, and the third solution is a point $R_3$,
$$
R_3 =\left(\frac 12,\frac 12\right)\ ,
$$
as seen by verifying it. (Bezout insures there are (at most) three solutions.)
Now, in order to get the sum $P_1+P_2$ in $(E(\Bbb Q),+)$ we have to build $P_3:=-R_3$, so we draw the line through $R_3$ and the infinity point, its equation is $x=\frac 12$, and intersect it again with the elliptic curve. We obtain the claimed point
$$
P_3:=P_1+P_2:=-R_3=\left(\frac 12,-\frac 12\right)\ .
$$
Note that on page 15, some lines above, the author mentions the formula for computing the opposite of a point $P=(x,y)$ on the curve $(2.1)$, which is:
$$
-P=(x,\ -y-a_1x-a_3)\ .
$$
Our curve $E'$ is in the form $(2.1)$, and for it $a_1=a_3=0$, so the formula for the opposite of a point $(X,Y)$ is $(X,-Y)$. Now pass to the $(x,y)$-world to see that it is also valid inside it.
At a later point, an elliptic curve $(E,O)$ is a "good" cubic curve $E$ together with a specified rational point $O$ on it, and the addition of two rational points  $P_1,P_2$ is defined as follows.
Draw the line $P_1P_2$ and intersect it with $E$. There is a third point in the intersection (possibly needing to count multiplicities for this), denote it by $R_3$. The draw the line $OR_3$ and intersect it with $E$, the third point is the point $P_3:=P_1+P_2$. It turns out after these definitions were done that this operation is indeed a group operation, and then $P_3=-R_3$.
$P_3=-R_3$.

Since cryptography is the final target, it may be useful to have code reproducing the given situation. We add on $E'$:
EE = EllipticCurve([0, 1/3 + 1/6, 0, 1/3/6, 0])
P1 = EE.point((0, 0))
P2 = EE.point((1/3, 1/3))

print(f'P1 +   P2 = {P1 +   P2}')
print(f'P1 + 2*P2 = {P1 + 2*P2}')

And we obtain:
P1 +   P2 = (1/6 : -1/6 : 1)
P1 + 2*P2 = (8 : -70/3 : 1)

This is the projective version of the points. They are $(1/6, -1/6)$ and $(8, -70/3)$. Now multiply each component with $3$ to get the points from the example 2.1, page 16 in the book, which are $(1/2, 1/2)$ and $(24, -70)$.
Comment: This is a different "change of variables" than the one given on Ex. 1.5 on page 8. Very interesting! I will try to understand both in the cintext of this particular curve.


When (if ever) should [solidity] programming questions be considered off-topic and migrated to stackoverflow?

Question: Are all solidity oriented questions on-topic by virtue of being about the programming language that Ethereum uses?
Answer: Yes, I think all questions about Solidity are on-topic as said by OP.
When this ESE (Ethereum Stack Exchange) graduates, if a relationship is set with stackoverflow, I believe that Solidity questions on SO can be migrated to ESE: Will it be possible to migrate questions between the trilogy and the Stack Exchange 2.0 sites?
Comment: I concur, it is definitely a matter of size of ESE and Ethereum, and i predict solidity will be a main driver for this community. So let's encourage such questions.
Comment: @eth OK, but question must be improved first. As it's for now it just asks what the benefit of having an interface is. This is not Solidity scope. So I will try to edit the question first.
Comment: What about questions that seems to be oop related and not even linked to Solidity as http://ethereum.stackexchange.com/q/5726/405 ?
Comment: @NicolasMassart imo the question is fine, but it should be edited/improved with something about Solidity as the asker says in the comments...  That way, some answers will also include at least some relevant part to Solidity
Comment: @eth but if someone asks "what a variable is used for in Solidity ?" Is it also on topic? For me it's the same type of question an putting the word Solidity in the question doesn't force it to be relevant for this SE site.
Comment: @NicolasMassart I agree "variable" would not be on-topic. imo there's enough with interface question that when someone writes a more detailed answer, it will be clearer to see the relevance.  imo A better answer should at least mention import; how solc processes a file with multiple interface/contracts; and it could explain why thedao does what it does.  I have to check the details so haven't posted an answer.
Answer: Yes solidity is always considered on-topic, even if used in other context, since it's central part of the ethereum ecosystem.
In the future, if there are ecosystems using modified solidity implementations which are not backwards compatible with ethereum, we could reconsider if such questions are off topic.
But for now there is really no point in migrating solidity questions to stack overflow. Should we add solidity to the tour page?


High $p_T$ and high $Q^2$ in deep inelastic hadronic collisions

Question: When reading about high energy collisions (for example proton-proton collisions at LHC), I always find the relation $Q\sim p_T$, which, for me, is hard to demonstrate. Moreover, I found statements about the interaction time $\tau$, which is related to $Q$ and $p_T$ in this way: $\tau\sim \frac{1}{Q} \sim \frac{1}{p_T}$, where again $Q\sim p_T$ is assumed. To understand, I would really like someone to define $Q$ for a proton-proton (parton-parton) interaction. Is this $Q$ the same if I take an $s$ channel or a $t$ channel process? Thanks!
Comment: Hi Marco, and welcome to Physics Stack Exchange! It sounds like you're asking several different things here. Could you try to narrow down your question to ask one specific thing? You can post other questions separately. In your case, I'd suggest removing the first question about the relation between DIS and $p_T$ and posting that separately.
Answer: Q^2  is the Mandelstam variable t, i.e. the four momentum transfer squared where the s channel is the x axis in the feynman diagram.

where p1 p2 are incoming.
In the same link  it is seen that at the relativistic limit :

The dot product for t (Q^2) is p transverse to the incoming beam direction of p1 , p2 are incoming.
etc.

Is this Q the same if I take an s channel or a t channel process

No, Q is only defined in the t channel, with incoming p1 p2.
Comment: Hi @anna, thanks for your answer. What I don't understand is why all people say: "At LHC we look at high $p_T$ events, as these events are due to deep inelastic scattering processes". This statement works for a process with a photon exchanged in the $t$ channel. But take a Drell-Yan process: $q\bar{q}\rightarrow \gamma^*\rightarrow q\bar{q}$, which happens in the $s$ channel. In this case the two out-coming quarks (which I'll see as two jets) won't have a preferred direction (i.e. they won't be necessarily at high $p_T$). Am I wrong?
Comment: One chases high ptransverse events because they are the true picture of the center of mass interaction, the transverse component does not change with the Lorenz transformation. It is sufficient for an interesting event to have a high pt because it shows high break up at the cms.  Identifying the pt with Q2  is a mathematical definition which in terms of Feynman diagrams may be useful or not.


sharingd wants to use the "Local Items keychain

Question: Every time after I log into my computer the first thing that happens is I get this message even if I put in the password. I can click it 3 times or so and it will go away, or I can give it the password but it will come back. I want to know what is sharingd? It looks like the terminal screen on the lock. Can anyone explain?
Answer: What is sharingd?
sharingd is sharing daemon that enables AirDrop, Handoff, Instant Hotspot, Shared Computers, and Remote Disc in the Finder.

How to solve asking for password problem?
I think the login password and the keychain are not the same. That's why you get those messages. You want your default keychain to be unlocked automatically when you log in. Synchronise your Keychain Access and account login passwords by doing this:

Open Keychain Access (you can get to it by choosing Utilities from the Go menu in the Finder).
From the Edit menu, choose Change Password for Keychain "login."
Type the former password of the account that you are currently logged in to, then click OK.
If you entered the correct password, a new window appears; enter the original password again in the Current Password field.
In the New Password field, type the password that matches your current account password.
Re-enter the newer password in the Verify field, then click OK.
Comment: For point 2: That is "choose the Keychan 'login' in the menu on the left before going for the menu bar.


Noether's theorem and Invariance of Lagrangian under translation

Question: Consider a coordinate system in which the point A has coordinate $z_0$ and point B has ccordinate $z$ where there is a particle of mass $m$. Let there be a constant gravitational field of Earth. The Lagrangian of a particle in this system is given by $$L=\frac{1}{2}m(\dot{x}^2+\dot{y}^2+\dot{z}^2)-mg(z-z_0)$$ where the potential energy of point B is measured w.r.t point A. Now consider different coordinate system where the origin is shifted from $x=y=z=0$ to $x=y=0,z=\alpha$. In this coordinate, A has coordinate $z_0+\alpha$ and B has coordinate $z+\alpha$. Therefore, although the coordinate $z$ is not cyclic, the Lagrangian remains invariant under translation in the $z$ direction. Therefore, by Noether's theorem, the momentum $p_z$ should be conserved. But as we know this is not the case due to constant gravitational field along $z$-direction. Is this not a contradiction?
Comment: If your $z_0$ is a *fixed point*, then it is *not acted upon by translation*. By definition, a symmetry transformation can only act on the dynamical variables, not on constants, so your Lagrangian is not invariant.
Comment: You have to look at what a transformation for the Noether theorem is - it is a transformation *of the dynamical variables*. Your translation of the coordinate system does not fulfill the technical prerequisites of Noether's theorem.
Comment: A is a fixed point. $z_0$ is the coordinate label of A that will change under the change of coordinates system. I don't get your point. Think of a coordinate system and translating it.
Comment: Here I'm talking about translating the coordinate system not the particle itself. If I changed the location of the particle B, then yes, you're right.
Comment: Okay. Now this makes sense to me. It is true that if a coordinate is cyclic, the corresponding linear momentum is conserved (as can be seen from Euler-Lagrange equation). Is the reverse also true? I mean, can the Lagrangian be invariant under $q_i\rightarrow q_i+\alpha$ without $q_i's$ being cyclic? Or should I post it as a different question?
Comment: @SRS That is simply the meaning of "cyclic".
Comment: I was thinking of a different mathematical scenario (and looking for a physical realization) in which the Lagrangian is conserved under translation without the coordinated being cyclic. For example, can we not have two different dynamical variables $x$ and $y$, appearing in the potential as some function of $f(x-y)$? If this be the case, neither $x$, nor $y$ will be cyclic. However, the Lagrangian $L$ will be invariant under $x\rightarrow x+\alpha$ and $y\rightarrow y+\alpha$.
Answer:
ACuriousMind has already pointed out in comments the crucial point: $z_0$ is an external parameter, not an dynamical variable of the action $S[x,y,z]$.
OP then ponders in a comment what happens if we artificially promote $z_0$ to a dynamical variable of the action $S[x,y,z,z_0]$? Nevermind this possibly does not make physical sense. What would be the mathematical consequences for Noether's theorem?
OK, let's investigate. The translations $$ z ~\longrightarrow ~ z+\alpha, \qquad z_0 ~\longrightarrow ~ z_0+\alpha $$ is indeed an exact off-shell symmetry of the action $S[x,y,z,z_0]$. Noether's theorem then therefore states that the corresponding Noether charge $$p_z~:=~\frac{\partial L}{\partial \dot{z}}$$
is conserved on-shell
$$ \frac{dp_z}{dt}~\approx~0. $$
[Here the $\approx$ symbol means equality modulo eom.]
Only trouble is that the eom for $z_0$ reads
$$ 0~\approx~\frac{\delta S}{\delta z_0}~=~mg, $$
i.e. if we want to put the system on-shell, we would have to turn off gravity! And then $p_z$ would be conserved on-shell. Therefore Noether's theorem is not violated.


Keeping Azure MARS backup after server deleted

Question: An Azure Windows file server was backing up its files using the MARS agent into the recovery services vault and is listed as a protected server (see below). This server has been superseded but before I delete it, I want to check that the MARS backup will be preserved. My client needs to keep this historical backup for many years.
Answer: Deleting the VM has no effect on the backup itself. Also have a look here
Even if you would delete the backup with all the recovery points the backup data would be retained for 14 additional days (assuming soft delete is enabled)


Looking for a short story I read in the 1960s about an alien hunting an earthman

Question: My impression is that the hunt occurred in the dark in an abandoned city.  The intelligences of different species of aliens were closely graded, for example 13.7 compared to 13.5.  For some reason I associate the story with another plot in which humanity has fled the Earth but centuries later a ship returns to the "Hall of Departure" on Earth.  Any clues or leads appreciated.
Comment: Do you recall why the alien was hunting the earthman? And did the alien get him in the end, or did the earthman escape, or kill the alien? Also, did you read this in a magazine, or in an anthology?
Comment: If anyone correctly identifies the story you're looking for, please mark that answer as [accepted](https://scifi.stackexchange.com/help/accepted-answer) by clicking on the check mark beneath the voting buttons. Or if the only answers posted are incorrect, please indicate that with a comment so we know to keep looking. Thanks.
Answer: This sounds very much like Star Rangers by Andre Norton from 1953.
The Central Control ship Starfire crashes on an unknown planet.  They discover native inhabitants on the planet after initially believing there was no intelligent life there.
After some time, they discover an abandoned city.  Other people from Central Control planets have settled there.
The crew of the Starfire and the people who have taken refuge in the city are from various planets that individually developed life - there's humans and lizard men and other variants of upright bipedal humanoids.
Common to all of them are telepathic abilities.  The abilities are rated by numbers.  That's your "13.7 compared to 13.5."
There is a (telepathic and physical) fight (at night, in the rain) in the city between one of the refugees (known as "the Arcturian") and a member of the crew of the Starfire.  The Arcturian loses - despite having the higher rating.  He was sick (had a fever and hallucinations) during the fight. Besides being a megalomaniac he had also accidentally/negligently infected some of the native inhabitants with whatever virus he had.
In the end, it turns out that the planet is Earth.  They do indeed find a "Hall of Departure" from which humans had set forth to colonise the other planets thousands of years before.  Earth had become a legend, and no one knew really where it was any more.
Comment: Aka _The Last Planet_, as noted in the link.  This was one of Norton's earliest SF novels in her "galactic" setting.  Critics have remarked that The Hall of Leave-Taking mentioned lots of nearby stars, even Alpha Centauri(!), and it was implied those names were still familiar.   So how could Earth--and Sol--have been lost?  In her subsequent "galactic" books Norton seemed careful not to mention any real stars.


How can I mount a window fan in a very tall slider?

Question: I am looking for a way to mount a window fan like this one in my apartment.  The only windows my unit has measure 70" x 58" (H x W) with 29" wide slider panel which opens horizontally.  This is too tall to mount most window fans as the extenders don't usually stretch past 3-4'.
Comment: stack two of them, then you need to cover 3', which is a size you already found. If you want to get fancy you could wire them together for a single control/plug. It would be nice to push top and pull bottom...
Comment: Are we to assume you'd rotate the fan sideways? I just wouldn't do that. Problem solved.
Comment: Plywood.  Problem solved!
Answer: Window fans and window air conditioners seem to be almost universally designed to work with single-hung or double-hung windows -- that is, windows in which a sliding sash moves up and down rather than sideways. Installing one of these in a horizontal window will be a fight from the moment you open the box.
The first thing is to prevent the sash sliding sideways (opening) any further than needed to accommodate the fan. The same techniques that prevent a burglar forcing entry by sliding the window work here: a wood dowel in the sliding track, a clamp to the window frame, etc.
Assuming the fan rests at the bottom of the opening, the second thing is to block the space above the fan. Depending on your requirements for security, aesthetics, air sealing, and weather resistance you might choose acrylic or polycarbonate sheet, plywood, or even cardboard. A foam gasket around the sheet can improve the weather seal. Whatever the material it'll need to be trimmed to fit. Shims or a narrow block of wood on the fixed side and top of the frame can help to hold the sheet in place. The side that interfaces with the window sash is difficult: a person could make or find some kind of U- or H-profile channel that fits nicely around the edge of the sash, but it might just be too much trouble.


Even when the enable Pin is low, Im getting voltage on the output

Question:
Hi,
Im using TPS53353DQPR to generate 3V3 from 12V0. Even when the enable pin is low , there is around 2.5V on the output. I removed FB5, still there is voltage on output when enable is low.I tried isolating it from all the possible leakage points but Im unable to bring it down . Is there any possible solutions that i can implement? Thanks
Comment: It looks like you did not manage to remove all the possible leakage points. Show the schematics to see the rest of the circuit and tell more what you tried to do to isolate the leakage.
Comment: If you removed FB6 then where would the output voltage be leaking from? R117? seems unlikely but you could test that hypothesis by measuring the VFB voltage.
Comment: @user253751 The leakage could come via any circuit that is powered by the 3.3V supply but not shown on this schematic page. It could even come via R123 for all what we know. Also, there is no FB6 shown on the schematics. It might be a typo or not, as  there is FB5 in the schematics.
Comment: @Justme  can i know how the leakage can come from R123 that is on the Power good pin?
Answer: "There is 2.5V on the output". You're measuring it with a multimeter with 10MOhm+ input impedance. It doesn't take much to drive 2.5V into megaohms. Try loading that output down with say 1kOhm resistor and see what you measure then. My hunch is that it'll be <1mV.
But make sure you're telling us the full picture: the circuits that use VCC_PROC_PCH_3V3 cannot be connected to any other power source either, and they can't have their inputs driven by external circuitry either.
Remember that you can make some CPUs run on nothing but parasitic power coming on the digital logic lines. That's what happened to the very first ARM processor prototype (look on YouTube for some entertaining material about that). It appeared to consume a zero current: due to a mistake in the test setup, it was not fed any power, but instead was running on the current sourced from the bus pins driven by other ICs that were powered on, such as memories :)
Comment: Hey, I cant post the whole schematic for NDA and the design is huge. I wanted to know if is there any way possible to remove this voltage by any method? Thanks
Comment: And i also tried Pulling it down. i used 100Ohm resistor. 1.8V was found.


Bought domain for $10, a year after asked for $25 to renew

Question: I bought my domain name 1 year ago from Godaddy for as cheap as $10. A year after I received a reminder email from them asking to renew my domain. After following renewal instructions I ended up with a cost of $25. The checkout page contains 2 items though, which both look the same to me, would it be safe to remove one? Screenshot:
Comment: Make sure that email really came from godaddy. There is a scam email that does this very thing you wrote about. In fact, if you could post the contents of the email in your question, that would be helpful.
Comment: Did your domain expire? What is the TLD? Are you sure this is just the domain or domain + hosting? There is a fee round about that if your domain has already expired and the renewal falls outside the grace period. depending on the TLD, the price would almost always go up (particularly with GoDaddy), but that cost almost certainly includes something else.
Comment: Did you buy it with some discount or deal? They will typically charge the real price after a year. If not, it can be the that the renewal price you see is for more than one year.
Comment: I echo what John says. Be sure that you really are facing a $69 renewal. This is not a normal fee for GoDaddy. It is somewhere around $15 and $10 more with privacy. It is possible that the TLD requires a higher fee. You have not given us enough information to know. Can you post an anonymized version of the e-mail? That will allow us to evaluate what you are seeing. Cheers!!
Comment: I'm betting they're charging you for the anonymous whoisGuard fees which are about $10. That should be optional. If they're forcing it, you need to find another registrar.
Comment: My bad, the $69 actually included the ssl certificate service which I didn't even ask for. Omitting the service and proceeding to the checkout page I ended up with $25 total, I'm seeing 2 items in the checkout page though, and I'm not sure if I need both... please see edited question, would it be safe to remove one item? they look quite the same
Answer: It's quite typical of GoDaddy to have a low introductory offer for the first year. But the "renewal" costs are hard to find. This is, unfortunately, quite common practise, but not necessarily "standard". It relies on the fact that most users probably don't change the registrar. But this domain might have been heavily discounted in the first year. Personally, I avoid registrars/hosts that are not upfront with their costs and prefer registrars have the same registration/renewal costs.

if so, is there anyway I can change my registrar while keeping the same domain name for cheaper rates?

Yes, you can change registrar at "any time". Providing you're not too close to renewal and they've already taken payment! It can also take several days to transfer the domain - but that doesn't necessarily mean any down time.
There might also be restrictions on transferring a domain too soon after registration. eg. in the first 3 months.
Also, some registrars might charge an additional "admin" fee for transferring away. Need to check their T&Cs. Again, I would avoid any registrar that imposes additional fees like this, most do not. (I don't think GoDaddy does.)

And, as mentioned in comments, be wary of any scam emails (that have plucked your details from the WhoIs database) trying to get you to "renew" with them, rather than your real registrar.
Comment: My answer still stands. GoDaddy's renewal fees are nearly always higher than the initial registration. The "Private Domain Registration" was perhaps included for free in the first year (a common sales promotion) - that does say "Renewal", so presumably you did have that in the first year?
Comment: Thanks for answering, please see my edited question... I was actually mistaken, the $69 included the ssl certificate service which was suggested out of nowhere and included in the total before proceeding to checkout
Comment: Yes, I recall having purchased it for privacy (see my comment to @Rob's answer). It doesn't seem like I have the option to opt out, am-I forced to repurchase the privacy service?
Comment: The privacy service renewal should not be mandatory.
Comment: Yes, I managed to turn off privacy, marked as solved! sorry for misleading question.
Answer: So it was WhoisGuard fees for $10. This gives you anonymity for "whois" so no one can see your registration information online. You don't have to accept that. What will happen is, when someone does a "whois yourwebsite.com", it will show GoDaddy contact information instead of your personal or company information.
If you didn't ask for whoisGuard or SSL, and GoDaddy tacked that on automatically, I will add that to my list of 9634 reasons I won't use GoDaddy for anything.
Comment: I don't know what GoDaddy's term means exactly but you should not, in any way, be required to purchase it.
Comment: I recall having opted for the anonymity service "WhoisGuard" in the past, but not ssl which yes was suggested out of no where, I did not ask for the service. I'm assuming "WhoisGuard" would be the second item "Private Domain Registration Renewal", doesn't seem like I have the option to remove it though, am-I forced to re-purchase it?
Comment: Will have to contact them I guess.
Comment: My registrar has free anonymous whois.  GoDaddy are price gougers.  And don't get me started on their pretend dedicated servers.


How can I create a smart contract using another smart contract?

Question: I want to create a smart contract which I can link to my website using web3.js and create input fields for creating a contract using the main contract and I can set the fees also which should go inside the main contract for creating a contract.
Please let me know if this is possible.
Answer: Its not straight forward but here is an example from uniswap: uniswap createpair function
It boils down to using the evm create2 opcode: create2


Sniper bolt warping when rotated in pose mode

Question: I'm trying to rig a bolt action sniper. I made sure the bone root was in the dead center of the bolt's selected vertices. However when I go to rotate the bolt's bone in pose mode, the bolt warps and basically looks like its being scaled down. How do you properly set up a bone on a sniper bolt? So it can be realistically rotated bolt-action style?
Blender file just int case
Answer: If a vertex is assigned to two or more bones, its movements will be conditioned by the position of all the bones involved, while if it's assigned to one bone only (even with a small amount of weight) it will follow the movements of that bone exactly.
The "correct" way to rig, in your case, could be to have a bone controlling all the gun except the bolt vertices, and a second bone - child of the "main" bone - controlling only the bolt vertices.
In this way you can avoid any deformation of the objects.
Don't use automatic weighting, use "with empty gorups" option instead, then select all the bolt, select the bolt bone's vertex group and click "Assign" button underneath the vertex group list.
Do the same for the main bone (which has to be the parent of the bolt bone), selecting all vertices except the bolt.
Comment: There's never only one option for doing things, it depends. For instance bone animations can be exported to a game engine, while Blender constraints not. So, it depends.
Comment: Are bones really necessary here?  I would be tempted to parent the bolt to the gun and set a constraint.  I ask because I am not familiar with bones being used in this way.
Answer: So I guess you cannot assign the entire gun to a bone and have other bones assigned to sub-sections of the gun. When i unassigned the entire gun from the handle bone the bolt rotated normally without warping.


Does anyone regularly use FLAC compression for their acoustic data?

Question: We have a large (>500TB) acoustic dataset that so far has remained uncompressed. I am considering going back and FLAC compressing all of our data in order to make data transfers and archive easier and more cost-effective. However, it is active storage and the data are still regularly accessed and used for different projects. MATLAB will read FLAC data using audioread.m and I think PAMGuard will read FLAC files as well. I don't know a ton about data compression, will you lose data processing efficiency if you directly read in FLAC files without uncompressing to WAV? Either because it takes longer to read from FLAC, or because the file is being uncompressed and held in memory? Are there other factors that make FLAC compression not feasible for actively used data storage?
Comment: PAMGuard will indeed read and write FLAC files.
Comment: A couple previous posts on different forms of compression, file types, etc. - https://bioacoustics.stackexchange.com/questions/344/how-if-at-all-are-you-compressing-your-recordings AND https://bioacoustics.stackexchange.com/questions/48/does-the-file-format-of-audio-recordings-e-g-wav-vs-mp3-matter-if-you-are-p/62#62
Comment: @AnnAllen -- If one of the answers below answers your question, please 'accept' the answer by checking the checkmark under the vote tally. See https://stackoverflow.com/help/someone-answers
Answer: Any compressed file will take longer to read than a raw uncompressed file simply because the CPU has more stuff to do and, since we are dealing with very large data volumes, this can lead to large increases in processing time. For long term storage, it is also more risky to hold compressed files because a single bit of corruption might make all or part of a file unreadable. If a single bit is switched in a raw file then it alters only one sample (usually).
As a side note, here is what we usually do with high frequency X3 compressed data recorded in the marine environment: The data are roughly x4 compressed - we decompress and then run through PAMGuard (note soon PAMGuard will directly read these files so decompressing will be unnecessary). We run a high false positive rate click detector, noise metrics and LTSA on the full bandwidth data (384 or 576kHz sample rate usually). We also decimate the data to 96kHz sample rate and save that as uncompressed wav files. Once processing has finished we dump the full bandwidth decompressed files and keep only the full bandwidth X3, PAMGUARD binary/database and raw 96kHz wav files.
The reason for doing things this way is that there is very little other than echolocation clicks in the higher frequency band but at 0 - ~50kHz the soundscape is much more complex, with many many different animal vocalisations, environmental and anthropogenic noise (e.g. dolphin whistles, fish grunts, seal scarers etc.). We can be pretty sure that a high false positive click detector, LTSA and noise metrics will extract everything we need in the higher frequency band but automated analysis of the lower band is extremely difficult, so we just save the raw files. That way, we have a much smaller easier to handle dataset that has 99% of what we need but also the archived compressed files just in case. Obviously this strategy is species and environment specific but gives an idea of a data management approach.
Comment: It depends on the bottleneck. When you have network attached storage, data transfer is slow, and if your processor is powerful, then compressed files load much faster than uncompressed, because less data needs to be transferred.
Comment: Yes, good point.
Answer: I have worked with relatively large FLAC data sets (a few TB, not anywhere near 500 TB!) and been very happy with it/have no issues to report. I am not an engineer so am coming at this opinion from the analyst end user side of things. I find FLAC is very easy to work with and don't notice a slow down in processing time, with the caveat that I haven't done any timed tests, and that I am primarily working in MATLAB.
The WISPR system that I've worked with extensively over the last several years records directly to FLAC. In our first years with that project we were converting the FLAC to wav for any bioacoustic analysis. But, in recent years we stopped doing that because we found it unnecessary; most programs can now read FLAC directly (MATLAB, Raven, Audition) and I modified a version of Triton that can make LTSAs directly from FLAC files (I have it forked from the main Triton repository on GitHub and am always looking for people to try it and point out bugs :)).
I have not personally compressed wavs to FLAC using the executable mentioned in this answer, but I have gone from wav to FLAC and back just using audioread and audiowrite in MATLAB. I assume that is not the fastest choice, but I find it is fast enough for a few TB of data. I
Answer: Yes, I almost always store large acoustic files in FLAC. It's usually not an issue for smaller files of 10s or even 100s of GB, but files in the TB+ range get unwieldy fast.  And moving them is like watching paint dry.
If you have data in the 100s of TB, you will definitely notice your data transfer time significantly decrease...and of course your storage costs. As mentioned above, most acoustic software lets you work directly from FLAC.  If it doesn't, it will provide a conversion function. On modern systems, I haven't noticed that much of a performance hit.  Conversion is pretty easy to script in just about any modern language.
Besides the decreased storage requirements, FLAC is a lossless compression, it's open source, and it's available for all major platforms directly from the people that maintain it (https://xiph.org/flac/)...or your favorite software. I personally like the idea that it isn't proprietary.
If you are planning to submit acoustic data to NOAA/NCEI, they prefer FLAC.
Answer: FLAC is great. I hope to see more projects and application programs using it. Compressing takes a bit of CPU time but uncompressing is easy. Depending on noise level, I get a compression to about 1/2 or 1/3.
Answer: Our usual workflow with FLAC is to leave projects that are not being actively analyzed saved in FLAC, which gives us about a 50% file size reduction, while projects that are being actively analyzed stay in WAV format because it's easier to work with, especially in R with seewave and tuneR.


Problem during Ubuntu 15.10 boot process

Question: I might have a problem, which I do not know how to solve:
I have installed Ubuntu 15.10 on my PC, which is equiped with a Nvidia GeForce GTX 980 StriX graphics card.
What happens, when the system boots is, that first I can see the "eggplant" colored starting screen and normally I would also see the Ubuntu logo with the box below it, where I type in my password. But this does not happen.
What happens is, that my computer screen suddenly turns black, then blue with "No HDMI 1 connection", but this can't be, because my screen is linked by HDMI cable with the graphics card of my computer.
Now, what I found out by coincidence is, that when I disconnect the hdmi cable and reconnect it with the computer again, suddenly the startung screen with the Ubuntu logo and the password box appears again, like it was always there. From that point on everything works fine, the computer and the system run normal.
Btw, I already tried the "nomodeset"-thing, as well before installation as after the installation, but that totally messed up everything. After restart I wasn't even able to enter my password in the pw box anymore, because when the Ubuntu starting screen appeared (this time like it should always do), it had a very bad resolution and instead of typing my password inside the pw box, the letters appeared in the left upper corner of my screen and they were white letters on a black background. Oh, and they could be seen, of course, so no "super secret password" anymore.
Does anyone have an idea what the problem could be and how it can be solved?
There is something I am not sure about:
When I go to System -> Applications and Update -> Additional Drivers, I can choose between two different drivers for my graphics card:
1st: NVIDIA binary driver - version 352.63 used by nvidia (proprietary, tested)
2nd: NVIDIA binary driver - version 352.63 used by nvidia (proprietary)
Currently the X.Org-X-Server-Driver is marked and used.
If you need any more information about the hardware I am using or anything else, please ask what you have to know to give an answer to my problem.
Thank you and best regards
Moe
Btw: I am a Ubuntu beginner.
Answer: You might want to have a look on this post. Seems like you are encountering the same issue.


$|\nabla f (x)| =1$ implies $f$ linear?

Question: Suppose $f: \mathbb{R}^n \to \mathbb{R}$ is smooth and $|\nabla f (x)| = 1$. Must $f$ be linear (up to an additive constant)? That is, must we have $f(x) = a\cdot x +b$ for constant $a,b\in\mathbb{R}^n$ with $|a| = 1$?
Comment: If it is true, then it's not for any simple local reason. If we remove just one point from the domain, then it's not true anymore, because the distance to the removed point is then a solution.
Comment: Does this answer your question? [Function whose gradient is of constant norm](https://math.stackexchange.com/questions/867992/function-whose-gradient-is-of-constant-norm)
Comment: It is true, but the argument I can come up with for it is based on the fact that the integral curves of a constant norm gradient are geodesics, which leads to geodesic crossing problems if you have a non-constant direction of the gradient
Comment: Actually the sketch of a proof that I'm thinking of only works for $\mathbb{R}^2$, though i suspect the result is true generally.
Answer: Yes, this is true: smooth global solutions of the eikonal equation are affine. The proof is similar to Solution of eikonal equation is locally the distance from a hypersurface, up to a constant. It goes like this:

By the mean value theorem, $f$ is $1$-Lipschitz.
Trajectories of steepest ascent/descent, i.e., solutions of the ODE $x'(t)=\nabla f(x(t))$ both forward and backward in time, are straight lines. Indeed, along such a curve we have
$$|x(t)-x(s)| \ge |f(x(t))-f(x(s))|=|t-s|$$ which, the curve being unit speed, implies that it's a line.
Let $\Gamma$ be any level surface of $f$ (WLOG,  $G=\{f=0\}$), and $L$ a normal line to this set. By item 2  above, $L$ a path of steepest ascent/descent. Choose coordinates so that $L$ is the $x_1$-axis. The restriction of $f$ to $L$ is either $x_1$ or $-x_1$. The $1$-Lipschitz condition implies  $\operatorname{dist} (te_1,\Gamma)=|t|$ for all $t\in\mathbb{R}$. Hence, $\Gamma=\{x:x_1=0\}$.
Since all level surfaces are planes, and they are disjoint, they must be parallel. After rotation, $f$ is a function of $x_1$ only: more specifically,  either $x_1$ or $-x_1$.

$|\nabla f (x)| =1$ implies $f$ linear?


Do double-pole breakers allow the rated current or twice that amount?

Question: We are installing 2 double pole 40 amp breakers for an electric tankless hot water heater, into our 200 amp panel. Is that going to use 80 amps or 160 amps?
Answer: Assuming you are in the USA, this will allow up to 80 amps @ 240 volts, out of the 200 amps available.
Answer: The draw will be less than 80 amps, code limits the breaker size to 60 amps with the current draw at a max of 48a NEC 424.22 so multiple breakers are used the wattage of the heater will provide the maximum demand that the heater will use.


IPV6 Support For Cisco Nexus Switches

Question: Does CISCO Nexus 3548P-10G L3 Switch Supports IVP6? What are some other alternative L3 Switches with same or slightly higher hardware configuration as CISCO Nexus 3548P-10G and IPV6 support
Comment: Surprisingly (at least I was surprised), it does not run any v6 routing protocols.  So I'd say support was "limited."   Other product recommendations are off-topic for this forum.
Comment: Did any answer help you? if so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you could provide and accept your own answer.
Answer: I'm responding because you're asking for alternatives. Have you considered the Brocade VDX 6740 or 6740-T? Both come with a very similar CLI to the Nexus, and are extremely affordable when compared to the N5K, yet way more solid than the N3K.
They also come with the layer 3 capabilities available off the bat. No need for additional licensing or hardware modules for routing.
Comment: Product or resource recommendations are explicitly off-topic here, as they are on most SE sites. There is [hardwarerecs.se] for this sort of thing.

IPV6 Support For Cisco Nexus Switches


How to replace certain blocks

Question: I was bored on Minecraft, and so I created a Superflat world with villages. Is there any way that I can replace all of the Gravel to say... TNT? I felt like being destructive, and I was wondering if there would be a faster way than manually replacing each of the gravel with TNT by hand. I don't use WorldEdit because it sadly will not run on my computer.
Comment: You can makke schematic for superflat map, so instead of dirt, there are TNTs....but that would probably be too much of them xD
Answer: This is simple to do with the /fill command. (1.8+ only)
Syntax:
/fill [x1] [y1] [z1] [x2] [y2] [z2] [BlockToFill] 0 replace [BlockToBeReplaced]
So in your case it would be:
/fill [x1] [y1] [z1] [x2] [y2] [z2] minecraft:tnt 0 replace minecraft:gravel
This will replace any gravel between the two co-ords with TNT.

How to replace certain blocks


Hyperlink in Tooltip

Question: How to create hyperlink in tooltip like in below image
Answer: You could create a custom ToolTip that inherits from System.Windows.Forms.ToolTip.
There is an example on CodeProject that adds an image to the ToolTip, you should be able to do something similar to add hyperlinks.
Answer: It's not a true tooltip - That's actually a floating window. You would need to create a window with a hidden border (titlebar etc) and set to "stay on top", then show it when the mouse moves in/out.

Hyperlink in Tooltip


How strong is Magellan?

Question: He was trusted to guard the World Government's maximum-security prison from the most dangerous criminals and pirates from all over the world, he must be extremely strong. The main reason for the mass breakout success was because he was tricked but not defeated.
Is he at par with the Admiral? Or maybe somewhere lower than that?
Answer: You cannot go by status alone to indicate someone's actual power.

 After the great breakout out of Impel Down, he was demoted to Vice-Warden. Probably because of his pride. So based on status alone you would think Hannyabal to be stronger than Magellan, which we know he is not.

 Well he wasn't before the timeskip. We haven't seen either of them after that, so it's hard to say where they stand now.

In the One Piece power system, it is actually hard to say who is stronger in general, since it depends on lots of factors, like who you are up against. For example, Crocodile was much stronger than Luffy, but Luffy still beat him by using the water trick. In my opinion I think he wouldn't be far off the admiral's level, since he beat Blackbeard's crew with just one hydro attack. Actually Magellan's power and ability makes him the perfect guy for the job and wouldn't be a good admiral. He would have a hard time arresting someone without mortally poisoning him.
Comment: To add to this in more government context. Garp is generally hailed as someone incredibly powerful and already noted as someone who should have been admiral and even fleet admiral but was content at Vice Admiral.  Same thing for a lot of positions revealed over time, they dont always equal the strength of the character.  Sometimes they are weaker like Captain Fullbody or Morgan.
Comment: Spoiler formatting is a little bit weird; I've edited your post to move the image into a spoiler block.
Answer: There is no way to know as One Piece is relative, however there are a few facts that help determine this better.  Also here's a related post: Haki vs.Venom Venom Fruit
No real way to train against being poisoned at Magellan's level of poisons, while some people like Mr. 3 and Ivankov seem to have counter measures. Even Gold Roger died from disease which indicates Haki/fortitude doesn't help against physiological changes.
He jailed and kept in line the world's worst criminals:

Many of Blackbeard's crew including Shiryu, Logia users, and strong Haki users.
Blackbeard (Yonkou) and crew were completely defeated by him. It is also worth noting that Shank's scar was given by Blackbeard before he even got the Yami Yami fruit. 1 Yonkou = Marines + Piratelords per Government's assessment.
Positions are also based on intelligence, career drive and politics.
He spent most of the day in the bathroom as he ends up poisoning his own food which his stomach can't handle. This can be argued as a negative for a position like admiral which is publicly visible.
It was never established whether or not he can use Haki. A lot of fruit users, especially powerful ones, tend to rely more on their fruits like Ace and Kizaru.
Answer: Considering that his devil fruit is of Paramecia type, he cannot be on par with admirals. Also it is unknown whether he can change his poison's composition like Coco from Toriko. If he can change then he can be considered somewhat dangerous. If he cannot change then he seems pretty useless as Iva-san had antidote for his poison. He could guard the prison because the prison had many other supporting features to trap the convicts. But that also failed. So he cannot be on same league as Admirals but much lower than them.
Comment: it is incorrect to say that a character is powerful or not just on the basis of his/her devil fruit , even paramecia types who know haki are at times at par with those of the logia type . Whitebeard had gura gura no mi ( which is paramecia ) but he was powerful than the admirals !
Comment: He cannot be equal as an admiral, knowing that admirals can use Haki while Magellan cannot. He is definitely strong, the fact that he is guarding Impel Down. In comparison, I could he is as strong as a warlord neglecting Haki.
Comment: absolutely correct. can't say anything about that. but magellan didn't show any inclination of having haki. And although it can't be compared on basis of type of fruit, but being intangible is an added advantage which is not there with paramecia.
Comment: I would say he is more powerful than Croc (who is a logia) or Gecko and likely some haki users.  I highly doubt he is as strong as an admiral (they are the strongest in the marines besides (sometimes) their bosses and Magellan is in the marines) but you can't just look at the devil fruit. It is strongly implied that Shanks is stronger than an admiral and he doesn't seem to have any devil fruit. Raliegh definitely doesn't and held his own against an admiral. Again, they have haki but Luffy defeated 2 cannon logias without haki.
Comment: @maseru There is no evidence he doesn't know Haki.  Some fruit users simply just rely on their fruits more, like Kizaru or Ace.  Also his power makes him one of the most dangerous people in the world as even Blackbeard (Yonkou) got his butt handed to him by Magellan.
Comment: @Sp0T logia isn't necessarily the most powerful though for it automatically puts you on a higher playing field.  Also Sengoku (Fleet Admiral) was a Zoan type.
Comment: @Sp0T To answer wether he can change the poison type, he can.  It was actually stated he has different versions of poisons.  His final version of the poison is an instant kill and can infect/destroy everything it touches including the ground (akin to acid). Also Ivankov didn't have an antidote, he just made Luffy's body go into overdrive to neutralize it. However Shiryu does have an antidote to atleast some of his poisons, as he saves blackbeard with it. http://onepiece.wikia.com/wiki/Magellan
Answer:
Is he at par with the Admiral? Or maybe somewhere lower than that?

Possibly around the levels of Vice admirals but then again some of the Vice admirals are extremely strong like Issho; now an Admiral.
Again like @PeterRaeves mentioned, position alone doesn't determine the strength. Its relative.
Comment: First part is a baseless comment. Please provide support if there is any for this.  As your second part mentioned it is all relative in the one piece world.

How strong is Magellan?


What do ref, val and out mean on method parameters?

Question: I'm looking for a clear, concise and accurate answer.
Ideally as the actual answer, although links to good explanations welcome.
This also applies to VB.Net, but the keywords are different - ByRef and ByVal.
Answer: By default (in C#), passing an object to a function actually passes a copy of the reference to that object. Changing the parameter itself only changes the value in the parameter, and not the variable that was specified.
void Test1(string param)
{
    param = "new value";
}

string s1 = "initial value";
Test1(s1);
// s1 == "initial value"

Using out or ref passes a reference to the variable specified in the call to the function. Any changes to the value of an out or ref parameter will be passed back to the caller.
Both out and ref behave identically except for one slight difference: ref parameters are required to be initialised before calling, while out parameters can be uninitialised. By extension, ref parameters are guaranteed to be initialised at the start of the method, while out parameters are treated as uninitialised.
void Test2(ref string param)
{
    param = "new value";
}

void Test3(out string param)
{
    // Use of param here will not compile
    param = "another value";
}

string s2 = "initial value";
string s3;
Test2(ref s2);
// s2 == "new value"
// Test2(ref s3); // Passing ref s3 will not compile
Test3(out s2);
// s2 == "another value"
Test3(out s3);
// s3 == "another value"

Edit: As dp points out, the difference between out and ref is only enforced by the C# compiler, not by the CLR. As far as I know, VB has no equivalent for out and implements ref (as ByRef) only, matching the support of the CLR.
Comment: "copy of the reference to that object" or "reference to the copy of that object" ?
Answer: One additional note about ref vs. out: The distinction between the two is enforced by the C# compiler. The CLR does not distinguish between between out and ref. This means that you cannot have two methods whose signatures differ only by an out or ref
void foo(int value) {}

// Only one of the following would be allowed

// valid to overload with ref
void foo(ref int value) {}

// OR with out
void foo(out int value) {}

Answer: out means that the parameter will be initialised by the method:
int result; //not initialised

if( int.TryParse( "123", out result ) )
   //result is now 123
else
   //if TryParse failed result has still be
   // initialised to its default value (0)

ref will force the underlying reference to be passed:
void ChangeMyClass1( MyClass input ) {
   input.MyProperty = "changed by 1";
   input = null;
   //can't see input anymore ...
   // I've only nulled my local scope's reference
}

void ChangeMyClass2( ref MyClass input ) {
   input.MyProperty = "changed by 2";
   input = null;
   //the passed reference is now null too.
}

MyClass tester = new MyClass { MyProperty = "initial value" };

ChangeMyClass1( tester );
// now tester.MyProperty is "changed by 1"

ChangeMyClass2( ref tester );
// now tester is null

Answer: One of my own questions at stackoverflow handles this topic too.
It handles about "pass by reference" and "pass by value" in different types of languages, c# is included so maybe you can find some extra information there as well.
Basically it comes down to:

ref: the parameter with the ref keyword will be passed by reference
out: the parameter with the out keyword will be treated as an output parameter

but that's really the most basic answer you can give, as it is a little more complex than it is stated here


Pre- and post- presentation data analysis

Question: I have carried out some research on whether awareness and knowledge of HIV had been increased on university students by giving a questionnaire to students before and after a presentation on HIV. Only 140 students completed the pre questionnaire and only 129 completed the post questionnaire after the presentation. So how is it possible to compare whether knowledge in students increased following the presentation as the numbers are unequal before and after? Could I compare the mean or mode score before and after even though the number of participants was different?
Comment: @AdamO I have to disagree, as bash has described, I believe, a situation in which answers were obtained just before and after a presentation, i.e., it seems most of the respondents must have been in both pre- and post- groups.  If that is true, it is too far a stretch to assume there are independent groups and to analyze the data accordingly.  You have a point in that normally it increases power to take dependency into account, but here to assume no dependency will fuzz over the group differences so much that it not only will affect F- and p-values but will in fact produce an invalid test.
Comment: Hi thankyou for your reply, but I did not record individual ID for each of the students so that is why i am in a bit of a dilemma as there is no way of knowing the students that completed both questionnaires or not.
Comment: That's unfortunate that you don't have ID. If you did have ID, you could pair tests and calculate a paired difference in response scores. However, this is not 100% necessary. You will have to make some assumptions, but naively going about treating these data as independent and calculating differences in pre/post treating them as separate populations still gives you a valid test. You just have less power to detect if your intervention was effective.
Comment: @rolando2 how do you define an invalid test?
Comment: Do you have linkages? So if ID 103A had 60% on test 1 and the same student ID 103B scored 80% on the test 2, you could say there was a 20% improvement? Do the students complete the same test at both iterations or do they receive different versions of the test?
Comment: Students also recieved the exact same questionnaire before and after the presentation. But I am not sure whether I can say awareness increased after the presentation as there is no way of knowing whether people completed both or only one questionnaire.
Answer: Few approaches were suggested to you including

t-test for independent samples - but your samples are not independent,
repeated-measures ANOVA - but you are unable to link cases,
mixed-effects model - the same problems like with ANOVA, plus you have only two groups and that is a small number for random effects.

The only one of the three that you actually can use is independent samples t-test since linkage between cases is not preserved. On another hand, there are three unknowns:

is the change in scores significant?
the unobserved scores,
the linkage between scores.

The problem is that the samples are not independent and on another hand, without linkage the dependency was not observed. Because of that you should be more cautious with possible results. I think that what I would use is actually independent samples t-test, however the one that would provide more information on uncertainty about possible results - the Bayesian implementation of it. You could use Kruschke's BEST or the implementation by Rasmus Bååth (you can download it here).
However notice also another problem: if you gave the same test to the students than their responses would not only reflect gain in knowledge but also the fact that they already have seen the questions - so it could be boring for some to answer them for second time etc. So because of all those methodological flaws I would be very cautious with the results.
Answer: You can use repeated-measures ANOVA and resort to listwise deletion (i.e. use only complete cases), or you can use mixed-effects models (also known as random-effects models, multilevel models) and avoid the need for listwise deletion.
Mixed-effects models handle unbalanced designs (where the sample size differs from one time point to the next), whereas repeated-measures ANOVA doesn't. I certainly recommended looking into mixed-effects models.
Comment: Two problems with this approach: (a) you did not record case ID's, (b) you have only two groups (some say the rule of thumb is $\geq 10$ groups for mixed models).
Comment: Thankyou I appreciate your comment, I am personally thinking the mixed-effects model might be better for my data will have a look into how to do this.


Guitar bridge out of place?

Question: I primarily play piano, but I keep an electric guitar around to play with from time to time. I don't think this is right - the bridge seems to be tilted instead of flush with the guitar. This is a Squier stratocaster, if that helps.
Answer: Your suspicion is correct -- that's not set up properly. If you take off the rectangular back panel of your guitar, you should see a number of springs that connect the metal block underneath your tremolo bridge to a "claw" piece that is screwed into the body of the guitar.
These springs should fully counteract the tension created by the strings on the other side of the instrument. You can adjust this tension by screwing the claw further into the body, and by adding more springs.
If you've got three springs in the back, that should be enough to balance strings of a typical gauge, but heavier strings may require four springs.
So presuming you have enough springs and everything in the back is in good working order, all you need to do is adjust the claw to your preferences. This kind of bridge requires enough spring tension such that it is pulled back to rest against the body of the guitar, but can be more tight to emulate a hardtail bridge (with no movement of the tremolo) or less tight if you do plan to install the tremolo arm and have some play when you move it.
The exact setting would be up to you, but if this is just a beater guitar that you want to play around with from time to time, you will probably want to add enough spring tension such that the bridge is not going to be going anywhere, even with strings installed--like a hardtail. Much less maintenance than managing a guitar with a floating or close-to-floating trem.
Also, in the present configuration, you are probably having action and intonation issues from the string saddles being closer and higher up than they should be positioned. So, you definitely want to get this fixed up.
Answer: Excellent answer above! I would also like to add, in my experience with these strat type vibrato systems, they're actually Vibrato systems and not Tremolos. But, my experience is this, after 20 some years and hundreds and hundreds of stratocaster type guitars through my workshop.. not all of the Claw Springs are the same.
Depending on the maker of the guitar, or more importantly the country of manufacture, not all springs are made of the same materials. I've had some Squier strats with very soft and flexible springs on the spring claws. They almost have a sort of blueish look to the metal of the springs. Even with the spring claw screwed all the way close to the body of the guitar, the bridge would still lift up one me.
When I'd go to bend a string, the springs would still let the bridge lift up off the body. It was set with just a set of 9 gauge strings, low action and three springs on the claw. So if I had say an open bass note ringing and bending a single string like say a g string, the force from the bend would pull the bridge up with the bend, and throw my bass note flat. So not all springs are made the same.
Some have softer material they're made with where others have a stronger metal material. Also, if your springs are nickel plated or chrome plated, that helps add strength to the springs so they do not become to flexible. The unfinished springs, the blue looking kind, I think just don't hold the tension at all that well on some guitars. I usually would replace the cheaper springs out with some good nickel plated ones and the problem was solved.
Another thing I want to add is this, if you don't ever want to mess with the springs again, or worry about cheap ones letting your bridge plate ever lift from bending strings.. you can do one simple thing. Simply block the bridge in place. You take a block of wood that fit between the body cavity of where the vibrato block is and the body of your guitar, and place a wooden block between the two, that fits snug. This way, if you ever do some hard bending, the wooden block will not allow the metal block of the vibrato plate to be lifted up from the springs. Its a cool way to stop any tuning issues with those strat vibrato systems.
And if you want to ever use your vibrato you can just install your whammy bar and lift up and let the block slip out. And you're good to go again. After years of having so many guitars with different strat floating vibratos, I've found not all the springs are the same. Some are thin gauge of wire and others are bigger, some are soft metals and some are hard metals. Anyways, just a tip for anyone having the same problems.

Guitar bridge out of place?