Show a ManyToManyField as Checkboxes in Django Admin

Question: Is there a simple way to show a ManyToManyField as Checkboxes in Django Admin?
Thanks in advance!
Comment: I would suggest changing the accepted answer, so as to not confuse visitors.
Answer: From this answer it seems like it is possible to use ModelAdmin.formfield_overrides to override the ManyToManyField to use CheckBoxSelectMultiple:
from django.db import models
from django.contrib import admin
from django.forms import CheckboxSelectMultiple

class MyModelAdmin(admin.ModelAdmin):
    formfield_overrides = {
        models.ManyToManyField: {'widget': CheckboxSelectMultiple},
    }

I haven't tried it and am merely quoting from the source, but it seems plausible. Good luck.
Warning: as @errx rightly pointed out, the documentation highlights the following caveat:

If you want to use a custom widget
  with a relation field (i.e. ForeignKey
  or ManyToManyField), make sure you
  haven't included that field's name in
  raw_id_fields or radio_fields.
formfield_overrides won't let you
  change the widget on relation fields
  that have raw_id_fields or
  radio_fields set. That's because
  raw_id_fields and radio_fields imply
  custom widgets of their own.
Comment: there is a warning from django docs.
If you want to use a custom widget with a relation field (i.e. ForeignKey or ManyToManyField), make sure you haven't included that field's name in raw_id_fields or radio_fields.

formfield_overrides won't let you change the widget on relation fields that have raw_id_fields or radio_fields set. That's because raw_id_fields and radio_fields imply custom widgets of their own.
Comment: Thanks for the heads up. Will place warning in answer.
Answer: This is most certainly possible. Here is the code which you can place in the ModelAdmin subclass:
def formfield_for_manytomany(self, db_field, request=None, **kwargs):
    if db_field.name == 'your field name':
        kwargs['widget'] = form_widgets.CheckboxSelectMultiple()
        kwargs['help_text'] = ''

    return db_field.formfield(**kwargs)

This was derived from looking into the admin code.
Answer: To override for a single field the following is useful:
def get_form(self, request, obj=None, **kwargs):
    form = super(VNodeAdmin, self).get_form(request, obj, **kwargs)
    form.base_fields['node_type'].widget = forms.CheckboxSelectMultiple()
    return form

Answer: I think there is no simple way to do this. You can try to override ModelAdmin class but this is not a "simple" way.
But you can use filter_horizontal or filter_vertical to add almost similar functionality
http://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.filter_horizontal


MVC2 w/Areas Updated ChildApp.dll - Renders blank page/Error BC30456: 'Title' is not a member of

Question: We have an MVC2 app using Areas. The app contains many child apps, each consisting of an MVC Child Application and a Child DataLayer class library (ChildApp1 and ChildApp1Data).  The MVC Child App, and the DataLayer class library DLL's are deployed into the Parent bin folder, and the views into the Parent Areas folder.  The app is deployed at client site and working great.
We have not had any problems delivering updated dll's for child apps until now.
We have now delivered an updated Child MVC App DLL and DataLayer dll (ChildApp1.dll, ChildApp1Data.dll) to the bin folder.  The views were not updated.
In this case the ChildApp1.dll was a newer compile, but the source DID NOT CHANGE.  Only the DataLayer was changed. (Support delivered the current pair together).
Now, when the Main.aspx page is rendered by the controller, the page is blank.  View source reveals the following:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<META content="text/html; charset=windows-1252" http-equiv=Content-Type>

Error BC30456: 'Title' is not a member of ... is logged.
The Main.aspx page starts with:
<%@ Page Title="" Language="VB" MasterPageFile="~/Views/Shared/Main.Master" Inherits="System.Web.Mvc.ViewPage(Of SSManager.MainFormView)" %>

What could be causing this?
A search for "dpieagent_htmladvised" hasn't turned up any indication of what it is or where it came from.
After significant research, I have seen the cases where System.Data.Entity is an issue.  We do not use Entity anywhere.
I have seen the issues where the class name has caused problems.  The Class Name in SSManger was not changed, and the form view model MainFormView was not changed.
The environment is an IIS 6 webfarm, with F5 load balancer.
If I remove the strongly typed view model the page loads:
<%@ Page Title="" Language="VB" MasterPageFile="~/Views/Shared/Main.Master" Inherits="System.Web.Mvc.ViewPage" %>

Any help/info would be greatly apppreciated!
Answer: Did you try to add the SSManager complete namespace at the web.config system.web/pages/namespaces references?
Something like:
 <system.web>
     <pages>
         <namespaces>
            <add namespace="ChildApp1.SSManager"/>
 ...

Comment: Thanks Oleiro, but the DLL in question is a DataLayer module.  No classes from it are referenced in the view.  If we use classes in a view. (We typically use an Imports directive on the page anyway).  We have successfuly replaced DLL's in the bin folder for over a year.  This one has presented this unique error.


What is the Difference Between Mercurial and Git?

Question: I've been using git for some time now on Windows (with msysGit) and I like the idea of distributed source control. Just recently I've been looking at Mercurial (hg) and it looks interesting. However, I can't wrap my head around the differences between hg and git.
Has anyone made a side-by-side comparison between git and hg? I'm interested to know what differs hg and git without having to jump into a fanboy discussion.
Answer: These articles may help:

Git vs. Mercurial: Please Relax (Git is MacGyver and Mercurial is James Bond)
The Differences Between Mercurial and Git

Edit: Comparing Git and Mercurial to celebrities seems to be a trend. Here's one more:

Git is Wesley Snipes, Mercurial is Denzel Washington
Comment: "Git vs Mercurial Please Relax" is seriously out of date, although it's as old as this question. Maybe this question should be deleted and re-opened now that both tools have had 3+ years of features added.
Answer: I work on Mercurial, but fundamentally I believe both systems are equivalent. They both work with the same abstractions: a series of snapshots (changesets) which make up the history. Each changeset knows where it came from (the parent changeset) and can have many child changesets. The recent hg-git extension provides a two-way bridge between Mercurial and Git and sort of shows this point.
Git has a strong focus on mutating this history graph (with all the consequences that entails) whereas Mercurial does not encourage history rewriting, but it's easy to do anyway and the consequences of doing so are exactly what you should expect them to be (that is, if I modify a changeset you already have, your client will see it as new if you pull from me). So Mercurial has a bias towards non-destructive commands.
As for light-weight branches, then Mercurial has supported repositories with multiple branches since..., always I think. Git repositories with multiple branches are exactly that: multiple diverged strands of development in a single repository. Git then adds names to these strands and allow you to query these names remotely. The Bookmarks extension for Mercurial adds local names, and with Mercurial 1.6, you can move these bookmarks around when you push/pull..
I use Linux, but apparently TortoiseHg is faster and better than the Git equivalent on Windows (due to better usage of the poor Windows filesystem). Both http://github.com and http://bitbucket.org provide online hosting, the service at Bitbucket is great and responsive (I haven't tried github).
I chose Mercurial since it feels clean and elegant -- I was put off by the shell/Perl/Ruby scripts I got with Git. Try taking a peek at the git-instaweb.sh file if you want to know what I mean: it is a shell script which generates a Ruby script, which I think runs a webserver. The shell script generates another shell script to launch the first Ruby script. There is also a bit of Perl, for good measure.
I like the blog post that compares Mercurial and Git with James Bond and MacGyver -- Mercurial is somehow more low-key than Git. It seems to me, that people using Mercurial are not so easily impressed. This is reflected in how each system do what Linus described as "the coolest merge EVER!". In Git you can merge with an unrelated repository by doing:
git fetch <project-to-union-merge>
GIT_INDEX_FILE=.git/tmp-index git-read-tree FETCH_HEAD
GIT_INDEX_FILE=.git/tmp-index git-checkout-cache -a -u
git-update-cache --add -- (GIT_INDEX_FILE=.git/tmp-index git-ls-files)
cp .git/FETCH_HEAD .git/MERGE_HEAD
git commit

Those commands look quite arcane to my eye. In Mercurial we do:
hg pull --force <project-to-union-merge>
hg merge
hg commit

Notice how the Mercurial commands are plain and not special at all -- the only unusual thing is the --force flag to hg pull, which is needed since Mercurial will abort otherwise when you pull from an unrelated repository. It is differences like this that makes Mercurial seem more elegant to me.
Comment: to merge  (pull) an unrelated project with git, you can simply do: `git pull `. the mail you quoted is from the very early days of git (2005)
Comment: Note that TortoiseHg also works together with Nautilus, the Gnome file manager on Linux.
Comment: knittl: ah, good, I'm glad to hear that Git is getting less arcane. Still, I think the example shows a bit how the systems differ in what we think it cool and Git feels more low-level to me compared with Mercurial (but not any more powerful).
Comment: The Ruby script is only generated if it the httpd is Webrick, the ruby webserver.
Comment: Like Git, Mercurial stores snapshots of your files when you commit. I do not agree that renames can only be tracked with a heuristic like in Git, there is nothing in the model that precludes adding extra information to a snapshot, e.g., rename information. We do that in Mercurial.
Comment: I use Mercurial much more than git, but in my experience github has always been faster and more responsive than bitbucket unfortunately...
Comment: I can't speak for Mercurial, but git stores snapshots, not changesets. Patches are derived from adjacent snapshots when needed. This is an important conceptual difference when doing anything other than adding commits. It also has implications for tracking renames, for example (they can only be heuristically detected).
Answer: Git is a platform, Mercurial is "just" an application. Git is a versioned filesystem platform that happens to ship with a DVCS app in the box, but as normal for platform apps, it is more complex and has rougher edges than focused apps do. But this also means git's VCS is immensely flexible, and there is a huge depth of non-source-control things you can do with git.
That is the essence of the difference.
Git is best understood from the ground up – from the repository format up. Scott Chacon's Git Talk is an excellent primer for this. If you try to use git without knowing what's happening under the hood, you'll end up confused at some point (unless you stick to only very basic functionality). This may sound stupid when all you want is a DVCS for your daily programming routine, but the genius of git is that the repository format is actually very simple and you can understand git's entire operation quite easily.
For some more technicality-oriented comparisons, the best articles I have personally seen are Dustin Sallings':

The Differences Between Mercurial and Git
Reddit thread where git-experienced Dustin answers his own git neophyte questions

He has actually used both DVCSs extensively and understands them both well – and ended up preferring git.
Comment: I've often read people mention git being a "platform", but that's more of a theory or common myth because there no major examples of it as a platform to do something other than run git.
Comment: So, in a nutshell: Mercurial is an open-source distributed revision control system, and git is a lifestyle choice.
Comment: @Ian - If I am not mistaken Aptana Studio 3 uses it for its internal update system.
Answer: The big difference is on Windows. Mercurial is supported natively, Git isn't. You can get very similar hosting to github.com with bitbucket.org (actually even better as you get a free private repository). I was using msysGit for a while but moved to Mercurial and been very happy with it.
Comment: So "natively" is not quite the right word, but it is not well supported under windows, that is for sure.
Comment: Windows supports Unicode, though MS chose to go for UTF-16 in its API rather than UTF-8. Despite that, it would be quite possible for git to support Unicode cross-platform. SVN has solved that problem quite well. But it's just not a high priority for the msysGit development at the moment. http://code.google.com/p/msysgit/issues/detail?id=80
Comment: git is supported to a point on Windows. But try using Unicode filenames cross-platform and see what pain you get.
Comment: @Craig: That's more of a platform shortcoming.  A competent platform would allow you to switch to a suitable locale.  If you stick to utf-8, you'll be mostly fine except that Mac OS X has slightly different normalisation of utf-8, however, I'm not sure if windows even lets you use utf-8...
Answer: If you are a Windows developer looking for basic disconnected revision control, go with Hg. I found Git to be incomprehensible while Hg was simple and well integrated with the Windows shell. I downloaded Hg and followed this tutorial (hginit.com) - ten minutes later I had a local repo and was back to work on my project.
Comment: I followed the same tutorial. It's definitive.
Answer: I think the best description about "Mercurial vs. Git" is:
"Git is Wesley Snipes. Mercurial is Denzel Washington"
Comment: How ist that supposed to help? Does that mean that git is more the martial arts type?
Answer: They are almost identical.
The most important difference, from my point of view (I mean, the reason that got me to choose one DVCS over the other) is how the two programs manage branches.
To start a new branch, with Mercurial, you simply clone the repository to another directory and start developing. Then, you pull and merge.
With git, you have to explicitly give a name to the new  topic branch you want to use, then you start coding using the same directory.
In short, each branch in Mercurial needs its own directory; in git you usually work in on single directory.
Switching branches in Mercurial means changing directories; in git, it means asking git to change the directory's content with git checkout.
I'm honest: I don't know if it's possible to do the same with Mercurial, but since I usually work on web projects, using always the same directory with git seems much confortable to me, since I don't have to re-configure Apache and restart it and I don't mess my filesystem everytime I branch.
Edit: As Deestan noted, Hg has named branches, which can be stored in a single repository and allow the developer to switch branches within the same working copy. git branches are not exactly the same as Mercurial named branches, anyway: they are permanent and not throw away branches, like in git. That means that if you use a named branch for experimental tasks even if you decide to never merge it it will be stored in the repository. That's the reason why Hg encourages to use clones for experimental, short-running tasks and named branches for long-running tasks, like for release branches.
The reason why a lot of Hg users prefere clones over named branch is much more social or cultural than technical. For example, with last versions of Hg, it's even possible to close a named branch and recursively remove metadata from changesets.
On the other side, git invites to use "named branches" which are not permanent and are not stored as metadata on each changeset.
From my personal point of view, then, git's model is deeply linked to the concept of named branches and switch between a branch and another withing the same directory; hg can do the same with named branches, but yet it encourages the use of clones, which I personally don't like too much.
Comment: This is not a difference; Hg has named branches too.  We use them all the time during normal development instead of clone-branches.
Comment: AFAIK, named branch in Hg are obtained storing metadata in each commit; I may be wrong, but I read that once you create a branch, its metadata will be embedded in each changeset and become part of the history. This is a huge difference with git. "Clones are great for quick experiments where you don't want to record a branch name, and named branches are good for long term branches" http://tinyurl.com/2wz39qx

What I was trying to say with my post is that git's standard workflow invites you to use a single working copy; Hg standard workflow includes clones, which don't suite my personal needs.
Comment: named branches in hg are nothing like branches in git. In hg, there is one *true* path. All branches are branches off that path. In git there is no one true path. There's just different states of the repo and pointers into that state. Each branch is just a different pointer. Which pointer is the main one is up to use. Branches are all peers.
Comment: For a good explanation of similarities/differences re: branching in Git & Hg, see: http://mercurial.selenic.com/wiki/GitConcepts#Branch_model
Answer: There's one huge difference between git and mercurial; the way the represent each commit. git represents commits as snapshots, while mercurial represents them as diffs.
What does this means in practice? Well, many operations are faster in git, such as switching to another commit, comparing commits, etc. Specially if these commits are far away.
AFAIK there's no advantage of mercurial's approach.
Comment: Changesets (diffs) advantage is in taking up less space.  Git recovers the space used for commits by using compression, but this requires an occasional explicit recompress step ("git pack").
Comment: I fail to understand the distinction you're drawing between 'snapshots' and 'diffs'. Both hg and git store commits as (groups of) file _deltas_. Those deltas are based on whatever previous revision the respective SCM chooses. Have you got numbers that show that git is actually faster for the operations you mentioned? Updating to another commit spends most of its time writing to the working dir, not reading the repo, anyway.
Comment: It is now called 'git gc', but there are different levels of garbage collection, and some levels are executed automatically in recent versions of git.
Comment: actually mercurial uses snapshots as well
Comment: 'Snapshot's vs. 'diff's - utterly irrelevant. However the repo is stored internally has no bearing on what the user sees. Both git and mercurial present the user with 'snapshot's. There's no reason why a repository format implemented in the same way as git couldn't be added to mercurial, just as I believe Bazaar did.
Comment: +1. Yes, that's the main difference, I think (from the technical side).
Comment: +Kevin No, git stores snapshots, not deltas, deltas are calculated by comparing two snapshots.
+Mark It's true that nowadays that doesn't make much of a difference to the user (because both systems have implemented shortcuts), but it's still a technical difference.
Answer: Nothing. They both do the same, both perform about equally. The only reason you should choose one over the other is if you help out with a project that already uses one..
The other possible reason for choosing one is an application or service which only supports one of the system.. For example, I pretty much chose to learn git because of github..
Comment: Looks like your answer was far too pragmatic. :)
Answer: Also google's comparison (though it's a bit old, done in 2008)
http://code.google.com/p/support/wiki/DVCSAnalysis
Answer: If I understand them correctly (and I'm far from an expert on each) they fundamentally each have a different philosophy. I first used mercurial for 9 months. Now I've used git for 6.
hg is version control software. It's main goal is to track versions of a piece of software.
git is a time based file system. It's goal is to add another dimension to a file system. Most have files and folders, git adds time. That it happens to work awesome as a VCS is a byproduct of its design.
In hg, there's a history of the entire project it's always trying to maintain. By default I believe hg wants all changes to all objects by all users when pushing and pulling.
In git there's just a pool of objects and these tracking files (branches/heads) that determine which set of those objects represent the tree of files in a particular state. When pushing or pulling git only sends the objects needed for the the particular branches you are pushing or pulling, which is a small subset of all objects.
As far as git is concerned there is no "1 project". You could have 50 projects all in the same repo and git wouldn't care. Each one could be managed separately in the same repo and live fine.
Hg's concept of branches is branches off the main project or branches off branches etc. Git has no such concept. A branch in git is just a state of the tree, everything is a branch in git. Which branch is official, current, or newest has no meaning in git.
I don't know if that made any sense. If I could draw pictures hg might look like this where each commit is a o
             o---o---o
            /
o---o---o---o---o---o---o---o
         \         /
          o---o---o

A tree with a single root and branches coming off of it. While git can do that and often people use it that way that's not enforced. A git picture, if there is such a thing, could easily look like this
o---o---o---o---o

o---o---o---o
         \
          o---o

o---o---o---o

In fact in some ways it doesn't even make sense to show branches in git.
One thing that is very confusing for the discussion, git and mercurial both have something called a "branch" but they are not remotely the same things. A branch in mercurial comes about when there are conflicts between different repos. A branch in git is apparently similar to a clone in hg. But a clone, while it might give similar behavior is most definitely not the same. Consider me trying these in git vs hg using the chromium repo which is rather large.
$ time git checkout -b some-new-branch
Switched to new branch 'some-new-branch'

real   0m1.759s
user   0m1.596s
sys    0m0.144s

And now in hg using clone
$ time hg clone project/ some-clone/

updating to branch default
29387 files updated, 0 files merged, 0 files removed, 0 files unresolved.
real   0m58.196s
user   0m19.901s
sys    0m8.957

Both of those are hot runs. Ie, I ran them twice and this is the second run. hg clone is the actually the same as git-new-workdir. Both of those make an entirely new working dir almost as though you had typed cp -r project project-clone. That's not the same as making a new branch in git. It's far more heavy weight. If there is true equivalent of git's branching in hg I don't know what it is.
I understand at some level hg and git might be able to do similar things. If so then there is a still a huge difference in the workflow they lead you to. In git, the typical workflow is to create a branch for every feature.
git checkout master
git checkout -b add-2nd-joypad-support
git checkout master
git checkout -b fix-game-save-bug
git checkout master
git checkout -b add-a-star-support

That just created 3 branches, each based off a branch called master.
(I'm sure there's some way in git to make those 1 line each instead of 2)
Now to work on one I just do
git checkout fix-game-save-bug

and start working. Commit things, etc. Switching between branches even in a project as big as chrome is nearly instantaneous. I actually don't know how to do that in hg. It's not part of any tutorials I've read.
One other big difference. Git's stage.
Git has this idea of a stage. You can think of it as a hidden folder. When you commit you only commit what's on the stage, not the changes in your working tree. That might sound strange. If you want to commit all the changes in your working tree you'd do git commit -a which adds all the modified files to the stage and then commits them.
What's the point of the stage then? You can easily separate your commits. Imagine you edited joypad.cpp and gamesave.cpp and you want to commit them separately
git add joypad.cpp  // copies to stage
git commit -m "added 2nd joypad support"
git add gamesave.cpp  // copies to stage
git commit -m "fixed game save bug"

Git even has commands to decide which particular lines in the same file you want to copy to the stage so you can split up those commits separately as well. Why would you want to do that? Because as separate commits others can pull only the ones they want or if there was an issue they can revert just the commit that had the issue.
Comment: @James: `git add --patch`, see http://linux.die.net/man/1/git-add or use `git add -i`, like in http://stackoverflow.com/questions/2372583/untangle-two-lines-with-git-add-p
Comment: "Git even has commands to decide which particular lines in the same file you want to copy to the stage so you can split up those commits separately as well." What are these commands?
Comment: @gman: instead of checking out the master and branching with `checkout -b ` you could just use `git branch ` to create a new branch without switching to it
Answer: There is a dynamic comparison chart over at the versioncontrolblog where you can compare several different version control systems.
Here is a comparison table between git, hg and bzr.
Comment: The information on Mercurial is not entirely accurate: Mercurial do have "intelligent merges after moves or renames". Concretely, this means that if I rename `dir-a/foo.c` to `dir-b/foo.c` and keep working on `dir-b/foo.c`, then your work on `dir-a/foo.c` will be correctly merged with my work after a pull.
Comment: The information (it comes from [Better SCM Initiative](http://better-scm.berlios.de/) comparison, IIRC) about **Git** is also inaccurate or even inavlid in a few places.
Answer: There are quite significant differences when it comes to working with branches (especially short-term ones).
It is explained in this article (BranchingExplained) which compares Mercurial with Git.
Answer: Are there any Windows-based collaborators on your project?
Because if there are, the Git-for-Windows GUI seems awkward, difficult, unfriendly.
Mercurial-on-Windows, by contrast, is a no-brainer.
Comment: I like git, but I have to agree here. Git has a nicer command line with the stage and better documentation. I would happily use the git commands with a posix shell. However tortoiseHG on windows is great, it even integrates with several diff tools (beyond compare) and has full support for sub-repos, and many hg plugins like strip/mq
Comment: There is at least one very good Windows (and OS X + Linux) Git GUI available.
Answer: One thing to notice between mercurial of bitbucket.org and git of github is, mercurial can have as many private repositories as you want, but github you have to upgrade to a paid account. So, that's why I go for bitbucket which uses mercurial.
Answer: Sometime last year I evaluated both git and hg for my own use, and decided to go with hg. I felt it looked like a cleaner solution, and worked better on more platforms at the time. It was mostly a toss-up, though.
More recently, I started using git because of git-svn and the ability to act as a Subversion client. This won me over and I've now switched completely to git. I think it's got a slightly higher learning curve (especially if you need to poke around the insides), but it really is a great system. I'm going to go read those two comparison articles that John posted now.
Comment: Take a look at hgsubversion: http://bitbucket.org/durin42/hgsubversion/. It currently requires a development version of Mercurial, but they will make a release for Mercurial 1.3, which is due July 1st.
Answer: I'm currently in the process of migrating from SVN to a DVCS (while blogging about my findings, my first real blogging effort...), and I've done a bit of research (=googling). As far as I can see you can do most of the things with both packages. It seems like git has a few more or better implemented advanced features,
I do feel that the integration with windows is a bit better for mercurial, with TortoiseHg. I know there's Git Cheetah as well (I tried both), but the mercurial solution just feels more robust.
Seeing how they're both open-source (right?) I don't think either will be lacking important features. If something is important, people will ask for it, people will code it.
I think that for common practices, Git and Mercurial are more than sufficient. They both have big projects that use them (Git -> linux kernel, Mercurial -> Mozilla foundation projects, both among others of course), so I don't think either are really lacking something.
That being said, I am interested in what other people say about this, as it would make a great source for my blogging efforts ;-)
Comment: Yes, they are both open-source projects.
Answer: There is a great and exhaustive comparison tables and charts on git, Mercurial and Bazaar over at InfoQ's guide about DVCS.
Answer: I realize this isn't a part of the answer, but on that note, I also think the availability of stable plugins for platforms like NetBeans and Eclipse play a part in which tool is a better fit for the task, or rather, which tool is the best fit for "you". That is, unless you really want to do it the CLI-way.
Both Eclipse (and everything based on it) and NetBeans sometimes have issues with remote file systems (such as SSH) and external updates of files; which is yet another reason why you want whatever you choose to work "seamlessly".
I'm trying to answer this question for myself right now too .. and I've boiled down the candidates to Git or Mercurial .. thank you all for providing useful inputs on this topic without going religious.
Comment: +1, because the "seamless" experience is more important than people who don't work with these things think. A solid plugin for the IDE makes a lot of difference.
Answer: Yet another interesting comparison of mercurial and git: Mercurial vs Git.
Main focus is on internals and their influence on branching process.
Answer: If you are interested in a performance comparison of Mercurial and Git have a look at this article. The conclusion is:

Git and Mercurial both turn in good numbers but make an interesting trade-off between speed and repository size. Mercurial is fast with both adds and modifications, and keeps repository growth under control at the same time. Git is also fast, but its repository grows very quickly with modified files until you repack — and those repacks can be very slow. But the packed repository is much smaller than Mercurial's.
Answer: The mercurial website has a great description of the similarities and differences between the two systems, explaining the differences of vocabulary and underlying concepts. As a long time git user, it really helped my understand the Mercurial mindset.
Answer: If you are migrating from SVN, use Mercurial as its syntax is MUCH more understandable for SVN users. Other than that, you can't go wrong with either. But do check GIT tutorial and HGinit before selecting one of them.
Answer: This link may help you to understand the difference
http://www.techtatva.com/2010/09/git-mercurial-and-bazaar-a-comparison/
Answer: Some people think that VCS systems have to be complicated. They encourage inventing terms and concepts on the field. They would probably think that numerous PhDs on the subject would be interesting. Among those are probably the ones that designed Git.
Mercurial is designed with a different mentality. Developers should not care much about VCS, and they should instead spend their time on their main function: software engineering. Mercurial allows users to use and happily abuse the system without letting them make any non-recoverable mistakes.
Any professional tool must come with a clearly designed and intuitive CLI. Mercurial users can do most of the work by issuing simple commands without any strange options. In Git double dash, crazy options are the norm. Mercurial has a substantial advantage if you are a CLI person (and to be honest, any self-respecting Software Engineer should be).
To give an example, suppose you do a commit by mistake. You forgot to edit some files. To undo you action in Mercurial you simply type:
 $ hg rollback
You then get a message that the system undos your last transaction.
In Git you have to type:
 $ git reset --soft HEAD^
So ok suppose you have an idea what reset is about. But in addition you have to know what "--soft" and "--hard" resets are (any intuitive guesses?). Oh and of course don't forget the '^' character in the end! (now what in Ritchie's name is that...)
Mercurial's integration with 3rd party tools like kdiff3 and meld is much better as well. Generate your patches merge your branches without much fuss. Mercurial also includes a simple http server that you activate by typing
 hg serve
And let others browse your repository.
The bottom line is, Git does what Mercurial does, in a much more complicated way and with a far inferior CLI. Use Git if you want to turn the VCS of your project into a scientific-research field. Use Mercurial if you want to get the VCS job done without caring much about it, and focus on your real tasks.
Comment: Actually you can [alias commands in git](https://git.wiki.kernel.org/index.php/Aliases), which makes the CLI less complicated to use. There are a bunch of them in this [SuperUser (StackExchange) question](http://superuser.com/questions/169695/what-are-your-favorite-git-aliases).
Comment: Truly yes, you could also write shell scripts to deal with some common tasks. Eventually you begin to realize that you are building a wrapper CLI to deal with a VCS that has a badly designed and counter-intuitive CLI.

And it is not only that. Git introduces an awful lot bunch of concepts with questionable usability that the user is eventually forced to learn and understand in order to feel comfortable with documentation and CLI messages.


How to make web site that is compatible to mobile(Blackberry,Android,iPhone) screen sizes?

Question: Hi I am developing a site for desktop.The site renders the contents for desktop size.But when I see it in mobile the content is not properly rendered.
How can I make a site that fits all mobile screen sizes say Blackberry,Android,iPhone, etc. Can anybody mention any articles. I know only HTML. Thanks in advance.
Answer: I remember looking into myself a while ago and finding this video tutorial on net-tuts+ to be a good starting point
Answer: It is hard to make a single site that looks good on both mobile and desktop. Resolution is not the only problem, the very way the user interacts with you site changes on a mobile device. That said, the typical thing to do is to have a mobile style sheet which is loaded for mobile, and a desktop sheet for desktop. You might even go so far as to limit some of your content on mobile to make the page lighter.
I found http://mobiforge.com to be a good source of info.


file permissions for the same user on 2 different computers

Question: I'm trying to change file permissions on a windows server for a domain. It works fine except for one little problem. There is a co-worker that logs in using the same user as mine but on my computer I have full file permissions and on hers the file is read-only. Any help?
Comment: Do you have the file open when she opens it?
Answer: You can replace all child object permission for Web User and Network Service of your Domain.
If permission is not given properly or not propogated proper then this should be happened.


Why does exhaust flow inwards through a radial turbocharger?

Question: In a radial compressor, the air enters centrally and passes outwards, aided by centrifugal force. But, as the diagram shows, in piston-engine superchargers the driving exhaust gas flows inwards through a radial turbine. This has to fight against centrifugal force instead of leveraging it. So why is it done?
Answer:
This has to fight against centrifugal force instead of leveraging it.

In fact, the opposite is true. The arrangement shown actually helps to extract energy, perhaps counterintuitively. A typical example of this arrangement is the Francis turbine.
A high flow speed plus high tangential velocity input, fed through to a low flow speed/low tangential velocity exit, will create the maximum energy differential for extraction. And that describes inwards flow.
There are a few ways of looking at this. One is to look at the exit velocity of the fluid. In a compressor, it's okay if the fluid has some leftover velocity as it will by converted to static pressure when slowed down by Bernoulli's law. For a turbine, the exit velocity should be as low as possible, as kinetic energy of the exhaust flow is 'wasted' energy. So it makes sense to place the exit at the inner radius of the turbine, where the radial velocity component is lowest.
Another way of looking at it is pressure. Centrifugal force creates a pressure gradient across the turbine in radial direction. As a 'packet' of air moves inwards, its pressure becomes lower. By conservation of energy, this must mean that it is expending work on its surroundings. The turbine extracts this work done from the packet of air moving inside.
Another intuitive explanation involves an ice skater retracting their arms in a pirouette (or a bored office worker on a swivelling chair). By conservation of angular momentum, their angular velocity increases. A packet of air would 'like' to increase its angular velocity, but this is kept fixed by the turbine rotating at a fixed velocity. The packet of air must thus be slowed down moving inwards, and as a result exerts a pressure on the turbine blade in front of it.
The choice between axial, centrifugal or mixed-flow is done based on the flow conditions, with high-flow low pressure differential favouring axial design and lower flow or higher pressure differential favouring the radial setup as shown. A more compact design means fewer turbine or compressor stages, which results in a higher pressure differential across the single stage. Thus, a radial setup is preferred.
Comment: Thank you. I have some observations. If the exit velocity of a compressor can be manipulated by design, so can that of a turbine. Then, whichever way the air flows its angular momentum will change, it doesn't matter which direction it pushes on the blades. So those points are not significant. But as you say, "The turbine extracts [the] work done from the packet of air moving inside." A high flow speed plus high tangential velocity input, fed through to a low flow speed/low tangential velocity exit, will create the maximum energy differential for extraction. And that describes inwards flow.
Comment: Exactly. Indeed you could swirl the turbine blades such that the flow is slowed down towards the outer perimeter but then you are limited by practical engineering (a larger blade so more wetted=draggy area). The reverse is just easier.
Comment: It's not obvious why the radial flow speed is lowest at the axis. In fact, due to the constricting effect (less volume near the axis), by Bernoulli we'd expect a _higher_ radial speed.
Comment: @MSalters For most rotating devices, it is obvious that radial speed is greatest at the perimeter, lowest at the axle. You are right that, for turbomachinery, you could indeed find that the channels are directed forward or aft, effectively changing the radial speed. Your intuition is precisely the reason why this turbine is so effective: we would expect by Bernoulli (which is really conservation of energy) that the radial speed is higher, but instead the turbine slows down the radial speed and thus extracts work. See also my last comment.
Comment: @Sanchises: I still find it non-obvious. The radial velocity at a distance R by definition needs to be the volume flow divided by the cross-section at distance R. That cross-section, for a radial flow in a cylinder of length L, has an area  2πRL. For a constant volume flow, that means the radial velocity is proportional to 1/R. I.e. the velocity goes up. Of course, this is under the assumption of a constant volume flow. In reality, the mass flow is constant, and the pressure drops, so the volume flow only increases going inward. Hence the increase in radial velocity has to exceed 1/R.
Comment: @MSalters The reason the pressure drops is because the cross-sectional area *of the flow* is actually increasing. The air enters through a narrow slot in the inner wall of the feed duct and exits through a large-diameter exhaust duct. In this way the volume relationship you assume is defeated by design.
Comment: @MSalters It's indeed only 'obvious' if you don't think too hard about it :) I worked from the assumption of constant channel cross-section. While this may look difficult to achieve in practice, remember that the cross-sectional area of the flow is defined perpendicular to the flow. By curving the channels (which is a natural thing to do since the flow is not flowing radially initially) you can easily control the cross-sectional area to suit the flow.
Answer: It does seem counterintuitive to arrange the flow as it has been done in turbochargers, but this arrangement is the best compromise for harnessing kinetic energy from exhaust gasses of a reciprocating engine.
Design goals are

compact size
small backpressure
simplicity of construction (build and maintenance cost)
ability to utilize "traditional" materials and manufacturing tehcniques.

The turbine housing is formed in such a way, that it dimishimes in size as it circles the turbine wheel. Thus the exhaus gasses travelling throug the chamber eventually (rather quickly in fact) run out of space, and are pushed into the exhaust outlet by the following exhaust pulses.
As such, the exhaust gasses do not need to overcome or fight centrifugal forces, as the housing provides a path that guides the gasses along.
This arrangement, as opposed to reversing the flow, allows for a simplier and less critical turbine wheel profile, and much higher efficiency across flow rate range (iirc I try to dig up the reference) Compared to an axial turbine this construction is less efficient, but it also is so much more simple and compact, that it by far outweights the smaller efficiency.
Comment: Thank you. A couple of problems I have with that. 1) Does not the circling air path still create a centrifugal force and hence an unwelcome backpressure component? 2) If this is all so great for the turbine, why is it not equally great for the compressor?
Comment: One way to look at it is that the logic is similar for a regular fan. If you want the fan to blow air the curved (concave) part of the fan should be behind the fan. If you want to blow air into the fan the curved part of the fan should be in front of the fan. Your question is analogous to asking if it's so great for the fan to blow in the direction of the curve why is it less efficient for a windmill to receive wind in the same direction?


How to set ${CMAKE_INSTALL_PREFIX}/bin in the path?

Question: I want to develop smart contracts and started from scratch and i couldn't find a solution to set my CMAKE_INSTALL_PREFIX/bin environment path!
Comment: Probably a better place for this question is stack overflow, on which there might have already been an answer: https://stackoverflow.com/questions/11840482/cmake-install-prefix-environment-variable-doesnt-work . Not sure what you are trying to achieve: if you want the output directory to be in the operation system's path variable, you will have to manually add it; or if you want to set CMAKE_INSTALL_PREFIX for your cmake build, you will have to either use "set" in your cmake file, or "-D" option in your cmake command.
Answer: If CMAKE_INSTALL_PREFIX is set (check with echo $CMAKE_INSTALL_PREFIX), then you would add
[[ -d $CMAKE_INSTALL_PREFIXPATH ]] && PATH="$PATH:$CMAKE_INSTALL_PREFIX/bin"

to one of your start up files (bashrc/zshrc).


If the grammar is ambiguous then there exists exactly one handle for each sentential form.?

Question: there can be two productions from which we can do the reduction. After giving precedence and associations as required there will be one handle only.so is this statement true??
Comment: This is how compiler generators work.
Answer: This is partially true, a reduce/reduce conflict is usually resolved by specifying precedence or by letting the parser builder choose which rule to apply before the other.
This means that the conflict is solved but not that the parser is going to behave exactly as intended. It is convenient to study what is causing the conflict and think if a refactoring of the grammar is needed to express what you are trying to parse or if the automatic choice/precedence is enough.
Answer: If you have a grammar which has ambiguous rules, you get multiple interpretations.  You don't have to insist that the grammar removes ambiguity; you can simply agree that something is ambiguous and parse it multiple ways:
<code>fruit flies like an arrow.
</code>
The result of the parse is multiple interpretations.
Now, for such a language to be useful to a reader, either he has to be happy with the ambiguity, or you need to give him a way to resolve it. (In the example, I've decided for you that you are happy the ambiguity, because I haven't given you a way to resolve it!).  Or, one can provide the reader of something with ambiguous parsess, a way to choose which parse make sense, and he rejects the inappropriate parses.
I can do that for the above case by telling you that I mean "fruit => watermelon".
Computer grammars are not different, but most programmers don't want ambiguous code.  So in general, langauge designers like to define unambiguous grammars.  In practice, they don't succeed and you get funny language rules like, "If this could be interpreted ambiguously, then interpret it this way.".


Are there any useful guides to writing stories based in RPG universes/aimed at a role playing audience?

Question: It seems that the RPG  genre of books and stories have standard components, that fans have come to expect to see from authors. Is there a definitive guide somewhere to these components, with instructions for a starting author?
Answer: Not exactly a definitive guide, but Kameron M Franklin might have a few ideas. :)
Answer: First, some reality: books written in a copyrighted RPG setting are almost always commissioned by the owner of the RPG property, and those publishers very rarely accept unsolicited manuscripts. So before you write your awesome D&D adventure novel, you really ought to go to the WotC website and determine if they'll even look at your manuscript. (Assuming you want to get published. If you just want to have fun, go ahead, but be aware that it's illegal for you to then publish the story.) If you do get a contract to write a tie-in novel, the publisher will give you their guidelines with exactly what they expect.
If you're merely hoping to write an RPG-like epic fantasy adventure, then there is no better advice than just to read lots and lots of them. There is no written formula; you'll pick up the unwritten formulas just by being well-read in the genre.
Comment: The advice is valid, but I'm looking for information on how to write better manuscripts. Probably, questions of how to market them (or convince WotC specifically to accept a manuscript) should be broken out and answered separately on the site.
Comment: Reading lots and lots of RPG-like epic adventures, sounds like fun, but is very time consuming. I'm hoping there is a quicker way to do it - possibly, someone has already done all the legwork, read most of the books out there (or has written them), thought of the genre intelligently, and produced an instruction manual on how to do the work.
Comment: @blueberryfields:  It's usually necessary to read a lot of books before writing one.  If you think it a waste of time, then you probably shouldn't try writing in that genre.
Comment: @David Thornley I'd rather read 1,000 RPG based books, and one book on how to write books about RPGs, than read 100,000 books.


CSS menu not working properly in IE7

Question: I have got a css menu over here, http://fitzwilliamcardclub.com/ and it is working just fine in all except IE7 (tested ok with FF, Chrome, Safari, IE8 & IE9, Opera). In IE7 the dropdown menu is hiding behind the main background as there is a small hint that the menu is expanded on the hover but it is going behind the main background starting just below the menu. I have been trying on this for more that three days now but it could not help with this and it is  really frustrating. I tried almost all things what i could thought of, setting z-index of menu  elements and of background etc. but it does not work. Can someone take a look at the site navigation menu at http://fitzwilliamcardclub.com/ and post a fix, if it possible at all. Thanks in Advance.
Answer: Give #main a position:relative and set the menu li's to have a higher z-index than #main.
Answer: For IE7, giving the parent element a higher z-index actual fixes the bug. I'd used such a fix on http://www.skinwerein.com/.
This might be helpful to you. http://brenelz.com/blog/squish-the-internet-explorer-z-index-bug/

CSS menu not working properly in IE7


Azure SQL reserve external IP

Question: How can I set an Azure SQL database to have a fixed static IP?
We are using the Resource Group model - I can reserve IPs no problem and I can assign them to VMs easily but I cannot see how to assign one to a SQL Server?
Answer: The VM has it's private addresses translated to a publicly routable IP address at the network boundary - this is called network address translation. when you assign a public IP to an instance in the cloud what you are really doing is setting up a NAT rule. Inside the VM you continue to work and configure software as you would on a private network, so if your VM has an IP address of 192.168.1.100 then that is how SQL should be configured too. Azure will route incoming network requests to ip public IP address to it's private address. If that doen't anwer your question perhaps you can provide more details
Comment: ok, it's a database as a service model - you won't own an IP address for this and it is liable to change at any moment - so you clients firewall will need to access it by it's FQDN - this might be a problem for your client as it adds a bit of overhead to the connection. https://blogs.msdn.microsoft.com/psssql/2014/03/27/dont-rely-on-a-static-ip-address-for-your-sql-database/
Comment: yeah, his firewall will have to do a lookup going out each time - this should be doable - or if its something temporary you could lookup up the FQDN and supply the IP address - but it might break next week.
Comment: in most firewalls it a global config rule and in all the ones i've seen it's disabled. checkpoins, fortinets, sonicwall - it has to poll the dns server to look for any changes. http://kb.fortinet.com/kb/documentLink.do?externalID=FD37062
Comment: Thanks Rob - I am talking about a SQL Server, not a VM. We have an external client that needs to create a firewall rule to access our SQL Server and requires a static external IP to do so?
Comment: Thanks Rob - I've read that article, unfortunately our client needs to create a firewall rule to allow outbound access so an FQDN is out. Are we stuck here?
Comment: I've never come across a firewall that will allow an FQDN based rule?
Thanks for your help.
Comment: Great, thanks Rob. Firewall is a Fortinet AFAIK so fingers crossed.

Azure SQL reserve external IP


Nintendo DS WiFi Support

Question: I still have the original DS and can only get online by either using WEP or no security at all. This is an annoyance since my security is set to WPA2 on my router. What type of WiFi security do each of the DS models support?  I guess that also leads to another question, do certain games only work on certain types of WiFi security or is it solely based on the DS itself?
Comment: in short, its probably easier if you made a separate insecure network for WEP for your DS if you plan to use the online components
Answer: According to Nintendo's Wifi help page:

Important note about the Nintendo DSi and WPA security: While the Nintendo DSi is compatible with WPA security, Nintendo DS games with online play still require the use of WEP or no security to connect with the Nintendo WFC.

After some clarification from Micheal Madsen, it seems the answer is slightly more complicated than initially assumed.  I'm basing my answer here on the connectivity section of the wiki page, and the above statement from Nintendo.

3DS and DSi: WEP will work, guaranteed.  WPA and WPA2 will work if the game supports it.
DS: WEP only.

So for ease of use, WEP is the lowest common denominator. All DS models (and games!) support WEP.  Use that if you don't care about the encryption protocol, and your main focus is just getting online.  Things get dicey if you own a DSi or 3DS.  In that case, if you want to use WPA or WPA2, the game needs to support it, as well.
I went looking for a complete list of games that would support WPA, but all I found was "Newer games that were specifically developed for the DSi will support WPA".  So there's no clear way to know if your game will work or not, other than to try it.
If you don't want to downgrade your encryption protocol, an alternate option is using the wireless dongle offered by Nintendo.  Be warned that it can mess with your network, though; I ran into some fun internal network issues when it was active.  The only way to resolve it was to unplug it, and reboot the router.
Comment: @fbueckert It's the only way it can work; the DS doesn't have any OS to abstract it away (so the code has to be on the cartridge), and the WiFi hardware didn't support WPA on a DS (Lite). And sorry to rain on your answer, but the 3DS has the same issue, since it doesn't attempt to fake WiFi for those games, but gives them direct access to the WiFi module - it's even listed in [the manual](http://mediacontent.nintendo-europe.com/NOE/downloads/CTR_OperationsManual_UK_1102_NFRP.pdf) (see page 90).
Comment: DSi and later supports WPA and WPA2, but the games have to support it as well, so it only works with sufficiently new games (and even then, I'm not sure that it's a given they were compiled with a proper version of the WiFi library code).
Comment: @MichaelMadsen Do you have a source for that?  The wiki states that the DSi only supports WEP or unencrypted.
Comment: It's actually listed in that Wikipedia article, though in a slightly roundabout way: "(only compatible with WEP or unencrypted networks while playing regular Nintendo DS games) ". To give an example, [Pokémon Black/White supports it](http://gaming.stackexchange.com/questions/18510/do-all-pokemon-b-w-wifi-features-work-with-wpa2). If the game is DSi enhanced (e.g. uses the camera) and has WFC support, then it should support WPA on a DSi; I must admit I haven't tested any games released after that without (other) DSi enhancments.
Comment: Huh.  That sounds like a terribly inefficient way to code for wireless.  It works only when the game AND the system support it; lowest common denominator is that WEP is guaranteed to work, but everything above that is iffy.  Bleh.
Comment: @fbueckert I have a DSI and I can confirm it works with WPA since that's what I use for my wireless security
Comment: @MichaelMadsen I think I finally got it right.  Thanks for the clarification.

Nintendo DS WiFi Support


Who are the shareholders/owners/beneficiaries of the private component/aspect of the City of London Corporation?

Question: Insofar as some parts of it (so called "City's Cash") function as a private entity from monies "built up over the centuries" to such extent as to make it exempt from the Freedom of Information Act, then who controls these private components?
Comment: I've added a link to the question which includes some of the things the Cash is used for.
Answer: See https://democracy.cityoflondon.gov.uk/documents/s162344/Citys%20Cash%20Annual%20Report%20Financial%20Statements%202020-21%20-%20ARM-FC.pdf:

City's Cash is a fund of the City of London Corporation
...
City's Cash is managed by committees of the City Corporation, with Membership of
the committees drawn from the 25 Members of the Court of Aldermen and the 100
Members of the Court of Common Council. Members of the Court of Aldermen and
Court of Common Council are elected by registered voters (both residents and
businesses) within the City of London. In determining appointments to
committees, the Court of Aldermen and Court of Common Council will take into
consideration, amongst other things, any particular expertise and knowledge of
the Aldermen and Members.
Comment: That sounds like more along the lines of some board of directors or something that manage the entity's assets and affairs for the benefit of the shareholders. Whose benefit does the city's cash exist for?
Comment: @Seekinganswers The City of London corporation. It is fairly standard for endowments to exist as a separate corporate entity, to create a barrier to spending the principle.


Do electron microscopy change the structure of the specimen due to the vacuum step?

Question: Since specimens have to be prepared using the vacuum, would the pressure change affect the structures of the specimen?
Comment: You should specify the type of EM.  Transmission electron microscopy uses a tissue block not *conceptually* much different from paraffin-embedded sections for the light microscope.  Scanning EM often involves coating specimens with a conductive material, which in most cases probably changes their structure more than the vacuum, but there are other options... that answer would be more interesting.
Comment: What specimens ? It certainly does not bother  metallurgical samples.
Comment: I was thinking along the lines of biological specimens like Bowman's capsule, and this question popped up in my head when I was looking at an SEM, but I guess I was just curious about whether there would be any artefacts caused by the preparation stages of the vacuum.
Answer: There are several different ways to deal with the difficulties of imaging biological samples in vacuum. I'll go over the ones I'm familiar with.
TEM - plastic sections
The water in the specimen is gradually replaced with a resin which then solidifies, and slices about 100 nm thick are cut from the specimen and put into the TEM column at high vacuum. The chemical composition of the specimen is radically altered, but the shape of cells and even the arrangement of organelles inside can be preserved if the treatment is done well. Here's a representative image for this technique from http://www.cellimagelibrary.org/images/7722. You can see the endoplasmic reticulum with ribosomes and mitochondria.

TEM - CryoEM
The specimen is cooled so fast that the water in and around it solidifies without forming ice crystals, which would otherwise disrupt membranes, etc. The specimen is nearly identical to its natural state. These 'vitrified' specimens can be put directly into the microscope column, but they need to be maintained at liquid nitrogen temperatures. The size of specimen that can be cooled rapidly enough is limited to about 300 microns thick. A standard TEM beam doesn't penetrate well through samples more than about 200 nm thick; cryo specimens can be cut similar to plastic sections (though it's much harder than at room temperature), or by focused ion beam milling. Here's a representative image from https://www.pnas.org/content/117/16/8941 showing flagellar motors:

Environmental SEM
Larger specimens can be imaged without dehydration or coating in an environmental SEM (ESEM). This microscope has a high-vacuum chamber for the electron gun and lenses, and a low-vacuum chamber containing the specimen and detectors. This method can image larger samples, up to about 10 mm, close to their natural state, but isn't as high-resolution as the TEM methods. Here's an image from https://forschungsinfrastruktur.bmbwf.gv.at/en/fi/fei-esem-xl30-scanning-electron-microscopy_540 showing a small fish, you can judge for yourself how well the structure is preserved:
Comment: Love the images! And great answer


Want to buy Honda Odyssey van

Question: I live in OC, Ca. My long term goal is to buy a good used Honda Odyssey family van. please let me know how do I do it. I am on a low budget and looking to get good bang for the buck. I have never bought a used car before. What are the details and how do you go about doing it.
Comment: [This question](http://mechanics.stackexchange.com/questions/1463/what-to-check-when-buying-a-used-car) may give you some guidance
Comment: Welcome to the site: you should refer to our FAQ (http://mechanics.stackexchange.com/faq#dontask) for some guidance on appropriate question topics.  In this case, we'd be a better community to ask how to fix a van rather than how to purchase one.
Answer: Go to a mechanic you trust.Explain that you are looking for a used car and what would they charge to put it on the lift and check it out for you,time frame involved,advance notice etc.Do some research on line on the vehicles you are interested in.Check what the sale prices are like in your area.Find a vehicle and have your mechanic check it.If the seller is unwilling to allow this walk away quickly and don't look back.Once you have the mechanics report figure the cost of any repairs into the purchase price.Just because something is found doesn't mean it isn't a good deal.It is mearly a bargaining point for the purchase aggrement.

Want to buy Honda Odyssey van


Issues with mouse and keyboard

Question: I just reinstalled Ubuntu and I'm having some problems with the mouse and the keyboard that I can't solve.

Prior to reinstalling the system, if I held any key, the system would repeat it infinitely (for example, I could erase an entire line just by holding backspace). Now it's not working and setting the keyboard settings to "key presses repeat when key is held down" won't help -- it only makes the key repeat for a short time - it then automatically stops working while I'm still holding the key.
The mouse is having a similar problem. Before reinstalling, I could could select an entire area of the desktop for how much time I could. Now if I try to do this, the mouse fails and the selection disappears when I'm holding the left button.

Both these features were very useful to me and I can't find any way to bring them back. Can any of you help me?
Answer: I managed to solve the problem by opening a terminal and typing the following:
<code> sudo su

 echo "blacklist peaq_wmi" >> /etc/modprobe.d/50-blacklist.conf
</code>
After a reboot, everything works fine.

Issues with mouse and keyboard


Can the grammar (have something done) be used when an "appliance" rather than a "person" does something for us?

Question: Is this sentence correct?

I had my dishes washed by the dishwasher.

or this form of grammar (have something done) is used "only" when "someone" is paid to do something for us?
Thank you
Answer: I think this is very borderline.
@astralbee says that we don't say that a tool did a job, but rather that a person used a tool to do a job. There's truth to this, but I don't think that's an absolute rule. I think it depends a great deal on just how automatic the tool is.
"A hammer put in these nails." Unlikely. Yes, we would be more likely to say, "I used a hammer to put in these nails."
But, "The robot vacuum cleaner cleaned the carpet." I wouldn't hesitate over that for a moment.
A dishwasher is somewhere in the middle. If someone said, "The dishwasher washed the dishes", I'd accept that as a perfectly reasonable statement. Sure, you had to put the dishes in the dishwasher, load it with soap, maybe other preparations. It's not like it just went and picked the dishes up itself. But still, it's pretty automatic, it does a good deal of the job all by itself. And if Bob collected all the dirty dishes and put them in the sink and then Sally washed them, I don't think anyone would quibble if you said, "Sally washed the dishes."
"I had my dishes washed by a dishwasher" seems a little awkward to me, but I can't put my finger on why. Compare to, "I had my dishes washed by the maid". I wouldn't have any problem with that.
So I have this "gut feel" that that's a funny wording and I wouldn't say it, but I can't give a good reason why not.
Answer: I don't know of any rules preventing this and I'd certainly not be surprised if I heard it used for appliances.
I'd consider changing the sentence to this though:

I have had my dishes washed by the dishwasher.

Or, more naturally:

My dishes have been washed by the dishwasher.
Comment: While grammatical, I'd say both are somewhat unusual. More common, to me, would be *I washed my dishes in the dishwasher*. (Which is understood figuratively, rather than in the literal sense of the actual words in the sentence.) It's in contrast to *I washed my dishes by hand* or *I washed my dishes in the sink.*
Answer: I don't think it sounds natural at all.
A dishwasher is an appliance, a tool. It doesn't just pick your dishes up at your request and wash them for you. It requires your manual intervention.
You wouldn't say:

I had the nails knocked in by a hammer.

You would say:

I knocked the nails in with a hammer.

I think the most natural and common way to express what you are trying to say would be:

I used the dishwasher to wash the dishes.


How to check which app changes home background image

Question: The background of my homescreen keeps changing and I do not know what causes it. I can change the background manually, but after a certain moment of time it just changes automatically to another background. It is really annoying. I mean... I do not hate baby's. But I do not want them randomly eating biscuits on the background of my phone .
Comment: Do you use a custom launcher?
Comment: I mean a third-party launcher
Comment: Have set any live wallpaper?
Comment: I am using the default Oneplus launcher, but same kept happening, using the Nova launcher. I do not think I have a live wallpaper (how can I check that?). And isn't the live wallpaper overwritten anyway when I select a new background?
Answer: An app must have the permission android.permission.SET_WALLPAPER to change wallpaper. I suggest you find out which apps have that permission and than try to disable or remove some of those app one by one until you no longer have that problem.
You can use a permission checker app to find those app. User Izzy maintains a nice list here if you need help finding one. I have used aSpotCat earlier so I'm showing you how you can use it to list all the apps having that permission.

Launch the app.
Choose List apps by permission
Scroll down and choose Misc. Permission
Tap the three horizontal line icon next the Misc. Permission to list the permissions instead of the apps.
In the search bar (tap the lens icon) type android.permission.SET_WALLPAPER
Under Set Wallpaper category you can find the apps which have the permission to change wallpaper.


Mount NFS Share in Kodi on Android TV

Question: I have a Sony Bravia Android TV. Has anyone managed to mount an NFS share in the Kodi media center app? Any help is greatly appreciated.
Comment: I did, but not directly through NFS, but through Samba / SMB instead. But, since you have already figure this thing out then there is no point to follow this discussion.
Answer: Figured it out. One needs to add the insecure option on the server side,
<code>/mnt/MOUNTPOINT IP (ro,no_subtree_check,insecure)</code>
works on my system.

Mount NFS Share in Kodi on Android TV


take screen shots from a flv video

Question: I am working on a videos sharing web site and I want to take screen shot from a flv video file from a another website like youtube. I am using PHP but i have no idea how to do it.
any guidance is appreciated.
Answer: There seems to be ffmpeg extension for PHP.
By quickly looking it, something like this should work:
<code>$movie = new ffmpeg_movie('foo.flv');
$frame = $movie->getFrame(1234);
imagefromjpeg($frame, 'foo.jpeg');
imagedestroy($frame);
</code>
Of course this means that this extensions has to be added to current PHP installation.
Answer: You can download the flv video on to your server (there are many many apps and documentation on getting the flv from YouTube) and then use a command line tool to extract a screenshot from the video (i.e. similar to this blog entry).
I don't know any tool that would allow you to do this without downloading the video. While it is technically possible, you'd probably have to go outside PHP and adapt an open source tool for your needs. This site might be a good starting point for such a solution.

take screen shots from a flv video


Is it possible to run both Xcode 3 and 4 side-by-side on the same machine?

Question: As the title says, can I have both versions of Xcode installed on the same machine?
Comment: @Ricket: Because Xcode is very, very buggy right now and it is not necessary to have v4 to use the latest SDKs.
Comment: Out of curiosity... Why? (oh gosh that's such an Apple thing to say)
Answer: To answer your question: Yes. When you install Xcode 4 (and its dev tools) your "old" Xcode folder gets renamed as Developer-old (provided you already had Xcode 3 installed)
To answer Ricket: Xcode 4 doesn't support a few things (yet) like Plugins and some features (like assembly code) are non existent in Xcode4 (perhaps yet or never) so if you rely on some things you might want to keep a copy of Xcode 3 around.
If you want to take a look at a good Xcode 4 review (and see some of the key benefits/drawbacks) have a look at this.
Comment: That certainly is not what happened when I installed Xcode 4 the other day. It completely removed Xcode 3. Maybe the behaviour has changed in a later version.
Comment: @andy that'd be strange, but I cannot confirm nor deny it at this point because I already have both. I'm sure there was an option to avoid that and replace it, but I installed this a few months ago and I don't remember now.
Answer: Yes.
From the doc 'About Xcode and iOS SDK.pdf':

By default, Xcode 4 installs in the folder /Developer - but if you wish to install it in a different folder, allowing it to co-exist with previous Xcode 3.2 installations, you can change this location. You do this by selecting "Custom Install"

The doc gives detailed instructions.
Answer: Just installed Xcode 4 (iOS 5 beta) following Wayfaring Stranger's pointer to change the destination of Essentials (default is Developer folder, which would have probably uninstalled Xcode 3).
However, note that installation vis-a-vis commandline tools was not so smooth. So far I noticed:

xed disappeared from the PATH (and the new Xcode didn't get added, either). My scripts/aliases stopped working until I fixed the issue. You might want to make sure your PATH is set up right after the install.
xed from my custom install folder (4.0) can't find Xcode.app that it's supposed to launch.
XcodeBuild (and probably other commandline tools) was replaced with the new one in /usr/bin, so if you're building against an SDK that's not included in Xcode 4 (e.g., 4.2), you'll get build errors.

As far as the question of why one would want to install these side by side, there's another reason that hasn't been mentioned by others. If you have a team of even a few people and a ship date, you might not want to change your tooling until a later date. But, you might want to check out what's new. For example, I want to follow along with the WWDC sessions that discuss the new SDK/Xcode features.
Answer: Just got XCode 3 and 4 working together.  First I installed XCode 4 and then decided I needed both.  After installing XCode 3 to /Developer/XCode3 , then XCode 4 broke.  I ran the XCode 4 installer again and now both work.


how can I create wifi hotspot on windows 7 that can be shared with my macbook?

Question: My USB modem has issues so my Mac doesn't recognize it. I created an ad hoc wifi hotspot  on my Windows 7 laptop with WPA2 encryption and shared the internet. My Macbook Pro sees the wireless network but when I enter the password I get a connection failed warning. I tried connecting also with my iPhone and before I entered the password I got a messag/e that "MyWirelessNetwork" is not connected to the internet. How can I solve this issue
Comment: Does it work if you set up sharing with WEP (just for testing)?
Comment: no, the issue is the same
Comment: bmike's answer looked good.  Did it help?
Answer: The first step is to run the Wireless Diagnostic from the Mac since it's easy. There are iOS diagnostics, but you'll have the best luck determining why OS X won't connect to the network. From there, the iPhone issue will likely be solved, but if not you'll have a smaller problem to solve.
Option click your WiFi icon in the menu bar (place it there in network settings if it's absent) and then select Wireless Diagnostics.
Answer: yeah sure you can,read the tutorial below, it exactly helps you out
http://www.techtweetz.com/how-to-create-wifi-hotspot-on-windows-7-8-1-10/
Comment: what part of that will help someone that's already created a hotspot but can't get it to integrate with their iPhone?


python requests.get always get 404

Question: I would like to try send requests.get to this website:
requests.get('https://rent.591.com.tw')

and I always get
<Response [404]>

I knew this is a common problem and tried different way but still failed.
but all of other website is ok.
any suggestion?
Comment: I think you need to add headers.
That would solve your problem.
Answer: Webservers are black boxes. They are permitted to return any valid HTTP response, based on your request, the time of day, the phase of the moon, or any other criteria they pick. If another HTTP client gets a different response, consistently, try to figure out what the differences are in the request that Python sends and the request the other client sends.
That means you need to:

Record all aspects of the working request
Record all aspects of the failing request
Try out what changes you can make to make the failing request more like the working request, and minimise those changes.

I usually point my requests to a http://httpbin.org endpoint, have it record the request, and then experiment.
For requests, there are several headers that are set automatically, and many of these you would not normally expect to have to change:

Host; this must be set to the hostname you are contacting, so that it can properly multi-host different sites. requests sets this one.
Content-Length and Content-Type, for POST requests, are usually set from the arguments you pass to requests. If these don't match, alter the arguments you pass in to requests (but watch out with multipart/* requests, which use a generated boundary recorded in the Content-Type header; leave generating that to requests).
Connection: leave this to the client to manage
Cookies: these are often set on an initial GET request, or after first logging into the site. Make sure you capture cookies with a requests.Session() object and that you are logged in (supplied credentials the same way the browser did).

Everything else is fair game but if requests has set a default value, then more often than not those defaults are not the issue. That said, I usually start with the User-Agent header and work my way up from there.
In this case, the site is filtering on the user agent, it looks like they are blacklisting Python, setting it to almost any other value already works:
>>> requests.get('https://rent.591.com.tw', headers={'User-Agent': 'Custom'})
<Response [200]>

Next, you need to take into account that requests is not a browser. requests is only a HTTP client, a browser does much, much more. A browser parses HTML for additional resources such as images, fonts, styling and scripts, loads those additional resources too, and executes scripts. Scripts can then alter what the browser displays and load additional resources. If your requests results don't match what you see in the browser, but the initial request the browser makes matches, then you'll need to figure out what other resources the browser has loaded and make additional requests with requests as needed. If all else fails, use a project like requests-html, which lets you run a URL through an actual, headless Chromium browser.
The site you are trying to contact makes an additional AJAX request to https://rent.591.com.tw/home/search/rsList?is_new_list=1&type=1&kind=0&searchtype=1&region=1, take that into account if you are trying to scrape data from this site.
Next, well-built sites will use security best-practices such as CSRF tokens, which require you to make requests in the right order (e.g. a GET request to retrieve a form before a POST to the handler) and handle cookies or otherwise extract the extra information a server expects to be passed from one request to another.
Last but not least, if a site is blocking scripts from making requests, they probably are either trying to enforce terms of service that prohibit scraping, or because they have an API they rather have you use. Check for either, and take into consideration that you might be blocked more effectively if you continue to scrape the site anyway.
Comment: @roganjosh: It could be the site administrators saw a specific Python script abuse the site and wanted to block that one script, quickly. It could be they implemented a naive blacklist, and will make it more sophisticated as the need arises. Etc. Just because the blockade is simple today, won't mean it won't become harder to bypass as abusers bypass it.
Comment: Why might a site block python as a user-agent? I've been reading around this but when it's so easy to "spoof" (I guess) a user-agent, it doesn't make sense to me.
Answer: One thing to note: I was using requests.get() to do some webscraping off of links I was reading from a file. What I didn't realise was that the links had a newline character (\n) when I read each line from the file.
If you're getting multiple links from a file instead of a Python data type like a string, make sure to strip any \r or \n characters before you call requests.get("your link"). In my case, I used
with open("filepath", 'w') as file:
   links = file.read().splitlines()
   for link in links:
      response = requests.get(link)

Answer: In my case this was due to fact that the website address was recently changed, and I was provided the old website address. At least this changed the status code from 404 to 500, which, I think, is progress :)

python requests.get always get 404


gimp - print - fit whole page

Question: I use gimp as an all-purpose image viewing/editing/printing software (which it was not designed for). Now I have a picture and want to upscale it and print it in the largest possible size on an A4 sheet of paper with the best possible interpolation method. And all this has to be simple enough to repeat thousands of time throughout my life. How?
Answer: Astoundingly, GIMP does not seem to have an option for fitting the print to the
page size. The only way I can see is to use
Image → Print Size…. and set the print width or height parameters to dimensions
suitable for printing on A4.
The size of the A4 page are 210 × 297 millimeters or 8.27 × 11.69 inches.
The print should be a bit smaller to leave some margins.
Change the larger axe and let the other adapt itself.
See the documentation
for more details.
Answer: It's easy:

File -> Print.
Switch to tab "Image Settings"
Change "Size width|height" with arrow buttons
See "preview" on the right.
Press "Print" button in the bottom.

Screenshot of a File -> Print window, where You can set image print size in Gimp before printing:

p.s. I have Gimp v 2.10.18. (now is 2021)
p.s.2 This setting will be resetted after closing print dialog window. If you need settings to be saved, use "Image" -> "Print size" as answered in the answer by @harrymc
Comment: +1 this is a great option because one can see a preview of how it will fit the page before printing. I haven't tested but imagine this does not store the "Print Size" with the document permanently as answered in the answer by @harrymc
Comment: I tested: "Print Size" will be resetted after closing "Print" window. Added this to my answer. Thank You of reputation up! Now i can (and did it) inline screendshots!

gimp - print - fit whole page


Converting MaterializedDataRecord to an entity or why does EntityDataSource break my entity

Question: I'm using an EntityDataSource. When I leave the "Select" property blank, all works great - in SomeWebControl_DataBinding I can perfectly convert the DataItem of the GridRow to my Entity (let's call it USERS).
Literal ctrlTime = (Literal)sender;
GridViewRow row = (GridViewRow)ctrlTime.NamingContainer;
USERS usersRow = (USERS)row.DataItem;
DateTime timestamp = usersRow.Time;

However I only need to show the 1st 1000 rows of the table so what I do is I fill the "Select" property of the EntityDataSource and set it to "TOP(1000) |list of all fields in the entity|". But as soon as I do that
    USERS usersRow = (USERS)row.DataItem;

fails miserably, telling me that it can't convert from MaterializedDataRecord to USERS.
What I ended up doing is this:
Literal ctrlTime = (Literal)sender;
GridViewRow row = (GridViewRow)ctrlTime.NamingContainer;
DbDataRecord usersRow = (DbDataRecord)row.DataItem;
DateTime timestamp = (DateTime)usersRow["Time"];

I could probably use (MaterializedDataRecord) instead of (DbDataRecord), I just didn't want to scare my colleagues. Now, this works, however I find it ugly and it sort of defeats the beauty of using the EntityFramework. Also, this is a very basic example, in the future I might face similar situation where I would need to box/unbox lots of other fields, which doesn't look good.
So my question is: is there any way of easily converting the MaterializedDataRecord to an entity or of setting the EntityDataSource not to consider the presence of something in the "Select" as a "threat" which leads to creating MaterializedDataRecord instead of an entity?
I mean I would understand that behavior if I was selecting a subset of the entity's fields, but here I'm selecting all the fields, so this shouldn't be a problem for the EntityDataSource to convert.
Thanks!
Answer: As you can see here Performance of Linq to Entities vs ESQL, it appears that EntityDataSource uses ESQL to compose the query. Then when you use the "Select" property, it changes the projection and you can't use anymore the model Entity.
What you can do is use the QueryCreated event and filter the top 1000 records before the query is executed by changing it. There is an example here http://msdn.microsoft.com/en-us/library/ee404748.aspx.


How should implement Hashbang (AJAX) in content page tabs?

Question: As some of you may know, Google is now crawling AJAX. The implementation is by far something elegant, but at least it still applies to Yahoo and Bing AFAIK.
Context: My site is driven by Wordpress & HTML5. An Custom Post Type has tree types of content, and the contents of these are driven by AJAX. The solution I came for not using hashbangs (#!) until fully understand how to implement them is rather "risqué". Every link as HREF linking to *site.com/article-one/?tab=first_tab*, that shows only the contents of the selected tab (
Content...
). Like this:
This First Tab

As you may note, data-tab is the value that JavaScript sends with AJAX Get, that gets the related content and renders inside a container. At the other side, the server gets the variable and does a <?php get_template_part('tab-first-tab'); ?> to deliver the content.
About the risqué, well, I can see that Google and other search engines will fetch *http://site.com/article-one/?tab=first_tab* instead of http://site.com/article-one/, making users come to that URL instead of showing the home page with the tab content selected automatically.
The problem now is the implementation to avoid that.
Hashbang: From what I learned, I should do this.

HREF should become site.com/article-one/#!first-tab
JS should extract the "first-tab" of the href and pass it out to $_GET (just for the sake of not using "data-tab").
JS should change the URL to site.com/article-one/#!first-tab
JS should detect if the URL has #!first-tab, and show the selected tab instead of the default one.

Now, for the server-side implementation, here is where I'm kind lost in the woods.

How Wordpress will handle site.com/article-one/?_escaped_fragment_=first-tab?
Do I have to change something in .htaccess?
What should have the HTML snapshot? My guess is all the site, but with the requested tab showing, instead of showing only the content.

I think that I can separate what Wordpress will handle when it detects the _escaped_fragment_. If is requested, like by Google, it will show all the content plus the selected content, and if not, it's because AJAX is requesting it and will show only the content. That should be right?
Answer: I'm gonna talk third person.
Since this has no responses, I have a good one why you should not do this. Yes, the same reason why Twitter banged them:
http://danwebb.net/2011/5/28/it-is-about-the-hashbangs
Instead of doing hashbangs, you should make normal URIs. For example, an article with summary tab on should be "site.com/article/summary", and if it is the default one that pops out (or is it already requested) it also should change to that URI using pushState().
If the user selects the tab "exercises", the URL should change to "site.com/article/exercises" using pushState() while the site loads the content throught AJAX, and while you still maintain the original href to "site.com/article/exercises". Without JavaScript the user should still see the content - not only the content, the whole page with the tab selected.
For that to work, some editing to the .htaccess to handle the /[tab] in the URL should be done.


Is 也 within the kanji 池 acting as a phonetic?

Question: Recently, I have been studying kanji seriously. I just learned the compositions 成り立ち of kanji. There is a 成り立ち that confuses me a lot. My text book says 池 is a kanji categorized as 形声文字 (kanji composed with 音記号(音符) and 意符. 音記号 of 池 is 也, but 也 itself is read ヤ not チ(onyomi of 池)or いけ. How come this kanji 池 is read チ(音). Is 音読み and reading of 音記号 are completely different things? However, is there a possibility that my textbook (my professor's hand-made book) is wrong.
Comment: [This](https://chinese.stackexchange.com/a/17067/28044) in the Chinese forum may have some relevance.
Comment: Both China and Japan have a long history, and the way their characters are read has changed over the years. Just because a character is phono-semantic (形声文字) does not mean its original reading is still preserved everywhere. Nevertheless, generally speaking, the connection between the on-reading and the phonetic component of a phono-semantic kanji is (still) obvious in many cases.
Answer: The answer is clearer if we look at how they may have been pronounced in Old Chinese.

池

(Baxter–Sagart): /*Cə.lraj/
(Zhengzhang): /*l'al/

也

(Baxter–Sagart): /*lAjʔ/
(Zhengzhang): /*laːlʔ/

(Baxter-Sagart refers to one set of reconstructions, specifically the one in this book.)
Now, reconstructions are necessarily based on incomplete information, and so you can see that the two reconstructions don't agree on what the initial or final of 池 and 也 actually are. However, both of them agree that the two characters were certainly pronounced more similar to each other than in modern Chinese varieties.
You can see that 池 ended up diverging from 也 in pronunciation starting from Middle Chinese because of a difference in articulation in the initial (either a sesquisyllable in Baxter-Sagart, or a pharyngealised initial in Zhengzhang's reconstruction).
In summary, you can see that while 也 is not a meaningful phonetic component from the point of view of modern Chinese dialects or Sino-Japanese readings, they were much closer to each other in Old Chinese.
(PS: Your question also applies to 地, which is certainly more similar to 池, but also raises the similar question of why it has a phonetic 也. The answer is the same as above.)
Comment: Yeah, the relevant time for when it sounded the same is thousands of years ago... As far as categorization is concerned.
Answer: While the history of Japanese characters being imported from Chinese is relevant, it is probably more useful to focus on how Japanese is classified now.
Kanji characters are usually categorized into 4 types, as follows:

Pictograms (象形文字) like 門
Ideograms (指示文字) like 二 or 三
Compound ideograms (会意文字) like 明
Phonetic-ideographic characters (形成文字) like 池
(There are 2 other categories but they are somewhat rare. )

The phonetic-ideographic characters contain a component that sometimes gives a clue to the pronunciation of the character. For example, you will find that the component 昜 sometimes appears on the right side of a kanji. As you can see here, it usually carries the pronunciation of ヨウ. But not always. Therefore, as a learner you can't rely on specific components always being pronounced a certain way. Kanji evolved in a very unorthodox way, meaning that learners are better served by developing an awareness of the components, but not relying on them to provide solid rules about meaning or pronunciation.
If you want to check the category of any joyo kanji, try this site: https://www.kanjidatabase.com/kanji_search.php and select 'Look Up Kanji' and then tick 'Kanji Classification'. Don't let this derail your learning process - it is more relevant in academic discussions, although it can have implications for learners.


system of binomial factors

Question: A system of any number of binomial factors each the sum of two squares being supposed multiplied together , show , by any method, that their product is the sum of two squares.
Comment: Please share your thoughts so far :)
Answer: Hint: $(a^2+b^2)(p^2+q^2)=(ap-bq)^2+(aq+bp)^2$. Using this identity repeatedly will do the job.
The identity can be verified most simply by expanding each side. It is sometimes called the Brahmagupta-Fibonacci Identity.
Remark: Brahmagupta actually used a more general identity, in a study of the solutions of the so-called Pell equation. He did not call it the Pell equation, since his work was done about $1000$ years before Pell lived.
If you are familiar with complex numbers, you can note that $(a+bi)(p+qi)=(ap-bq) +i(aq+bp)$. Thus the identity can be viewed as saying that the norm of a product is the product of the norms.

system of binomial factors


Can I host the same domain I've used as a nameserver?

Question: I've setup a domain I have as NS1.DOMAIN.COM for my other sites. But there seems to be an issue with actually getting it to be viewed as a website. I'm currently using VESTA and my registrar is GoDaddy. Any suggestions about things I should check into would be much appreciated.
Answer: That's an odd thing to do.
I suggest you don't use ns1.domain.com as a web server. It's probably your name server, which points to a different address.
Tell me your domain or post your zone (DNS config) and I'll look at it. There's probably something wrong.
Also, maybe you should post your web server configuration as well... I suspect you could have more than one issue.
If you don't put enough information into your question, people can't help you. And people will down vote you and vote to close your question.
Things you should check: Your DNS config and web server config. More advice is pending. Waiting on details.
Comment: It's basically a VPS, and I set up a DNS Template using the IP of the server.  There was no NS available,  so I made one from a domain I own on GoDaddy. This is basically something I've setup so I can learn about it.
Comment: I've read a bunch of articles about gluing it,  but they're all from ten years ago and aren't even relevant when it comes to navigating around GoDaddy to make the changes/corrections.  One of the only tips that seemed positive was to use FreeDNS to setup the nameserver.
Comment: @SteveVentimiglia 1. You need a nameserver for every domain, usually there are at least two. 2. Quite often they are called ns1 ans ns2 3. You can't host a website before you have a your domain working properly. 4. You can only use Serverfault to solve business IT problems and it's not clear that's what you're doing. 5. Your question is about to get closed for being off-topic. 6. I warned you yesterday, it might be too late. 7. Consider another StackExchange community like SuperUser or something. 8. When you get there still follow my instructions. Good luck!
Comment: Thanks for your feedback. I had actually done everything the way it needed to be done and became frustrated since it wasn't working.  The issue was more about a setting in Vesta that I was overlooking in my "n00b" phase of playing with setting up a VPS host and the Vesta CP.  However, it would be extremely kind of Google to stop 10-14 yr. old sets of "instructions" (aka "destructions") from showing up first on their SERPs when there is zero benefit to them.  Thanks for your patience.
Comment: I've accepted your answer, based on the advice you've posted and the help you were attempting to provide. Thanks for your patience.
Answer: It can be done: the A record for the name server domain has to point to a server running DNS. That server can also run a webserver, so the same server can respond to web requests.
However, it is a bad idea to do this.