help with registering MVC3 route i have web application that i wants to map two URL path  first  {domain} ex :- www.youdomian.com for home page {domain}/{id} :- www.youdomain.com/1234 for second page also have httphandler  how can i registered this route   this is what  have done. i commented the first line to get work httphandler  //routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute("Shorten", "{id}", new {controller = "SecondPage", action = "Index"});  routes.MapRoute("Default", // Route name                 "{controller}/{action}/{id}", // URL with parameters                 new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults   problem is when i call handler it's redirected to secondpage route how can i by pass this
ASP.NET MVC custom routing for search Here is my scenario.  For the example lets say that I need to return a list of cars based on a search criteria.  I would like to have a single View to display the results since the output will be the same, but I need several ways of getting there.  For instance, I may have a Form with a textbox to search by year.  I may have another separate page that contains a hyperlink for all red, Toyota cars.  How do I handle these multiple scenarios in the same View and Controller.  My dilemma is that the search could contain several options… year, make, model, etc but I don’t know where to put them.  What is the best approach for this?  Should I define the parameters in the routing or go with query strings, etc?
Deleted downvotes should appear in Achievements dialog "Good morning.  Here is something awesome that you got last night!", said the Top Bar:    "21?  That must be two answer upvotes and, um, an answer that I downvoted that was deleted?", I thought.  Ok, let's look at the details and find out:    The +20 on my egrep answer is new and I've seen the other Achievements on the list, so where did the extra +1 come from?  In order to avoid confusion, the recent reputation changes in the dropdown should add up to the number in the notification.      I suspect this particular case is a bug.  Assuming the +1 is a downvote reversed by an answer deletion, I could see the argument for excluding it from the Achievements dropdown.  After all, it's not exactly something you accomplished.  Except it kinda is.  Part of the reason for downvoting is to  low-quality content.  The ultimate sign that such content was deemed beneath community standards is when it gets deleted.  I'm not sure that we should , but putting a note in your achievements in such cases seems like it would reinforce positive (albeit negative) behaviour.  This question is a feature request that rep gains from deleted downvotes be listed in the Achievements dialog, without getting into broader issues of displaying other activity on deleted posts such as those discussed in .  Thus, this is not intended to completely address the issue of the Achievements sum not adding up, but is intended to help encourage good community moderation by appropriate downvoting of low-quality content. Show hidden files on Mac OS X Mojave using Terminal To see my /etc folder I've tried this command in Terminal:  sudo chflags nohidden /etc   followed by:  sudo defaults write com.apple.Finder AppleShowAllFiles true; killall Finder   also tried:  sudo defaults write com.apple.Finder AppleShowAllFiles YES; killall Finder   Neither of them seemed to work. Commas for multiple adjectives spectral radius in normed space is subadditive. I am reading the book "characterizations of c*-algebras" by Doran and Belfi. On the page 299, the book reads "It can also be shown that if $xy=yx$, then $\nu(x+y)\le\nu(x)+\nu(y)$." The definition of $\nu$ is as follows: in normed algebra,  $$\nu(x)=\limsup_{n\to\infty}\|x^n\|^{\frac1n}$$  Note that the algebra is not assumed to be complete and is also not assumed to be complex scalar(we can have real scalars)  This is my trial: I just tried to mimic the proof of the Minkowski inequality, but failed.  Thank you Summary table with a field that shows components of each summarized record Mathematical induction for inequalities: $\frac1{n+1} + \frac1{n+2} + \cdots +\frac1{3n+1} > 1$ If the velocity is a relative quantity, will it make inconsistent equations when applying it to the conservation of energy equations?  For example:  In the train moving at $V$ relative to ground, there is an object moving at $v$ relative to the frame in the same direction the frame moves. Observer on the ground calculates the object kinetic energy as $\frac{1}{2}m(v+V)^2$. However, another observer on the frame calculates the energy as $\frac{1}{2}mv^2$. When each of these equations is plugged into the conservation of energy, they will result in 2 distinct results (I think). If $\sin \theta+\cos\theta+\tan\theta+\cot\theta+\sec\theta+\csc\theta=7$, then $\sin 2\theta$ is a root of $x^2 -44x +36=0$ My own bonafide attempt. $$ 0&lt;\theta&lt;\pi/2$$   and $$\sin\theta+\cos\theta+\tan\theta+\cot\theta+\sec\theta+\csc\theta=7$$   then show that $\sin 2\theta$ is a root of the equation $$x^2 -44x +36=0$$   I tried to use the above given equation of all the trigonometric ratios, though I ended up with an expression of $\sin\theta\cos\theta$.   But this too is in the form of $\sin\theta$ and $\cos\theta$ which was $\sin\theta\cos\theta=\frac{1}{6-\sin\theta-\cos\theta}$.  When I put that in the quadratic equation, it would again transform into the form of $\sin\theta$ and $\cos\theta$, and hence at last I couldn't prove the thing.  Even hints would work, as I would like to solve the question myself. How can I find the number of partitions of $n$ into exactly $k$ distinct parts, where each part is at most $M$?  The number of partitions $p_k(\leq M,n)$ of $n$ into at most $k$ parts, each of size at most $M$, is given by the generating function: $$  \binom{M+k}{k}_{x} = \prod_{j=1}^{k}\frac{1-x^{M+k-j+1}}{1-x^j}= \sum_{n=0}^{kM} p_{k}(\leq M,n) x^n $$  For the number of the partitions $p_k(\mathcal{D},n)$ of $n$ into at most $k$ parts there is the recurrence relationship: $$   p_{k}(\mathcal{D},n) = p_{k}(\mathcal{D},n-k) + p_{k-1}(\mathcal{D},n) $$  But what, if I want to count only the partitions with distinct parts and restricted number of parts and restricted part size?  Update: Now I know the generating function for the number of distinct restricted partitions $p_k(\leq M, \mathcal{D},n)$ of $n$ into exactly $k$ distinct parts, all at most $M$ is $$    \prod_{j=1}^{M} (1+xq^{j}) = \sum_{k,n=0}^{\infty}p_k(\leq M, \mathcal{D},n)x^{k}q^{n} $$ and there is also a recurrence relation $$    p_k(\leq M, \mathcal{D},n) =         p_{k-1}(\leq M-1, \mathcal{D},n-k) +         p_k(\leq M-1, \mathcal{D},n-k) $$ How can I prove this? Could you recommend a book, where I could read about this? How do I run wireshark, with root-privileges? A standard installation of Wireshark doesn't give the program permission to access the network interface.   I suppose I have to run the program with sudo, but do not know how to add it to the icon - if that's the way to do it. Lots of questions are very generic, &quot;share an experience&quot; kinds of questions. In these cases, I am quite often interested in specific answers that may not have gotten that many upvotes. These questions also tend to elicit lots of responses, so going back to find the answers I'm interested in somewhere in the middle of a sea of responses is a pain. Is there a way to favorite or bookmark these answers? pkexec command in a .desktop file I made a .desktop file for Androxyde's Flashtool (utility for Sony Xperia devices that I have to open with an executable file in its folder) that requires root privileges to use fastboot utilities. I used to make it work with gksu, but I'm on Ubuntu 15.04 and gksu is now old.  I tried to modify the exec line from Exec=gksu /home/natasha/FlashTool/FlashTool to Exec=pkexec /home/natasha/FlashTool/FlashTool Then, I read about pkexec doesn't allow to run X11 applications and so I override in this way:      The problem now is: It asks me the password but the Flashtool's GUI doesn't start. BUT if I execute that command in terminal, the program starts without problems. What can I do? How do lexical closures work? While I was investigating a problem I had with lexical closures in Javascript code, I came along this problem in Python:  flist = []  for i in xrange(3):     def func(x): return x * i     flist.append(func)  for f in flist:     print f(2)   Note that this example mindfully avoids lambda. It prints "4 4 4", which is surprising. I'd expect "0 2 4".   This equivalent Perl code does it right:  my @flist = ();  foreach my $i (0 .. 2) {     push(@flist, sub {$i * $_[0]}); }  foreach my $f (@flist) {     print $f-&gt;(2), "\n"; }   "0 2 4" is printed.  Can you please explain the difference ?    Update:   The problem is not with i being global. This displays the same behavior:  flist = []  def outer():     for i in xrange(3):         def inner(x): return x * i         flist.append(inner)  outer() #~ print i   # commented because it causes an error  for f in flist:     print f(2)   As the commented line shows, i is unknown at that point. Still, it prints "4 4 4". Photoshop To CSS: How do you translate Fill to CSS I have a content box in photoshop with the background color #bc0018 with a 65% opacity and 50% fill.  I am able to translate the backgroundcolor and opacity part to this, but without the 50% fill the backgroundcolor looks different.  .content-box {     background-color: rgba(188, 0, 24, 0.65); }   Any suggestions on also getting the proper "fill" in CSS?  EDIT  I did just divide the opacity by half and it appears to achieve the same effect as a 50% fill. Still, I would love to hear how other people do this? I definitely don't want to create an image just for this.  .content-box {     background-color: rgba(188, 0, 24, 0.325); }   Thanks! How to calculate the Fourier transform of a Gaussian function? I would like to work out the Fourier transform of the Gaussian function   $$f(x) = \exp \left(-n^2(x-m)^2 \right)$$  It seems likely that I will need to use differentiation and the shift rule at some point, but I can't seem to get the calculation to work. Does anyone have any advice?  By the way, I am using   $$\mbox{FT}(f)(k)=\int_{-\infty}^\infty f(x)e^{-ikx}\,\mathrm d x$$  as my definition of a Fourier transform. Many thanks. A teacher wants to randomly form two teams of 5 students from a group of 5 girls and 5 boys for a sports activity. A teacher wants to randomly form two teams of 5 students from a group   of 5 girls and 5 boys for a sports activity. Two of the girls, Ann and   Alice, are selected as team leaders. Find the probability that one   team has exactly 3 girls.   If i do this way $$\dfrac{{3 \choose 2}{5\choose 2}{1\choose 1}{3\choose 3} \times 2!}{{8 \choose 4}{4 \choose 4}} = \dfrac{6}{7}$$  Which turns out to tally with the answer. But i got one big question, is my way correct. Do i really need to times $2$ here? Please see my link below to my previous question cause the previous question make me doubt if i should times $2$. I'm looking for a paper that could help in giving a guideline on how to choose the hyperparameters of a deep architecture, like stacked auto-encoders or deep believe networks. There are a lot of hyperparameters and I'm very confused on how to choose them. Also using cross-validation is not an option since training really takes a lot of time! Does the cross-entropy cost make sense in the context of regression? Does the cross-entropy cost make sense in the context of regression (as opposed to classification)? If so, could you give a toy example through TensorFlow? If not, why not?   I was reading about cross-entropy in  by Michael Nielsen and it seems like something that could naturally be used for regression as well as classification, but I don't understand how you'd apply it efficiently in TensorFlow since the loss functions take logits (which I don't really understand either) and they're listed under classification Why is the comma splice an error? It's always drilled into us that we shouldn't use comma splices. They're bad, to be avoided and poor form.  But why? What makes the comma a faulty choice in something like this:     I never liked school, it was boring and repetitive most of the time.   It could be replaced with a semicolon, dash, period or colon and be "correct." Yet to a fair amount of people, the comma seems fine. If it weren't, it wouldn't be found so often in online forums, text messages, emails and so on.  What makes the comma between two sentences an error? Strip whitespace from jsp output