I'm trying to convert single line 'C' style comments to 'C++' style.  The 'sed' below isn't bad, but of course it fails if any leading code (code before the comment) has any ' / ' in it at all:  sed -i 's,\(^[^\/]*\)\/\*\([^\*]*\)\*\/[ ]*$,\1\/\/\2,' filename   What I wish I could do is this:  ... [^\\/\\*] ...   i.e. negate ' /* ' which doesn't work of course, but after several hours of searching, I can't find a simple explanation of how to do that properly :(  It doesn't seem like it should be rocket science.  For example, these strings:   blah blah        /* comment */ blah blah / blah /* comment */ blah blah        /* comment */ blah blah blah / blah /* comment */ blah    ... should convert thusly:  blah blah        // comment  blah blah / blah // comment  blah blah        /* comment */ blah  (this CAN'T be converted) blah blah / blah /* comment */ blah  (this CAN'T be converted)   ... obviously no conversion can take place if there is code AFTER the 'C' comment.  I will do a close visual comparison between the file, before and after, so there's no need to handle ' /* ' inside a literal, nor do I want to convert anything multi-line.   Note I think of this as a 'negation' problem but maybe there is another way.  I  just need to capture everything before a ' /* ' and I don't care how.  FOLLOW UP ON ANSWER BELOW  Well damn! I see that I've completely misunderstood something fundamental:   .*/\*   ... reads: "anything except slash star followed by slash star", so actually I get my 'negation' for free :-)   So, going even further than Barmar:  sed -i 's,^\(.*\)/\*\(.*\)\*/\s*$,\1//\2,' filename   ... will even catch this:  blah / * blah        /* co / mme * nt */   and output this:  blah / * blah       // co / mme * nt    Enlightenment.
I am trying to write a script that will delete all comments and everything in between inside C files in my current directory. I've been using sed, and this is what I have so far:   sed -i '/ * [^()] */d' *.c  This works when the comments are on the same line as an asterisk or backslash.   However it doesn't work when there is a commented line without a slash or asterisk.   I know sed goes line by line, I just don't know how to tell it to keep deleting until it sees a */.
Counting buffer overlap in QGIS How can I add new autostart programs in Lubuntu? In Lubuntu, there's no 'Add New Program...' button in Desktop Session Settings. Is there an easy way to add new autostart programs in Lubuntu? has a duration of instantaneous. However, it also produces an ongoing effect, and the spell's text describes when this effect ends (emphasis added):  At the end of every 30 days, the creature can repeat its saving throw against this spell. If it succeeds on its saving throw, the spell ends. The spell can also be ended by greater restoration, heal, or wish.  The fact that the text refers to the spell ending, as opposed to just &quot;the effect&quot; or something similar, implies that it produces an ongoing magical spell effect, which can be dispelled using Dispel Magic. However, it has also been argued that any effects that persist beyond a spell's stated duration cannot be considered magical (with the classic example being fires started by a Fireball spell). Applying this rule to Feeblemind, it shouldn't have any ongoing effects since its duration is instantaneous. So, which is it? Are the ongoing effects of Feeblemind considered magical and therefore susceptible to effects like Dispel Magic, or are are they simply the lingering result of the initial shattering of the creature's intellect and personality? (Note that the final sentence quoted above does not by itself rule out Dispel Magic and other ways of ending the spell. It gives additional options for ending the spell, but it doesn't say these are the only options.) Prove that there is a bijection between the set of all subsets of $X$, $P(X)$, and the set of functions from $X$ to $\{0,1\}$. Given any set $X$, let $P(X)$ be the set of all subsets of $X$, and let $\{0,1\}^X$ be the set of all functions $X \rightarrow \{0,1\}$. Construct a bijection (and its inverse) between P(X) and $\{0,1\}^X$.    Let us define $f: P(X) \rightarrow \{0,1\}^X$ by $f(\alpha) = g_{\alpha}$ where $\alpha \in P(X)$ and $g_{\alpha} : X \rightarrow \{0,1\}$ is defined by  $$g_{\alpha}(x) =\begin{cases}        1 &amp; x \in \alpha \\       0 &amp; x \in X-\alpha     \end{cases}$$  We need to check if this function is well-defined. Let $\alpha, \beta \in P(X)$. If $\alpha=\beta$, then $\alpha$ and $\beta$ correspond to the same set, and so correspond to the same function since both $g_{\alpha}$ and $g_{\beta}$ send that set to 1 and the ($X-$that set) to 0.   If we have a function $g_{\alpha} \in \{0,1\}$, then $\alpha$ is a set in $X$ that is sent to 1. But since $P(X)$ is the set of all sets of $X$, we must have $\alpha \in P(X)$. So the function is surjective.  Finally, if $g_{\alpha}=g_{\beta}$ then both $g_{\alpha}$ and $g_{\beta}$ send the set $\alpha$ or $\beta$ to 1. So $\alpha$ and $\beta$ must be same set. In other words, the function is injective; and hence bijective.   The inverse function is $f^{-1}: \{0,1\}^X \rightarrow P(X)$ where $f^{-1}(g_{\alpha}) = \alpha$.     Another way to prove this is to first construct the inverse function, show that it is well defined, and then show that $ff^{-1}$ and $f^{-1}f$ are the identity functions, right?  So if we let $g_{\alpha}=g_{\beta}$, then $\alpha=\beta$, because otherwise $g_{\alpha} (\beta)=0$ and $g_{\beta} (\beta)=1$; a contradiction.   Now we have $f \circ f^{-1} (g_{\alpha}) = f(\alpha) = g_{\alpha}$ and $f^{-1} \circ f(\alpha) = f^{-1}(g_{\alpha}) = \alpha$ , and so $f$ and $f^{-1}$ must be bijective. "define:" oneboxing selects completely bogus data I found this weird word, "burke", and decided to check it out. It turned out it was an alternative spelling of "berk". This is what define: berk in chat expanded to:    So, according to that, "berk" as a noun can mean "a fool, prat, twit", or "berk", or "berk", or "berk". Wow, who would have thought "berk" might mean berk. Three times, just to be sure.  That got me really curious so I checked the wiktionary page directly. It shows three meanings for "berk": the same as meaning #1 that was oneboxed, plus two others that are not at all simply stated as "berk".  Further down from there we can find the other three "berks". Number three, for instance, is easy to trace since "indefinite plural berkë" seems quite greppable. And it turns out that it's Albanian. Im asked to prove that a polynomial of an odd degree has a root. Im going to use IVT to prove this, but I'm wondering if I can use the assumption that an odd degree polynomial has either two cases:  $$ \lim_{x\to\infty}h(x)=+\infty \\ \lim_{x\to-\infty}h(x)=-\infty \\ $$ $$and$$ $$ \lim_{x\to\infty}h(x)=-\infty \\ \lim_{x\to-\infty}h(x)=+\infty \\ $$ Then by this there exists numbers $a,b$ such that $$ h(a)&lt;0&lt;h(b) $$ $$or$$ $$ h(b)&lt;0&lt;h(a) $$ Which I think would prove that odd degreed $h(x)$ has at least a root. Or is there a more convincing way to show that there are numbers in $h(X)$ greater than zero and less than zero?  edit: (sorry about the bad limit notation) Where do I get the key for the first house? I've 'completed' the game, but didn't find the key for the first house. (I got the one for the arcade machine house). Where can I find it? One of the drivers behind the 'Rule of Two' is that with fewer Sith, the dark side will become more concentrated in those users and they will be more powerful as a result. Is there any indication that the same is true for Jedi? Are PPAs safe to add to my system and what are some "red flags" to watch out for? It is well known that $\sqrt{2}$ is irrational, and by modifying the proof (replacing 'even' with 'divisible by $3$'), one can prove that $\sqrt{3}$ is irrational, as well.  On the other hand, clearly $\sqrt{n^2} = n$ for any positive integer $n$.  It seems that any positive integer has a square root that is either an integer or irrational number.        How do we prove that if $a \in  \mathbb N$, then $\sqrt a$ is an integer or an irrational number?      I also notice that I can modify the proof that $\sqrt{2}$ is irrational to prove that $\sqrt[3]{2}, \sqrt[4]{2}, \cdots$ are all irrational.  This suggests we can extend the previous result to other radicals.        Can we extend 1? That is, can we show that for any $a, b \in \mathbb{N}$, $a^{1/b}$ is either an integer or irrational? I am using a premium legit version of Minecraft that I purchased. I can log into minecraft.net as well as mojang.com but I am unable to login to Minecraft the game through the minecraft.exe or the Technic launcher. The Minecraft servers are up and running fine. My internet connection is also fine. I double checked my credentials and even tried changing my password. I tried using both my username and my email. I tried all of this on two separate accounts that I own. I tried deleting my login, launcher, launcher.pack.lzma, and launcher_profiles.json and then reopening Minecraft. I tried re-downloading minecraft.exe.   Nothing has worked and I seem to have run out of options. I sent a help request to Mojang but in the meantime I was hoping that maybe you guys could offer some advice. Computation of a limit involving factorial $\lim_{n \to \infty} \sqrt[n+1] {(n+1)!} - \sqrt[n] {(n)!} = \frac{1}{e}$ Recently I have opted for broadband connection which is coming directly cat5 cable with RJ45 port to my laptop. They have provided me with IP address, default Gateway, subnet mask, preferred DNS and alternate DNS server information. Also the username and password.  The Modem model is Beetel 450TC1 which is actually an ADSL+2 Router. The modem has 4 lan port and one RJ11 port (for internet).   Can I use this modem as a wireless hotspot without connecting the RJ45 cable directly to my laptop?  If yes, can anybody help me with that? I haven't seen the question stated precisely in these terms, and this is why I make a new question.  What I am interested in knowing is not the definition of a neural network, but understanding the actual difference with a deep neural network.  For more context: I know what a neural network is and how backpropagation works. I know that a DNN must have multiple hidden layers. However, 10 years ago in class I learned that having several layers or one layer (not counting the input and output layers) was equivalent in terms of the functions a neural network is able to represent (see Cybenko's ), and that having more layers made it more complex to analyse without gain in performance. Obviously, that is not the case anymore.  I suppose, maybe wrongly, that the differences are in terms of training algorithm and properties rather than structure, and therefore I would really appreciate if the answer could underline the reasons that made the move to DNN possible (e.g. mathematical proof or randomly playing with networks?) and desirable (e.g. speed of convergence?) Restart my graphics card without rebooting? I would like to make some changes to the core toolbar module across all my sites, and I don't want to modify the actual core's css.  It looks like I should be able to override the core css found in modules/toolbar/toolbar.css by simply copying this file into my sites directory at /sites/modules/toolbar/toolbar.css.  I tried doing this, cleared the Drupal cache, but nothing happened.  What am I missing? I am debating whether or not to get the Potato Sack (yes, I realize I've been debating for several weeks now) bundle through steam.  I already own: Defense Grid: The Awakening, Super Meat Boy, and Audiosurf, all of which are part of the sack pack. What happens if I buy the Potato Sack?  Do I get 2nd copies of the three above mentioned games to gift elsewhere?  Is the price of the bundle reduced by the games I already have?  Do I get nothing special for already owning those 3 games? Is there any difference between Present Perfect and Present Perfect Continuous? How to download a file using Selenium's WebDriver? Basically I want to at least check that a download-able file exists / download link works and preferably get stuff like the file size too. Here's an example: link = self.browser.find_element_by_link_text('link text') href = link.get_attribute('href') download = self.browser.get(href) print download  That fourth line prints &quot;None&quot;, presumably because I haven't manually clicked the Save button, and even if I had, I doubt WebDriver would be able to &quot;see&quot; the file. Any ideas? I'm using Firefox as my browser-under-test, and I understand that the file handling for downloads is somewhat browser and/or OS-specific. When adding NOT NULL columns with a DEFAULT value - does PostgreSQL optimize this operation?  In case the table has n rows, a not-optimized alter-table-add-column would yield n writes of the default value - which could be very painful, obviously. With the optimization the DB would instantaneously create the new column, store just one copy of the default value which would be returned when no non-default value is found for that column in a suitable index data structure.  For example  such an .