I would like to do the following in Ruby:   Create a class with a method in it 1.5 Create an instance of the class Create a reference to the method in the instance Execute the method later   Something like this:  class Cat   def meow     puts "meow"   end end  my_cat = Cat.new portable_meow = my_cat.method("meow") portable_meow.execute # outputs "meow"
Is it possible in Ruby to get a reference to methods of an object ( I would like to know if this can be done without procs/lambdas ) , for example , consider the following code :   class X   def initialize     @map = {}     setup_map   end    private   def setup_map     # @map["a"] = get reference to a method     # @map["b"] = get reference to b method     # @map["c"] = get referebce to c method   end    public   def call(a)     @map["a"](a) if a > 10     @map["b"](a) if a > 20     @map["c"](a) if a > 30   end    def a(arg)      puts "a was called with #{arg}"   end    def b(arg)      puts "b was called with #{arg}"   end    def c(arg)     puts "c was called with #{arg}"   end end   Is it possible to do such thing ? I would like to avoid procs/lambdas because I want to be able to change the behaviour of A,B,C by subclassing .
How to call a function on a directive scope from the controller I opened a can of sliced black olives for my pizza and only used half. I put the leftovers into a sealed container with the liquid and put it in the fridge. Under those conditions how long will the olives last? Is there a better way to store leftover olives? Why is the Petersen graph no Cayley graph? Finite ring has only zero divisors and units Sum of nil right ideals Is the phrase "it's just a matter of semantics" meaningless? I hear this phrase from time to time, and I really don't know what it means.  Two people are debating, and one says "the difference between your position and mine is just a matter of semantics."   This would seem to me to be quite an important difference.  That is, if one person means one thing, and the other person means something else, then they really do have different positions.  If they said "it is just a matter of terminology" or "just a matter of phrasing" I would get it.  But if someone says "we differ only what we mean" ... it kinda makes me chuckle because it seems to be saying that their meaning is not important, as if the argument was primary and the positions they take a secondary consideration.  So I started looking around for examples of this. I guess it seems that there is a popular notion that semantics is about very fine distinctions, such as:   Another interpretation seems to be that semantics is the difference between two ways of saying the same thing:   Maybe it is just a way of stopping an annoying conversation:   And then there is some usage that I simply don't understand:    And also:   Still, to me it is just a meaningless phrase.  Am I missing an important meaning here? I've noticed an interesting phenomenon in the user interfaces of many famous applications, they're moving away from the glossy complex to a more dull and bare minimum design.  Why the sudden change? It also appears that most of these companies have adopted this design around the same time, was that linked to some new study?  Examples: Will wolves attack and kill ocelots in Minecraft? I know they kill sheep. I just don't want my cats being eaten. Definition of complex number In many situations (problems as well as solutions) I encounter the complex number $i$ which many times is defined as $i^2=-1$ instead of $i=\sqrt{-1}$, since it is "more preferred". Does anyone know why? Is it because there are two solutions to the equation $x^2+a=0, \ \ a&gt;0$? Nonabelian semidirect products of order $pq$? I just constructed the semidirect product in Lang, and I'm trying to tie some facts together. From Ash's Algebra, I know that if $p\lt q$ are distinct primes, if $q\not\equiv 1\pmod{p}$, then any group $G$ of order $pq$ is abelian.  Is the converse true, that for any primes $p\lt q$, if $q\equiv 1\pmod{p}$ then there exists a nonabelian group of order $pq$?  One example I found online is that $\mathbb{Z}_3\ltimes \mathbb{Z}_7$ is nonabelian, and here $7\equiv 1\pmod{3}$. I was considering then semidirect products $\mathbb{Z}_p\ltimes\mathbb{Z}_q$ where $q\equiv 1\pmod{p}$ and some homomorphism $\phi\colon \mathbb{Z}_p\to\operatorname{Aut}(\mathbb{Z}_q)$ I calculate that  $$ (1,0)(0,1)=(1+0,\phi_0(0)+1)=(1,1) $$ and $$ (0,1)(1,0)=(0+1,\phi_{-1}(1)+0)=(1,\phi_{p-1}(1)). $$ Is it true somehow that $\phi_{p-1}(1)\neq 1$ in each case to show the group is nonabelian? I guess if it did this would imply $\phi_{p-1}$ is the trivial automorphism, so maybe there's something there? If not, is there a way to show $\mathbb{Z}_p\ltimes\mathbb{Z}_q$ is nonabelian in these cases in general? Thanks. Local html file AJAX Call and jQuery Woes Can truesight see through a druid's Wild Shape? The rules for truesight state:     A creature with truesight can (..) perceive the original form of a shapechanger or a creature that is transformed by magic   A druid player argued that since the druid is still a "humanoid" (not a "shapechanger"), and since , a creature with truesight should not see through it.  As the DM, I ruled against it because I believed the intent of truesight is to see through all kinds of shapechanging effects but I was still left wondering if I missed anything. I couldn't find anything about this in the errata either.  So, going by strict RAW, should a creature with truesight be able to see the druid's true form while a druid is using wild shape? Currently, the only way to ask for something to be migrated to a site that isn't part of the standard migration path is through a custom mod note.  I currently have two active custom mod notes on Stack Overflow that ask for migration that are not standard targets for SO.  I believe the questions could be better answered on another site.  Fortunately, or unfortunately, the questions have been answered, and answers have been up voted and accepted. At this point, a week and a half later, migrating either of the questions would be disruptive to both communities and not necessarily produce a better answer (they've got accepted answers).  The unfortunate part is I really do believe that both questions could have gotten better answers and more attention on another site.  What I would like to see is a more streamlined way to flag for moderator attention for migrations.  The UI would look something like this:    This would allow people to find the proper site easily.  No more "Migrate this to Mathamatica.SE" because, well, that doesn't exist.  Something that I didn't do on this mock up is add a link to the corresponding help/on-topic page for the target site.  Something people could check and click before hitting the submit button.  I don't have this quite right again, because while that shows a "closing for off topic", this is a flag and not a vote to close.    The "flag for migration" is only one part of this though.  The other part would be to make another flag queue style thingy for moderators in which they could look at just migration flags created through the above interface.  By providing the mods with a "just migration" view into the flags, questions that should be migrated can be quickly identified from the multitude of existing flags and handled promptly before the migration would be disruptive. Probability for roots of quadratic equation to be real, with coefficients being dice rolls. I really need help with this question.     The coefficients $a,b,c$ of the quadratic equation $ax^2+bx+c=0$ are determined by throwing $3$ dice and reading off the value shown on the uppermost face of each die, so that the first die gives $a$, the second $b$ and and third $c$. Find the probabilities that the roots the equations are real, complex and equal.   I was thinking about using the fundamental formula but i'm not sure how to go about doing it. Help would be greatly appreciated. Matching a sentence with grep What is the ancestral form of language used in the fable that David was studying during the flight? David studies linguistics during the flight to LV-223. We get to listen and read a fable. Is it written in a real language? What is the name of the language? Can the fable be translated?  Approximate quotation:     hjewis jasma hwaelna nahast akwunsez dad'kta, tam ghermha vagam ugenthe Is the following word order acceptable? I need your opinion about the word order in the following sentence: “In her garden grows a cherry-tree.“? Is it grammatically acceptable? Windows 7 task bar at autohide, make it totally disapear? My desktop look is empty so all I have is a nice wallpaper. My Windows taskbar has the "Taskbar Appearance" setting to "Auto-hide the taskbar". Although hidden, it leaves a thin top layer so you can still see it a bit, and where the pinned shortcuts are. Is it possible to totally have it hidden without a trace? This is a serious question. It really bugs m. I'm using pdfLatex (with --shell-escape option) and I had a problem of compilation with TexWorks that was successfully solved with the help of other post in this site: .  After correcting that error the code compiles smoothly but just displays the logarithmic grids, not the function. The gnuplot files are created in the right place, but the graphic doesn't come out in the PDF.  Code from :  \documentclass{article}  \usepackage{tikz} \usepackage{bodegraph}  \begin{document}  \begin{tikzpicture}[     gnuplot def/.append style={prefix={}}, % Fixed the issue (prefix was 'gnuplot/\jobname/' before) ] \begin{scope} \UnitedB \semilog{-1}{2}{-50}{60}  \BodeAmp{-1:1.35}{\POAmpAsymp{4}{2.0}+\IntAmp{1}}  \end{scope} \end{tikzpicture} \end{document}   Any clues? get UTC time in PHP