Comparison of Clojure web frameworks

Question: There are a few web frameworks for Clojure

Compojure
Webjure
Conjure
Moustache

and also some libraries for dealing with certain web development subtasks, such as

Enlive for templating
Hiccup for templating
Ring to handle lower level stuff with requests/responses
ClojureQL for persistence (it doesn't seem very active, though)

There are also hundreds of Java libraries to be used. Some aspects were already discussed here and two of them compared a bit.
I wonder how these frameworks/components compare in terms of maturity, scope, ease of development, Django/RoR feeling, etc.
Comment: Where does this stand today, nearing the end of 2013?
Comment: Don't forget to add Clojure on Coils at https://github.com/zubairq/coils and also Pedestal
Answer: When I first started with web development, it was with Clojure. I had no prior experience with web development at all. I could not, for the life of me, figure Compojure out. I don't know if beginner documentation has been improved since then (it wasn't that long ago) or not, but at the time, I couldn't manage it. A friend pointed me to Moustache and after reading the README, I was able to throw together what is http://try-clojure.org in it's current state. So, as far as ease of use goes, I think Moustache takes the cake for me.
However, if this has existed at the time, I might be singing a different tune.
Conjure looks very cool, though very different from the other frameworks. Given my very limited experience with web development in general, I don't have much say in this matter, but Conjure feels kind of unclojurey to me. It just doesn't feel right. It may just be that I'm not used to the way it does things.
UPDATE: It has been a while since I wrote this. Lots of things have changed. Not many people use Moustache anymore, and it isn't really actively maintained, though it was complete enough (and simple enough) that it probably still works, I'd now recommend going with Compojure or Noir instead. Both of these are currently maintained frameworks and both are excellent at their job.
UPDATE 2: Noir has been deprecated for quite a while and most of its functionality moved to a library designed to be used from compojure/other ring-based web frameworks called lib-noir.
Comment: As for the update, Moustache is alive and well. It didn't really need any maintenance and I have been its happy user throughout all the changes in Clojure core. Christophe Grand is currently at work on releasing a new version, with a richer syntax and more features.
Comment: thanks for adding to the list of frameworks, Moustache is new to me
Comment: @[Adam Schmideg] There are probably even more of them! Those are just all I can think of right now. They're certainly the most popular ones. :)
Comment: [here](http://cgrand.github.com/moustache/syntax.html) is a link where the updated syntax is specified.
Comment: One more change: Noir as a framework is depreciated, the core parts moved to a library based on ring/compojure.
Comment: It's been a while since this has been updated, is compojure still the recommended framework?
Answer: I know this question is a bit dated... but I couldn't help but suggest Noir as a very nice option.
Noir uses a combination of Ring, Compojure, and Hiccup to get the job done. Check it out!
Comment: Noir is now deprecated, see: http://blog.raynes.me/blog/2012/12/13/moving-away-from-noir/. The author recommends using Compojure instead.
Answer: As mentioned in Bjorn Lindqvist's comment above, Noir is dead.  Details here.
Instead, consider using Compojure and lib-noir.
Answer: Thinking in terms of frameworks is probably a mistake. The better approach is to think in terms of library components which you put together in order to have the 'framework' which best suits your requirements.
I have used a number of frameworks in the past. Most of them do a reasonably good job at getting you up and running with a basic application quite fast. However, without exception, I have found all of them just get frustrating more often than not. Often it is due to too much boilerplate or just having to jump through hoops which are not relevant for the application your developing.
When first coming to Clojure, I started looking for frameworks, but then realised this was the wrong approach. Instead, I found it much better to just start with a basic ring application and then add libraries as I needed them. This can seem like a bigger learning curve to start with, but in fact it turns out to be just as efficient because your not forced to learn a whole heap of framework scaffolding which you often don't need.
However,I have found looking at various frameworks really useful as it gives me ideas of how to best integrate a library and more importantly IMO, how you can best structure your lein project.clj file to best suit the workflow you want.
I've found the following templates really useful. I don't use any of them 'as is', but have adapted/stolen ideas from many of them to develop the frameworks which best suit the app I'm working on

Luminus and Luminus templates provides a very extensive framework. I find them a little 'heavy' for many applications, but there are some great examples of how to integrate various Clojure libraries into your app. The main website also has some useful documentation.
Reagent Project, which includes a reagent template provides a good starting point for an app using Reagent (react.js) ClojureScript support. I've found this to be one of the easiest ClojureScript libraries to create an app with good Javascript integration.
lein-figwheel is a really interesting template using figwheel to provide dynamic loading of clojurescript so that you see your ClojureScript changes in the browser as you modify your code. Many other templates have now added this functionality to their own templates. Originally developed with Om in mind, Luminus and Reagent templates now also integrate Figwheel functionality in their templates. Really shows some of the benefits of Clojure and ClojureScript for interactive development.
Compojure Template is a great starting point. It sets up a very basic compojure based project with all the basic ring and compojure stuff. Great way to start with Clojure web development because it is simple and allows you to focus on the basics before drowning under all the other options.

There are many other templates and frameworks, many of which I've not had time to look at yet. These days, I often start with either compojure template or reagent template and then add additional bits if and when required. I usually also include selmar for templates and use essentially the same configuration Luminus uses.
Perhaps the most important part of getting a good 'framework' for you web development is to experiment and understand how lein works and the lein project.clj file. Having a good project.clj file will determine your workflow. Having the right profiles, ability to start the repl in different ways and load different libraries which allow you to kick off figwheel or a browser repl or generate a jar etc is all about your project.clj file. Get this right and your environment will provide just the workflow you need.
Answer: A new player appeared in the scene as a good alternative to implement REST services is liberator. It makes easier to expose your data as resources while automatically complying with all the relevant requirements of the HTTP specification RFC-2616 and plays nicely with http-kit and Compojure.
Pretty happy with http-kit btw, the live code reload feature is handy.
Answer: try road framework for fast web dev
https://github.com/zhujinxian/road
<code>(defn render-test [ret tmt]
  (-> (resp/response "------render----test------")
    (#(resp/content-type %1 "text/plain"))))

(defn foo
  "I don't do a whole lot."
  [x]
  (str "来自源码目录的参数:" x))

(defn handler [^Integer x]
    {:$r render-test :text (str "hello world, road goes sucess!" (foo x))})

(defn home [req content ^Integer num]
    {:hiccup "home.clj" :content (str "home" content) :num num})

(defroad road (GET "/web-test-0.1.0-SNAPSHOT-standalone/main" handler)
              (GET "/web-test-0.1.0-SNAPSHOT-standalone/home/:num{\\d+}" home))

(defn -main [& args]
  (log/info "---------log4j test-------")
  (jetty/run-jetty road {:port 3000}))
</code>

Comparison of Clojure web frameworks


running web2py with GoogleAppEngineLauncher

Question: Trying to run my web2py app from the development server using GoogleAppEngineLauncher
Not sure if the on-line tutorials are out of date or I'm just missing something, but when I follow the link to download the GoogleAppEngine pythonSDK for OSX I get a dmg for the GoogleAppEngineLauncher.
I download and use that, which installs the proper executables, however after I setup my app.yaml file and run "dev_appserver.py myApp" I get this error:
fancy_urllib.InvalidCertificateException: Host appengine.google.com returned an invalid certificate (_ssl.c:503: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed):
I don't get the error if I try and launch the app from the launcher itself, however I can't launch the app because it says the directory already exists and I don't have write permissions.  I even tried chmod 777 on the myApp directory.
Should I not be using the GoogleAppLauncher?
additionally I tried using the linux SDX and received the same "certificate" error.  The error message directs me to a link mentioning that I need the "ssl" module, but that is included in python 2.7.2 which I am using.
The link also mentions: "appcfg uses SSL when connecting to the Admin Console by default, unless the --insecure flag is passed."  But I cannot find that flag in the help menu.
Answer: Found this answer which solves the problem.
Basically:
<code>rm google_appengine/lib/cacerts/cacerts.txt
</code>
From the SDK


Equation of motion for pendulum with variable length

Question: I learned from https://www.math.ubc.ca/~feldman/apps/vlPendulum.pdf that the equation of motion for a pendulum of variable length is
$$
l\ddot{\theta} + 2 \dot{l}\dot{\theta} + g \sin \theta = 0
$$
But when I try to reproduce this result using Newtonian mechanics I get an additional term $\ddot{l}\theta$:
$$
F=m\ddot{x} = m \frac{d^2}{dt^2}(l\theta) = m (l\ddot{\theta} + 2 \dot{l}\dot{\theta} + \ddot{l}\theta)
$$
which together with the tangent force $F_t = - m g \sin \theta$ yields the equation of motion
$$
F=F_t \\
l\ddot{\theta} + 2 \dot{l}\dot{\theta} + \ddot{l}\theta + g \sin \theta = 0
$$
What am I doing wrong here? Why does my Newtonian ansatz not generate the same equation of motion as the Lagrangian one?
Comment: You should try again while marking everything that is a vector as such.
Comment: I think you are making a mistake when taking the derivatives of the $\vec{\mathbf{x}}$ vector. Perhaps [this could be useful](https://en.wikipedia.org/wiki/Polar_coordinate_system#Vector_calculus)
Answer: In polar coordinates we have:
$$\frac{d}{dt}\hat{r}=\dot{\theta}\hat{\theta}$$
$$\frac{d}{dt}\hat{\theta}=-\dot{\theta}\hat r$$
So if we are taking the derivative of the position vector or $\vec x=r\hat r$ with respect to time we will get:
$$\dot{\vec x}=\dot r \hat r+r\dot \theta \hat \theta$$
$$\Rightarrow \ddot{\vec{x}} = \ddot{r}\hat r+\dot r \dot \theta \hat \theta + \dot r \dot \theta \hat \theta + r \ddot \theta \hat \theta -r \dot{\theta}^2\hat r = \left(\ddot r-r\dot\theta^2\right)\hat r + \left( r \ddot \theta + 2\dot r \dot \theta\right) \hat \theta$$
Now putting $r=l$, and plugging this into Newton's $\vec F=m\ddot{\vec{ x}}$ you will get the correct result.
$$\begin{array}{rl}
mg\cos{\theta} -T& =m\left(\ddot l-l\dot\theta^2\right)\\
-mg\sin{\theta} & =m\left( l \ddot \theta + 2\dot l \dot \theta\right)
\end{array}$$
Assuming the length varies slowly in time one can attempt to actually solve these equation using Adiabatic invariants.
Comment: Sorry, but what is $T$ in your notation?
Comment: The tension in the string.


how to Compute the number of pairwise non-isomorphic 7-regular graphs on 10 vertices?

Question: Compute the number of pairwise non-isomorphic 7-regular graphs on 10 vertices?
Comment: What have you tried?  Also, it is usually best not to phrase your question in the form of a command.  The question may be to compute something, but you're basically telling us to do it for you.  At least say, "I'm stuck on this, can any one please help?" or something like that.
Answer: You do that by looking at the complement, the graph of missing edges.
Answer: If you're interested in this question from a computational mathematics point of view (and this is a specific instance of a broader problem), then this can be computed using Brendan McKay's geng (part of the gtools package, which can be downloaded with nauty).  Specifically:
geng -n 10 -d7 -D7

computes the number of non-isomorphic graphs with $10$ vertices, minimum degree $7$ and maximum degree $7$.
If you want to understand why the number is what it is, Hendrik Jan's hint is excellent.


How to Insert Videos from Youtube Using the  Tag?

Question: What is the best way to insert videos from youtube using the  tag? How Can I achieve it?
Answer: The simplest way to play videos in HTML, is by using YouTube as a source.
First, you should  upload the video to YouTube or copy the embed code of an existing video, which will be inserted in a  element in your web page.
To have the embed link of the YouTube video follow these simple steps:
-Open the video on YouTube and click the share button.
-Open the Embed code.
-Copy the Source link.
As you copy the embed link you can insert it into your HTML document as the src of your  element. Also define width and height for your video. Now let's see how it will look like.
Comment: You can try the examples yourself here : https://www.w3docs.com/snippets/html/how-to-insert-video-in-html.html
Answer: YouTube gives you the full tag you need to copy.
Go to the video that you want to embed, click Share, click the Embed option, and then copy/paste the iframe code it gives you.
Answer: Here is YouTube's help document which tells you how to do it: https://support.google.com/youtube/answer/171780?hl=en

Embed a video

On a computer, go to the YouTube video you want to embed.
Under the video, click SHARE .
Click Embed.
From the box that appears, copy the HTML code.
Paste the code into your blog or website HTML.
Answer: If you are using latest html5 version then you should use this code.
   HTML5 can come up with some new tag Video tag are one of them.

       <video width=auto height=auto controls>
         <source src="https://www.youtube.com/embed/W7qWa52k-nE" type="video/mp4">
        </video>

If you want to use iframe tag you should use this code.

Comment: Can you link to any YouTube documentation about this?
Answer: you can insert video from youtube using the iframe
code

Answer: You can insert Video in your webpage using iframe.
Follow this step:

Use the youtube site to find the video you want
Click the'Share'button    below the video
Click the 'Embed' button next to the  link they show you
Copy the iframe code given and paste it into    the html of your web
page.

Write following code in HTML and paste that link between src attribute.


MFMessageComposeViewController addAttachmentData on iPad iOS7 black screen

Question: I have a MFMessageComposeController, and I want to send images via iMessage (SMS not available on my iPad).
This is my code:
- (void)presentMessageController  {

   if(![MFMessageComposeViewController canSendAttachments])
   {
    UIAlertView *warningAlert = [[UIAlertView alloc] initWithTitle:@"Error"
                                                           message:@"Your device doesn't support sharing photos via SMS!"
                                                          delegate:nil
                                                 cancelButtonTitle:@"OK"
                                                 otherButtonTitles:nil];
    [warningAlert show];
    return;
   }

  MFMessageComposeViewController *messageController = [[MFMessageComposeViewController alloc] init];
  messageController.messageComposeDelegate = self;

  [messageController addAttachmentData:imgData typeIdentifier:(NSString *)kUTTypePNG filename:@"image.png"];

  // Present message view controller on screen
  [self presentViewController:messageController animated:YES completion:nil];
}

The problem seems to be in [messageController addAttachmentData...]. The messageController is not presented, instead a blank screen appears, and app is hanging up, and after 1-2seconds, the delegate responds with MessageComposeResultCancelled, and I see this in console:
timed out waiting for fence barrier from com.apple.mobilesms.compose
Warning: Attempt to dismiss from view controller  while a presentation or dismiss is in progress!
If I comment that line, the messageController is presented (iMessage is opened).
IMPORTANT:

This is happening when testing on iPad (I tested on iPad 2 only, with iOS 7.0.3 installed). Same code works perfect in iPhone 5, 4, 4S with iOS 7.0.3.
When black screen appears, there is no way to return to app. You have to terminate the app, and restart.

Anybody experiencing same issue? Please help. Thanks.
Comment: the code seems to be correct, check if the imgData is not nil
Comment: imgData is not nil. And [messageController addAttachmentData..] is returning YES. So image is attached.
Answer: try changing:
[messageController addAttachmentData:imgData typeIdentifier:(NSString *)kUTTypePNG filename:@"image.png"];

to:
[messageController addAttachmentData:imgData typeIdentifier:@"public.data" fileName:@"image.png"];

Comment: I just tested, and it has exactly same result. Black screen and hang-up.
Answer: Call presentMessageController method after some delay
[self performSelector:@selector(presentMessageController) withObject:nil afterDelay:0.5];


What is the meaning of "gather way" in "The idea gathered way"?

Question: As far as I know "gather way" means "to attain headway" in navigation. So I believe this is a kind of idiom or something like that.
I just found this sentence with no context, so I don't know if you could help me with the meaning of it.
Answer: As you already know, "to gather way" is a nautical term that means to begin to move or to move with increasing speed. (To attain headway.)
Without context (you said their wasn't any), I have to imagine that it is perfectly natural for someone in my own boat club to use the phrase "the idea gathered way" to mean that the idea picked up momentum.
The notion that ideas have momentum is not unheard of, especially among people who pay a lot of respect to the process of ideation. Here is one example, in an article titled "The Momentum of Ideas", taken from the New York Times quoting Newt Gingrich:

I'm a very idea-oriented candidate. And I think the Internet makes it
  possible to create a momentum of ideas that's very, very exciting.

Another metaphor similar (but not identical) to "momentum of ideas" might be "avalanche of ideas". These bring to mind that the ideas, once they have been conceived, have an unstoppable power, being able to move of their own accord.
Answer: The phrase gather way is normally used with ships as suggested by OED:

gather way (of a ship) begin to move.

I haven't come across the use of the expression "idea gathered way" anywhere before. A search in Coca and Google Books would suggest that nobody has use this expression in any book or magazine. Therefore I don't think gathered way should be treated as a phrase that functions as a single unit in the expression "The idea gathered way". It is most likely that there are some words missing after way, which would mean it is merely an extract from sentences like "The ideas gathered way too fast...".
Comment: @user37612 In short, *gather* is not used together with *way*. The word *way* belongs to another phrase, such as *way too fast*.
Comment: How did you come across a single sentence (_or is it!?_) with no context at all? It sounds like the clue on a torn fragment of paper in the usual type of detective film. If there was at least a full stop, that would disprove yhcra's theory. I'd go with Jim's answer, and your hunch that this is a metaphorical extension of the nautical usage. Compare sense (2) given by Collins ( http://www.thefreedictionary.com/make+way ): **make way**
1. To give room for passage; move aside.
2. To make progress.

And also 'He made his way homewards.'

There are other V + N idioms: catch fire; set sail ...
Comment: Please provide the entry from your dictionary by editing the question and copying it in. Thanks.
Comment: So, could ypu tell me why "way" is used here? I can't understand the meaning of it.
Comment: I came across it while I was checking my language dictionary. I needed some information about it, because I didn't have any context in my dictionary.


Saving a pavlova that didn't form a crust

Question: I have cooked my pavlova the same way I normally do, however it hasn't formed a nice crust like it usually does. I've heard that it may have something to do with the humidity? (It did rain here today and was a reasonably warm day.) Can I put it back in the oven and to save it or do I have to start all over again?
Comment: When you say it didn't form a crust - is it still wet and holding its shape, like a meringue topping? Or did it collapse or do something else entirely? What exactly does it look like?
Comment: What temperature and process did you use to cook it? if it has set,  shove it back in a very hot oven for a few minutes, and watch it. When it reaches the colour you like, take it out
Comment: Thanks, yes, held it's shape, so turned the oven back on to a higher heat (180deg C) and left it in for about 15mins watching it closely, let it cool again and it did form a crust but had collapsed about 20mins later....so I'll try again today :)
Answer: I have never tried it myself,  but a torch can be used to make a crust on the meringue in a baked Alaska. Testing it on a small part of it could give you a clue if it is worthwhile.
Answer: I guess there is a good chance you can save it by extending the time in the oven and increasing the temperature slightly (if the humidity is the problem it means that it is loosing water slower so it needs more time and it can benefit from a temperature boost).
BUT IF IT IS CRITICAL that you get it right and you don't have time to do it again if this fails, assume it would fail. The crust may get too thick for your liking.
Comment: Thanks Ali, have another attempt in the oven at the moment. Here's hoping to success today :)


How does the switch analyse the EtherType field in Ethernet frame?

Question: What exactly happens when switch receives the frame with given EtherType? Does it analyze it at all or only looks if the TPID is present?
Comment: Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you could provide and accept your own answer.
Answer: Switches are transparent devices, and they simply don't care about the payload of a frame. A switch is only concerned with the source and destination MAC addresses, and a VLAN tag if the frame happens to use a trunk.
A switch will use the source MAC address to build or update its MAC address table, and it will use the destination MAC address to figure out to which interface it should forward the frame by searching for the destination MAC address in its MAC address table.
Comment: The switch examines EtherType, to see if the frame is a special frame called a Bridge Protocol Data Unit. Those frames are valid only between switch neighbours and they go to the CPU of the switch. All other traffic takes the forwarding path; that is, to the egress queue indicated by the destination MAC address in that VLAN's MAC address table.
Comment: BPDUs are determined by the special layer-2 multicast address: `01-80-C2-00-00-01` for 802.1D compliant switches. Cisco has its own layer-2 address for PVST+.. In fact, the OUI, `01-80-C2` is a special multicast OUI that an 802.1D compliant switch will not forward to other interfaces.
Comment: @vk5tu Ron's right: first, the switch needs the multicast address to get a BPDU forwarded to the CPU. It's there that the Ethertype is analyzed and the BPDU is handed over to the STP protocol engine.
Comment: What about trunk ports of a switch? Doesn't the switch examine TPID for ingress packets on these kind of ports to determine if the packet is dot1q/QinQ?
Answer: I think TPIDs are analyzed in case the frame arrives on a Trunk port, in which case the switch has to determine the VLAN header structure (is it a Dot1q, QinQ or a native VLAN frame) in order to assign the frame to the correct VSI.


Why are electrons negative?

Question: By my understanding their charge could have been called positive, and the charge of the proton and positron called negative. What are the historical reasons for this?
Comment: Possible duplicate of [Why is charge of the electron negative?](https://physics.stackexchange.com/q/176589/)
Comment: There is a related discussion in [Why is the charge naming convention wrong?](https://physics.stackexchange.com/q/17109)
Comment: This seems the sort of question that would be well suited to the [History of Science Stack Exchange](https://hsm.stackexchange.com/). I'm a bit surprised it hasn't been asked there already.
Answer: When they discovered electricity they were studying electric current. They called this a positive flow of charge, because it's in the direction of the current that they saw.
When they discovered the electron they found that it was moving opposite to the previously determined "positive" flow, therefore calling it negative.
When they discovered the proton they realized that it's attracted to electrons. Since electrons are "negative" they called protons "positive".
They're arbitrary naming conventions that have nothing to do with any actual physical properties of the particles.
You could switch them and as long as you maintain that switch on all your calculations then it all still works out.
Comment: Can you expand on that flow experiment?
Comment: In 1733 C F du Fay rubbed glass with silk causing them to stick. He proposed two different electric fluids which cancelled each other out called Vitreous and Resinous electricity. Ben Franklin proposed the one fluid theory. In the Leyton jar experiment he figured all of this "fluid" was in the glass and would transfer. He posited that having too much of this fluid was excess or positive, and too little was negative. Later when the electron was discovered it happened to be flowing in the direction of the negative so they called it negative.
Comment: Hi Big Joe. If you edited this information into your answer, possibly with some supporting references, it would make the answer a lot better.

Why are electrons negative?


What happens if a Green Lantern (or any color) ring is destroyed?

Question: I know if the user is killed the ring seeks out a new host, but what if the ring itself is destroyed?
Answer: New rings can be forged.

Each ring had to be created initially, and replacements can be made as well.

Rings are a potent tool, but they are not indestructible.  When they are destroyed, the Lantern using them ceases to be able to use them (and frequently dies - not because the ring is destroyed, but because they're facing a foe that will kill them).
The rings contain immense emotional light power, stored within them.  It is refilled regularly when the Lantern charges with a power battery (which can ALSO be destroyed).  This power, however, is something that is naturally occurring in the universe, and doesn't interact with the universe outside of when it is shaped and focused by a Lantern (using their ring).
Rings don't explode or otherwise react violently to their own destruction.  Most likely, the stored emotional energy simply dissipates back into the background emotional energy field of the universe.
Comment: "and frequently dies - not because the ring is destroyed, but because they're facing a foe that will kill them" Or because of environmental factors from which they are no longer protected, e.g. the vacuum of space.
Answer: The short answer is: nothing happens.
I can't recall any time in the comics this happens, but drawing from the movie "Green Lantern First Flight", which focuses mostly on the fall of Sinestro there is a scene where:

(after getting the yellow ring) Sinestro assaults Oa. Sinestro overpowers the Green Lanterns on Oa and forces them to surrender their rings. He then uses his ring to break each of theirs. As he does this the rings snap and shatter, but nothing more happens to them.
Answer: Breaking a power ring is like breaking a regular gun or a sword: the only thing that is broken is the ring itself (and as said by the others, they can be reforged). The main side effect of this breakage is that usually the wearer gets in trouble: unarmed and with a really limited defensive capability, he can become easy prey of whoever broke the ring. Also, as seen in the Injustice comics

 being in space when the power ring was stolen (and broken) by Sinestro did not end well for Kyle Rayner

This can be seen in some comics: in the War of the Sinestro Corps power rings are broken and later reforged.
Another thing to note is that rings can be broken from overexertion (or at least in the New 52's GL series Sinestro says he has broken a ring once).
EDIT: You asked about all colors, so there are a few extra side-effects that I did not mention:

As their heart is useless, Red Lanterns rely on the ring to keep them alive, so if you destroy the ring of a RL he will likely die.
The Indigo Tribe is mostly comprised of psychopaths only held back by the ring's function to allow them to feel compassion. Thus, if the ring is broken they revert to their usual selves (as seen when the Indigo central battery is destroyed in the New 52 GL -vol. 1 if I recall correctly-)
Comment: If the opponent is strong enough to take a break the ring then the wearer has a "really limited defensive capability" anyway.
Comment: @user001 Not necessarily, a good defense does not requiere to be a damage sponge. Superior mobility and adaptation to the environment can be as good a defense as a shield. So, if your foe is strong enough to break your ring but he can't reach you, your defense is good. If he manages to get a hold on you and break the ring then you are in a tight spot and defenseless as you (most likely) can't outrun him or fly to space or wherever he can't go.
Answer: Back in v1 and v2 Green Lantern with Hal Jordan, the GL power ring was indestructible, as was the power battery. It was rare that a battery, or a ring, exploded from outside forces.   With Hal Jordan becoming Parallax, all the rings and batteries "went dead", as they were supposed to be connected through time and space to the Central Power Battery on Oa.  Kyle Rayner's single power battery was supposed to be "indestructible", as it was the last one.
When Hal Jordan came back in Rebirth and the GLC was reborn, the batteries got more easily broken, and with the retconning even Sinestro has admitted to breaking two or more GL rings in the past, from demanding too much of a power ring.  After Blackest Night, the portable batteries are durable but often used as improvised bombs when the occasion demands it.
The indestructibility has been inconsistent throughout DC's history.


Tail light Amperage draw

Question: I wish to hardwire the accessory tail light on my e-bike. It uses 2 AAA batteries at present (3V). I consider a flashing tail light to be critical to safety. It has died a couple of times during a ride, unbeknownst to me. My thought is to use a buck converter from the 48v main battery (or the 6v output supplied by the Bafang wiring harness) but I don't know the requirement of the light in amps. Any advice is welcome.
Comment: Which tail light is it? The current consumption will be pretty low, probably less than 100mA. There are ebike lights that run from 6V or 12V directly. The safety of flashing lights is debatable anyways, since drivers can't estimate distance to a flashing light.
Comment: @Erlkoenig most ebikes are 36V or 48V. There are certainly constant lights for those voltages because I've fitted one. In the OP's position, I'd do what I set up for my ex: a built in constant light, with a flashing battery one as well, mounted in a different place. Then no single failure can leave you with nothing at all, and you have both the steady light that's easy to locate, and the flashing one to get attention.
Comment: Another option is to add a second rear light - this decreases the chance of both going out at the same time.
Answer: To all practical purposes, they use such a small current it can be considered none.  AAA Batteris are around 750mA, lights last around 30 hours - around 25mA.  Running off the 6V supply will require nothing more complex than a simple 3V regulator.
It is possible to buy lights specifically for Bafang, which would be a better option if your EBike is compatible with them. If you cannot find a set, IMHO, running two rechargeable battery lights and regularly recharging them would be best.
Answer: There are tail-lights that are designed to be powered by the e-bike battery. At least Shimano and Bosch units provide either 6 or 12 volts DC to the taillight through a buck converter. Many taillights designed for e-bikes accept both 6 or 12 volts DC.
Use the 6 volts provided by the Bafang wiring and buy an e-bike specific taillight. It's intended for powering lights. A second buck converter would just add to the idle power consumption of your electrical system. It's better to use a single buck converter for many things than to add yet another buck converter for yet another accessory you want to power.
The amperage is about zero. Long time ago, the German light system had 3 watts at 6 volts (0.5 amperes), out of which 2.4 watts (0.4 amperes) were for front light and 0.6 watts (0.1 amperes) were for taillight. That was at the time of incandescent and halogen bulbs. Today, I'd say 0.01 - 0.03 amperes is a reasonable draw for a taillight. If powered by the ebike battery, that probably has 500 watt-hours, then you probably could get over 2000 hours of usage, but the ebike system probably has higher idle current draw so the high idle current would cut that battery life to a fraction.
In any case, the e-bike propulsion system uses way more power. Good systems cut propulsion when you have only few percent battery left, leaving the rest for the lights.
With e-bikes, you should probably throw away the flashing function. It makes it hard for car drivers to observe the path of the light, because at one instant the light is at some point, and then it's off, and then it goes on at an entirely different point. Humans are better adapted to observing motion of lights that are continuously on rather than flashing.
The only benefit of flashing is if the flasher is powered by few small batteries such as 2 AAA's. In that case, flashing increases battery life. If powered by a dynamo hub or an e-bike main battery, flashing has no usefulness.

Tail light Amperage draw


How to access eth wallet with utc file

Question: I have only saved the UTC file generated from myetherwallet and after losing data from my laptop i lost the document where i had my password and private key. Can i recover my account now ?
Answer: No, the file you have contains your private key, but it's encrypted with a password. If you no longer have that password, you can't decrypt it.
Comment: Is there a program for brute force ? i remember words but not the exact order
Comment: There almost certainly are, but I'm not familiar with any, sorry.
Answer: By UTC file, do you mean the JSON keystore file?  It should follow roughly this format.
You can attempt to brute force your password with pyethrecover.
Answer: You can brute force your password if you have hint of password. You have to use hashcat but hashcat and jtr showing error that's you have to setup hashcat properly to use it and decrypt your wallet sucessfully
Which version UTC file you have.
If you need more help how to set up hashcat for ethereum and commands visit my profile

How to access eth wallet with utc file


How can I enable remote login in 13.10?

Question: So far I have tried: checking the appropriate boxes in "Desktop Sharing," and then trying to log in using my email address from "Remote Login" at the login prompt on a different machine. It doesn't seem to work, however. Clicking the question mark next to "Remote Login" says that I need an Ubuntu Remote Login account, but then clicking "Set up" makes the screen go black for a second, then returns me to the login screen.
Answer: One thing its Desktop Sharing, and another very different is Remote Login.
In Ubuntu you have Desktop Sharing while using a program and service called vnc server this program needs to be installed either with synaptic or with the ubuntu app market.
Once this application is installed you can share your Desktop and someone can connect to it from the local network in the current session.
A Remote Login can be done installing a SSH Server, then from a remote terminal type :
<code>$ ssh -Y username@remote ip address
It will ask if you want to add the ssh key type (YES) then type the remote user password and then once logged in just type startx
$ startx
</code>
This will initiate the default window manager (unity or gnome).
Or from a linux desktop login choose REMOTE LOGIN then type the local IP of the machine that you need to use.
You may also initiate a separate session using VNC but the basic idea of VNC its to share the current live session instead of initiate a new one.
A basic difference between SSH and VNC is that VNC does compress the video and images streamed to the client while SSH does not, but the image quality its very good
Other advantages of VNC Clients is that they can be installed and executed in almost any device or OS, Google Chrome itself have one extension, Windows, MacOS X, iOS, and Android as well.
But in my own experience its easier and quicker to install TEAMVIEWER, it does work flawless in ubuntu and any other OS, and you can access your desktop from anywhere not only your local network, the only cons is that it can't open a separate session as SSH X or VNC.
Comment: Thanks for the other options, but what I'd really like to do is get the "remote login" from the login screen (lightdm) working.

How can I enable remote login in 13.10?


Pipe output of tcpdump with buffer -B option

Question: I am processing the output of tcpdump on Ubuntu 16.04LTS using the following command:
$ sudo tcpdump -i wlan0 -e -s 64 -n -j adapter -K -l | python script.py
This works, but unfortunately, there are too many packets to handle for the scripts I want to write, so I would like to remove packets that are coming from the same IP address to once every 100ms or so.  I don't see a way to do this in the tcpdump manpage.  Is there a way to do that?
I did see that you can adjust the buffer size using -B, but when I try to execute the following with a test python script (that simply outputs what it reads on stdin):
$ sudo tcpdump -i wlan0 -e -s 64 -n -j adapter -K -B 64 -l | python test.py
I get nothing but blank lines output to the terminal.  I don't understand how the buffer works, because if I don't pipe it to a script the output to the terminal works fine using:
$ sudo tcpdump -i wlan0 -e -s 64 -n -j adapter -K -B 64 -l
(Python script):
import sys

while True:
    print sys.stdin.readline()

Can someone explain if there is a way to effectively limit the number of packets per second from each IP address that are output, and if not, how the -B option works, and if it can be piped to a python script like this?
Answer: After trial and error, I found out that if I tried anything lower than 256 in the -B option, it would fail.  So in case this helps anyone else, use at least -B 256


How to theoretically determine the flow rate for a fan design?

Question: I am trying to design a ducted axial fan. The fan will be pulling air through a filter, and ejecting out into the atmosphere (For a CO2 direct air capture application). However I want to start with the physical parameters (blade diameter/hub diameter/airfoil profile/AOA/rpm etc). While varying these parameters I am trying to predict flow rate and static pressure. I think I understand how to determine the static pressure based on the thrust provided by the blades, and thus generate a pressure-rpm curve, but what I don't understand is how to determine volume flow rate theoretically. Is it simply a matter of a blade velocity diagram (where I would only know the tangential velocity for a given rpm)? Or is there a way of finding flow rate/axial velocity based on the pressure? I can not find an answer to this in the usual equations for fan design. I am essentially trying to find the axial velocity and static pressure provided by a fan based purely on the physical characteristics of the fan. I intend on validating the design using CFD afterwards.
Thank you.
Comment: Is this a ducted fan or open?
Comment: It is a ducted fan, thank you.
Answer:  For unducted fans a relatively simple very fast  program to estimate the performance of a fan or rotor is at https://au.mathworks.com/matlabcentral/fileexchange/21994-analysis-of-a-rotor-blade-system-using-blade-element-momentum-theory. It is designed for helicopters without blade twist or variable chords but could probably be modified to accommodate twist. The output array out1 contains Thrust Generated, Power Required, Figure of Merit, so divide the thrust by the disc area to get pressure, and power/thrust is an upper bound of the average flow speed.
However for ducted fans the effect of the duct and blade tips interacting is far more complex and there is no simple solution. here's a plot of the Figure of Merit vs rpm for 3 tip clearances and an open rotor. This was taken from https://www.sciengine.com/SCTS/doi/10.1007/s11431-021-2110-x;JSESSIONID=7905c56c-4cdb-4bd9-9cc6-e640d30beae2
Answer: Flow rate = V_induced * Area of the duct (at the rotor plane)
V_induced can be calculated using Momentum (or combined Blade Element Momentum Theory, BEMT), for open rotors. (this reference uses V0 notation, and gives a method to iteratively find induced (in-rotor-plane) velocity.)
Effect of the duct can be approximated using empirical methods. [I came across this fantastic paper about testing ducted fans]
Be warned that your "filter" will be affecting the results dominantly. Of course, you can compare your various fan designs (parameter sets).
For validation, you'll probably find the optimum parameters after building and testing a few (or several) fans.


Redirect browser to a different website when you visit a certain website?

Question: I am having this problem with yahoo mail. When I log out of my email, it takes me to yahoo.com homepage instead of the yahoo login website. What I want to do is that when the yahoo.com website is reached, it will skip displaying the yahoo.com website and display the https://login.yahoo.com/ website instead.
Comment: I can get you a working solution if you accept the fact that you will *never* be able to visit the yahoo.com site (at least until you disable the solution I provide).
Comment: OK what is the solution?
Answer: Greasemonkey should do it: https://addons.mozilla.org/fr/firefox/addon/greasemonkey/
Use this script:
// ==UserScript==
// @name        yahoo.com to login.yahoo.com
// @description Redirects yahoo.com to login.yahoo.com
// @include     http://yahoo.com/*
// @version     1
// ==/UserScript==
    if(content.document.location == "http://yahoo.com"){
            window.location.replace("http://login.yahoo.com")
}

Comment: script didn't work
Answer: First install the Redirector add-on.
Then access the redirector configuration page by clicking on the Redirector button or entering this url directly in the address bar resource://redirector-at-einaregilsson-dot-com/redirector.html.
On the Redirector page, create a redirect with the following configuration and save it:

Description: [Any identifiable text you like]
Example URL: yahoo.com
Include Pattern: (http(s)?:\/\/)?(www\.)?yahoo.com
Redirect To: https://login.yahoo.com
Pattern Type: Regular Expression

Now, you will be redirected to the login.yahoo.com page any time you enter any URL that matches the regular expression in the include pattern. You can view the yahoo.com site by disabling redirector via its button's popup menu.


I bought Minecraft for the Xbox one but can't get it on the PC

Question: I bought Minecraft for the Xbox One, which in turn gave me the Windows 10 Edition for free (still on my Xbox.) Now I want to play on PC for a school project in com tech, but it says I have not purchased it. Does that mean I have to buy the game again or is there a way around this?
Answer: Minecraft Java edition (for computers) is a completely separate game from whatever you can buy on consoles.
Answer: You have to download it off of the windows store application. Make sure you are logged into the same Microsoft account as the one you bought Minecraft for Xbox.
Comment: I went to minecraft on Microsoft store on my pc, but it just said "play free trial"


Movie about an astronaut getting controlled by an alien

Question: I remember watching a movie about an astronaut returning from space and becoming sick. Later, he dies from his sickness and his wife realizes an alien was controlling him. soon she starts to get sick and controlled by the alien. I think she gives birth to the alien, but I'm unsure.
Comment: I remember watching it a while ago, like in the 2010s and the movie was in English. I don't remember anything else sadly.
Comment: I also remember the movie's setting being dark in color.
Answer: Sounds like The Astronaut's Wife starring Johnny Depp and Charlize Theron (1999)

Astronaut returns from space and acts strangely
Alien controlling body of astronaut and then his wife
Gets wife pregnant


What is Bayesian Posterior Contraction?

Question: I am currently reading about Bayesian Lasso Regression. It was stated that the Lasso Penalty is non Bayesian because the posterior does not contract at the same rate as the posterior mode. I have looked for a non technical definition of bayesian posterior contraction rate but found none. Can anyone provide me with an explanation?
Answer: Posterior contraction is about the contraction of the posterior distribution (of some random variable of interest), not the posterior mode.
Under Bayesian models that obey standard regularity conditions, as data are observed, the posterior distribution of a random variable morphs from the prior distribution to a point mass (Dirac measure) centered at the true value of the random variable.
Posterior contraction is the movement of probability density from the prior distribution of a random variable ($\theta$) to a point mass centered at the true value ($\theta_0$) as data are observed. The contraction is described by a distance metric between the posterior distribution and the point mass centered at $\theta_0$, as the number of data points ($n$) increases, and the contraction rate is measured by a sequence of numbers that decreasing to 0 ($\epsilon_n$).
The distinction between posterior distribution and posterior mode is important, because posterior contraction is often discussed in the context of Bayesian nonparametrics. Under Bayesian nonparametric models, we are typically interested in modeling the data density. The posterior distribution of the data density ($f$) approaches the true data density ($f_0$), which is usually a collection of observed data points and not just a point mass.
Regarding lasso, I am not sure whether it's productive to argue over whether lasso is Bayesian. Bayesian methods represent a spectrum from empirical Bayes to full Bayesian hierarchical models.
Nonetheless, lasso has a key deficiency: If you use the posterior mode to estimate the coefficients (consistent with common practice), these estimates will often be biased towards 0 in practice, because the posterior contraction rate is slow (for model with a Laplace prior as compared to a Gaussian prior).
You may consider the use of non-local priors for variable selection, where coefficients are either shrunk toward a point mass at 0 or away from 0. Practically, only coefficients with small values will be forcibly shrunk toward zeros, instead of most coefficients.
Answer: The definition I know, is close to what is described in this preprint (Schad et al, arxiv:1904.12765):

posterior contraction estimates how much prior uncertainty is reduced in the posterior estimation:
$$ s = 1 - \frac{\sigma^2_{post}}{\sigma^2_{prior}} $$
Here, the variance of the posterior distribution, $\sigma^2_{post}$,
  is divided by the prior variance, $\sigma^2_{prior}$. In general,
  additional information from the likelihood will reduce uncertainty,
  such that the posterior variance will be smaller than the prior
  variance. If the data is highly informative, then the variance in the
  estimate is strongly reduced, and there will be strong posterior
  contraction $s$ close to $1$. However, when the data provide little
  information, then the posterior variance will be of similar size as
  the prior variance, and posterior contractions will be close to $0$

However, I don't see how would this be related to the notions about lasso, that you mentioned.

What is Bayesian Posterior Contraction?


What's the fastest way to make money online?

Question: Everything in the online world is expensive, well the best things are. We all want the luxurious apartment with 10 cars garage and the best weapons but to achieve that, we need money. Which missions or activities give the most cash ?
Answer: UPDATE: since the latest 1.0.3 patch, the quick replay has been removed. So sadly, from now on only the first completion gives 9000$, and every repeated run only 3000$.
"Violent Duct" from Gerald. It gives 9000$ and can be done solo in around 3-4 minutes. You have to be level 15 to start this mission. It is currently only the second best mission (as far as I know) to make money, but it's available from pretty early on and you can do it solo.
A few hints:

do the mission on easy difficulty, you take less damage and still get
the same reward
a gun with high range comes in quite handy, get an AK-47 as soon as
you have access to it
flank them from the left side. As soon as you collect the coke, avoid
the incoming enemies and just drive off the same way you came from

This mission was nerfed so it only gives you 3000$ per run after voting for repeat, but you can avoid that by pressing the R2 (quick restart) on PS3 (not sure about xbox, i guess right trigger) after rating the mission. The only problem with that is that you can't buy ammo between your runs. So bring a lot of ammo with you. If you run out of ammo, end the mission, restock and call Gerald until he gives you the same mission again.
Answer: So far the fastest, funnest, and most consistent way I've found to make money is repeated replays of either races or survival.  Either way has distinct advantages and disadvantages.

Races, especially point-to-point street races with supers, take about
2-3 minutes and can net the winner 6K, plus some nice RP to boot.
The top 7-8 positions will also make some money, but not as much.  It
pumps your driving skill to at the same time.  The difficulty here is
that it takes some driving skill to win the races.
Survival can also return some nice cash rewards.  Cash and RP are based on the level reached, though it's not hard to make it to level 4 and get 4K out of it.  This game type takes a bit longer, but has some other nice benefits.  First, you're going to pump your shooting skill pretty heavily.  Secondly, you'll get tons of ammo and weapon pickups.  If you pick up a weapon you'll get to keep it until you log out of the session. It's nice to have a free spare RPG in your back pocket for a few hours.

The key to both of these approaches is to get a solid group of cohorts to grind the replays with.  If you cut out having to wait for new player to join and people who like to loaf in the lobby, you can get very quick turn around.
Also don't forget to sell a car to LS Customs every 48 minutes.  The best cars can get you up to 8K.
Comment: I don't think you get to keep the weapons, I think they stay until you change sessions or log off.  That was my experience with the uzi anyway.
Comment: @turbo double checked this and you're right.
Answer: Hmm, alright. This post is pretty outdated, more based on the first release of GTA Online. I saw recently a post was closed because it was a duplicate of this post, that's kinda unfourtunate because this was posted 6 years ago and can't serve much help for late-game grinding in my opinion, so I came here to put my answer in.

EARLY GAME (Job Grinding)

So, you just got off the plane, 12 in the chamber, 36 in the pocket. Firstly, I'd strongly reccomend to not try and kill that level 351 going around in their Zentorno, because each time you die, you gotta pay $500 in healthcare and bail bills. Also, deposit your money on the Maze Bank website on your phone, or else you'll drop yet another $500 each time you die.
What you should do however, is job grinding. A lot of jobs do in fact work, I personally grinded the Dispatch Missions given by Martin Madrazo (Mz on the map), however, these jobs require a second person, some four people. A tip here is to always play on Hard Mode. This gives you more money and I didn't find it to be that more dificult than Normal.
To summarize;

Try and not drop money.
Don't go after high-leveled players.
Grind Jobs. (Easier with friends)

Gather some new weapons, experience, and abilities to buy more armor to move on to the;

MID GAME (Heisting)

This is where your profits can skyrocket if you do it right, you got two options here;

Buy your own luxury apartment (200k) and start your own heists.
Join another player's heists.

The latter being cheaper than setting heists up yourself, but an apartment can be bought after doing about 10 jobs nowadays, which has actually been brought upwards since the game was released, however, to my knowledge, the apartment heists haven't changed payout to match the inflating GTA prices, so sometimes this will be worse than job grinding.
If however, you get the "Casino Heist - Big Con" invite on your phone, try and get in.
Big Con is the easiest approach to the casino heist. Make sure that the player hosting has "Gruppe Sechs" as Entry Disguise, "Staff Lobby" as exit and "High Level" as buyer, if the host only gives you 15% of the cut, that's actually fine, some may give 20% or ask you how much money you have and change your cut accordingly, but don't over-negotiate. After this you could net yourself an easy 200k, just follow the other players in the lobby and listen.
A bonus option is to find someone kind enough to bring you along and help you, I personally have given a lvl 30 about 1 million by doing the casino heist with him over and over. If you get lucky like that you can get some very easy cash. Crews also help, try and find either a Grinder Crew or a "We will always help if you help back" kind of crew, don't however join the reccomended rockstar crews (the ones with a pointy end to their tags), these crews are notoriousley toxic across the community, and of course there's the good, but the IGN crew especially is known to be the most toxic, cargo-greifing players to possess.
If you ever see an event going on, such as "Triple Rewards on Deadline!", Do, That, Job. My first week of playing I grinded the living life outta "Sumo: Remix" because it was double money and got myself probs 1 million by doing that.
To summarize;

Do heists, preferably the more modern ones.
Be friendly and eventually others will help back.
Sieze any oppurtunity you find.
Avoid the extremley large crews, find a small, loyal community.

When you have collected, maybe a few million, you'll be at the start of the;

END GAME (Bunkers, Coke, Cars, oh my!)

Personal taste is a strong part here, but I'll try my best to explain each business in detail shortly, you'll have to go down one of two paths;
CEO: Great for solo, decent for groups.
MC: Great for groups, terrible for solo.
The CEO is able to operate the following businesses:

Bunker
Import/Export
Special Cargo
Nightclub
Hangar

also can operate these non-businesses;

Office (Everything is done through the computer in there, apart from that, nothing)
Arcade (Only 5k/day max, alright?)
Facility (Don't bring up the orbital cannon.)

They can also register as VIP without having 50k in the bank, making VIP work such as Headhunter or Sightseer easy to get at. These missions can net you 20-25k in the span of 5 mins using a Buzzard (which are on sale atm go get one).
Your best solo buildings are as follows:

Bunker (1 Vehicle Sales from 1 Supply Purchase)
Import/Export (1 Source, 1 Sell = 80k)
Nightclub (Only 1 Vehicle Sales)

You unlock CEO by buying an Office from the same website you buy houses from. A CEO's organization can have the CEO and 3 Associates/Bodyguards (Depending on how the player is invited) alongside. You also have access to VIP Abilites as CEO such as;

Dropping BST (2x Damage + 1/2 Damage Taken for 1 Minute)
Spawning Vehicles that you own right next to you (Select vehicles, such as Buzzard)
Bribe Authorities (No wanted level for 2 mins)
Ghost Organization (3 min off-radar for all members AND for driven sell vehicles)

The MC branch of businesses are better with friends, losing acces to both the Special Cargo and Import/Export for 5 businesses that work similarly to the bunker.
The MC President is able to operate the following businesses;

Bunker
Hangar
MC Businesses
Nightclub

and can also operate these non-business buildings;

Arcade
Clubhouse (Only MC contracts)
Facility

Your best team-businesses are as follows;

MC Businesses (1 Supply gets multiple vehicles)
Hangar (Get 4 crates with 4 players)

You can also spawn any motorcycle stored in your Clubhouse through the MC menu. A MC can hold 8 Members in total, and the President can promote members for more abilities.
You can become a MC President after buying a Clubhouse from Maze Bank Foreclosures.
For both branches, the Arcade can be useful for the MCT. It costs a fair bit (on sale atm) but allows you to buy supplies for all businesses from the comfort of it.
Of course, anything other than the Clubhouse, Office, MC Businesses, Special Cargo and Import/Export can be done by both MC and CEO effectivley, CEO can have 4 players, and MC can have 1.
To summarize;

Buy Businesses from Online
CEO better solo
MC Better with friends

GREIFERS

A grinder's worst enemy, a player that serves to ruin sell missions and kill level 7 Timmy who's bringing a car to LS Customs on a broomstick. You may have experienced them early on, but be ready now. Since you are playing in Freemode now instead of a private job, others can join and destroy your cargo. I'm a culprit of this myself, level 30 I saw a red truck nearby and blew it up with grenades, GRENADES, not knowing that in reality I just destroyed probs 120k of cocaine.
You can avoid greifers through this;

Be Attentive
Be Quick
Be Private

Being Attentive of any Off-Radars or Facility Jumps can help massivley, if you think a player is coming after you off-radar, use Ghost Organization yourself, they can't track your vehicle like that.
If you think an orbital cannon is after you, use off-radar, they can't lock on during that time.
Know all the icons for the special vehicles, if no special icon is appearing on the player, and they have the default player blip, still be careful. They can use a nightshark with 5 stickies strapped to it to deal basically no damage to themselves and instantly destroy a sell vehicle. Know counters of all vehicles.
Selling quickly can get the cargo safe before the local MK2 greifer even knows you are selling, avoid crashing and optimise routes, know what mission you are doing.
Create a Solo-Public lobby by cutting GTA's internet access temporarily with Resource Monitor. This'll prevent players from indirectly joining you for a couple of mins.
If all else fails, GET OUT OF THE VEHICLE and kill the greifer. If you are not inside, they can't lock onto you. (Unless they're using a terrorbyte, in that case, pretty unfourtunate)

So, that was it for my money guide, apologies if its a bit long but it needed to go here with the outdatedness, I'd love for some more people to comment and/or edit this post to keep it updated. Thanks for reading!


Prove analyticity by Morera's theorem

Question: Let $f$ be continuous on the complex plane and analytic on the complement of the coordinate axes. Show that $f$ is analytic everywhere. Hint: Morera's theorem. I think that I need to show that the integral is zero almost everywhere so by Morera's theorem it's analytic, but I'm not sure how to do that. Any help please?
Comment: It's certainly 0 on the complement of the coordinate axes by analyticity.  Now, Morera's theorem needs the integral over every triangle to be 0.  The only case where there's any trouble is a triangle with border on the axes.  Argue that this case is also fine by taking the limit of a triangle off the axis.
Comment: See the second half of the answer  here: http://math.stackexchange.com/questions/159659/which-sets-are-removable-for-holomorphic-functions
Comment: What about the absolute value function, $|z|$? Surely it's continuous everywhere and analytic on the complex plane minus the origin ($ \mathbb C \setminus\{0\}$). Why does the same strategy with Morera's theorem not imply that $|z|$ is entire?
Comment: @Nick: The absolute value function is not analytic anywhere. Check the Cauchy-Riemann equations. It maps the entire complex plane to the real line, so it cannot be conformal. There are many reasons.
Answer: It's enough to show that the integral of $f$ along every circle is $0$.  If the circle does not cross or touch one of the axes, you've got it.  If crosses an axis, approximate it by two simple closed curves: one of the follows an arc of the circle until it's very close to the coordinate axis, then moves along a line close to the axis until it reaches the arc, then moves along that arc.  The other does the same on the other side of the axis.  The integrals along those two lines approximately cancel each other, because you assumed continuity, and the approximation can be made as close as you want by making the lines close enough to the axis, again because you assumed continuity.  So in the limit, they cancel each other and the whole thing approaches the integral along the circle.  So $$\lim\limits_{\text{something}\to\text{something}} 0=\text{what}?$$
If it merely touches an axis without crossing, the problem is simpler.  If it crosses both axes, it's more complicated in details, but conceptually pretty much the same.
Comment: yes, thank you. I understand the idea now and I`ll try to write the details and see how that works.
Comment: Just a question: is that will make any difference if I choose circle, rectangle, or anything else? How many cases do I have here? Is it different when I take the curve intersect both axes or I deal with it as you explained above? I do think it`s similar but I just need to break it down to the one axes case, right?
Comment: It shouldn't matter whether it's a circle or a rectangle.

Prove analyticity by Morera's theorem


OpenVZ container(s) and NAT

Question: I have been trying to days to solve my NAT issue with OpenVZ. I have used their guide on their website/wiki, however I just seem to be unable to get it to work.
My Linux box is running on CentOS 6 (64 bit), in my own home. My router's default traffic router is set to my Linux box at 192.168.1.90 (therefore ALL traffic, unless said otherwise in port forwarding, is sent and received from/to 192.168.1.90) - This works just fine on the host node. I tested with Teamspeak 3 and Apache on default ports. They both worked just fine and were accessible from the outside (port 80 not in use/unable to be used by ISP). However, whenever I create a slave node this suddenly turns hell.
After setting the nameservers, I can ping, call-up hostnames and do every I would do as a client, however I am unable to host anything that can be accessed by the outside. Lets take Apache again, this I can access on 192.168.1.91 from within the network, but unable to from the outside, even if I add a port forward config in my router to point towards .91 instead of default .90 - No luck. On OpenVZ's guide as linked earlier, I did all the steps and checked twice, all fine and went down to "Access from internet to container" - my config/iptables is as follows:
iptables -t nat -A PREROUTING -p tcp -d 46.32.xx.xxx --dport 80 \
-i eth0 -j DNAT --to-destination 192.168.1.91:80;
iptables -t nat -A POSTROUTING -s 192.168.1.91 -o eth0 -j SNAT --to     46.32.xx.xxx;

I tried with and without the last line, as that's supposed to direct traffic from within to outside, which works fine. I am unable to visit my website both on the port 80 and 8081 (first line --dport I tried to change to 8081).
On canyouseeme.org I tried to lookup these ports. Host node it worked fine when Apache was running but on slave node with this IPtables config, it gives "No route to host". Without it just gives "Connection refused".
My full IPTables rule list is as follows without the rule stated before:
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED
ACCEPT     icmp --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:ssh
REJECT     all  --  anywhere             anywhere            reject-with icmp-host-prohibited

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination
REJECT     all  --  anywhere             anywhere            reject-with icmp-host-prohibited

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

Answer: I guess the problem not in your host, it is in your container
maybe there is no default route in it
try:
ip route

and make sure that there is default route rule
Comment: While I appreciate your answer, my problem was actually that blindly added some sysctl rules that were only supposed to be added on Ubuntu/Debian. Removing those and doing sysctl -p then everything worked just fine. I upvoted your answer however :)

OpenVZ container(s) and NAT


Is 1/2" plywood standard and appropriate for a roof replacement?

Question: A local roofer submitted a proposal to me for a roof placement that included replacing rotten plywood with 1/2" CDX.  The existing plywood on my roof is only 3/8".   I thought perhaps he made a mistake, but no, this is what he is proposing.  He said it's only a difference of 1/8" thickness.  Is it customary to mix the thickness of existing and new plywood on a roof?
Comment: you gotta be kidding me, you only have 3/8" ???  OMG that is way too thin. It must be saddled like crazy.  Replace the whole roof with a min or 5/8 or better yet 3/4. !!!!!!
Comment: Wow I thought 1/2 was as thin as you could go. RUN AWAY find a new place +
Comment: Code still allows 3/8' for roof sheathing... Sad but true... Nope it is not customary to mix, but in this case it may be a good idea. If the roof dips here and there because of the thin plywood the 1/8 jump may no be so bad in the mix of it all
Comment: Here (in snow country) 1/2" OSB is standard, with 7/16" being common for walls. 30 years on it's working out fine. Only once in many years of construction did I see someone pay for 5/8" OSB on a roof, presumably to prevent any slight sagging years down the road. 3/4" is unheard of and I'd consider it absurdly wasteful.
Answer: I spent 4 years representing a roofing company in NC.  Occasionally I have seen 3/8" plywood on a roof.  It is certainly not preferred by professionals interested in quality.  Mixing thicknesses is not preferred either, but if you use the proper underlayments and decent shingles, particularly archatectural, you aren't likely to notice.  Half inch on a roof is usually OK and very common, at least around here.  Obviously 3/4" is better.  If you can afford to replace all the plywood, it certainly wouldn't be a bad thing.
Comment: I've never seen 3/4" on a roof, and I'm in snow country. It would be a waste (and therefore not "better"). If you're after completely flat, 5/8 is adequate.
Answer: If you mix thicknesses of plywood it will cause a problem eventually, and the thicker sheathing will be noticeable (probably within a month)... and this will reduce the life of the shingles, tar paper, and roof. 3/8" should be replaced (optimally) but it would be better to use all the same thickness sheathing than to mix them.
If you absolutely must use different thickness sheathing, replace all of the plywood above the one that needs to be replaced (to the ridge of the roof). In other words, you don't want to have 3/8" above the 1/2" because it will create a ridge that water will settle in.
Answer: It's fine, and there is no need for the extreme (and expensive) approaches suggested in some other answers.
Where a 1/2" sheet butts up against a 3/8" sheet, the 3/8" side can have several strips of roofing felt (narrow on the bottom, then progressively wider) applied to ease the transition, before the base layer of felt is applied to the whole roof.
3/8" APA rated sheathing is typically rated for a 24" span (distance between rafters) in a roof application. Half-inch is rated for a 32" span in the same application. Due to market pressures the 1/2" may actually cost less than the 3/8" and will be stronger.


How to browse windows shares from Unity

Question: How can I browse windows shares from unity?
Comment: This question does not apply to recent versions of Ubuntu. With 11.10, at least through 12.10, you should be able to just click the file-folder icon in the launcher, which opens the Nautilus file browser. Then click "Browse Network" on the sidebar... et voila!
Answer: The only way I've found out how to do this is to open a folder window from Unity and then find it from there. Go to Files and Folders on the launcher on the left, and open any folder window (ie, Documents). If it doesn't open in the file manager, hit the little folder icon on the top-right. You should then see the classic file manager appear. Open the Go menu and select Network. From there you can browse Windows shares.
If you already have the file manager pinned to your launcher, you can also open it there.
So, in short, I don't think you can currently do this from within Unity. Whether this will be a feature for 11.04 remains to be seen.
Comment: The file manager will be in the Launcher by default in 11.04. You'll have a Desktop Folder by default in 11.04 (files on the desktop from ~/Desktop). We will also make some small improvements to file management in the Dash, but that won't be the focus for 11.04.
Comment: Thank you. I think the to-do list for 11.04 Unity is way too extensive to be achievable in only six months.
Comment: Looking at Unity, I really miss the convenience of the old "Places" menu. I was hoping Unity would at least equal it in terms of functionality rather than remove the concept all together.
Answer: If you are trying to connect to a specific thing (network location, ftp, etc...) and want to do it like you used to (Places -> Connect to Server), you can open the file manager (or open any folder to open the file manager) and do File -> Connect to Server

How to browse windows shares from Unity


Transparent user images

Question: I uploaded an image for my Stack Overflow account and it had a transparent background.  Now it has a black background.  Is it possible to have Stack Overflow default to a white background instead of a black background?
Comment: You could edit it and add a white background yourself... Stack Exchange uses Imgur to upload images, so it's up to Imgur what color background you end up with.
Comment: Sounds good. I'll go ask them to default to white :)
Answer: For me, the background from a transparent gif becomes grey:

If you need the transparency, it works for me in Q&A posts using imgur. Is it a gif or a png?
Comment: The original image should always retain transparency. It's the automatically resized images that will have a background (Imgur reformats them to change the size).

Transparent user images


Is $\mathbb{Q}_p \otimes_{\mathbb{Q}}\mathbb{Q}_p $ coherent?

Question: Let $\mathbb{Q}_p$ denote the field of fractions of $\mathbb{Z}_p$. By the answers to this quesition the tensor product $\mathbb{Q}_p \otimes_{\mathbb{Q}} \mathbb{Q}_p$ cannot be a Noetherian ring (alternatively, this follows because the transcendence degree of $\mathbb{Q} \to \mathbb{Q}_p$ is infinite). One could instead hope for the weaker result that this ring is coherent. Is this true?
Answer: You can use the following:
Lemma. Let $A = \operatorname{colim}_i A_i$ be a filtered colimit of coherent rings such that $A$ is flat over each $A_i$. Then $A$ is coherent.
For example, this is true if all the transition maps $A_i \to A_j$ are flat.
Proof. Let $I \subseteq A$ be a finitely generated ideal. Then $I = AI_i$ for some finitely generated ideal $I_i \subseteq A_i$ for some $i$. By assumption, $I_i$ is finitely presented as $A_i$-module, i.e. there is an exact sequence
$$A_i^m \to A_i^n \to A_i \to A_i/I_i \to 0.$$
By flatness of $A_i \to A$, the sequence
$$A^m \to A^n \to A \to A/I \to 0$$
is exact as well, i.e. $I$ is finitely presented. $\square$
Example 1. Let $K \subseteq L$ and $K \subseteq M$ be field extensions. Then $A = L \otimes_K M$ is coherent. Indeed, it can be written as a colimit
$$A = \underset{\substack{\longrightarrow \\ K \subseteq L_i \subseteq L \\ K \subseteq M_j \subseteq M}}{\operatorname{colim}} L_i \underset K\otimes M_j,$$
where the colimit runs over all finitely generated subextensions $K \subseteq L_i \subseteq L$ and $K \subseteq M_j \subseteq M$. Each $L_i \otimes_K M_j$ is Noetherian, so in particular coherent, and the transition maps are flat because both $L_i \to L_{i'}$ and $M_j \to M_{j'}$ are.
Example 2. The algebraic integers $\bar{\mathbf Z}$ are coherent as the colimit of all $\mathcal O_K$ for $\mathbf Q \subseteq K$ finite. The transition maps $\mathcal O_K \to \mathcal O_L$ are flat because $\mathcal O_K$ is a Dedekind domain and $\mathcal O_L$ is torsion-free.
Comment: Right, that didn't work at all. In fact it's somehow the opposite: the valuations on the intermediate rings (induced by the valuation on $\mathbf Z_p$) are basically never divisorial, because that would give a nontrivial extension of residue fields (for dimension reasons). In particular, $\mathbf Z_p$ cannot be written as a colimit of DVRs that are essentially of finite type. I think it's fair to ask the $\mathbf Z_p$-version as a separate question ― I don't see any way to apply my flatness argument.
Comment: Dear Remy, thank you for the update. But I don't quite understand the example - it seems you claim that the maps in the filtered colimit factor through the localizations? But this does not appear to be the case in general, already for $\mathbb{Z}_{(p)} \to \mathbb{Z}_p$
Comment: Thank you, that is very nice! I have to admit, I expected the answer to be negative, and as such didn't ask what I was most interested in - do you happen to know if $\mathbb{Z}_p \otimes_{\mathbb{Z}} \mathbb{Z}_p$ is coherent?
Comment: At the end, "$\mathcal O_K$ is DVR" should be "is a Dedekind domain", or say that its localizations at primes are DVRs


Custom category link in wp_list_categories()

Question: I simply want the link to be /catname instead of /category/catname for all the links listed using the wp_list_categories() function. Any ideas for this?
Answer: Okay, I've found the answer. This is not possible. So I had to build the permalink manually this way:

 <?php $category_ids = get_all_category_ids();
 $args = array( 'orderby' => 'slug', 'parent' => 0 );
 $categories = get_categories( $args );
 foreach ( $categories as $category ) {
 echo '
slug . '" rel="bookmark">' . $category->name . '

'; } ?>

Comment: Great work. Thanks for posting this. I was having a similar issue and this solution helped me fix it. I didn't want the list of categories to be put under an  as wp_list_categories() does. Sometimes Wordpress has some stupid ways of doing things.


Why is my cactus' arms growing skinny like this?

Question: The arms of my cactus are growing skinnier and I don't know how to make it grow and appear like the original arm (lower part of the arm). It's skinnier and has a lighter green color than the loser part of the arm. Should I water it more? Or give it more sunlight?
Answer: It's likely something called Etiolation. This is where the plant is not getting enough light in it's growing stage. If you've ever had a house plant start to lean towards a window, you've experienced this. Unfortunately this type of growth is more permanent with a cactus as it grows so slowly. You'll see this on all those Instagram Influencer's posts...
I'd say try to get him some more light. All is definitely not lost and it looks quite lovely and healthy! Might just add to the wonderfully funky look. Over time though, if it stretches too much and then the next growth cycle has more sufficient light, the new growth will be fatter and could become too heavy for the skinny part.
Good luck!
Comment: Yes, definitely more sunlight. A cactus needs 6 or more hours of direct sunlight. A south facing window would be ideal for this. I don't know how long the new growth is going on like this, since years or just since recently? It is worth trying to save it asap, since it is a very nice specimen.

Why is my cactus’ arms growing skinny like this?


When restoring a SQL Server DB from dump files on a remote NAS share, copy before restore or restore directly?

Question: My team is considering backing up all DBs to an Isilon NAS and we're conducting time trials to see if the restore time from the NAS is quicker than performing a copy to local storage before restoring. Besides considering the throughput of the source and target storage and the network link, what else should we consider before making a selection? Thank you!
Answer: In my experience, there has been nothing to gain by copying files locally before carrying out the restore. If the target of the restore has sufficient IO capacity, you should be able to restore from the network share at very close to the speed of a file copy.
Answer: Feel free to restore across the network if it's stable.  If it isn't, then it's much quicker to just copy it over first, then try to restore.  With a copy you can use a robocopy type program to pick up where it left off in case of a network error/outage.  Once it's copied over, you can just restore in SQL Server.  SQL Server will not be able to 'pick back up where it left off' in case of network errors.
Backing up is more sensitive than a restore, your file will either fully restore or it will not fully restore; those are the only 2 options.  Backups might get corrupted during many different parts of the process from disk IO sub system on the storage, copying across the network, disk at rest possibly, etc.
This is of course not saying your restored backup won't get corrupted after it was restored, or even if your database itself wasn't corrupted when backed up. :)
Comment: Network stability and speed truly are the differentiators here. I backup all of my databases across the network, but those are all on 10Gb pipes. You might consider copying the file across if you are using a slower network as there are copy optimizations done with threading in Robocpoy. As always your mileage may vary, so I would recommend testing with various sizes of databases.


Synthetic fusional morphology

Question: Are there other languages, apart from those in the indo-european and semitic language families, that have synthetic-fusional morphologies?  It seems that the synthetic-agglutinative morphologies are much more common (eg. uralic, altaic, caucasian, basque, hurrian, sumerian, etruscan)
Answer: The WALS website enumerates and classifies some languages having a fusional morphology: https://wals.info/chapter/20.
Still on WALS, some statistics are given about the degree of exponence of a few languages: https://wals.info/chapter/21
Indeed, from this sample, it seems agglutinative morphology is much more common.

Synthetic fusional morphology


Closed, Creating a method to airdrop ERC20 Token B to the holders of ERC20 Token A

Question: I've been attempting some form of solidity code to automate the airdropping of Token B to the holders of Token A almost all day, but I still couldn't find much that works. How could I do this?
Comment: What is it you really want ? Stack exchange is not here to code for you, but instead we are here to provide a solution to a specific problem. So what have you tried, what is the problem with what you tried ?
Answer: Two obvious approaches spring to mind.
PUSH
An off-chain process would listen to Token A's event log to compile a list of holders and then proactively send Token B. Since Token A is constantly in motion, either a cut-off time or a continuous process and the requirement should be clarified. A notable disadvantage of this approach is the centralized gas payer bearing all the costs of transactions and infrastructure as well as the responsibility.
PULL
This has the same requirement to resolve the question of the cut-off time. I do not see an obvious way to do this on a continuous basis, but it might be possible. It's about ensuring the accounting works.
Users who are entitled to get some Token B send a transaction to a claims window contract which computes their entitlement from their Token A balance (at a point in time) and sends them their allotted Token B. This would be an on-chain solution with no transaction cost or infrastructure cost for the operator.
It should be much easier to define what the contract is supposed to do in this scenario. And, it should be trivial to ensure that transactions can complete at a known fixed gas cost that would be paid by the beneficiary who is incentivized to pay it.
A slight-of-hand method could be considered
ERC20 is about the interface and the result - not about the method.
Nothing is stopping one from computing supply and account balances using information that is available in another contract.
Consider:

Your Token B balance is your Token A balance (at a cut-off time) plus or minus everything that happened here, after that.

If you wrote your ERC20 contract that way, then the airdrop would be complete at initialization.
Hope it helps.
Comment: Unfortunately it seems like what I need won't work with either of these options. Thank you for the prompt response, but I'll have to mark this closed. Have a great day!
Comment: Thanks for accepting my answer. Consider elaborating on what you need in another question. We don't have enough information to suggest a departure from a typical approach.


What is the best noun meaning "getting invaded"?

Question: In a technical formulation, I need to define two opposite states. In particular, the first represents the state of an agent which invades, thereby called invasion. The second one corresponds to the agent which is invaded. What noun would reflect the latter meaning?
Comment: The invasion is an event that both sides experience. An occupation could be said to exist during or after an invasion.  An invasion is still an invasion for the invaded people, Columbus Day and Australia Day are sometimes referred to as Invasion Day by some people (usually those invaded).
Comment: During an *invasion*, there are both *the invaders* and *the invaded*. The word *invasion* doesn't distinguish between the two.
Comment: *Invasion* isn't a state, it's an action. The state of someone who's invading is that they're *invading* or *occupying* or *in occupation*; the others are *being invaded* or *being occupied* or *under occupation*.
Answer: States are more like adjectives or attributes, and entities move from state to state is more like some thing, a noun, having an attribute corresponding to the state the entity is in.
'Invasion' is the noun for the act (the verb) invading. So for the process of an 'invasion', the 'invaders', a noun/entity, the actors preforming the invasion) invade (a verb/ the label for some transition/change of state) a ... well, you're looking for some word that says it is the entity that has been invaded, the object of an invasion.
There is no single word, cognate or not, that captures the object of the invasion.

Invaded land, Conquered people, occupied territory, the place that has been invaded

are all noun phrases which capture the idea, but a single noun doesn't exist for it in English. English doesn't really allow well for making a noun out of an adjective.
In Romance languages, you can use adjectives without a following noun:

un employé

which has been borrowed directly into English as 'employee'. The '-é' or rather the '-ee' ending is also productively in English but it takes time for particular instances to catch on. Divorcee, trainee, adoptee are all objects of a transitive verb. 'Invadee' ... just isn't an accepted word in English at least not in formal writing.


How to format a grid column

Question: I have a grid in my module that shows a few columns, one is "price". But it shows the price like this "00.0000", how can I make it show "00,00"? I don't believe I need to post any part of my code for this, do I? If so, tell me what.
Answer: Declare your column like this:
<code>$store = Mage::app()->getStore();
$this->addColumn('column_id_here', array(
    'header' => Mage::helper('module_alias_here')->__('label here'),
    'index' => 'column_name_here',
    'type'  => 'price',
    'currency_code' => $store->getBaseCurrency()->getCode(),
));
</code>
Answer: <code>$this->addColumn('order_amount', array(
  'header'    => Mage::helper('manoreport')->__('Order Amount'),
  'width'     => '100px',
  'type'      => 'price',
  'index'     => 'subtotal_invoiced',
  'currency_code' => 'CURRENCY CODE HERE'
));
</code>
Please try this.
<code>'type'      => 'price',
</code>
OR You can create custom renderer follow below link:
https://makandracards.com/magento1/35007-grid-column-options
Comment: That link is gonna be very useful to me in the future. But since your answer and Marius are basically the same, I'm gonna accept his answer because he send it first. Thank you very much!

How to format a grid column


Prettifying results of cqlsh commands in Linux terminal

Question: Is there any way to prettify the results of cql commands in the Linux terminal while using the cqlsh utility (cql version of Mongo .pretty())? It becomes quite difficult to read the results when the output is displayed normally, especially when there are nested documents and arrays
Answer: Perhaps you are interested in the EXPAND command?
Usage: EXPAND ON;
From the documentation over at Datastax:

This command lists the contents of each row of a table vertically, providing a more convenient way to read long rows of data than the default horizontal format. You scroll down to see more of the row instead of scrolling to the right. Each column name appears on a separate line in column one and the values appear in column two.

Source: https://docs.datastax.com/en/dse/5.1/cql/cql/cql_reference/cqlsh_commands/cqlshExpand.html
Answer: cqlsh is a python script that uses the datastax python-driver to make queries to cassandra.  You can modify the script to meet your needs (see: Why does cqlsh right-align strings? for an example), or you can write a program using the python-driver or another library to do what you need.
Since mongo is document-oriented, it makes sense that pretty-printing is an available option.  However cassandra is more columnar / row-oriented so you don't typically look at result sets like documents, instead you look at them more like rows, although I do see the utility in a 'pretty-print' like function.


Disks utility says SMART is not supported, is there a workaround or another way to troubleshoot?

Question: I am using the Live USB to troubleshoot a troublesome hard drive.
I want to run the self-test but as you can see in the image below that it says "SMART is not supported" and because of this I can't run the test. Is it because it's in Raid configuration?

Is there a way to make is so SMART is supported?
Are there other tools on the Live USB to troubleshoot my troublesome hard drive?
Comment: What hard drive ? manufacturer please ...
Comment: @bodhi I want to say it's a Western Digital VelociRaptor. Don't worry about it though, I solved my underlying issue.
Answer: After fooling around with Disks I found a benchmark option.
The benchmark can be used to test the read/write speed even if SMART is not supported, this is useful in determining if the hard drive is slow or the installation of your OS is messed up.

Click the drive.
Click the gears icon.
Click "Benchmark..." to benchmark.

For what it's worth my troublesome hard drive has a read/write speed of 8MB/s / 6MB/s, compared to a working one that is closer to 80MB/s. This answers my underlying issue which was trying to figure out if something was wrong with my hard drive or my Windows installation.


Is it possible to see if an in app purchase was made in sandbox mode

Question: I am working on an iOS library that records a successful in app purchase to our API for later processing.  What I would like to be able to do is log to our api if the IAP was made in sandbox (with a test user) or not.
Answer: That information is in the receipt.  You can:
1) grab the receipt and submit it to the Apple servers (sandbox or production).  It will come back either valid or with a 21007/21008 error revealing its environment.
2) grab the receipt and decode it.  There is an undocumented field that indicates whether or not it is from the sandbox.
I'd go with #1
Answer: After a while of hunting I came across this post which seems to be what I am trying to do. Check if iOS app is live in app store I will update the post once I am fully deployed and tested but it seems to be working for now.


How do you sync from USB?

Question: On AnkiDroid, how do you sync from USB?  I'm unable to find the option in settings.  Is it just a matter of having your device plugged in via USB and having AnkiDesktop open?
Answer: AnkiDroid developer here.
It does not work so easily unfortunately.
Right now the easiest/safest would be:

Export your decks as an APKG file
Copy the APKG file over USB
Open the APKG file in Anki Desktop

There is a more convenient solution but it is very difficult to set up initially:

Set up Android to to Ethernet over USB
Install your own sync server
Compile AnkiDroid with your own sync URL
Comment: Done: https://code.google.com/p/ankidroid/issues/detail?id=2397 There are currently 679 enhancement requests and all are waiting for volunteers :-)
Comment: With ADB running on the computer (see e.g. [Is there a minimal installation of ADB?](http://android.stackexchange.com/q/42474/16575)), would there be anything to ease the job? Or would that be an idea for a future version of *AnkiDesktop* maybe? Not using it myself, just suggesting ;)
Comment: @Izzy: Indeed copying the SQLite files over USB with adb pull/push sometimes work, but it breaks things when the database is not properly closed, so it is very dangerous and not recommended.
Comment: I rather thought about something implemented into Anki: Dektop triggers an Intent, which exports the data and gives back the `/path/to/file.apkg`, which then can be "pulled" by the Desktop (raw idea, but you get it). Would be an easier variant of your first approach then – with the difference of the user just having to "push a button" in AnkiDesk :)
Comment: Put it on your Todo list and mark it as "patches/pull-requests welcome" then, linked from the README so visitors of the [project's Github page](https://github.com/ankidroid/Anki-Android) can't miss it :)

How do you sync from USB?


Does this double integral exists?

Question: I've calculated $\iint_D\frac{y}{x^2+y^2}\,dA$ where D is bounded by $y=x$, $y=2x$, $x=2$, in this way:
$$\iint_D\frac{y}{x^2+y^2}\,dA=\int_0^2\int_x^{2x}\frac{y}{x^2+y^2}\,dy\,dx=\cdots = \ln \frac{5}{2}.$$
However, I wonder if the fact that the $\frac{y}{x^2+y^2}$ is not bounded on D invalidates all the calculations and in fact the double integral does not exist. All the theorems that I consult have as a hypothesis that the integrand is bounded on the region of integration and hence my doubt regarding this double integral. Can anyone help me? Does this integral exist?
Comment: You didn't bother to show the computation, but probably it's valid. The function you integrate is positive and for such you can carelessly change the order of integration due to Tonelli's theorem. Also, a function doesn't have to be bounded for an integral to exist, think for simplicity about one-dimensional integral $\int_0^1 x^{-1/2}\,dx$.
Comment: Why is the fraction not bounded on the region $D$?
Answer: $$\int \frac{ydy}{x^2+y^2} = \frac{1}{2} \int \frac{d(y^2+x^2)}{x^2+y^2} =\frac{1}{2} \ln(x^2+y^2) + C$$
So
$$\int_0^2\int_x^{2x}\frac{y}{x^2+y^2}\,dy\,dx= \frac{1}{2} \int_{0}^{2}\ln(x^2+y^2)|_{x}^{2x} dx$$
Answer: Changing to polar coordinates reveals why the integral is finite even though the integrand is $\mathcal{O}(r^{-1})$ as $r \to 0$.
For a quick check, note that the integrand is nonnegative and $D$ is a subset of the sector
$$S=\{(r,\theta): 0 \leqslant r \leqslant 2\sqrt{5},\, \frac{\pi}{4} \leqslant \theta \leqslant \arctan (2) \}$$
Thus,
$$\int\int_D \frac{y}{x^2+ y^2} dA \leqslant \int_{\frac{\pi}{4}}^{\arctan(2)}\int_0^{2\sqrt{5}} \frac{r \sin \theta}{r^2} r \, dr \, d\theta = 2\sqrt{5}\int_{\frac{\pi}{4}}^{\arctan(2)}\sin \theta \, d\theta,$$
where the integral on the RHS is finite since the sine function is bounded.

Does this double integral exists?


How can I embed a WordPress blog into another site?

Question: I currently make my website using iWeb. Is there a way that I can embed a WordPress blog into the site? Either through an easy option or through coding?
Answer: It can be done, but not through iWeb. You will need to do it through code (in Wordpress' case, PHP).
Here's a guide for integrating Wordpress with your site, I'm afraid laying out the steps would be far too long an answer for SO.
http://codex.wordpress.org/Integrating_Wordpress_with_Your_Website
Comment: Can I add PHP directly through iWeb?
Answer: I would agree that an iFrame is the easiest way...
However there are some real problems with this method.  Wordpress has it's own automatic navigation which visitors will use, taking them to places that may be different than your normal navigation would. Categories and other that cannot be switched off.  You can remove these through some tweeking of the css but then you might as well do the php thing.
Answer: I'm on a PC and using NetObjects instead of iWeb, but I used iframes to do mine and think the technique could work for iWeb. Basically it involved adding the iframe HTML, some javascript to adjust the iframe hieght, and some tweaks to the WordPress theme to get rid of the header.
I put together a tutorial video on how I did it here: http://www.youtube.com/watch?v=7GuocgQlCmw The description on youtube includes links to where I got the information on how to do it and my blog entry describing the process.
Answer: The simplest way is to make an iframe in iweb and insert your wordpress blog in the iframe. Many people do it this way.