Can't understand "puts" keyword in Ruby code
Anyone can comment this ruby code?
I have read lots of information about page caching and partial page caching in a MVC application. However, I would like to know how you would cache data.  In my scenario I will be using LINQ to Entities (entity framework). On the first call to GetNames (or whatever the method is) I want to grab the data from the database. I want to save the results in cache and on the second call to use the cached version if it exists.  Can anyone show an example of how this would work, where this should be implemented (model?) and if it would work.  I have seen this done in traditional ASP.NET apps , typically for very static data. Sign of Work and potential energy in electrostatics Conceptual question:  Suppose we have a configuration of point charges. If the potential of the energy of the system is negative, this means work is positive.   I'm kind of rusty with my mechanics, does the fact that the work is positive mean that to arrange the configuration you have to do work against the electric field? I.e. supply energy via some external force?  In terms of electrostatics, is there a general way of interpreting the sign of potential energy and work? When I googled stomach flu, there were many questions and statements like      How do you get the stomach flu?    Or     Difference between a stomach flu and food poisoning    Or      Six facts about stomach flu   When do you use the, a or nothing? And which should I use for a sentence like "I got a stomach flu from someone" ? How to plot periodic function's graphic? I've just installed a new SSD replacing an HDD in my old (late 2008) iMac. When I switched it on all I got on screen was a question mark.   On the advice of my son I tried cmdR during switch on with no result.   I then tried alt which at least got me a cursor on the screen, but nothing else. Any suggestions? I've got everything backed up on an external Hard Drive, by the way. Salesforce Account as Entry source in Journey Builder Does NOT work How to analyse 'Element not Found' exceptions when working with Selenium I'm looking for an algorithm that sorts strings similar to the way files (and folders) are sorted in Windows Explorer. It seems that numeric values in strings are taken into account when sorted which results in something like  name 1, name 2, name 10   instead of  name 1, name 10, name 2   which you get with a regular string comparison.  I was about to start writing this myself but wanted to check if anyone had done this before and was willing to share some code or insights. The way I would approach this would be to add leading zeros to the numeric values in the name before comparing them. This would result in something like  name 00001, name 00010, name 00002   which when sorted with a regular string sort would give me the correct result.  Any ideas? I am trying to mimic the interesting proof from  to give a generating set of the ideal correspond to the $d$-uple embedding: We fix the notation $\Delta = \big\{ (\nu_0, \dots, \nu_n) \in {\mathbb{N}}^{n+1}_0 ~:~ \nu_0 + \dots + \nu_n = d \big\}$. The polynomial map is $\theta : k[y_\nu : \nu \in \Delta] \rightarrow k[x_0, \dotsc, x_n]$ given by $$ \theta ( y_\nu ) := x^{\nu_0}_0 \cdots x^{\nu_n}_n $$ and we know that ${\mathrm{ker}}~\theta$ is the ideal of the $d$-uple embedding, i.e., $\rho_d({\mathbb{P}}^n) = Z({\mathrm{ker}}~\theta)$ (cf. Exercise I.2.12 Hartshorne). Now let $W \leq k[y_\nu : \nu \in \Delta]$ denote the ideal $$ W := \Big\langle y_{\tau_1} y_{\tau_2} - y_{\tau^{\prime}_1} y_{\tau^{\prime}_2} ~:~ \tau_1, \tau_2, \tau^{\prime}_1, \tau^{\prime}_2 \in \Delta, \tau_1 + \tau_2 = \tau^{\prime}_1 + \tau^{\prime}_2 \Big\rangle $$ Clearly, $W \subseteq {\mathrm{ker}}~\theta$. Using the lemma in the above link, we need to produce a $k$-subspace $T \subseteq k[y_\nu : \nu \in \Delta]$ with the conditions $$ T + W = k[y_\nu : \nu \in \Delta], \hspace{.2in} \theta \lvert_{T} = {\mathrm{injective}} $$ After a few thoughts it seems reasonable to think of the following subspace as a candidate for $T$: First define the equivalence relation on $\Delta \times \Delta$ given by $(\tau_1, \tau_2) \sim (\tau^{\prime}_1, \tau^{\prime}_2)$ if $\tau_1 + \tau_2 = \tau^{\prime}_1 + \tau^{\prime}_2$. Let $\Omega \subseteq \Delta \times \Delta$ be a subset with a unique representative from each class of $\sim$. Now let $T$ be the $k$-span of the monomials $y^{\alpha_1}_{\tau_1} \dotsc y^{\alpha_r}_{\tau_r}$ (with the distinct elements $\tau_1, \dotsc, \tau_r \in \Delta$ and $\alpha_1, \dotsc, \alpha_r \geq 1$) such that $(\tau_i, \tau_j) \in \Omega$ for each $i \neq j$. Clearly, $\theta$ is injective if restricted to $T$. I got lost in the step : Each monomial $M$ of $k[y_\nu : \nu \in \Delta]$ satisfy $M \equiv b$ mod $W$ for some $b \in T$. Did I do anything wrong? I am currently running a Dungeons and Dragons 4 campaign for a group of 9 players.  Whittling the group down to a more manageable size is not really an option since they are all family.  When we do combat it takes forever even if I have one player help me and allow them to go 2 at a time.  When we do story based adventure there are 2-3 players that do most of the talking and the others twiddle their thumbs.  I've tried encounters with many foes, encounters with only a few tough foes, dialog only encounters, social puzzle encounters, everything I can think of.  What else can I try to get this group more engaged? Density of states for arbitrary dispersion relation If I have a 3D dispersion relation   $E=E(k_x, k_y, k_z)$ I have an equation for the density of states, which is   $D(E)=\frac{1}{\nabla_k E}\int\frac{dS}{(2\pi)^3}$  1) I am confused about the integral. What am I integrating over, exactly? It must have units of the $k$ vector, so it's a k-space integral, but what is the surface that is relevant?  3) Where does that equation come from, how is it derived? Attributive nouns vs. of-genitive I would be very grateful for some advice on how to decide whether to use an attributive noun or the "of genitive" (periphrastic genitive).  It seems to me that an attributive noun is generally preferable, except when it leads to ambiguity, often due to the combination of several modifiers with mixed dependent relationships.  Additionally, the of-genitive, when used stand-alone, seems to impart a more formal tone, a higher register.  Simple examples (preferred first, less-preferred second):  The department secretary vs. the secretary of the department.  But:  The excellent secretary of the department vs. the excellent department secretary.  Any additional guidelines would be most welcome. How to get GNOME Shell "Applications overview" to show the full name of applications This question has been asked before but that was over 6 years ago and I'm hoping to get a more updated answer.     Basically when I search for an application, if the name is too long it's shortened with an ellipsis (...). I want to know how to change it so that the whole name is displayed. Example:   I hope it's OK to ask for an updated answer.  I'm using Ubuntu 17.10 with GNOME Shell 64-bit. Delete all data for a kind in Google App Engine I would like to wipe out all data for a specific kind in Google App Engine. What is the best way to do this? I wrote a delete script (hack), but since there is so much data is timeout's out after a few hundred records. How can I make a logo in Adobe Illustrator like the AntiParticle logo below, from ?   It is a large number circles of different, varying sizes, which form the shape of a text character. I cannot find enable-interactive-search in    gsettings set org.gnome.nautilus.preferences enable-interactive-search true.     I searched using    gsettings list-recursively | grep search     and    gsettings list-recursively | grep interactive     but no such option.  Can you help me disable this in Ubuntu 17.10 and later? Is there a better way to do optional function parameters in JavaScript? How do I get the latest GIMP version available? I understand that there is a new version of the GIMP available, although it appears that the only way of doing this is by compiling from source :P  Is there another way of getting it, or if I have to compile can I do that through the terminal or better still; a GUI? I have a project where I have a few layers (State of Texas, cities, roads, etc.). They are all resaved and projected to NAD83 / UTM zone 14N EPSG: 26914. The project CRS is also NAD83 / UTM zone 14N EPSG: 26914 and on the fly projection is enabled. I added a text delimited file and cannot get them to line up. I checked the attribute table of the delimited file and the coordinates are correct. I cross-checked this with a point close to where a few of the points from the delimited file are and they are very close so in theory they should be lining up. I tried to save the delimited file and save it with the same projection and add the shp file back in and that did not work. Anyone have any ideas? I can't think of anything else to try. What is the optimal path between $2$ fixed points around an invisible obstructing wall? Every day you walk from point A to point B, which are $3$ miles apart. There is a $50$% chance each walk that there is an invisible wall somewhere strictly between the two points (never at A or B). The wall extends $1$ mile in each direction perpendicular to the line segment (direct path) between A and B, and its position can be at any random location between the two points. That is, it can be any distance between A and B such as $0.1$ miles away from A, $1.5$ miles away, $2.9$ miles away.... You don't know if the wall is present or where it is until you walk into it.  You must walk around the wall if present as there is no other way to circumvent it.  Assume the wall is negligible thickness (like a force field), all ground is perfectly flat, and the y coordinates at both A and B are $0$ (although I don't think the optimal path will change much if they weren't).  What strategy minimizes the average expected walk distance between A and B?  How do we know for certain this strategy yields the shortest average walking distance?  To get the $100$ bounty points, I would like a convincing argument from you as to why you feel your solution is optimal and cannot be beaten.  For those of you using computer simulation, anything reasonably close to optimal is a candidate for the bounty.   Can anyone beat the optimal solutions submitted so far?  There are still a few days to try.  Even a slight beat (if not due to roundoff error or some other error) would help prove previous solutions are non-optimal.  You can just use the table of $31$ points (x-y coordinates) and compute that path length and then if you can find better then I will accept that answer.  I think by Sunday night I may have to award the bounty otherwise it may get auto-awarded.