How to list files that was modified last from a directory using ruby
How to order files by last modified time in ruby?
T-SQL: Selecting Column Based on MAX(Other Column) Why does my procedure run slowly until I update statistics? How to make a modification take affect without restarting nginx? Apache has a graceful option which can scan for modification in http.conf without restarting Apache. What about nginx? Deploy Community Builder audience page assignments with ant migration tool? In Community Builder, if you create audiences and assign them to page variations, you cannot deploy these using change sets, according to .  In fact, Audience doesn't even appear in the list of change set components.  On the other hand, Audience metadata can be deployed using the ant migration tool, so I was hopeful that the audience assignments would also be deployable.  Unfortunately, I haven't had success in deploying any audience assignments, either for entire pages or for components on a page.  Has anyone found a workaround for deploying audience assignments for Community Builder pages?  I should say that I'm using the Build Your Own template.  If it can't be deployed, is there at least a way to get a list of audience assignments so I don't have to open every single page in the Community Builder to check?  Here's what I'm using in my package.xml manifest.  All the community builder page variations and all the audiences are created correctly, but the assignments are not.  &lt;types&gt;     &lt;members&gt;*&lt;/members&gt;     &lt;name&gt;Audience&lt;/name&gt; &lt;/types&gt; &lt;types&gt;     &lt;members&gt;*&lt;/members&gt;     &lt;name&gt;CustomSite&lt;/name&gt; &lt;/types&gt; &lt;types&gt;     &lt;members&gt;*&lt;/members&gt;     &lt;name&gt;SiteDotCom&lt;/name&gt; &lt;/types&gt; Ignoring programming style and design, is it "safe" to call delete on a variable allocated on the stack?  For example:     int nAmount;    delete &amp;nAmount;   or  class sample { public:     sample();     ~sample() { delete &amp;nAmount;}     int nAmount; } How long can I store soaked beans before cooking? Using Ubuntu 11.10, how do I format an external or USB drive? I don't find an option to 'format' when I right click. In the new version, the drives don't come up on the desktop, but instead come on the Launcher. Is there a missing definite article before caliph in 'the group's leader, XYZ, as (the) caliph'? I read news on the BBC (on its website) this morning. When I was reading the news I noticed the definite article the was missing in a sentence. As per my opinion, the reporter missed the article the. But I also thought that the reporter also had some point as he did not use the article there. So I just wanted to confirm so landed here to get some help on it.     On the website:      It also proclaimed the group's leader, XYZ  (name), as caliph and   "leader for Muslims everywhere".      As per my opinion it should have been:      It also proclaimed the group's leader, XYZ  (name), as the caliph and   "leader for Muslims everywhere".   Source link: I have always believed that it was ok to replace a capacitor with a slightly higher voltage rated one. eg 16v with 25v.Going higher than this would risk the capacitance value being out at the working voltage. However I just read the following quote from this       Electrolytic capacitors are non-ferroelectric with a very low dielectric constant. Their capacitance is derived from a very high surface area and nanometer thick dielectric layers. Their capacitance is not a function of applied voltage.‐Design Solutions For DC Bias In Multilayer Ceramic Capacitors (August 2010 Electronic Engineering Times)   So does this rule not apply to aluminum electrolytics? Eg will I have no issues replacing an electrolytic 25v 100uf with a 50v 100uf assuming both are low esr, similar footprint and good quailty? I have a query pattern that must be very common, but I don't know how to write an efficient query for it.  I want to look up the rows of a table that correspond to "the most recent date not after" the rows of another table.  I have a table, inventory say, which represents the inventory I hold on a certain day.  date       | good | quantity ------------------------------ 2013-08-09 | egg  | 5 2013-08-09 | pear | 7 2013-08-02 | egg  | 1 2013-08-02 | pear | 2   and a table, "price" say, which holds the price of a good on a given day  date       | good | price -------------------------- 2013-08-07 | egg  | 120 2013-08-06 | pear | 200 2013-08-01 | egg  | 110 2013-07-30 | pear | 220   How can I efficiently get the "most recent" price for each row of the inventory table, i.e.  date       | pricing date | good | quantity | price ---------------------------------------------------- 2013-08-09 | 2013-08-07   | egg  | 5        | 120 2013-08-09 | 2013-08-06   | pear | 7        | 200 2013-08-02 | 2013-08-01   | egg  | 1        | 110 2013-08-02 | 2013-07-30   | pear | 2        | 220   I know one way of doing this:  select inventory.date, max(price.date) as pricing_date, good from inventory, price where inventory.date &gt;= price.date and inventory.good = price.good group by inventory.date, good   and then join this query again to inventory. For large tables even doing the first query (without joining again to inventory) is very slow.  However, the same problem is quickly solved if I simply use my programming language to issue one max(price.date) ... where price.date &lt;= date_of_interest ... order by price.date desc limit 1 query for each date_of_interest from the inventory table, so I know there is no computational impediment.  I would, however, prefer to solve the whole problem with a single SQL query, because it would allow me to do further SQL processing on the result of the query.  Is there a standard way to do this efficiently? It feels like it must come up often and that there should be a way to write a fast query for it.  I'm using Postgres, but an SQL-generic answer would be appreciated. This is a "catch-all" question designed to serve as an answer for all questions about choosing web hosting.  Pro Webmasters no longer accepts new questions about how to choose hosting.  All future questions pertaining to finding web hosting should be closed as a duplicate of this question. For more information about this policy please see .    How to find web hosting that meets my requirements?  What we're looking for in answers to this question are the basics about web hosting:   What is web hosting? What is the difference between shared, VPS, and dedicated hosting? How does a content delivery network relate to web hosting? Anything else you feel is helpful in finding a web host.   What we do not want is:   Endorsements or recommendations for specific web hosts We do not want your experience or other subjective information (just the facts please) In wikipedia FKT algorithm is given for planar graphs. Not anything for complete graphs. I need to find the number of perfect matchings in complete graph of six vertices. Lagrange Multipler KKT condition I am looking at SVM, and reviewing Lagrange multiplier. Let's say with the constraint function $$g(x,y) = x^2 + y^2 -1 &gt; 0, $$ I am maximizing $$f(x,y) = x + y -1 .$$ Intuitively, since the constraint function does not provide a finite constrained region, there is no solution, and $f(x,y)$ can infinitely increase.  However, if I just plainly proceed with Lagrange multiplier calculation,  $$L(x,\lambda) = (x + y -1) +\lambda(x^2 + y^2 -1)$$ I get the solution: $$y,x = -\sqrt{2}/2, \lambda = 1/\sqrt{2}$$ And this still satisfies KKT conditions although the solution is wrong.  $$g(x) =&gt; 0 , \lambda =&gt;      0, \lambda g(x) = 0.$$  I expected that I would have some result that conflicted KKT conditions, but nothing was violated.   Does this mean that Lagrange multiplier under KKT conditions can produce a solution that cannot be solved, without giving any indication of intractability?  If functions are complicated, what's the systematic way to confirm that the optimization with inequality constraint functions is solvable using Lagrange multiplier? Syntax of Using Math Mode: Empty Lines (Beginner Question) I'm just starting to learn LaTeX. I tried typing \begin{equation*}  (math goes here)  \end{equation*}  and I got a whole bunch of errors. It seems LaTeX interpreted the empty line as the equation: when it saw nothing there, I guess it just ended math mode? It then said my other commands needed $'s so I assume that's what happened. When I typed \begin{equation*} (math goes here) \end{equation*}  everything was fine. So I'm confused. If LaTeX sees an empty line in an environment, does it just interpret this as me changing my mind, and deciding not to use the declared environment? Positivity of a determinant How to UPSERT (MERGE, INSERT ... ON DUPLICATE UPDATE) in PostgreSQL? Wouldn't multiple filters in a convolutional layer learn the same parameter during training? Based from what I have learned, we use multiple filters in a Conv Layer of a CNN to learn different feature detectors. But since these filters are applied similarly (i.e. slided and multiplied to regions of the input), wouldn't they just learn the same parameters during training? Hence the use of multiple filters would be redundant? Why doesn't my Bash script recognize aliases? "EOL while scanning single-quoted string"? (backslash in string) import os xp1 = "\Documents and Settings\" xp2 = os.getenv("USERNAME") print xp1+xp2   Gives me error   File "1.py", line 2  xp1 = "\Documents and Settings\"                                ^ SyntaxError: EOL while scannning single-quoted string   Can you help me please, do you see the problem? Differential Geometry-Wedge product How can we prove the following relation for differentiating the wedge product of a p-form $\alpha_p$ and a q-form $\beta_q$$$d(\alpha_p\wedge\beta _q)=d\alpha_p\wedge\beta_q+(-1)^{p}\alpha_p\wedge d\beta_q$$