How were sprites handled on the IIgs?

Question: The Apple II series including the IIgs did not have hardware sprite handling, though the IIgs did have high resolution graphics (compared to other Apple II machines). However people did manage to implement a number of high resolution sprite based games on the IIgs, including LemmingsGS, Rastan, and an unofficial port of Super Mario Brothers. These games manage full screen scrolling and numerous moving objects. What sprite handling libraries exist for the IIgs that can match the capabilities of those games?
Comment: FWIW, "give me a list of" questions aren't ideal for stackexchange. A better question might be, "how were sprites handled on the Apple IIgs?", with a request for examples of sprite libraries in the body of the question.
Comment: The question is already answered, but it could be extended to other simple computers, like the ZX Spectrum, which didn't even have shadow memory. But fine graphical games were written for it (one of my favorites is Underworlde).
Answer: There are two basic elements:

Using "compiled" shapes, where the shape is stored as a series of drawing instructions rather than as data
Taking advantage of the IIgs shadow RAM, as described in detail in this post

Compiling shapes was a popular technique on machines that didn't have a CPU that cached instructions and data separately.  Instead of looping over a bitmap, you just call a function that explicitly draws every pixel, given an X/Y screen offset.  This uses a lot of memory but avoids loop overhead, and lets you use faster immediate-mode instructions instead of indexed loads.
One sprite library example is "Mr. Sprite" from Brutal Deluxe.  The software is available here, and there's a detailed explanation of the technology here.
That's assuming you want super hi-res graphics.  If you'd like to use double lo-res graphics instead, try "Dolores" by 8-Bit-Shack; software here, tech discussion here.  You get lower fidelity but considerably more speed.
You can also find the source code to Rastan GS online, e.g. here.
Comment: The Mr Sprite explanation is very interesting and detailed, but while it explains how to draw a sprite at a chosen position, hardware-based sprites also keep the background, so that when you hide the sprite or move it to a new position, the background is automagically restored. How was that handled in software? Copying the background of the sprite before drawing it? Redrawing the background each time before drawing sprites on top?
Comment: @jcaron: you can blit to save/restore the rect covered by the sprite, or define the play area so that the background obscured by sprites is a simple pattern and can be erased quickly. It's also possible to skip the erase in some situations; for example, if I know the player's sprite can move no more than two pixels per frame and is always on a green background, I can add a two-pixel green border around the player and let it erase its own trail. I don't think there's a single correct answer for all situations.
Answer: There were multiple approaches possible, depending on the type of game. Many games used a combination of tricks to accomplish these techniques.
One approach was to disable the shadow memory, writing the the super-high-res buffer in bank 0, then reenable memory shadowing and run a fast copy function to read and write the SHR bank 0 memory to itself (with shadowing on, this would also write the screen data to the actual graphics buffer in bank $E0). Clever software could even copy only the bytes in bank 0 that changed, for faster update time. (Note that mvp/mvn memory copy opcodes would typically not be used, because they perform false reads of the destination address which is the slow, bank $E0 video RAM. Mapping the zero page or stack to the shadow region of bank 0 allowed faster opcodes to be used for this "blitting" logic.) Many side scrollers would use tiling, so that they could quickly avoid updating any tile which didn't change during a frame update. Animation/"video" players would often use frame deltas to speed up the frame rate (again, only updating video-memory bytes that changed).
Some animations in games were accomplished by manipulating the color palette, since there were 16 palettes of 16 colors individually selectable per scan line. By setting some colors to be the same, simple 2-frame animations can be accomplished just by swapping the palettes used on selected scan lines. Fades and vertical wipes can be accomplished the same way.
The 3200 color "mode" uses palette-modification tricks along with ray-gun synchronization to give the appearance of more colors or even simple animations. Using the vertical-blanking interrupt (or disabling interrupts and monitoring the VGC registers directly), smoother animations can be accomplished with reduced "tearing", because the screen updates are happening on a different part of the screen than the CRT is redrawing.
Some games (e.g. Tunnels of Armageddon) would use the IIgs fill-mode, which sacrifices one color in exchange for a repeat of the previous color used on that scan line; in this mode, the software just draws outlines of the shapes, and the hardware fills in the solids in between.
Since with 16 colors, there are two horizontal pixels per byte (in 320 mode), many games would limit onscreen movement to even-pixel boundaries and widths, so that no read-modify-write operations would be needed.
Because the horizontal resolution (320 or 640 pixels), palette, and fill mode is selectable per scanline, it's possible to use some combination of the techniques above to create the illusion of better/faster/higher-resolution graphics across the display, even though individual scanlines are limited in what they can display. The primary objective was always to limit the amount of the screen memory being rewritten per frame, approximately 25%-33% if I recall correctly.
Softdisk's publically-released GSLib/GTLib contained functions utilizing some of these techniques (including a library for handling 3200-graphics display and transitions). There used to be a version of Burgerlib for the IIgs, that handled blitting and some other sprite techniques, which was used in the port of Wolfenstein 3D (and Out of This World I believe, as well as other GS games). The demo culture in Europe produced some libraries as well. But most IIgs games seemingly used one-off or hand-crafted code, or at least proprietary libraries, for handling their sprites.

How were sprites handled on the IIgs?


Impersonating account holder, with perfectly good intentions, and the person himself willingly assisting. Is that a crime?

Question: Is it considered a crime for someone to help a close relative by calling that person's bank on their behalf, with the person himself sitting in the room and willingly assisting, and dealing with the customer care representative of the bank by effectively pretending to be that person (i.e. by saying "I am John Smith" rather than "I am John Smith's son")?
Comment: @DaleM there are many horror stories about broken suboptimal customer service procedures which stubbornly require a claim that John Smith itself is doing it. This seems a legitimate question.
Comment: Why would you? If John Smith is there he can authorize you to act.
Comment: If there a particular crime that you think might be involved?
Answer: It is in many jurisdictions a crime to misrepresent one's identity, but most if not all such laws specify a "fraudulent intent" or similar language as a required element of the crime.
For example Maryland code § 8-301. Identity fraud says:

(b) Prohibited -- Obtaining personal identifying information without consent. -- A person may not knowingly, willfully, and with fraudulent intent possess, obtain, or help another to possess or obtain any personal identifying information of an individual, without the consent of the individual, in order to use, sell, or transfer the information to get a benefit, credit, good, service, or other thing of value or to access health information or health care.

...

(c) Prohibited -- Assuming identity of another. -- A person may not
knowingly and willfully assume the identity of another, including a
fictitious person:
<code>  (1) to avoid identification, apprehension, or prosecution for a crime; or

    (2) with fraudulent intent to:

        (i) get a benefit, credit, good, service, or other thing of value;

        (ii) access health information or health care; or

        (iii) avoid the payment of debt or other legal obligation.
</code>

New York Penal law § 190.78 says:

A person is guilty of identity theft in the third degree when he or
she knowingly and with intent to defraud assumes the identity of
another person by presenting himself or herself as that other person,
or by acting as that other person or by using personal identifying
information of that other person, and thereby:
1. obtains goods, money, property or services or uses credit in the name of such other person or causes financial loss to such person or
to another person or persons;  or
2. commits a class A misdemeanor or higher level crime.

I think most other laws on similar offenses will have similar limiting provisions. Obviously if the person being represented knowingly consents to the deception there is no fraudulent intent.
Answer: The closest crime I can think of would be the offence of fraud by false representation contrary to section 2 of the Fraud Act 2006.
The specifics of whether the offence has actually been committed would turn on whether the person "intend[ed] to make a gain for [themselves] or another".
Given the example in your post, even if John Smith's son only intended to help his father, it would arguably still be fraud according to the literal interpretation of the statute. Whether it would actually be prosecuted is another matter entirely, I'm not sure the CPS would take it that far or that a jury would be inclined to convict.
Comment: You should check the statutory definition of "gain" a few sections later.
Comment: @user6726 I did. There's an argument to be made that a "gain" can include things such as access to someone's bank account in this scenario, although it would depend on the precise nature of why they were calling the bank and what they intended to do.


Difference between case object and object

Question: Is there any difference between case object and object in scala?
Comment: It is not necessary to use `case` to have pattern matching, it is just sugar. Implementing `unapply` yourself does the job.
Comment: He has a point - it's not necessary to have a case object in order to be able to pattern match on it. I think this wasn't addressed in the previous question...
Comment: I thought there would be a difference in pattern matching behaviour but both a case object and a normal object behave the same way in a pattern match AFAIK. It's pretty hard to find any information at all about case objects so I'm looking forward to someone enlightening us.
Comment: The accepted answer just doesn't answer the question, as discussed in the comments on it.  Way too late to make a difference, but should be noted.
Comment: It's not too late to edit the accepted answer. The edit will be reviewed and if relevant, accepted.
Answer: Here's one difference - case objects extend the Serializable trait, so they can be serialized. Regular objects cannot by default:
scala> object A
defined module A

scala> case object B
defined module B

scala> import java.io._
import java.io._

scala> val bos = new ByteArrayOutputStream
bos: java.io.ByteArrayOutputStream =

scala> val oos = new ObjectOutputStream(bos)
oos: java.io.ObjectOutputStream = java.io.ObjectOutputStream@e7da60

scala> oos.writeObject(B)

scala> oos.writeObject(A)
java.io.NotSerializableException: A$

Comment: Adding `extends Serializable` should do the same trick though.
Comment: I think that case objects can be serialized is the most difference from regular objects especially in the network communication between actors
Answer: Case classes differ from regular classes in that they get:

pattern matching support
default implementations of equals and hashCode
default implementations of serialization
a prettier default implementation of toString, and
the small amount of functionality that they get from automatically inheriting from scala.Product.

Pattern matching, equals and hashCode don't matter much for singletons (unless you do something really degenerate), so you're pretty much just getting serialization, a nice toString, and some methods you probably won't ever use.
Comment: This post perpetuates the myth that `object` is the same as a singleton. It is not. Rather it is exactly what it says it is, an object, i.e. a declaration and instantiation in one. This limits `object` to a single instance if defined in package scope, which effectively makes it a singleton, but only if defined IN THAT SCOPE. If defined inside a class, you can have as many instances as the class itself (it's lazily instantiated, so it's not necessarily 1-1). And those inner objects may very well be used as hash keys, making default equals/hashCode very much sensible.
Comment: The question is about `case object` not class, why is this the correct answer?
Comment: Point 3 and 4 of this answer is correct difference between case objects and objects. Point 1 and 2 doesn't matter for singleton objects. And singleton objects are always Products with arity 0 so point 5 doesn't matter also.
Comment: This does not answer the question. This answer deals with the difference between `case class` and a `class`. The question is about the difference between `case object` and `object`.
Comment: @C4stor The answer doesn't say that, though.  An object is not a class.  Given that case classes do a fair amount of magic behind the scenes, given Scala's various edge cases and complications, there's no reason simply to assume that the only difference between a standard Scala object and a case object is explained by what we know about the difference between standard classes and case classes.   This answer doesn't even address the wording of the question.
Comment: Having pattern matching makes a lot of sense if `case` is used in the "proper" use case: providing several implementations of one abstract class or trait. Some might be classes, some might be singleton objects.
Comment: Sure, but that works just as well for case objects as non-case objects.
Comment: In fact, some things behave differently for case objects than regular instances of case classes.  Pattern matching behaves differently, for one thing.  So the answer isn't even accurate.
Comment: It's not an answer to the question!
Comment: This is not the right answer it's about case class vs class difference
Comment: Because the list of differences between case classes and classes IS the list of differences between case object and object.
Answer: scala> object foo

defined object foo

scala> case object foocase

defined object foocase

Serialization difference:
scala> foo.asInstanceOf[Serializable]

java.lang.ClassCastException: foo$ cannot be cast to scala.Serializable
   ... 43 elided

scala> foocase.asInstanceOf[Serializable]

res1: Serializable = foocase

toString difference:
scala> foo

res2: foo.type = foo$@7bf0bac8

scala> foocase

res3: foocase.type = foocase
Answer: A huge necro, but it is the highest result for this question in Google outside official tutorial which, as always, is pretty vague about the details. Here are some bare bones objects:
object StandardObject

object SerializableObject extends Serializable

case object CaseObject

Now, lets use the very useful feature of IntelliJ 'decompile Scala to Java' on compiled .class files:
//decompiled from StandardObject$.class
public final class StandardObject$ {
   public static final StandardObject$ MODULE$ = new StandardObject$();

   private StandardObject$() {
   }
}

//decompiled from StandardObject.class
import scala.reflect.ScalaSignature;

@ScalaSignature(<byte array string elided>)

public final class StandardObject {
}

As you can see, a pretty straightforward singleton pattern, except for reasons outside the scope of this question, two classes are generated: the static StandardObject (which would contain static forwarder methods should the object define any) and the actual singleton instance StandardObject$, where all methods defined in the code end up as instance methods. Things get more intresting when you implement Serializable:
//decompiled from SerializableObject.class
import scala.reflect.ScalaSignature;

@ScalaSignature(<byte array string elided>)
public final class SerializableObject {
}

        //decompiled from SerializableObject$.class
import java.io.Serializable;
import scala.runtime.ModuleSerializationProxy;

public final class SerializableObject$ implements Serializable {
   public static final SerializableObject$ MODULE$ = new SerializableObject$();

   private Object writeReplace() {
      return new ModuleSerializationProxy(SerializableObject$.class);
   }

   private SerializableObject$() {
   }
}

The compiler doesn't limit itself to simply making the 'instance' (non-static) class Serializable, it adds a writeReplace method. writeReplace is an alternative to writeObject/readObject; what it does, it serializes a different object whenether the Serializable class having this method is being serialized. On deserializention then, that proxy object's readResolve method is invoked once it is deserialized. Here, a ModuleSerializableProxy instance is serialized with a field carrying the Class[SerializableObject], so it knows what object needs to be resolved. The readResolve method of that class simply returns SerializableObject - as it is a singleton with a parameterless constructor, scala object is always structurally equal to itself between diffrent VM instances and different runs and, in this way, the property that only a single instance of that class is created per one VM instance is preserved. A thing of note is that there is a security hole here: no readObject method is added to SerializableObject$, meaning an attacker can maliciously prepare a binary file which matches standard Java serialization format for SerializableObject$ and a separate instance of the 'singleton' will be created.
Now, lets move to the case object:
//decompiled from CaseObject.class
import scala.collection.Iterator;
import scala.reflect.ScalaSignature;

@ScalaSignature(<byte array string elided>)
public final class CaseObject {
   public static String toString() {
      return CaseObject$.MODULE$.toString();
   }

   public static int hashCode() {
      return CaseObject$.MODULE$.hashCode();
   }

   public static boolean canEqual(final Object x$1) {
      return CaseObject$.MODULE$.canEqual(var0);
   }

   public static Iterator productIterator() {
      return CaseObject$.MODULE$.productIterator();
   }

   public static Object productElement(final int x$1) {
      return CaseObject$.MODULE$.productElement(var0);
   }

   public static int productArity() {
      return CaseObject$.MODULE$.productArity();
   }

   public static String productPrefix() {
      return CaseObject$.MODULE$.productPrefix();
   }

   public static Iterator productElementNames() {
      return CaseObject$.MODULE$.productElementNames();
   }

   public static String productElementName(final int n) {
      return CaseObject$.MODULE$.productElementName(var0);
   }
}

        //decompiled from CaseObject$.class
import java.io.Serializable;
import scala.Product;
import scala.collection.Iterator;
import scala.runtime.ModuleSerializationProxy;
import scala.runtime.Statics;
import scala.runtime.ScalaRunTime.;

public final class CaseObject$ implements Product, Serializable {
   public static final CaseObject$ MODULE$ = new CaseObject$();

   static {
      Product.$init$(MODULE$);
   }

   public String productElementName(final int n) {
      return Product.productElementName$(this, n);
   }

   public Iterator productElementNames() {
      return Product.productElementNames$(this);
   }

   public String productPrefix() {
      return "CaseObject";
   }

   public int productArity() {
      return 0;
   }

   public Object productElement(final int x$1) {
      Object var2 = Statics.ioobe(x$1);
      return var2;
   }

   public Iterator productIterator() {
      return .MODULE$.typedProductIterator(this);
   }

   public boolean canEqual(final Object x$1) {
      return x$1 instanceof CaseObject$;
   }

   public int hashCode() {
      return 847823535;
   }

   public String toString() {
      return "CaseObject";
   }

   private Object writeReplace() {
      return new ModuleSerializationProxy(CaseObject$.class);
   }

   private CaseObject$() {
   }
}

A lot more is going on, as CaseObject$ now implements also Product0, with its iterator and accessor methods. I am unaware of a use case for this feature, it is probably done for consistency with case class which is always a product of its fields. The main practical difference here is that we get canEqual, hashCode and toString methods for free. canEqual is relevant only if you decide to compare it with a Product0 instance which is not a singleton object, toString saves us from implementing a single simple method, which is useful when case objects are used as enumeration constants without any behaviour implemented. Finally, as one might suspect, hashCode returns a constant, so it is the same for all VM instances. This matters if one serializes some flawed hash map implementation, but both standard java and scala hash maps wisely rehash all contents on deserialization, so it shouldn't matter. Note that equals is not overriden, so it is still reference equality, and that the security hole is still there. A huge caveat here: if a case object inherit equals/toString from some supertype other than Object, the corresponding methods are not generated, and the inherited definitions are used instead.
TL;DR: the only difference that matters in practice is the toString returning the unqualified name of the object.
I must make a disclamer here, though: I cannot guarantee that the compiler doesn't treat case objects specially in addition to what is actually in the bytecode. It certainly does so when patterm matching case classes, aside from them implementing unapply.
Answer: It's similar with case class and class ,we just use case object instead of case class when there isn't any fields representing additional state information.
Answer: case objects implicitly come with implementations of methods toString, equals, and hashCode, but simple objects don't.
case objects can be serialized while simple objects cannot, which makes case objects very useful as messages with Akka-Remote.
Adding the case keyword before object keyword makes the object serializable.
Answer: We know objects and "case class" before. But "case object" is a mix of both i.e it is a singleton similar to an object and with a lot of boilerplate as in a case class. The only difference is that the boilerplate is done for an object instead of a class.
case objects won't come with the below ones:
Apply, Un-apply methods.
here are no copy methods since this is a singleton.
No method for structural equality comparison.
No constructor as well.


How to hook up a WiFi thermostat. Having 5 wires and no C wire

Question: I have 2 wires coming up from my basement oil fired furnace and 3 wires coming from my central air handler in attic I am trying to hook up a Honeywell WiFi thermostat. The 2 wires from the basement I believe are easy to hook up. One goes to white and one to Rh. The three from central air are green yellow and red.  Which I believe will go to green, yellow and Rc.  The question is I have no blue wire, C wire. If I look at the terminal in the attic is shows a blue wire on one side but does not label it C. ( see attached pic). Can I run a wire from #5 to C on thermostat
Answer: You are correct
Based on the wiring diagram and provided photo, you appear to be correct that terminal 5 on your air handler's control block is your C terminal.  So, go ahead and run your new thermostat cable, using that as C while matching the existing wiring for the remaining connections.


Tire / Elasticsearch for HABTM associated models

Question: I am trying to implement a full-text searching with tire/elasticsearch for my Client model. I have a set of users, working with clients. There is a HABTM association between Client and User models.
There is a manager function to scope only clients, managed by a particular user (in most cases it is the user currently logged in). I would like to implement a search filter in tire that would work much the same way as it works with ActiveRecord. It does not work with tire (throwing the no filter registered for [user_ids] error).
s.filter :user_ids, manager(params[:manager]).map(&:id)
  if params[:manager].present?

I believe I might be doing something completely off the wall here, but what is wrong with the way I do that and what tutorial/reading would you recommend?
Here is the model.
class Client < ActiveRecord::Base

  has_and_belongs_to_many :users, :uniq => true

  ## Tire would-be implementation
  # include Tire::Model::Search
  # include Tire::Model::Callbacks
  # mapping do
  #   indexes :name
  #   indexes :comment
  #   indexes :user_ids
  # end

  def self.manager(user_id)
    joins(:users).merge(User.current(user_id))
  end

  def self.index_search(params={})
    ## Tire would-be-implementation - does not work
    # tire.search(load: true) do |s|
    #   s.query { string params[:search], default_operator: "AND" } if params[:search].present?
    #   s.filter :user_ids, manager(params[:manager]).map(&:id) if params[:manager].present?
    # end

    # ActiveRecord implementation - works
    if params[:manager].present?
      if params[:search].present?
        @clients = manager(params[:manager]).where(['name LIKE ?', "%#{params[:search]}%"])
      else
        @clients = manager(params[:manager])
      end
    else
      if params[:search].present?
        @clients = where(['name LIKE ?', "%#{params[:search]}%"])
      else
        @clients = all
      end
    end
  end

end

Answer: Try something like
t.filter :not , {:ids => { :values => self.manager(params[:manager]).map(&:id) }} if params[:manager].present?

or
t.filter :ids, :values => self.manager(params[:manager]).map(&:id) if params[:manager].present?


Command line PDF reader

Question: Is there a command line program for linux that will let me read the text of PDFs?  I'll willing to live with a lack of pictures.
Answer: There are several pdf2text tools in Ubuntu. For example, the poppler-utils package contains /usr/bin/pdftotext.
Answer: Howto Open a PDF file under Linux / FreeBSD
(lower part of article give you the options you are looking for)
Answer: pdf2txt.py from the Python project PDFMiner.
Answer: zathura is the tool you are looking for => http://pwmt.org/projects/zathura/
For Ubuntu and Arch Linux, just use the package management tools apt-get install zathura or pacman -S zathura to install.
To view PDF in CLI/Terminals, just run zathura /path/to
NOTE: zathura depends on x11 client libraries, it cannot run without them. So if you ssh to a remote host and run zathura on it, you'll have to do X11 Forwarding (which means you need to run a X Server - Ubuntu Desktop will do).
Answer: One can use less PDFFILE.pdf, which shows the text of the pdf. It requires pdftotext from xpdf. I think it works pretty well for pdf's with a lot of text.
Also if you want to be able to see the actual pdf  file (in low quality) you can use the fbi, the linux framebuffer imageviewer.
sudo fbi PDFFILE.pdf

Small problem is that it needs root privileges.

Command line PDF reader


Install door trim where the door frame isn't exactly parallel to the drywall

Question: I have an interior door where for whatever reason, the surface of the drywall isn't exactly parallel to the surface of the door frame.  If I put the trim on the drywall, the trim and the door frame meet at the top, but there's a gap (probably 1/8" or so) at the bottom. I could leave the gap, but it would look ugly.  I could put spackle in the gap, but it would look ugly and probably fall out over time.  How do I put the trim on so that there's no gap?
Comment: Proper way is to figure if door frame or wall is out of plumb and adjust.  Usually want door frame plumb if nothing else.  If door is working right(part way open it stays in place,no gaps at door stops), easy way is to use a wood shim to match difference of spacing.  Wood trim just might bend enough to hide 1/8 difference, if thin.
Comment: I measured, and the door is out of plumb (although it works fine.)  The "wood" (it's actually an engineered wood 1x4) won't bend, so shimming won't work either.  I thought about a long filler, but ripping a piece of wood that long and that thin is an exercise of frustration (or worse.)  I could take the door our and plumb it, but that seems like a lot of work for this project.
Comment: Should not be that much work really.  Pop off the door stop in the centre and can then remove that side, move so it matches the wall.  Most doors only attached to wall with a few nails and use the door stops to hide them.
Answer: Decorator's caulk. Masks a myriad sins.
[Try living in an old Victorian house & be glad the top of the doorframe isn't itself at 10° off square ;) The doors here are mainly parallelograms.
Comment: Yes agreed, use paintable caulk (acrylic based with or without silicone) not spackle. 1/8in is really nothing to worry about.
Comment: That's good idea.  I also live in an old house where nothing is plumb, level, square or evenly spaced.  The door in question though is in an outbuilding which is modern.


Just found my SD card was corrupted.

Question: Just found my SD card is corrupted.  My internal memory is almost full so was checking to see if it was going to the SD card yet and saw that it was corrupted.   Bought a new SD card. Now what do I do?  Can I just transfer the same memory into the new one?
Comment: Yes..you should
Answer: Why did you decide it is corrupted? When my phone can't read my SD card I usually do the following.

Insert the corrupted card in PC and blindly copy its content in some HD directory. I usually specify option ignore errors. It may cause issues with some files, but usually it is recoverable
I format the corrupted card with option check media for errors. If it got formatted with only few or no errors, I usually reuse it. Otherwise I take a new card
I copy all copied content from hard drive back to the new or old recovered card
I return the card back in the phone and usually it continues working as before

Note that SD card usually holds only certain number of rewrites, therefore if you do writing a lot, then a new card will be always a better solution.

Just found my SD card was corrupted.


Non-minimal coupling of the gauge fields to the matter

Question: Does any one know the physical meaning of the following gauge invariant gauge coupling to the spinors?  $$\bar \psi F_{\mu \nu} [\gamma^\mu, \gamma^\nu] \psi$$ This coupling is not minimal, as $$\bar \psi(\partial_\mu + ig A_\mu) \psi$$
Comment: That's not a renormalizable coupling, in 4d.  You'll see such terms in effective field theories, but generally only when you're fairly close to the scale where they cease to be effective..
Answer: First, note that Your term is implicitly contained in an expression for the on-shell process $e \gamma\to e$ at tree level (with momenta $p, q \equiv p - k,k$ correspondingly), where $\gamma$ formally corresponds to external field $A_{\mu}$:
$$
\tag 1 M_{e\gamma\to e} \sim \bar{u}(p)\gamma_{\mu}u(k)A^{\mu}(q) \equiv \bar{u}(p)\left(\frac{(p+k)_{\mu}}{2m_{e}} - \frac{i\sigma_{\mu\nu}}{2m}(p-k)^{\nu}\right)u(k)A^{\mu}(q)
$$
Here $u$ is called spinor polarization vector, and $\sigma_{\mu\nu} \equiv \frac{i}{2}[\gamma_{\mu},\gamma_{\nu}]$. We see, that Your term is the second summand of $(1)$.
Second, note that loop corrections to process $e\gamma \to e$ generate form-factors $F_{1}((p-k)^2)$ and $F_{2}((p-k)^{2})$ near the first and the second summand in $(1)$. The second one comes explicitly, when we introduce effective interaction $~\sim\bar{\psi}[\gamma_{\mu},\gamma_{\nu}]\psi$ in the lagrangian, which is precisely Your term. Thus Your term brings no new fundamental effects, just corrections to known tree-level effects.
So, let's assume the physical sense of Your coupling by treating the second summand in $(1)$. Below I'll use the representation of gamma-matrices, for which
$$
\gamma_{\mu} \equiv \begin{pmatrix} 0 & \sigma_{\mu} \\ \tilde{\sigma}_{\mu} & 0\end{pmatrix}, \quad \sigma_{\mu} = (1,\sigma), \quad \tilde{\sigma}_{\mu} = (1,-\sigma)
$$
First, it is very attractive to study non-relativistic approximation, where $s$-th polarization $u_{s}$ (with $\epsilon_{s}$ being spin up down eigenvectors) is
$$
\tag 2 u_{s}(p)\approx \begin{pmatrix}\sqrt{\sigma \cdot p}\epsilon_{s} \\ \sqrt{\tilde{\sigma} \cdot p}\epsilon_{s}\end{pmatrix} \approx \begin{pmatrix}\sqrt{m_{e}}\left(1-\frac{\mathbf q\cdot \mathbf \sigma}{4m_{e}}\right)\epsilon_{s} \\ \sqrt{m_{e}}\left(1+\frac{\mathbf q\cdot \mathbf \sigma}{4m_{e}}\right)\epsilon_{s} \end{pmatrix},
$$
$$
\tag 3 u_{s}(k)\approx \begin{pmatrix}\sqrt{\sigma \cdot k}\epsilon_{s} \\ \sqrt{\tilde{\sigma} \cdot\mathbf p}\epsilon_{s}\end{pmatrix} \approx \begin{pmatrix}\sqrt{m_{e}}\left(1+\frac{\mathbf q\cdot \mathbf \sigma}{4m_{e}}\right)\epsilon_{s} \\ \sqrt{m_{e}}\left(1-\frac{\mathbf q\cdot \mathbf \sigma}{4m_{e}}\right)\epsilon_{s} \end{pmatrix}
$$
Second, it's convenient to divide $\sigma_{\mu\nu}(p-k)^{\nu}A^{\mu}$ term on two parts:
$$
\tag 4 i\sigma_{\mu\nu}q^{\nu}A^{\mu}(q) = \alpha_{i}E_{i}+\Sigma_{i}B_{i},
$$
where $\alpha_{i}=\gamma_{0}\gamma_{i}$ is called velocity, while $\Sigma_{i} \equiv \frac{1}{2}[\gamma_{i},\gamma_{j}]$ is the spin operator.
It is not hard to obtain by using $(2)-(4)$, that
$$
\bar{u}(p)i\sigma_{\mu\nu}F^{\mu\nu}(q)u(k)\simeq \text{const}_{1}(\bar{S}\cdot \mathbf B) + \text{const}_{2}([\bar{S}\times \mathbf q] \cdot \mathbf E (\mathbf q)),
$$
where
$$
\bar{S} \equiv \epsilon^{\dagger}\frac{\sigma}{2} \epsilon
$$
The first summand corresponds to spin magnetic moment interaction with magnetic field, while the second summand is called spin-orbit interaction.
In conclusion, Your summand generates radiative corrections to spin-orbit coupling and magnetic moment coupling.


How does this soil moisture sensor work?

Question: I found information on how a capacitance moisture sensor works, but I couldn't find any information on how the following sensor works. What is the theory behind this sensor?
Answer: As it requires no battery it looks like it measures the conductivity of the soil at three depths by creating a simple electric 'cell' from two dissimilar metals (inner wire and outer core)- probably copper/iron.  If all three layers are wet the output will be maximum and the meter reading will be high.
Comment: To measure conductivity between two electrodes, why would the electrodes need to be dissimilar metals? Are you suggesting a galvanic or electrolytic cell implementation, perhaps, rather than a conductivity sensing mechanism?
Comment: @ Anindo - Yes , perhaps a poor choice of word on my part. The liquid (water) present will form the electrolyte (a conductive fluid) between the dissimilar electrodes and complete the cell. See http://en.wikipedia.org/wiki/Lemon_battery
Comment: Yep, That's what I was suggesting: A galvanic cell, such as the lemon battery. Anyway, that's what I put down in my answer subsequently :-)
Answer: A likely mechanism for the operation of the sensor is by creating a Galvanic Cell battery out of the probe electrodes, with the moisture in the soil acting as the electrolyte / "salt-bridge".
From the Wikipedia page referenced above:

The "sensor probe" would consist of two dissimilar metals such as Zinc and Copper, which @JimDearden correctly surmises in his answer.
However, the actual current flow due to Galvanic redox reactions is what would create the energy to deflect the needle of the sensor, rather than conductivity of the moist soil alone. The moisture here works merely as an electrolytic medium for the electrochemical reaction.
This sensor would fail if used in distilled or otherwise very pure water, or moisture containing no dissolved salts / electrolytes.


Current Research Being Done on Hall Effect Thrusters

Question: It seems like electric propulsion will be the most viable candidate for current and future interplanetary missions. However, I was wondering what type of research is currently being done on Hall Effect thrusters in particular, and what the current limitations of such systems are (besides their low levels of thrust which are unfortunately inherent to all EP devices). It seems like a lot of work is being done on limiting erosion rates along channel/anode walls since operation times need to be extended into thousands of hours, and am I correct in thinking that the development of accurate numerical models is also an active part of current research as well? I'd love to hear of anything else being done.
Comment: A search of NASA's Technical Reports server for 'Hall effect thruster' reveals 2,695 documents. The most recent 10 docs were published in the last couple of years.  http://ntrs.nasa.gov/search.jsp
Answer: You are correct; channel erosion rate is a big area of research.
There is a substantial amount of research into upping the power level of EP thrusters so that the trajectories won't take as long. I have heard that when Hall thruster reach 700 kWatt power levels, an EP trajectory to Mars will be faster than a Hohman transfer to Mars.
https://news.umich.edu/thruster-for-mars-mission-breaks-records/
Generating initial guesses for EP trajectories for the initial step in optimization routines is also an active area of research. Shape based optimizers have been getting a lot of attention recently.  https://arc.aiaa.org/doi/10.2514/1.G000144


Pull-back of algebraic cycles under holomorphic maps

Question: Let $f:X \to Y$ be a holomorphic map between two smooth complex projective manifolds. Is there a good notion of pull-back of algebraic cycles by $f$ which preserves degree in the following sense: Suppose $V_1, V_2$ be two cycles in $Y$ with the same Hilbert polynomial and suppose $f^{-1}(V_i)$ are algebraic varieties. Then will the pull-backs of $V_i$ by $f$ have the same dimension and degree (as algebraic cycles)? A small comparison with the divisor case is as follows: As far as I understand that pull-back of line bundles preserves degree in the sense as above. By identifying Picard group with the divisor class group we have a similar statement as above.
Comment: @Sawin: I understand this fact. I meant that the ratio of the degrees of the pull-back of two line bundles with the same degree is $1$. That is what I try to explain in the beginning.
Comment: Pull-back of line bundles, say on curves, does not preserve the degree. Instead, it multiplies the degree of the line bundles by the degree of the map. Is that what you want? The Hilbert polynomial depends on the projective embedding, specifically through the line bundle $\mathcal O(1)$. Do you want $F^* \mathcal O(1)=\mathcal O(1)$? Something else?
Answer: Yes, as long as $f^* \mathcal O(1)$ is a rational mutliple of $\mathcal O(1)$. However, we will preserve not the dimension, but the codimension, as suggested by the case of divisors. We use the standard notion of pullback of cycles in algebraic geometry (e.g. Hartshorne appendix $A$). This behaves well with respect to the intersection pairing, so $f^* A \cdot  f^* B = f^*( A \cdot B)$.
Next recall that the degree of a cycle $V$ of dimension $d$ is just $V \cdot H^d$, where $H$ is the hyperplance class. Assume $H_Y = q f^* H_X$, and let $k$ be the relative dimension of $f$. Then the pullback of $V$ has dimension $k+d$, so
$f^* V \cdot H_X^{k+d} = f^* V_1 \cdot H_X^d \cdot H_X^k = q^d f^* V_1 \cdot f^* H_Y^d  \cdot H_X^k= q^d f^* (V_1 \cdot H_Y^d) \cdot H_X^k$
but $V_1 \cdot H_Y^d$ is just the class of $n$ points, where $n$ is the degree of $V$, so the degree of $f^* V$ is the degree of $V$ times $q^d f^* (pt) \cdot H_X^k$.


How to connect 4" PVC to broken sewer line?

Question: I have a piece of broken cast iron pipe with almost no overhang. Wondering what are my options here?
Comment: Does this answer your question? [How best to cut & tie into cast iron pipe](https://diy.stackexchange.com/questions/79264/how-best-to-cut-tie-into-cast-iron-pipe)
Comment: What is this to? Toilet flange? Drain? 2 pipes connecting together?
Comment: 'rubber donut insert' ... and an angle grinder.
Answer: I know that plastic convertors exist(ed) as the plumber used one for us...
You would need to remove material aound the pipe to provide sufficient connection.
I am not aware if they make an internal plastic version - but that would mean cleaning and sealing the internal surface which tends to be in worse condition that the outside...
Answer: A Fernco (brand-name often used as a generic term) coupling is the standard approach, and you'd need to open up some space around the pipe to attach one. Otherwise you're going to need to dig outside and replace that section of pipe through the wall.

Not associated, though I may have to buy a couple to solve a problem on my plumbing.
The "sheilded" variant adds a layer of metal to make the assembly more rigid and may be worth the additional cost.
Answer: Unfortunately there was no easy way to fix it.
As a result, I had to dig outside, cut the cast iron outside (rented a tool at home depot) and then used rubber coupling to connect one to another

How to connect 4” PVC to broken sewer line?


Does linux kill heavy and long running background processes after they reach some threshold?

Question: If I start a really heavy (memory/cpu intensive) running really long running process will the OS terminate it after a period of time arbitrarily?
I.e. are there any limits beyond which the OS would stop a background process from running?
Are these limits configurable? Where are they defined?
Comment: I don't know the rest but if your process consumes more memory than available, then it gets killed by the kernel with SIGKILL and dmesg shows out of memory message. I think CPU consumption should not be any problem, if you write a program with enough infinite loops on threads like while(1){}, it consumes the CPU quite heavily but I never experienced that the process was killed.
Answer: Yes, there are such limits. They are called resource limits (rlimits). There are more then dozen different limits. For CPU time, for memory, for number of opened files etc.
Kernel sends different signals to process, when process exceeds different limits. If process does not react properly, it will get killed.
For each rlimit there are two values. First one is current limit. Second one is maximal limit (which is maximal limit you can set). Only root (more precisely user with CAP_SYS_RESOURCE capability) allowed to increase maximal limit or set current limit greater than maximal limit.
There are getrlimit() and setrlimit() system calls to manipulate limits.
By default, most resource limits contain huge value, meaning no limits. Of course, real limits exist due to kernel design restrictions, available RAM, available space on disk etc.
Comment: It should be clarified that the "limits" regarding CPU time and memory usage are not by default defined -- i.e., if you haven't set them, then there are no such limits.
Comment: All the limits have default values. For most of them, including CPU and memory, these values are very huge numbers.
Comment: That "very large" default value is just the biggest number representable with a `rlim_t`, which is an (32-bit) integer type in the `struct rlimit` used by `getrlimit`.  If you actually read the man page: *The value RLIM_INFINITY denotes no limit on a resource*.  RLIM_INFINITY is -1 signed or 4294967295 unsigned -- all bits set.  That's the "very large" value you get for RLIMIT_CPU and memory stats like RLIMIT_AS, RLIMIT_DATA, and RLIMIT_RSS.  I'll flesh this out and add it to my answer so you can try it yourself ;)
Comment: Actually they are 64-bit types here, although that may vary system to system.
Answer: There are various ways to implement such a policy, but there is a fairly obvious reason why it does not exist by default in the first place: because the system is intended to be used to its maximum potential.  By analogy: if you bought a car that could do 200 kph and it had a 100 litre tank, you probably would not want it controlled by software that limited the speed to 100 kph and stopped the car when the tank was 2/3 empty, even if you'd been driving "for a long time".
Note there is no universal definition of "long-running".  Is 40 minutes long running?  How about 8 hours?  24 hours? 3 days? A week, a month, or a year?  None of those are that unusual.
With regard to the resource limits mentioned by rasen, this is a primary means by which you can "implement such a policy".  You did not actually ask how to do that, so I will not waste time going into depth, however, you did ask about the limits.  With regard to CPU and memory, there aren't any. This is from the getrlimit/setrlimit system call man page:

The  getrlimit()  and  setrlimit() system calls get and set resource limits respectively.  Each resource has an associated soft
  and hard limit, as defined by the rlimit structure [...] The value
  RLIM_INFINITY denotes no limit on a resource (both in the structure
  returned by getrlimit() and in the structure passed to setrlimit()).

So it is relatively easy to check this programmatically:
#include <stdio.h>
#include <sys/resource.h>
#include <errno.h>
#include <string.h>
#include <stdint.h>

int main (void) {
    struct rlimit rl;
    int resources[] = {
        RLIMIT_CPU,
        RLIMIT_DATA,
        RLIMIT_AS,
        RLIMIT_RSS
    };
    char labels[][16] = { "CPU", "Data", "Virtual", "Resident" };
    int rlen = sizeof(resources) / sizeof(int);
    printf("RLIM_INFINITY is %lu\n", (uint64_t)RLIM_INFINITY);
    for (int i = 0; i < rlen; i++) {
        if (getrlimit(resources[i], &rl) != 0) {
            fprintf(stderr,"!!%s\n", strerror(errno));
            return -1;
        }
        printf("%8s soft: %lu hard: %lu\n",
            labels[i],
            (uint64_t)rl.rlim_cur,
            (uint64_t)rl.rlim_max
        );
    }
    return 0;
}

You can compile that gcc -std=gnu99 and try it yourself.  This is the most definitive source of information, since it queries the kernel directly. Unless someone has intentionally configured limits on your system, you'll get something like:
RLIM_INFINITY is 18446744073709551615
     CPU soft: 18446744073709551615 hard: 18446744073709551615
    Data soft: 18446744073709551615 hard: 18446744073709551615
 Virtual soft: 18446744073709551615 hard: 18446744073709551615
Resident soft: 18446744073709551615 hard: 18446744073709551615

To clarify for non-programmers: the "RLIM_INFINITY" value is a value intended to indicate "infinity" or no limit (since computers cannot represent infinity as a number).  The RLIMIT fields are explained in the man page, to summarize:

RLIMIT_CPU: CPU  time limit in seconds.
RLIMIT_DATA: The  maximum  size  of the process's data segment
  (initialized data, uninitialized data, and heap).
RLIMIT_AS: The maximum size of the process's virtual memory (address
  space) in bytes.
RLIMIT_RSS: Specifies the limit (in pages) of the process's resident
  set (the number of virtual pages resident in RAM).

They correspond to actual usage values you can see in top (CPU, DATA, VIRT, and RSS).
Again: on a normal linux system, there is no per process limit on cpu or memory, but you can set such.


Social context of Buddhist rituals

Question: I have a couple of questions about Buddhism rituals. Were Buddhism's rituals performed by a certain social class, or for a particular political end? Also what else was happening in the culture at the time the ritual was created or performed? Did Buddhism's rituals serve to bolster the political interest of the status quo?
Comment: To maybe clarify the question slightly, do you have an example or a definition of what is and/or is not "a ritual"? Is it the same thing as a "rite" or "ceremony"? Does ordination and/or any other act count as a "rite" and/or a ritual? Is there anything that isn't a ritual?
Comment: Second question, are you interested in any specific country and/or historical period? Buddhism has been in Asia for more than two millennia now. In some places it is or was more-or-less the state religion, at least the established religion, and at other times and places in history it isn't/wasn't.
Comment: Are you looking for an answer like, "Yes, during the last 2500 years the following social classes performed Buddhist rituals: ..." followed by an incredibly long list? Or looking for an answer like, "No, the practice of Buddhism is in some ways meant to be classless"?
Comment: Do we have a "homework" tag yet? ;)
Comment: Also I think it can be difficult to ascribe motive: for example if a king is involved in a public ritual, is that for a "political end" (e.g. to gain favour with people) or is it for some more private/personal/religious motive of the king's? And how can one tell the difference?
Answer: In a sense, this series of questions is probably too broad to be answered in this format. Given Buddhism's 2,558 year history, it's rich and varied traditions, and it's spread throughout Asia and much of the world outside of Asia, Buddhism's history is not homogeneous. It's been adopted by many different cultures and each of those cultures adds it's own flavor to it's practice of Buddhism.
But there are some things that can be said. Unlike Hinduism, the prevalent religion in the region when Buddhism originated, a follower of the Buddha's teachings did not need to be born into any particular class or caste to be ordained or to be considered a teacher or leader. So the answer to your question about Buddhism's rituals being performed by a certain social class is, no.
A section of the Dhammapada called "Brahmanavagga: The Holy Man" reinforces this in quotes such as:

Not by matted hair, nor by lineage, nor by birth does one become a holy man. But he in whom truth and righteousness exist — he is pure, he is a holy man.

and

I do not call him a holy man because of his lineage or high-born mother. If he is full of impeding attachments, he is just a supercilious man. But who is free from impediments and clinging — him do I call a holy man.

Perhaps the most universal Buddhist rituals are Taking Refuge in the Buddha, the Dhamma and the Sangha. Also accepting a number of precepts, 5 for ordinary lay people, 8 for more serious or dedicated lay people, serious meditators, and ordinary lay people on an Uposatha day and hundreds of precepts for ordained men and women. Taking refuge and precepts might be considered a ritual in the sense that they are often stated aloud in a group; although these are equally valid when done privately. The fact that both of these "rituals" can be done privately without any connection to a religious institution or particular type of religious leader would seem to indicate no connection to furthering political ends or interests.
I think anything else that would be considered a ritual in Buddhism is more related to the particular culture practicing it; a cultural overlay if you will. In fact, in Buddhism, release from adherence to rites and rituals is one of the hallmarks of a person who has reached a particular level of attainment. From Wikipedia's page on Sotāpanna:

Clinging to rites and rituals - Eradication of the view that one becomes pure simply through performing rituals (animal sacrifices, ablutions, chanting, etc.) or adhering to rigid moralism or relying on a god for non-causal delivery (issara nimmāna). Rites and rituals now function more to obscure, than to support the right view of the sotāpanna's now opened dharma eye. The sotāpanna realizes that deliverance can be won only through the practice of the Noble Eightfold Path. It is the elimination of the notion that there are miracles, or shortcuts.

Social context of Buddhist rituals


Correct license for header only library

Question: I want to distribute a header only library and I think that the spirit of the LPGL license is very much what I want. In particular, however, I want that a 3rd party that uses my library and modifies it, shares these changes. Does the LGPL license, and if so which versions, cover this requirement?
Answer: No free licence can require that someone who modifies your library share those changes; see eg this answer for more discussion of that issue.
What LGPLv3 will do for you is require that if anyone modifies your library, and they distribute the modified library either on its own or as part of an executable program (proprietary or otherwise), they must make the source of the modified library available to those downstream recipients, and they must license it under LGPLv3, or GPLv3, when they do so (LGPLv3 s2).
The practical upshot of this is that the changes they make end up being available to the community, and if they're LGPLv3-licensed, you'll be able to incorporate them back into your library.
Will that suffice?
Comment: LGPL also requires the user can replace the library with their own modified version. For a header-only library, this likely means the user must have part of the program's source code.
Comment: (or not: see https://opensource.stackexchange.com/questions/10980/is-lgpl-ok-for-mostly-header-only-library )

Correct license for header only library


showing translation of the related node in view

Question: I have a node type called Match. Each match have two entity reference fields that points to  two nodes that has the type of Team. I built a view and use the relationship to show the matches and the information of the host team and guest team and it's fine.
My problem is that the Team node is multilingual and I want to show the translation of Team fields in the view. It is obvious that the fields has a reference to the original untranslated node ID and when I use the relationship in the view it will grab that node even if it has translations.
Answer: You can use the Translation redirect module (part of the Internationalization module) if your users are anonymous (unauthenticated). It just issues a 301 redirect whenever translated content exists.
If your users are logged in then there is another approach I have used, use an URL alias for your nodes. Set the alias to be the same for all translated content of a node and when linking to that node use the URL alias instead of the node number.
Comment: I think translation redirect works on a node , I'm using a view and having a field. I didn't totally get your second solution , should I use the URL alias in the entity reference field?
Comment: What is the value of `Field Language` in your view ? If it's `Current language` or `User's language` and your fields provide a translation, it should work right away.


Using pirated copy of old windows versions

Question: Is it still illegal for US citizens to install a pirated copy of Windows XP or Vista on their machines, considering those windows have reached end of life? Could one get arrested for that? Thanks for any feedback.
Comment: I think this question is off topic on Super User. Generally speaking, yes, it is illegal until the copyright expires (this is a long time away) or Microsoft relinquishes the copyright. The support life cycle is entirely unrelated.
Comment: It is even illegal to install windows 95 without a license. I wanted to say Windows 3.11, but I then remembered that they didn't use license keys back then. You owned the software or not.
Comment: I would recommend to get a valid licence, for example on ebay, the cost almost nothing and you will be on the save side.
Answer: Yes.
Microsoft holds the copyright and they have not relented on this issue.
Is it illegal to pirate a 1979 movie, even though it's old? Yes.
Comment: @K7AAY, I know that you have the best of intentions, but it may be wise to avoid posting answers to a question that is rather obviously off-topic.
Comment: I would've referenced to Windows 95, not an old movie, but yeah... same thing.
Comment: maybe yes, maybe no, it depends...  for who ever is interested in reading up on it, here's a [start](https://www.copyright.gov/help/faq/faq-duration.html)
Comment: Your point is taken so the answer is amended.
Comment: https://superuser.com/help/on-topic suggests it's in bounds. "Super User is for computer enthusiasts and power users. If you have a question about  ... computer software, and and it is not about …
programming and software development,
video games or consoles,
websites or web services like Facebook, Twitter, and WordPress,
electronic devices, media players, cell phones or smart phones, except insofar as they interface with your computer,
issues specific to corporate IT support and networks,
asking for a product, service or learning material recommendation,
Comment: The consensus opinion is that it is off-topic, including the perspective of the moderator who placed the question on hold.
Comment: @Run5k, guess you are not available.


Adding EPSG:7019 (GRS 1980) to PostGIS

Question: I have been trying to add the ESPG:7019 to my postGIS DB using INSERT into spatial_ref_sys (srid, auth_name, auth_srid, proj4text, srtext). I am trying to find the right definition to use inside this function. I tried espg.io and spatialreference.org and but can't find the definition. Some answers suggest that it's because GRS 1980 (EPSG:7019) is just an ellipsoid and not an real CRS. But how can we have an ESPG code for an ellipsoid? Also,select distinct ST_SRID(geom) from mytable returns 7019 in PostGIS -so it has to be one of the recognised CRS. So where can I find the right PostGIS deifnition?
Comment: All objects in the EPSG geodetic database have an ID: units, ellipsoids, coordinate operation methods, etc.
Answer: GRS 1980 is defined by two measurements:
Semi-major axis = 6378137
Inverse flattening = 298.257222101
With this, you've defined an ellipsoid, but you do not have a coordinate system. Where is Europe on this ellipsoid? North America? That is why you need a datum. The datum aligns the actual Earth onto this mathematical construct.
Once a datum is in place with the ellipsoid, you can use degrees or other angular measurements to pinpoint locations that are along the surface (given a Prime Meridian) and that is the basis for a Geographic Coordinate Reference System. (GeoCRS or GCRS)
Bottom line is that you can't use just an ellipsoid since they are abstract concepts and (in of itself) not tied to the Earth.
Comment: If you could also add why GRS 1980 still has `espg` code assigned to it (Refer mkennedy's comment) then this becomes a complete answer to my question for me to accept.

Adding EPSG:7019 (GRS 1980) to PostGIS


Diameter of any galaxy

Question: I've been trying to figure out how to find the diameter in kpc of any galaxy given that one knows the distance to it in Mpc (d) and also the angular diameter/size (A) in arcsec. I had a formula before to find the diameter of a planet: $D=\frac{2\pi dA}{360degrees}$ but this is only if the celestial object is round. Then I asked my friend who gave me another formula $D=d*10^6 *sin (\frac{A}{3600})$
My question is, is the second formula the correct one if I want to find the diameter of any galaxy no matter what shape it is or is there another one which I do not know of?
Answer: Given the angular diameter $a$ in radians and the distance $d$ in Mpc, you can get the actual diameter $D$ from:
$$D = d\tan{a}$$
Using the small angle approximation, you get:
$$D = da$$
$a$ is in radians, so to get the distance in Mpc from the angular diameter in arc seconds you'd need to convert the angle in arc seconds to the angle in radians: $a = \frac{2\pi A}{360\times3600}$, where the factor $3600$ is used to convert arc seconds to degrees, and $\frac{2\pi}{360}$ to convert from degrees to radians:
To get the diameter in kpc:
$$D = 1000\times d \frac{2\pi A}{360\times3600}$$
$$D = d \frac{\pi A}{648}$$
$$D \approx \frac{dA}{206} $$
where $d$ is in $\textrm{Mpc}$, $D$ is in $\textrm{kpc}$, and $A$ is in $\textrm{arcsec}$.
Here $D$ is the diameter for round objects (even for disk galaxies seen at an angle). If the object is not round then this would normally be the maximum diameter.
[EDIT (see answer and comments from HDE 226868)] For irregular galaxies you may also need to have more information (viewing angle) to find the real maximum diameter of the galaxy. But that information is (I think) only available for galaxies in the local group.
Answer: I'm not sure I understand the second formula (could you explain the variables?), but I do know that you can use parallax in certain situations. Parallax works by using the idea that objects appear to be in different places when you (the observer) are at different places - i.e. at different points in the Earth's orbit. This graphic gives a good description of the process.

Credit: Wikipedia.
What I think your friend is trying to get at is that if a galaxy is tilted at a certain angle, it will appear foreshortened, and it will seem smaller than it should at that distance. This could lead you to make an incorrect measurement of its angular diameter and therefore an incorrect measurement of its actual diameter. You could correct this using trigonometry if you knew just at what angle the galaxy was tilted, but it would be hard to measure that angle. You could avoid this whole dilemma if the galaxy was perfectly circular, because you would always see the longer side even if it was foreshortened, but that could be an invalid assumption.
By the way, the reason this isn't a problem with ideal, perfectly spherical objects is that they are perfectly spherical and cannot appear foreshortened.
Comment: But is foreshortening not 'just' an optical illusion? If you use instrumentation to measure the angular diameter, this should not be a problem?
Comment: @Dieudonne I thought it *was* just an optical illusion. It depends on the viewer's perspective, right?
Comment: You're right, it depends on the user's perspective. I guess foreshortening might be an issue for irregular galaxies although I'm not sure how this is related to the equation in the question?
Comment: @Dieudonne It's not related to the equation; I was trying to explain why the original formula would not work in all cases. Your answer better addresses the question, though.

Diameter of any galaxy


Create quads from vertices

Question: I drew these vertices over a shape to copy it. I want to make faces out of these vertices. I am now manually clicking 4 vertices at a time and then fill them by pressing F.
Is there a faster way to do this?
Comment: use C to circle-select, then color a group of 4 at a time, so you don't have to click each vertex.
Answer: Proportional Edit Saves Time

The image above shows using a sphere as a starting point for mesh.
If its educational for you to draw vertices one by one then so be it.  No one can argue with that. Or can they?
The model does not appear to be an organic model or face model subject to high levels of inspection.   Also I am assuming a bowl shape with a drape is above.  Below a plane with moderate vertex density created in a few seconds with edit mode Subdivide.
If you choose to take a different approach I suggest you use
Proportional Editing.  That term can be searched here at BSE.

The image above shows edit mode proportional edit. The arrow shows the proportional edit button with tool tip.
There are many completed introductory videos on the famous video website that rhymes with noonoob. Video may serve you better. This writing is not a tutorial. You may also want to include shape keys. One could could also used a hemisphere as a starting mesh rather than a plane.  No artistry here. Just a technical suggestion.  Of course there are plenty of other ways to  achieve a similar mesh model.
Once you have practiced a few times with proportional edit you may recreate your model in 8 minutes or less.
Tutorial Link
https://www.youtube.com/watch?v=MrNVVHdKd3E
I suggest seeing many of these videos and especially one on Shrink Wrap or Cloth Simulation.
Answer: Firstly, as atomic's answer has suggested, placing vertices on a surface to copy it is perhaps not the most economical way  .. look up some sources on retopology in Blender.
However, since we're here,  one quicker way to do what you're doing is:

select all the vertices along a row, in order, from end to end.
hit J to create an edge loop along them
Bridge the edge loops you have. (CtrlE for the edge menu > 'Bridge Edge Loops')

Create quads from vertices


Which is faster, PRF based on AES-CTR and PRF based on BLAKE{2,3}?

Question: Recently Blake3 has been announced, which can be used as PRF.
I'm wondering which PRF is faster, namely PRF based on Blake3 or the one based on AES-CTR?
Comment: About what platform(s) are we talking about here? About how much data are we talking? Is the key largely fixed or often-changing? Also intuitively Blake3 should be slower because it's designed to be a collision-resistant hash (which cannot be built from OWFs) whereas AES-CTR is "just" an encryption scheme (which can be built from OWFs so is "easier" in principle).
Answer: As @SEJPM pointed out above, there's no one answer to this question. Everything varies based on what hardware you've got and what the length of your input is. As a first step, I'd start by looking at SUPERCOP performance measurements. You can find AES-CTR measurements at https://bench.cr.yp.to/results-stream.html, and BLAKE3 measurements at https://bench.cr.yp.to/results-hash.html. There's an enormous amount of data in both pages, because there's a lot of different hardware to consider. (And of course, lots of stream ciphers and hash functions to measure.)


What kinds of attacks would be missed if we don't look at both host and network activity

Question: Suppose I have both network based IDS and host based IDS installed in my environment, will I miss any security attacks if I don't correlate the information from these sources? If so, what are they?
It seems that one of these systems should be able to catch any attack whenever they happen, but not sure if I am right about it.
Answer: I'll turn your question around:

"What attacks can only be detected by a combination of host and
  network data?"

And the answer to that question is: not many.
The true power of correlation of host and network data is the ability to see 'beyond' the attack to see how widespread it is and where it originated from. In other words, you correlate those two data sets in order to help you respond, not just identify.
An anti-malware detection algorithm can identify an attack on a host, but the other sources of data can provide what you need to eradicate it, not just from the host, but from your entire environment.
The wider view might be considered the 'real' attack, if that's what you meant. And, if you didn't mean that, it should be included in your consideration.
Answer: You leave out a bit of key information to consider. For example, when you say "attack" you don't mention what the target asset is running.
In the case of an HTTPS website, most IDS/IPS's don't offer the ability to upload your SSL certificates in order to decrypt the traffic in order to inspect it.
In this case, your IDS/IPS's are providing little to no protection. They can still see and prevent any attacks that are designed to be leveraged during the SSL negotiation/handshaking process but that's it.
This is where a host based agent would be beneficial (or an application firewall) as it will be able to inspect the traffic after it has been decrypted.
The ability to correlate this information comes in handy during forensic investigations, validating false positives, validating security controls (ie: The attack was stopped at the IDS and didn't make it back to the host, which can be correlated via the hosts logs)
Answer: Well it depend firstly there are two types of IDS signature based and anomaly based. Signature based IDS work pretty similar to AV you have signatures with well know attack, so the IDS monitor packets on the network and compare them against a database of signatures if the packets are meet to some signature, the IDS will alert you. The other type is anomaly based well this type of IDS collect data and store it into database, and when the IDS see something unusual  he will alert. So basicly you will always miss vulnerable places. And in my opinion there's always chance to miss attack vectors, no mater what you do.
Hope that this answers your question, if there are any misunderstanding ask in comments.
Answer: Correlation is used to reduce false positives. Intrusion Detection Systems are notorious for generating a large number of false positives due to the anomaly based detection. In case of signature based IDS the rate of false positives is reduced but the detection capability is limited to only known attacks for which the IDS has the detection signature.
If you don't correlate the information and analyze the events from both host based IDS and network based IDS individually, you won't miss any attack. However, correlating the two events will make the life of the analyst a lot easier.
Also, correlating the events will help you prioritize the detected attacks. For example, an attack pattern for Windows XP operating system detected by the NIDS will generate an alert on the NIDS interface. However, if the destination IP is a Linux box, you don't need to be alarmed because the attack is bound to fail.
The bottom line is, if you want to reduce the false positive rate and ensure that only those events are detected and acted upon by the analyst which have a high chance of true positive, correlate the events from HIDS and NIDS.


What's the simplest way to backup my WordPress database?

Question: I have WordPress installed on my server for my blog. I back up all the files from the server on a schedule. But this is just the files--not the database. Ideally, I'd like to automatically save a database dump on the server periodically so that it gets backed up along with all the files. What's the simplest way to do this?
Answer: There is a plugin called WP-DB-Backup http://wordpress.org/extend/plugins/wp-db-backup/
You can configure it to email you a backup of your blog at a specific interval.
Answer: There are several back-up plugins. The simplest procedure is for the back-up to include the xml export file as then it can easily be imported into another WordPress installation.
One plug-in that does this is BackWPup (http://wordpress.org/extend/plugins/backwpup/). You can set it to email you a back-up at regular intervals. It is highly customizable.
Plug-ins that return only the SQL file are more difficult to restore as you have to go via phpMyadmin rather than simply through a WP backend.
Answer: There is also a service, Backupify, www.backupify.com that provides backup services for wordpress.
Answer: BackWPup http://wordpress.org/extend/plugins/backwpup/ will run on a cron job to backup just the database and/or wp-content or any other folders and files.
If you have access to any FTP accounts (or amazon S3 bucket, etc.) other than where your site is, the plugin can also send the files there; very good for security to have a completely separate place for your backups.
Answer: You can install a plugin name duplicator It will allow you to backup all your files as well as database from admin panel
Answer: Maybe not the simplest, but other way to do it is with wp-cli, if you have SSH access to the server:
http://wp-cli.org/commands/db/export/
And you can do a cron file to fire and schedule your wp command from the server.
Answer: Plugins are not reliable for backup, in my opinion, because should your site fail to function, there is no way to use the restore feature of your plugin.
If you have cPanel on your host server, there is a simple tool in the Backup section which allows you to "Doownload a MySQL Database" as a compressed .sql.gz file.
Backup MySQL database via cPanel
If you don't have cPanel, you can do this through phpMyAdmin.

Select the WordPress database you wish to back up.

Click the "Export" tab.
Choose the "Quick" export method and click go.

You can check the "Custom" options if you think you may want to change anything, such as adding compression.
Export MySQL database via phpMyAdmin
Both of these options have a simple restore/import feature and can restore compressed databases of they in the same compression format used during the export process.


Unattended rsync and remote command

Question: I am trying to write a script that compiles an executable, runs rsync to copy it to a remote server, and then opens an ssh session into the server and dispatches the executable to the grid engine.
In other words, I want a script that does the following:
1. (locally) compile
2. rsync local to remote
3. (remotely) run command to dispatch

The issue I have is that compiling the executable takes a lot of time, and right now my simple bash script will first compile, then prompt my password for the rsync and again for the SSH command.
Is there a way to somehow prompt my password once, prior to the compilation step? We are not allowed to use SSH keys for security reasons.
Answer: Sure, use sshpass:
read -s -p "Password: " SSHPASS
# compile
rsync -e "sshpass -e ssh" ...
sshpass -e ssh <foo> rm -rf /

Arguably worse security than using keys.

Unattended rsync and remote command


Verse in ramanyan when Sita warns Ravan to dare not touch her

Question: What is the verse when Sita warns Ravan of touching her in Lanka
Comment: Sita was abducted by Ravana,  on lifting her up with his left hand at her plait of hair at nape, and with his right hand at her thighs (Aranya kanda 3-49-17).  So he did touch her.  Sita only warned him in Lanka that she can reduce him to ashes with austerity power.
Comment: @srimannarayanakv That looks like an answer to me.
Answer: This is what Sita says to Ravana -

तथा अहम् धर्म नित्यस्य धर्म पत्नी दृढ व्रता |
  त्वया संप्रष्टुम् न शक्या अहम् राक्षसाधम पापिना || ३-५६-१९

raakshasa adhama = oh, demon, basely; tathaa = likewise - on par with Rama; dharma nityasya = in righteousness, one who steadied himself; dharma patnii = legitimate, wife; dR^iDha vrataa = solemnly, pledged [wife]; aham = such as I am; paapinaa tvayaa sampraSTum = by a trespasser, by you, to touch; aham na shakyaa = I am, not, possible - impossible.

"Likewise, I am the solemnly pledged legitimate wife of one who steadied himself in righteousness, and such as I am, you basely demon, it is impossible for you trespasser to touch me even. [3-56-19]

PS: I could not find this verse in the critical edition, though.
Comment: The OP was asking of her statement in Lanka, but not in Forest. :-)@I will close your question
Comment: @srimannarayanakv This incident occurs in Lanka only. It is present in Aranya kanda, but occurs in Lanka, after kidnapping of Sita.
Comment: Please check.  It was stated by Sita before abduction.(3-47-37) https://valmikiramayan.net/utf8/aranya/sarga47/aranya_47_frame.htm
Comment: @srimannarayanakv Your quote is interesting, but the one I quoted is 3.56.19, which occurs after the abduction, in Lanka.
Comment: If he was not able to touch Sita, how could he lifted her at the time of abduction?;-) @I will close your question
Comment: Actually before abduction she was saying so, in continuation of her statement that had Sri Rama was present, he cannot do so. @I will close your question
Comment: @srimannarayanakv I stopped thinking logically. OP wanted verse stating such and such and that is what I provided.
Answer: Sita was abducted by Ravana, on lifting her up with his left hand at her plait of hair at nape, and with his right hand at her thighs.   So he did touch her during abduction.

इति उक्त्वा मैथिलीम् वाक्यम् प्रिय अर्हाम् प्रिय वादिनीम् || ३-४९-१५
  अभिगम्य सुदुष्ट आत्मा राक्षसः काम मोहितः | जग्राह रावणः सीताम् बुधः खे
  रोहिणीम् इव || ३-४९-१६
On saying that sentence to Maithili, who by herself is a nice talker
  and who is a proper one for addressing with nice words, that verily
  evil-minded demon Ravana maddened by lust drew nigh of Seetha and
  grabbed her, as Budha, the Jupiter grabs the Star Rohini in firmament.
वामेन सीताम् पद्माक्षीम् मूर्धजेषु करेण सः | ऊर्वोः तु दक्षिणेन एव
  परिजग्राह पाणिना || ३-४९-१७
He that Ravana grabbed the lotus-eyed Seetha on lifting her up with
  his left hand at her plait of hair at nape, and with his right hand at
  her thighs.

However,  Sita did warn him in Lanka (Sundara Kanda) that she can reduce him to ashes with austerity power.

असंदेशात्तु रामस्य तपसश्चामपालनात् | न त्वां कुर्मि दशग्रीव भस्म
  भर्मार्ह तेजसा || ५-२२-२०
"O Ravana! Although you are suited to be burnt into ashes, not having
  the mandate of Rama and preserving austerity, I am not reducing you
  into ashes with my glory."


How to retain the most data for editing?

Question: I have started a bit of astrophotography, an important part of which is the editing of the image to bring out stars etc not even visible after a ~40 second exposure. To do this the image must retain as much data as possible - what are the best kinds of setting/procedures to achieve this?
Comment: Can you elaborate on this? What are your current settings and setup? What do you mean by "retain as much data as possible"?
Answer: Light pollution is the biggest challenge when it comes to Astrophotography, optimum exposure and retaining as much detail and information possible.
Therefore, my first advise, that is only if you are not already doing this, is to seek out a dark sky. There are apps and websites that will help you locate areas closest to you.
This alone will help increase detail quite considerably.
The next step, taking into account that the Camera is set to RAW and turned to manual mode, I would suggest, is to use a exposure method called ETTR or Exposure To The Right.
This method uses overexposure to get the highest dynamic range by capturing the maximum amount of light.
When you view this data via the Histogram, the graph will show the data pushed to the right. in other words, looking from the left, it will be fairly flat for the first
50/60% of the Histogram and there will be a sudden elevation which will reach the top of the chart with 10/20% of the histogram left and continue off the chart to the right.
It is here, in the latter half of the histogram where the data resides that you need to bring to fruition in Lightroom.
An Example of an ETTR Exposure will be 30 Seconds shutter with an aperture of f/2.8 and ISO of 3200/6400 -
The high ISO is a key to the extra detail and will make a significant difference to the final image which will have great detail, show less luminance noise, less colour noise and appear cleaner and smoother than if taken on a slower ISO of say 1600 or 800 with a faster shutter speed of say 15 seconds and appears to be more pleasing straight from the camera.
The reason for this is due to it having a higher signal to noise ratio, and even though the initial RAW file looks completely overexposed and unusable, it has in fact captured more usable Data that can now be used in Lightroom to bring out the details in the stars and the gases of the Milky way.
Such an image when first viewed in Lightroom will look over exposed and very washed out, even if has been taken from a very dark sky and away from light pollution.
The next stage is to work in Lightroom to bring out the details without blowing out any highlights and keeping the sky as dark as possible reducing the original Orange tint from the ETTR exposure.
My personal work flow is to bring down the exposure first whilst increasing contrast, but ensuring that there is a balance between the stars, Planets, gases, Milky way and the dark sky.
The next stage is to alter the White Balance to get rid of the orange cast.
If there is any light pollution from the ground, say a nearby city, then I use a Gradient filter to correct the light spillage.
To summaries, ETTR will capture greater dynamic range, detail and image data with a higher signal to noise ratio than would a normal exposure. You can then make optimal use of this data in Lightroom to bring down the exposure, increasing contrast and reducing any orange cast to bring out the desired detailed effect
Answer: The first and most important thing is to shoot in RAW.
Next, you need to make sure that you are not losing anything in the RAW conversion process. This could happen in two ways. First, low values could be clipped at 0 by a "black level" setting. The second and much more subtle is that faint detail could be lost to noise reduction. I'm not talking about the NR applied by an explicit setting in the RAW converter, but that applied by the demosaicing algorithm itself. Yes, a RAW conversion algorithm can apply noise reduction. For this reason I would favor an open source RAW converter such as RawTherapee, or at least a RAW converter that uses an open source demosaicing algorithm.
There are tons of sites that cover astrophotography out there. One that I would recommend (while not solely about astrophotography, it has tons of other interesting articles) is www.clarkvision.com .
Comment: If you do use proprietary RAW convertors offered by the camera manufacturers keep this in mind: some Nikon models are known as "star eaters" for the way they eliminate very weak stars during the noise reduction process. Canon, on the other hand, leaves more of the noise in by default and leaves it to the user to decide how much they wish to clean it up.


Usage of definite article

Question: "The new laws are seen as an attempt to gag the press."
In this sentence why the definite article 'the' is used before 'laws'(noun). I always get confused when to use 'the' and when not to. My teacher taught me, it is used when both speaker and listener are aware of what they are talking about i.e. both of them are familiar with that(noun). Can someone please clarify this?
I have a feeling that I should've used 'the' before 'speaker' and 'listener' in the above sentence. Am I right?
Comment: Your first sentence cannot be the first mention of the topic in general (if not the new laws themselves); there is some context missing that informs this usage of the definite article here. Without prior discourse, the question can't really be further addressed. // Using 'the' before 'speaker' and 'listener' is optional here, but should be balanced (not just one article). // Learning all the subtleties associated with article usage takes a lifetime. For instance,...
Comment: 'My teacher taught me that it is used when both speaker and listener are aware of what they are talking about' uses the null article (twice) (after Masters), not the zero article. Not many people know that.
Answer: To me, the context supplies the shared familiarity. In other words, there were "old" laws but "new" ones have appeared and their newness makes them specific and separates them out from the general category of "laws" so that both reader and writer know which laws are being discussed.
It's this separating out a countable noun from a larger more general category, which seems central to using the definite article, or at least that is what I have read, as I have labored over how to teach this aspect of English.
But the previous poster is correct, there are endless subtleties associated with  learning how to use articles in English

Usage of definite article


How to implement a secured download system?

Question: What's the best way to implement a download system?
It needs to be integrated with an asp.net application.
I need the following features:

Deliver files larger than 50mb
Only users authorized by an asp.net login page can download
Need to know if the user downloaded the whole file, or part of it
Once the file is downloaded or canceled, the same url will not be available again

It's something similar to rapidshare I believe, but integrated with an asp.net application.
What would you guys suggest?
thanks!
Answer: What if you hosted the files on a lighttpd server running modsecdownload, and used your asp.net app to generate the secure urls to the files on that server?
That approach should handle items 1,2 and 4.
Not sure how you could tell from the server side that the download was completed successfully, maybe have some logic that parses the server logs?
Comment: lighty is awesome. It's ridiculously fast and lightweight.
Answer: You could also use nginx and its X-Accel-Redirect feature. It's simple, and nginx is even more ridiculously fast and lightweight than lighttpd. A common setup at least in the Ruby and Python web world is to run nginx in front of lighttpd or Apache. nginx serves all static media and proxies dynamic request to the web server behind it.


Hide the built-in Send button in Outlook 2003

Question: I am using ms-outlook 2003, i want to hide the built-in send button and use the custom button to send the mail.
As i have worked on C,C++ and on Java, dont know how to work on VB/VBScript/VBA, can any body tell me how to hide this button and also how to send mail from custom button, how to access the fields of mail (ie., the TO field, Subject field, Msg Body, attachment etc).
Comment: What are you trying to achieve? There may be a better way.
Answer: If you want to do this you have to get a reference to the button via its ID. Then you can control it properties such as enable / disable it.
VB
<code>Set oCommandBars = Item.GetInspector.CommandBars
Set oStandardBar = oCommandBars("Standard")

Counter = 1

For Counter = 1 To oStandardBar.Controls.Count
    If oStandardBar.Controls(Counter).ID = "1975" Then
        oStandardBar.Controls(Counter).Enabled = False
        Exit For
    End If
Next
</code>
But as Lazarus say's there are many ways to skin a cat so may be a little more explanation would help, are you doing this in and Addin or via Automation etc?


Big theta of summation

Question: I had a quick question with which I am not sure how to get started. I've done some time complexity stuff that involves big-oh, omega and theta notation but nothing with sums.
Here is the question: $$ f(n) = \sum_{k=1}^n {k^{3}\over2^{k}} $$
Prove that $$ f(n) = \Theta(1) $$
Any tips, advice or answers to similar questions would be appreciated. Thanks.
Answer: Here is a hands-on approach: for every positive $x$, $x\lt2^x$ hence $x\lt4\cdot2^{x/4}$, which implies that $x^3\lt64\cdot2^{3x/4}$. Thus, $f(n)\leqslant64\sum\limits_{k\geqslant1}2^{-k/4}\lt64/(1-2^{-1/4})$, which is finite. Now, the assertion $f(n)=\Theta(1)$ simply means that the sequence $(f(n))_n$ is bounded, hence we are done.
More generally, for every $|r|\lt1$ and every $a$, $\sum\limits_{k\geqslant1}k^ar^k$ converges.
Answer: First note that it is sufficient to prove that $f(n) \in \mathcal{O}(1)$, since $f(n)$ is trivially in $\mathcal{\Omega}(n)$. Next note that
$$\sum_{k=1}^n k^3 x^k < \sum_{k=1}^{\infty} k^3x^k = S(x) \,\,\,\,\,\,\,\,\, \forall x \in (0,1)$$
Hence, if we prove that $S(x) \in \mathcal{O}_x(1)$, we are done, where $\mathcal{O}_x(1)$ indicates that the constant depends on $x$.
Recall that
$$\sum_{k=1}^{\infty} x^k =  \dfrac{x}{1-x} = \dfrac1{1-x} - 1$$
Differentiating term by term, with $x \in (0,1)$, we get that
$$\sum_{k=1}^{\infty} kx^{k-1} = \dfrac1{(x-1)^2} \implies \sum_{k=1}^{\infty} kx^{k} = \dfrac{x}{(x-1)^2} = \dfrac1{x-1} + \dfrac1{(x-1)^2}$$
Again differentiating term by term we get that
$$\sum_{k=1}^{\infty} k^2x^{k-1} = -\dfrac1{(x-1)^2} - \dfrac2{(x-1)^3}$$
Hence,
$$\sum_{k=1}^{\infty} k^2x^{k} = -\dfrac{x}{(x-1)^2} - \dfrac{2x}{(x-1)^3} = -\dfrac1{x-1} - \dfrac3{(x-1)^2} - \dfrac2{(x-1)^3}$$
Differentiate this again to get that
$$\sum_{k=1}^{\infty}k^3 x^{k-1} = \dfrac1{(x-1)^2} + \dfrac6{(x-1)^3} + \dfrac6{(x-1)^4}$$
Hence,
$$\sum_{k=1}^{\infty}k^3 x^{k} = \dfrac{x}{(x-1)^2} + \dfrac{6x}{(x-1)^3} + \dfrac{6x}{(x-1)^4} \in \mathcal{O}_x(1) \,\,\,\,\,\, \forall x \in (0,1)$$
Take $x= \dfrac12$ to get what you want.

Big theta of summation


How to get a windows close/minimize buttons in top GNOME panel?

Question: I want to get any application's close/minimize button in top gnome-panel. Please note that my top gnome-panel also has global-menu applet. Is there any app which can do that?
Answer: You can the gnome panel window applets.
<code>sudo add-apt-repository ppa:tsbarnes/misc
sudo apt-get update
sudo apt-get install gnome-window-applets
</code>
Once installed you will see two new panel applets. Window title and window buttons. Place them anywhere on the panel.
Comment: I tried it. But its not removing the title bar of the application. Basically, my top gnome-panel is in auto-hide mode. And whenever I open an application, the title bar of the app should not be there. Instead, it should be in the gnome-panel. I hope i am clear. There is a compiz setting which can remove the title bar, but I need it in my gnome-panel.
Comment: @user12016: see the Window Applets options. Because that's exactly what WIndow Applets does...
Comment: Agree with windows applets. But how do I make the title-bar of an application disappear, since I already have it in my gnome-panel now ?
Answer: The solution is to make the "Decoration Windows" in "Window decorations" inside CCSM blank and use Windows applets.
Thanks Andrew from Webupd8.
Answer: You can remove the titlebar using the tips in http://ubuntuforums.org/showthread.php?t=1077662&page=2
I used the steps in modifying the theme xml file.
Comment: Could you please copy those steps into your answer?
Answer: Well, Its 2012 and Ubuntu 12.04 was released recently. Gnome windows applets also was recently updated to support Gnome 3. It is highly customisable now and it even can hide compiz decorations for maximised windows. A must have for any netbook and people who are looking to save vertical space.
Right now it only works for Gnome 3 classic/fallback version

Install fallback version (sudo apt-get install gnome-fallback-version)
sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install gnome-window-applets

Thanks to Andrei of Webupd8.


How to make this saturated text effect?

Question:
This is a popular effect on YouTube. Anyone know how to do it
Comment: How is the text more saturated? It's just lighter. At the very least, it's _less_ saturated than the background. Also, would it be too much to ask to show some effort, like what you've tried and what didn't work? Or at least a question mark behind your question?
Answer: I don't know if it works like Photoshop but it should, anyway, you have to "play" with the text layer blending mode until you find the right one to produce that kind of effect. You could try "Overlay" or "Vivid Light" which should give you that result.
You can also visit the Adobe support page if you want more information about blending modes in After Effects. Heres the link:
https://helpx.adobe.com/after-effects/using/blending-modes-layer-styles.html
Comment: This answer has the essential. It works like in PS.  Except there are more available blending modes in AE. You can have for example grey text with blending mode Linear Dodge (=Add) . The lighter text, the more white is the result. Maybe you noticed that the 1 is partially erased or masked off.
Answer:
First add the text you want
Then add an adjustment layer between the text and your footage
Apply the contrast and brightness effect to the adjustement layer and turn the brightness down
Then on the adjustment layer adjust the alpha matte drop down box so that the whole clip is dark apart from where the text is

How to make this saturated text effect?


Change default desktop manager

Question: I'm kind of new into Linux world.
I'm using a Debian distro. I want to switch the default desktop manager into Awesome, and I want to boot straight to the command line, and from there start Awesome.
How can I do that?
Thanks :)
Answer: You want to change what's started in the default runlevel.  You can find that with runlevel; it's probably 2 (you'll see N 2 -- in any case it's the last number).
Assuming it's 2, now ls /etc/rc2.d (or rc3.d, etc.).  Everything in there is a symlink with a prefix S[N] or K[N] where N is a number between 1 and 99.  Somewhere in that list you'll see (most likely) S[N]gdm, or possibly S[N]lightdm or S[N]xdm.  Something ending in dm (for display manager).  Double check by reading the comments in the top of this file; there should be a Short Description including mention of "display manager".
When you are sure what it is (e.g., below assuming gdm):
update-rc.d gdm disable 2
update-rc.d gdm stop 50 2

The last command is optional; it just makes sure gdm is stopped if you happen to change runlevels from something else.  If you use it, you should now see K50gdm instead of S[N]gdm in /etc/rc2.d.  If not (i.e., you just used "disable"), you won't see any listing for gdm at all in that directory.
Reboot to make sure that worked.  You should end up at the command line.
To use awesome, create a file $HOME/.xinit:
#!/bin/sh

awesome

Make that executable (chmod a+x .xinit), and run startx.
Answer: After having disabled gdm for the runlevel 2 (additionnal informations here), the file that you have to create in your home directory (/home/your_username) is .xinitrc and not .xinit
#!/bin/sh
exec awesome

You can find a lot of informations on .xinitrc here.
Then the startx command will launch awesome Wm

Change default desktop manager


Convert existing Wordpress Site (with several plugins) into Multisite

Question: I want to convert an existing Wordpress Site into a Multisite. I have several
plugins installed. Is there a special preperation needed to get this plugins safely into the multisite mode?
Do I have to follow a special workflow.
Comment: As far as I know it won't break anything but it is hard to say how each plugin will react on MU.
Answer: You can always read through the documentation that WordPress.org has put together on Creating A Network.
The point below was taken from Step 1:

"Also deactivate all active plugins. You can reactivate them again
  after the network is created."

After the network is created I recommend activating your Plugins one by one and testing your site each time you have activated one
Site note: Also make sure you backup your database before you even start doing anything with MultiSite
Best of luck :)
Answer: Obviously there are steps. And you have to choose whether you want to go with subdomain or subfolder (and under certain condition you can overwrite your own choice upon the default).
I found a nice step-by-step guide to WordPress Multisite Helpful is:

The Complete Guide To Creating A WordPress Multisite Installation by Kevin Muldoon

It has a good tail with Fallback too - that tells how to fallback to a single site from a Multisite, that's nice. :) (BTW, don't rely on that, take backup of everything(file+database) before proceeding to multisite)

BTW, WordPress Multisite is a different concept. But everything will go nice by default if the thing is made WordPress-specific. If the thing is done by other means, without knowing how WordPress handles sites on Multisite, thing can go wrong.
So, for plugins, you have to know which one works on multisite, which one not. You can find the information on their plugin pages, or support forums. If you can't find, ask them about it. In my case I's using Redirection plugin and on switching to multisite, I found it won't work on multisite. So I made my own for temporary purposes. But it's buggy (I'm warning you :) ).
Mutisite is a different experience. You can obviously make a try on development environment at least. :)


Star gazing from the bottom of a well

Question: I have read that it is a myth that you can see stars in daylight if you stood at the bottom of a well, however, if you stood at the bottom of a well at night, or built a long non-reflective tube and pointed it to the sky, would you be able to see more stars through the tube in a light polluted area?
Answer: The stars are almost point-like light sources with a full width half maximum (FWHM) angular extent of 1-3 arcseconds, caused by atmospheric turbulence, depending on the quality of your viewing site. The well-adjusted human eye has a best angular resolution of only about 15 arcseconds. (Which can be estimated as $\lambda/D$ in radians, where $\lambda$ is $\sim 500$ nm and $D \sim 8$ mm is the diameter of the pupil.
Thus when you look at a star, its light is spread on your retina to occupy the same area as a patch of sky that is of order $100$ times the surface area.
Given that the daylight sky has a brightness of around 3 mag per square arcsecond (depending on how near the Sun you look and time of day etc.) then you can understand, just from a signal-to-noise pint of view, that the signal coming from the sky totally overwhelms even bright stars.
This calculation isn't going to be changed by looking at the sky from the bottom of a well.
The only way you could see stars during the daytime is to increase the angular resolving power of the eye by a factor of 10 or so, or better still, look through an 8 cm telescope, since that is exactly what a telescope does in addition to gathering more light.
Answer: I have not heard of this myth, but you can find it on Snopes:
https://www.snopes.com/fact-check/star-search/
Based on the discussion there, I would think that yes, you might be able to see more stars through a tube. You would be blocking some light sources, particularly local ones (depending on the size of the tube), but as discussed in the Snopes post, most of the skyglow would still be present. Like the daytime case, I doubt the effect would be significant enough for you to actually notice. Perhaps, if you knew a particular star was just below the level of your local observation conditions, you migth be able to increase the chance of observing that particular star with a long enough tube. However, I don't think the experiment is really worth performing.

Star gazing from the bottom of a well