Service 'tomcat7' is missing the ImageFile

Question: I am trying to run the Tomcat as a service on and Windows server.  If I run tomcat7.exe in the bin directory, I get the error "Service 'tomcat7' is missing the ImageFile".  If I run startup.bat, tomcat opens in a new window and works just fine.  Any ideas?  Thanks.
Answer: I had the same problem, and could find a workaround. I don't know if it will work for you, though, since the OS is different (Windows Server 2008).
Steps:

First delete the tomcat service with "bin\tomcat7.exe //DS/Tomcat7".
Now, disable UAC.
Install the Tomcat service again with the command "bin\service.bat install"
Start the service.
If you want (and probably will), enable UAC again.

Since I successfully installed and started the Tomcat service, I did not need to disable UAC again.
The advice to disable UAC is present Tomcat 7 documentation, located at "http://tomcat.apache.org/tomcat-7.0-doc/windows-service-howto.html"


What is the bending moment formula for continuously supported beam of equal span?

Question: Is there a standard chart in Eurocode for the maximum and minimum bending moment in uniformly loaded beam for indeterminate structures where we can use directly? Many textbooks give different coefficient values for the moment for continuous beam, some wl2/10, some 0.046wl2. I know that hogging and sagging moment are different. Is there an authoritative reference for this?
Comment: Which moment? The maximum positive moment along the span (which isn't at midspan)? The moment at midspan? The negative moment at the central support? And for what load? A uniformly distributed load along the entire beam?
Comment: I'll add an analytical answer tomorrow.
Answer: A continuous beam with two spans with uniformly distributed load looks like this:

This is symmetric, and we know by inspection that the rotation of the beam at the central support will be null. So let's make our lives a bit easier and only look at the right half of the beam, considering the central support as fixed. Obviously, this is only possible because the beam and its loading is symmetric.

This beam is still statically indeterminate, however. But let's get rid of the rightmost support for now:

This is an isostatic structure we can trivially solve. However, the deflection at the extremity will obviously be non-null, which isn't correct for our true condition. Let's calculate what that deflection would be, using the fundamental beam equation:
$$\frac{\text{d}^2}{\text{d}x^2}\left(EI\frac{\text{d}^2w}{\text{d}x^2}\right) = q$$
which tells us that the fourth derivative of the deflection is equal to the applied load.
So, integrating the applied load we get the shear force:
$$\begin{gather}
Q = \int\limits_0^L q\text{d}x = qx + C_1 \\
Q(0) = C_1 = -qL \\
\therefore Q = qx - qL
\end{gather}$$
Integrating the shear force we get the bending moment:
$$\begin{gather}
M = \int\limits_0^L (qx - qL)\text{d}x = \frac{qx^2}{2} - qLx + C_2 \\
M(0) = C_2 = \frac{qL^2}{2} \\
\therefore M = \frac{qx^2}{2} - qLx + \frac{qL^2}{2}
\end{gather}$$
Integrating the bending moment we get the curvature times the stiffness:
$$\begin{gather}
EI\theta = \int\limits_0^L \left(\frac{qx^2}{2} - qLx + \frac{qL^2}{2}\right)\text{d}x = \frac{qx^3}{6} - \frac{qLx^2}{2} + \frac{qL^2x}{2} + C_3 \\
\theta(0) = C_3 = 0 \\
\therefore EI\theta = \frac{qx^3}{6} - \frac{qLx^2}{2} + \frac{qL^2x}{2}
\end{gather}$$
Integrating the curvature we get the deflection:
$$\begin{gather}
EI\delta = \int\limits_0^L \left(\frac{qx^3}{6} - \frac{qLx^2}{2} + \frac{qL^2x}{2}\right)\text{d}x = \frac{qx^4}{24} - \frac{qLx^3}{6} + \frac{qL^2x^2}{4} + C_4 \\
\delta(0) = C_4 = 0 \\
\therefore EI\delta = \frac{qx^4}{24} - \frac{qLx^3}{6} + \frac{qL^2x^2}{4}
\end{gather}$$
Therefore, at the end of the cantilever the deflection is
$$\begin{align}
EI\delta(L) &= \frac{qL^4}{24} - \frac{qL^4}{6} + \frac{qL^4}{4} \\
\delta(L) &= \frac{qL^4}{8EI}
\end{align}$$
So, in order to regain compatibility with our true condition, we need to bring that deflection down to zero. That's done by the vertical reaction force of the rightmost support. So let's replace that support with a concentrated vertical force and calculate the deflection caused by that force:
$$\begin{gather}
Q = \int\limits_0^L 0\text{d}x = C_1 \\
Q(0) = C_1 = -P \\
\therefore Q = -P \\
M = \int\limits_0^L -P\text{d}x = -Px + C_2 \\
M(0) = C_2 = PL \\
\therefore M = -Px + PL \\
\theta = \int\limits_0^L (-Px + PL)\text{d}x = \frac{-Px^2}{2} + PLx + C_3 \\
\theta(0) = C_3 = 0 \\
\therefore EI\theta = \frac{-Px^2}{2} + PLx \\
\delta = \int\limits_0^L \left(\frac{-Px^2}{2} + PLx\right)\text{d}x = \frac{-Px^3}{6} + \frac{PLx^2}{2} + C_4 \\
\delta(0) = C_4 = 0 \\
\therefore EI\delta = \frac{-Px^3}{6} + \frac{PLx^2}{2} \\
\delta(L) = \frac{PL^3}{3EI}
\end{gather}$$
So now, we can calculate the necessary force to counteract the deflection at the rightmost extremity:
$$\begin{gather}
\frac{PL^3}{3EI} = -\frac{qL^4}{8EI} \\
\therefore P = -\frac{3qL}{8}
\end{gather}$$
So, looking at the component equations for the bending moment from the uniform load and the reaction force, we can add them together to get the final bending moment equation for the span:
$$\begin{align}
M &= \frac{qx^2}{2} - qLx + \frac{qL^2}{2} - Px + PL \\
M &= \frac{qx^2}{2} - qLx + \frac{qL^2}{2} - \left(\frac{-3qL}{8}\right)x + \left(\frac{-3qL}{8}\right)L \\
M &= \frac{qx^2}{2} - \left(qL - \frac{3qL}{8}\right)x - \frac{3qL^2}{8} + \frac{qL^2}{2} \\
M &= q\left(\frac{x^2}{2} - \frac{5Lx}{8} + \frac{L^2}{8}\right)
\end{align}$$
The minimum moment is found at the central support and is equal to
$$M(0) = \frac{qL^2}{8}$$
The maximum moment is trickier, since it isn't necessarily at midspan. First we need to calculate the moment's derivative zero to find its position:
$$\begin{align}
M' &= q\left(x - \frac{5L}{8}\right) = 0 \\
\therefore x &= \frac{5L}{8} \\
\therefore M_{max} &= M\left(\frac{5L}{8}\right) \\
&= q\left(\frac{\left(\dfrac{5L}{8}\right)^2}{2} - \frac{5L\left(\dfrac{5L}{8}\right)}{8} + \frac{L^2}{8}\right) \\
&= -\frac{9qL^2}{128} \approx -\frac{qL^2}{14.2}\\
\end{align}$$
That approximation is a classic numerical shortcut for the maximum moment on a fixed-and-pinned beam. And obviously all my results assume that $q > 0$ points upwards. So all the loads in the beams at the start of my answer have $q = -1\text{ kN/m}$. If you prefer to think of such loads as positive, just flip the sign in my results.
And then, to confirm our results, here is a beam with $L=5\text{ m}$ (per span) and $q=128\text{ kN/m}$. The equations give us
$$\begin{align}
M_{min} &= \frac{qL^2}{8} = -400\text{ kNm}\\
M_{max} &= -\frac{9qL^2}{128} = 225\text{ kNm}\\
\end{align}$$
Answer: I would suggest Timoshenko, Strength of Materials is an authoritative reference (used in the UK ...) : This is found on the www, and also, copies can be found in second-hand bookshops but even then they are not cheap...
Link removed to avoid "link rot"...
Comment: Dude, you don't have to remove the link. Just put the actual information from the link on your answer *along with* the link.
Comment: So as to avoid link-rot, please expand your answer to include the relevant information from the link provided, at least the most essential points. Feel free to quote directly from the source.
Comment: @wasabi I gave an answer to the very last question posed by the O P - "Is there an authoritative reference for this?" Surely answering that question with the information , of arguably one of the most eminent sources, is correct and not, as you say "link rot".
Comment: [Link rot](https://en.wikipedia.org/wiki/Link_rot) is the link breaking because of a change of URL. It has nothing to do with the quality of the information contained in the link. If the link rots, your answer becomes useless for future readers. Which is why it is best practice to quote the relevant parts of the source as well as offer the source itself, if available. Then the link might rot, but the relevant information will still be in your answer.


Why C language is taught as the basis of Computer Programming Languages?

Question: I often wondered why C Language is taught as the basis of programming languages everywhere. There are a lot of modern languages like Java, Python etc. which makes the syntax and programming easier. Why are we still holding the C Language up in the front as the basics of programming languages?
Comment: http://www.joelonsoftware.com/articles/CollegeAdvice.html
Comment: What do you mean exactly by "the basis of programming languages"?
Answer: It's not taught as the basis of Programming Languages. It's taught as the basis of how the machine works.
A programming language displays some facade to the programmer. Some abstraction. In functional languages it is functions. In logic languages it is logic. In OOP languages it is objects. In C it is the machine.
C, while hiding away the implementation details of the hardware on which it runs (register names, memory management, etc), gives the user the impression it deals with a machine. A computer. This gives students better appreciation of how the computer works. Some universities don't see "how the computer works" a necessary knowledge (it isn't), so they don't teach C.
Comment: Those universities *should* teach C. They should also teach more about databases and transaction processing principles.
Comment: @Craig As a placement student who started work 7 months ago for a year, there's a lot they should teach. I've learned more in the past 7 months than I've learned in the past two years at Uni so far.
Comment: @Niccolo All very valid points you put up. But isn't it very generally true for all programming languages? I think you can add why C is *better at abstracting...* than other modern mid level to high level languages.
Comment: @Gaurav Ramanan: No, it's not generally true to say that programing languages in general want to present the user with some abstraction of a machine. For example, when you use Haskell you "forget" about the machine. Prolog too is an example. But you do have valid points in that (1) many mainstream languages nowadays aren't very original and inherit the "there's a machine underneath" model, and (2) programmers often need to think of efficiency and can't quite escape the "there's a machine underneath" fact.
Answer: Basically C is Every Programming Language minus the Frills.
For someone new to the world of Programming concepts like Polymorphism, Event Driven programming, Object Oriented Programming just don't make any sense.
Remember that for a long time Computer Science existed inside Mathematics until the hardware technology was brought to the world. So now, you need a way for people to instruct the computer to achieve a certain objective. Most introductory level courses start by teaching how to implement a simple algorithm (like a Fibonacci Sequence or Factorial or whatever) as a computer program. You start with things like loops, conditions, functions, arguments etc. Instead of Interfaces, Classes, Singletons etc.
Things like Object oriented programming, Closures etc are a way to manage your code and architect your software application. Its the loops, conditions and arithemetic that actually do the real work! C is really good at teaching these things helped by the fact that There is a small, fixed number of keywords.
Less Language Learning, more Language Using.
When you learn C you automatically learn other languages.
C has been the inspiration for many many programming languages that have similar syntax. Personally I came from C to JavaScript and I felt right at home. According to Wikipedia

C influenced  AMPL, AWK, csh, C++, C--, C#, Objective-C, BitC, D, Go,
Rust, Java, JavaScript, Limbo, LPC, Perl, PHP, Pike, Processing,
Python, Seed7, Verilog (HDL)!

When one tries Java / PHP / JavaScript / C++ after C, they just learn some new concepts like OOPS, Closures (or forget some like static typing) and don't re learn loops, conditionals etc.
C is still in rampant use today.
C is used for System Programming, Developing OSes, Developing Servers, Databases, even Browsers and Virtual Machines.
C is blazzzingly fast!
The world's most performant Servers are written in C.
Statistical, Mathematical and other Computationally intensive environments are written in C. The GNU Multi-Precision Library, the GNU Scientific Library, Mathematica, R language and MATLAB are completely or partially written in C
C has been used to actually make (not just influence) more languages.
You can find parsers for almost any language in C. The primary implementations of Python (CPython), Perl 5, R and PHP are all written in C!
C is almost exclusive for writing Device Drivers.
Whether Linux, Windows or Mac there is a great demand for C Engineers in Hardware companies and Software Companies making OSes for development of device drivers.
C is almost exclusive for writing code in Embedded Environments.
All your Micro Controllers, System on a Chip, and other Embedded hardware is written either in Assembly or in C. Infact this is a reason why many Electronics majors are also taught C.
The next great language will be again based off of C.
That doesn't sound too unreasonable. C was appeared in 1972. C++ appeared 11 years later. JavaScript appeared 23 years later and C# arose 28 years later! All of them very strongly linked to C. C has withstood the test of time and there is still many more C like languages to come.
C will teach you theory and application.
Most importantly, the responsibility of an academic setup is not just just to teach you skills the industry needs, or you would need for a job but also equip you with enough theoretical and analytic skills so you can still stay relevant navigating the changes of the future.
Comment: C is a family of dialects which feature different trade-offs between the cost of providing different features or guarantees and the value to programmers of those features or guarantees.  The Standard specifies a rather anemic common core, but historically 99% of compilers have supported certain behavioral guarantees beyond those required by the Standard, and until 2009 I don't think there was any reason to believe that such guarantees would not continue to be treated as normative.  If too many students are taught that respectable compilers require `(x<> (31-y) >> 1)` rather than...
Comment: ...`(x<> (32-y))`, the days of C as a usable language will be numbered.  If students are taught that there are different dialects of C, code using features common to 99% of dialects prior to 2009 can often yield better performance than not using such features, but that writing code in clunky and hard-to-read fashion will make it compatible with hyper-modern compilers that promise to make it faster but in some cases might not be able to achieve even 2009-level performance, then the language might be able to recover from such insanity.
Answer: I wouldn't say that c is taught as "the basis of programming languages" very much, to be honest. Most introductory programming courses are in Java, with a handful in more esoteric languages (I know of universities that teach their intro to programming courses in ocaml and scheme, for example). Even before the shift to java, C wasn't a popular choice for a first language; my course taught Pascal, for example, and I believe this was reasonably common.
What C is popular for is courses on low level programing, where hardware interaction is required, and there's a good reason for that: few other languages are capable of handling that kind of job well, and C is ubiquitous in the embedded development industry.
Comment: By "esoteric" you mean "non-mainstream"?
Answer: C is often taught as the first language and often together with some other computer science course. It makes the understanding of the compsci easier and you also are closer to the hardware then Java and other languages.
Comment: This answer does not add anything beyond what has been said already.
Comment: Who exactly teaches C as a first language? I haven't come across such a course for years, now.
Comment: C is not taught as the first language rather as a introduction to programming languages


When deleting a theme, are the theme customizer settings also deleted from the database?

Question: So if I deleted a theme, then changed my mind later and decided to install the same theme again, would the customizer settings I had configured be deleted, or would they be saved so I still have them when I re-install the theme?
Answer: Short answer: No, your settings will not be deleted. They will be available next time you install the theme.
Long answer: There are 2 ways a theme can store its settings in the database: options and theme_mods. If they use options, then inside the wp_option table in the database there will probably be an option called {$theme-name} or {$theme-name}_options etc. It's up to the theme author what option name they choose.
If they use theme_mods, inside the wp_options table in your database there will be a theme_mods_{$theme-name} entry containing all the options.
When a theme gets deactivated these options are not deleted by default, and WordPress keeps them there for future use.
There is a way for themes to delete their options on deactivation (see the switch_theme action) but it's rarely used and there's no reason any theme author would use it to delete the theme settings on deactivation - unless it's a custom use-case.


OLS asymptotic results

Question: I'm trying to work through the proofs of the asymptotic distributions of OLS.  In this derivation, we make the assumptions that the observations $(y_n,\mathbf{x}_n)$ are i.i.d. and that the fourth moments exist.  The book I'm using (Ruud) says that the second-order moments of the random variables $x_{nk}x_{nj}$, $x_{nk}y_n$, and $y_n^2$ are functions of the fourth-order moments of $(y_n,\mathbf{x}_n)$.  Is this supposed to be obvious? Why is it the case that the second moments are functions of the fourth moments?
Comment: The heart of the matter is that $2\times 2=4$ and twice any nonnegative integer less than $2$ is less than $4$.
Comment: Am I just dense? For example, the variance of $x_{nk}x_{nj}$ is a second order central moment.  So $Var(x_{nk}x_{nj}) = E(x_{nk}^2x_{nj}^2) - E(x_{nk}x_{nj})^2$, which is a function of a fourth order moment and a second order moment.  Is it as simple as that?
Comment: Yes: you got it.
Answer: This comes up a lot in various contexts and therefore deserves a general answer.  The question concerns pairs of random variables, so let's simply call them $X$ and $Y$.  Think of them as the components of a bivariate random variable $(X,Y)$ with some distribution $F$.  The properties of $F$ won't matter: the following exposition is completely general.  It assumes only that any expectation that is taken actually exists and is finite.
A (raw) moment is given by powers $r$ and $s$, usually taken to be small nonnegative integers $0,1,2,\ldots$.  By definition it is
$$\mu_F(r,s) = E_F(X^rY^s).\tag{1}$$
You see, it's merely the expectation of a monomial function of $(X,Y)$.  When $s=0$, $Y^s=1$ disappears and we are left with the usual (univariate) moments,
$$\mu_F(r,0) = \mu_F(r) = E_F(X^r).$$
Let's take a little tangent to see that central moments don't introduce any real complication.
The central moments are linear combinations of the raw moments with universal coefficients (they don't depend on $F$, only on $r$ and $s$).  By definition they are
$$\mu^\prime_F(r,s) = E_F((X-\bar X)^r(Y-\bar Y)^s).\tag{2}$$
(As is usual, I have written $\mu_F(1,0) = \bar X$ for the expectation of $X$ and $\mu_F(0,1)=\bar Y$ for the expectation of $Y$.)  Ordinary algebra (the Binomial Theorem) lets us expand the right hand side of $(2)$:
$$(X-\bar X)^r(Y-\bar Y)^s = \sum_{i=0}^r\sum_{j=0}^s \binom{r}{i}\binom{s}{j}X^i  Y^j \bar X^{r-i} \bar Y^{s-j}.$$
Note the Binomial coefficients $\binom{r}{i}$ and $\binom{s}{j}$, which do not depend on $F$.  Linearity of expectation says if we take the expectation of the left hand side, it will be the combination of expectations on the right.  Bear in mind that since $\bar X$ and $\bar Y$ are numbers, they introduce no complications:
$$\eqalign{\mu^\prime_F(r,s)&=E((X-\bar X)^r(Y-\bar Y)^s) \\&= \sum_{i=0,j=0}^{r,s} \binom{r}{i}\binom{s}{j}E(X^i  Y^j)\bar X^{r-i} \bar Y^{s-j} \\&= \sum_{i=0,j=0}^{r,s} \binom{r}{i}\binom{s}{j}\mu_F(i,j)\mu_F(1,0)^{r-i}\mu_F(0,1)^{s-j}.} $$
This exhibits the central moments $\mu^\prime$ as linear combinations of the raw moments $\mu$.
Returning to the question, consider how you would go about computing, say, the variance of any monomial $X^rY^s$.  By one definition of variance (as the expected square minus the square of the expectation) and the definition of moments $(1)$, this is
$$\operatorname{Var}(X^rY^s) = E((X^rY^s)^2) - E(X^rY^s)^2 = \mu_F(2r,2s) - \mu_F(r,s)^2.$$
Nothing new appears: moments of powers of the variables are linear combinations of moments of the original variables.
It's that simple, and the generalizations to higher moments (central or not) of monomials, and to more than two variables, ought now to be obvious.

OLS asymptotic results


Problems writing a module for phpBMS

Question: I am trying to write a small, simple module for phpBMS.
I am basically modifying and simplifying one that exists, and have gotten to the stage of creating the table and pages in phpBMS itself and making the module installable.
I am now trying to create the php page that will allow for new records to be inserted into the table via phpBMS, and I get the following error:
Fatal error: Class 'guests' not found in xxx_addedit.php on line 45

The file is actually comments until line 40, so I have posted the first 9 lines, and line 45 corresponds to the 5th line
include("../../include/session.php");
include("include/tables.php");
include("include/fields.php");
include("include/menu.php");
$thetable = new xxx($db, "tbld:4e28e4bd-d4b0-1a2b-4d87-a4ddf8a54a86");
$therecord = $thetable->processAddEditPage();
if(isset($therecord["phpbmsStatus"]))
    $statusmessage = $therecord["phpbmsStatus"];
$pageTitle="xxx";

The original file I am modifying is viewable online in the source here, as well as the include files referenced.
It was my understanding that I should be able to make a new instance of the table class called whichever I like, so I am not exactly why it seems I have to define a class for each table?
Any advice here would be greatly appreciated.
Answer: Nevermind, I solved it by modifying the include file where classes are defined.

Problems writing a module for phpBMS


How can I set the day of the week as a variable in Swift?

Question: I'm making a basic iOS app and I need to return just the current day of the week as a string variable.
Answer: Assuming you need the name of the current weekday in the current locale:
let dateFormatter = NSDateFormatter()
dateFormatter.locale = NSLocale.currentLocale()
let today = NSDate()
let calendar = NSCalendar.currentCalendar()
let todayComponents = calendar.components(.CalendarUnitWeekday, fromDate: today)
let weekDayIdx = todayComponents.weekday
let weekday = dateFormatter.weekdaySymbols[weekDayIdx] as! String
println(weekday) // "Wednesday"

Answer: Here you go buddy:
    let date = NSDate()
    let calendar = NSCalendar.currentCalendar()
    let components = calendar.components(.CalendarUnitHour | .CalendarUnitMinute | .CalendarUnitMonth | .CalendarUnitYear | .CalendarUnitDay, fromDate: date)
    let hour = components.hour
    let minutes = components.minute
    let month = components.month
    let year = components.year
    let day = components.day

Answer: Welcome to Stack Overflow.
This is not a "write my code for me" site. It's a site for help with specific problems with your code that you have written.
I'll give you some suggestions:
The easiest way to do this is probably with an NSDateFormatter. Take a look at this thread (specifically the answer by Jon Shier)
Objective C - How can i get the weekday from NSDate?
It looks like you want an NSDateFormatter with the format string "EEEE":
let now = NSDate()
let formatter = NSDateFormatter()
formatter.dateFormat = "EEEE"
let weekday = formatter.stringFromDate(now)


Hibernate / JPA: Map a legacy database Not Null Foreign Key 'Dummy' value as NULL

Question: Using JPA 1.0, Hibernate 3.4*
I have to develop a JPA solution over a legacy system where foreign keys are defined as NOT NULL with a default value of -999999 (dummy value) to indicate an optional association.
Using @NotFound(action = NotFoundAction.IGNORE) from Hibernate Annotations isn't really helping, since it seems to ignore the @BatchSize annotation, hence producing thousand of single queries whenever the dummy value is encountered.
I suppose I could handle this using a Hibernate UserType but this seems quite elaborate for such a scenario, which is not that uncommon ...
Am I missing some obvious trick or default annotation here ?
Thanks
Answer: Try @Where(clause="other_id<>-999999") on the association


Python library or algorithm to generate arc geometry from three coordinate pairs?

Question: I'm trying to write code to generate fixtures for a django/geodjango project. I need to generate geometry for arcs (line string) given three lat/long pairs; start of arc, end of arc and centre of arc. I read through the geodjango documentation but this functionality doesn't seem to be available. Does anyone know if there is a Python library that provides this functionality? Or does anyone have an algorithm I can port to python? Thanks
Comment: what kind of arc: a LineString, a curve ?
Comment: Oh sorry, a line string.
Comment: If you're underlying database is postgis, it supports curves, IE ST_GeomFromText('CIRCULARSTRING(220268 150415,220227 150505,220227 150406) from http://postgis.net/docs/ST_CurveToLine.html
Comment: Thanks. I was originally using a plpgsql function that generates an arc from the three coordinate pairs. Unfortunately, we are re-designing our installer, which means the data is now written to json files instead of being loaded straight into PostGIS/PostgreSQL. So I can't use the function anymore and I have to generate the arg geometry using Python.
Answer: Shapely PyQGIS,  and  GeoDjango use the same API based on the GEOS library:
With Shapely:
with a list of points:
from shapely.geometry import Point, LineString, mapping
pt1 = Point(0,0)
pt2 = Point(20,20)
pt3 = Point (50,50)
line = LineString([pt1,pt2,pt3])
#GeoJSON format
print mapping(line)
{'type': 'LineString', 'coordinates': ((0.0, 0.0), (20.0, 20.0), (50.0, 50.0))}

or with a list of coordinates:
line = LineString([(0, 0), (20,20),(50,50)])
#GeoJSON format
print mapping(line)
{'type': 'LineString', 'coordinates': ((0.0, 0.0), (20.0, 20.0), (50.0, 50.0))}

with PyQGIS:
with a list of points:
line = QgsGeometry.fromPolyline([QgsPoint(0,0),QgsPoint(20,20),QgsPoint(50,50)])
#GeoJSON format
print line.exportToGeoJSON()
{ "type": "LineString", "coordinates": [ [0, 0], [20, 20], [50, 50] ] }

with GeoDjango (look at Django: GEOS API)
with a list of coordinates:
from django.contrib.gis.geos import LineString
line = LineString((0, 0), (20, 20), (50, 50))
# GeoJSON format
print line.json
{ "type": "LineString", "coordinates": [ [ 0.0, 0.0 ], [ 20.0, 20.0 ], [ 50.0, 50.0 ] ] }

The resulting line is made up of two segments: (0,0) to (20,20) and (20,20) to (50,50)
Comment: ""Oh sorry, a line string" -> what is an arc ? a segment of a LineString ?
Comment: Thanks but this doesn't give me an arc, it only gives me a line between three points.
Comment: I found this image after a quick search that hopefully shows what I'm after. I may be using the wrong terminology so I apologise if I'm confusing people. Refer to item "2" in this image: http://docs.autodesk.com/CIV3D/2013/ENU/images/GUID-4B5CB65D-AC29-432D-8A64-CC409B1A9B66-low.gif. The arc is comprised of multiple line segments.
Comment: In item 2, its is a polyline with three segments (look above)
Comment: two segments, sorry
Answer: Building on @gene 's answer above if you're looking to approximate a curve as a sequence of points using spline interpolation. In Python you can do this through the scipy.interpolate library. Particularly 1d interpolation.
For example
import numpy as np
import scipy.interpolate

coords = np.array([[0, 0], [25, 10], [50, 50]])

#The curve fits as a quadratic equation on three points
f = scipy.interpolate.interp1d(coords[:, 0], coords[:, 1], kind='quadratic')

#New points will be evenly distributed along x
new_x = np.linspace(np.min(coords[:, 0]), np.max(coords[:, 0]), 10)
new_y = f(new_x)

new_coords = np.vstack([new_x, new_y]).T

With a bit more work (play with shapely.interpolate) you can get a curve in segments of equal like so:
from shapely.geometry import Point, LineString, mapping

fine_x = np.linspace(np.min(coords[:, 0]), np.max(coords[:, 0]), 1000)
fine_y = f(fine_x)

fine_coords = zip(fine_x, fine_y)
fine_line = LineString(fine_coords)

even_line = LineString([
    np.array(fine_line.interpolate(i))
    for i in np.arange(0, fine_line.length, 5) #points 5 units apart
])

Comment: you can simplify: `fine_coords = zip(fine_x, fine_y)`
Comment: Thanks but I'm looking to generate segments using three coordinates; start of arc, end of arc and centre of arc.
Comment: @Stodge In which case take a look at [this answer](http://stackoverflow.com/a/11332375/379566) on Stack Overflow - it should have exactly what you're after
Comment: The result is not a LineString with three points. Otherwise   you can also use all the interpolation algorithms.
Comment: @gene Yeah. I'm now thinking Stodge is after a circular arc as generalised to a line string. After looking at it a couple of times, in the picture supplied in the comment to your solution I think the centre point of the arc is the green circle to the left of the "2"
Comment: You want to compute the midpoint of the arc ? (look at [How to find the middle point of a line in QGIS](http://gis.stackexchange.com/questions/58079/how-to-find-the-middle-point-of-a-line-in-qgis/58123#58123), it is similar with shapely)
Comment: @om_henners - yes, that's what I'm after. I humbly apologise if my question and comments are confusing.
Comment: @Stodge Not a problem at all. I'd suggest adding your code as a solution with a link to the Stack Overflow answer and marking it as correct so other users can easily find the answer in the future.


how to enable a profile to mass update records?

Question: How do I enable a profile to be able to mass update records of a specific object in Salesforce?
Comment: I don't understand question... Any profile that have access to edit/create object is able to insert/update a list of objects.
So what you want achieve?
Answer: This is all done through normal object permissions that can be set on the profile or as a permission set. It is important to remember that the user will need to have access to the records through the sharing model to be able to update them, otherwise they will not have access to those specific records. The easiest way to ensure they have access to every record of that object is to just give them Modify All access. This has several downsides to it in terms of security however so please be aware of that.
Overall, it is really just a combination of your object permissions and sharing model.


Change LUKS Passphrase Prompt

Question: How would one go about customizing the LUKS passphrase prompt when decrypting drive at system startup? I am on 16.04. Have looked into /lib/cryptsetup/cryptdisks.functions. Have also checked Plymouth. I cannot locate the output source. grep isn't helping either. I have scoured the web and have not seen any viable solutions other than recompiling from source.
Comment: It is in the initrd
Answer: It is in the initrd.img. On /scripts/local-top/cryptroot.

Change LUKS Passphrase Prompt


Rear wheel slipping out under load

Question: My commuting/cyclocross bike (a Surly Crosscheck) has a problem.
If I tighten the quick release skewer to a normal level, sort of firm to close it, then if I step on the pedals hard at some point, the rear wheel basically comes right out of the dropouts.
To keep the wheel actually in the frame, I have to cinch the quick release down hard enough that I get a bit concerned about ever opening it again. The springs get mangled.
This is a somewhat recent development and appears to be getting worse. Any ideas?
Comment: If the springs get mangled that means the skewer is assembled incorrectly.
Comment: I had this problem with anti theft skewers with pentagonal nuts. They supply them with a tiny key that is completely insufficient to tighten them adequately. Reverted to quick release and the problem was solved.
Answer: I had a similar problem on my Pugsley, though it was under braking (discs) that I was kicking the wheel around in the dropouts.
After talking with the guys at my LBS, I learned that I wasn't putting enough force into the quick release.  They said that a good, tight, clamp should leave an imprint of the lever on your palm when you close it.  It will be difficult to open, but not horrible.  This measure of tightness has served me well so far.
I would also check to ensure that your clamping surfaces are clean (get rid of any excess lube which may have seeped in there).  You can also look at the skewer itself to ensure it is a high quality skewer.  The type of clamp (I don't know if the older style even exists anymore, but I do run into them from time to time) can make a difference as well as the roughness of the clamping surface.  For a while I was using a pair of Surly Tuggnuts which have a smooth surface facing the frame which made my problem even worse.
Comment: I heard the same thing from several bike shops - the lever should leave a nice imprint in your palm once you force it shut.
Comment: I had the same problem, and the same solution worked for me.
Comment: I know the lever is shut hard enough, it's already the tightest of my bikes when I can still torque the rear wheel out. The surfaces are clean but look a bit polished. I will rough them up this weekend and see if that solves the problem.
Comment: If this is your [frame](https://surlybikes.com/uploads/bikes/geo-gusset.gif) then just by looking at it, it is obvious you will lose your rear wheel if you have disc brakes. The rear dropouts are at the wrong angle to handle disc brake torque. This is a bad design.
Answer: Are the skewers internal-cam or external-cam?
Internal-cam QR skewers have more mechanical advantage and allow for more clamping force. They're also less affected by dirt and crud. If you don't have internal-cam skewers, get some.
All you ever wanted to know about skewers, courtesy of Sheldon Brown.
Comment: As the link provides everything needed to solve the problem this is the correct answer.
Answer: I have seen this a few times where the axle is just a tad too long.  No matter how tight you clamp your QR, it won't be snug enough.  Did you buy the frame and build it up yourself?  If it is the axle, you can pop the wheel out, remove the QR and take a file to one end or the other.  Another possibility is the the wheel was built incorrectly and the axle actually needs to be moved back to center.  Are the axle lengths on either side of the lock nuts (these are the nuts that hold the cones in place on the hub) equal?
Answer: I had this same problem but i went to a bike shop and explained the situation, the bike mechanic gave me a serrated washer to be placed between the skewer and the bike frame on the cassette side. This solved the issue
Answer: I have this problem myself. Take it as a compliment from your bike--it means you're capable of putting a lot of torque/power through the rear wheel!
For me, the solution was to do what you've been doing--clamp down and take your wheel off sparingly. A better solution would be to purchase a quick release skewer with a rougher interface with the dropout. It might chew up the surface and your paint a little bit, but it will help prevent slippage.
Comment: I'd rather have paint chipping than my wheel coming off when sprinting all out.
Answer: Thanks for the great information on this thread. I'm having the same exact problem with my bike that has horizontal dropouts. I've been frustrated by the shifting rear wheel which usually happens on uphills and other inopportune moment. Even wrenching my QR super tight doesn't prevent the slipping. It's been an ongoing problem that has only been getting worse over time. After reading this thread I inspected my QR and sure enough, the cheap aluminum grips are totally worn down (see my pic below). Sheldon Brown recommends using QR with steel teeth on horizontal dropouts. I believe they also have steel inserts you can use along with aluminum QR. I'll let you know how it works out, but I'm feeling pretty confident about this fix.
https://www.sheldonbrown.com/skewers.html (scroll down to "Acorn-nut design" to see steel inserts)
Comment: I think other replies may have missed the fact that the Cross Check had (still has?) horizontal dropouts, not the more common vertical ones. I think this would have allowed riders to convert it to single speed easily. However, as you observed, you need 'older' style QRs with horizontal dropouts.
Answer: In my case, it turned out I had a broken axle.  This only became apparent after a shop offered to do a Gold Service (full strip down).  The only symptom that the axle was broken was the rear wheel slipping out of the frame.  I actually rode on a broken axle for several years!
Answer: PROBLEM SOLVED!  I got a 3/8 inch stainless lock washer (Everbilt Part
#597 618 package of 2 for 60 cents) at Home Depot.  I put one lock washer on the drive side of the rear wheel skewer.  I positioned the lock washer on the skewer between the outside clamp/nut and the spring so that when the wheel is mounted the lock washer is between the frame and the outside clamp/nut on the outside of the frame.
Apparently, the slipping can result when the ridges in the dropout get worn off or clogged with something like paint when you do a rattlecan paint job.
UPDATE: OR NOT.  I though that the lock washer had solved the problem.  Well, it worked for about a week, but now the wheel is back to rubbing again.  I have purchased an Ultegra internal cam type QR skewer to replace the weaker external cam QR skewer that came with the wheel.  Hopefully this will have enough pressure to keep the wheel in the dropout.
Comment: So is this a split washer or a crinkle washer?   I've had to use a mini triangular file on the ridges in the underside of a QR nut before.
Answer: Make sure your dropout faces, inside and out, are flat with no paint, burrs, or distortions, file if necessary. Then use the tool to adjust for parralel dropouts. Then tighten firmly. Start out in lower gear to reduce torque.
Answer: I had this problem too, I sanded down the dropouts because I saw that the someone painted them over, I actually took a nasty crash going 37mph in full sprint because my wheel came out.
I think it was the paint that shouldn't have been there.
Comment: Welcome to the site - after removing the paint from the dropout faces, did wheel retention improve in your experience?   Just trying to show if it helped or if this is an idea that wasn't tried and tested.   This is a useful answer - keep it up.   You can use the [edit] link to add more detail

Rear wheel slipping out under load


Is there a way to analyze what's using frametime or view all simulated meshes at once?

Question: I have relatively large scene in which I did some cloth simulations. I'm sure I don't have any simulation enabled (went through all visible and invisible meshes). But even without apparently nothing running, I get only 2fps. Surely there must be some simulation still running that I can't find. Is there a way to check that? Thanks in advance.
Answer: Alright, turns out using simplify solved the issue. I didn't know that the subD modifieres are such a frame eater for nonanimated objects.


Building a remote drone with a pi

Question: I am having trouble with powering my raspberry pi drone. I cant seem to find a battery small enough to let the drone fly but large enough to sustain flight for a decent amount of time. Any suggestions?
Answer: There are many remote control quadcopter, drone, etc, projects that use the Arduino family of single board computers.
Here are three links to one that has fairly detailed instructions and parts lists. You should be able to get ideas from this and other projects to help you develop your project.
http://www.diydrones.com/profiles/blogs/arduimu-quadcopter http://www.diydrones.com/profiles/blogs/arduimu-quadcopter-part-ii http://www.diydrones.com/profiles/blogs/arduimu-quadcopter-part-iii
One comment, since you say that your electronics experience is limited you may want to consider following some more simple Arduino or Pi interfacing projects such as interfacing to distance sensors.
Here's a link to some simple interfacing projects from SainSmart that helped me.
One challenge you may have is that the Raspberry Pi GPIO pins are strictly 3.3 v while many of the sensors and relays may not support.
You may also want to consider using a Raspberry Pi and Arduino in combination, with the Arduino handling all of the interfacing and the Pi doing all the CPU intensive work. There is a GertDuino board design by Gert van Loo to be an Arduino board designed specifically to interface with a Raspberry Pi.
Answer: Since its a drone, you're probably already using lithium-polymer (li-poly) batteries, and there's really nowhere you can go from there. The raspberrypi consumes quite a lot of power, and so do drones. You may have to go for a bigger drone to be able to carry bigger batteries.

Building a remote drone with a pi


Material constraint in anisotropic elasticity

Question: Consider the 2-dimensional (plane strain) case of a linear elastic general anisotropic material. Its elasticity tensor in engineering (Voigt) notation is positive definite, and looks like:
\begin{equation}
C_{ij} =
\begin{bmatrix}
c_{11} & c_{12} & c_{13}\\
c_{21} & c_{22} & c_{23}\\
c_{31} & c_{32} & c_{33}
\end{bmatrix}
\end{equation}
I was wondering if the condition $c_{11}c_{33}-c_{13}^2>0$ a consequence of the positive definiteness of $C_{ij}$ or a consequence of its ellipticity? I am not even sure there exist necessary conditions for ellipticity in the general anisotropic case.
Answer: In order for the strain energy density to be positive, the elasticity tensor has to be positive definite. According to Sylvester's criterion, a necessary condition for positive definiteness is that all of the principal minors are positive. The condition you cite follows directly from the second principal minor being positive (under an appropriate symmetry operation).


C# Can I make a namespace accessible everywhere in my dot net web site for code-behind and classes

Question: I have an extension method for String that I want to be available on every code behind and class in my solution. The method is sitting in a particular namespace. I'd like everywhere to have access to that namespace without me having to include it in every class.
I've used the "namespaces" tag in the web config to successfully include it on every aspx page, but this does not make it accessible on code behind or elsewhere.
So, is there a similar way to include a namespace everywhere?
Comment: Are you able to alter the namespace of the extension method?  If you put it in the same namespace as the code-behind files (if feasible) that would do it.
Answer:
So, is there a similar way to include a namespace everywhere?

No, I am afraid that there isn't. If you place the extension method in some of the root namespaces then it will be in scope for the child namespaces. For example:
namespace Foo
{
    public static class Extensions
    {
        public static void Go(this string value)
        {
            ...
        }
    }
}

will be in scope inside all classes declared in Foo.* namespaces. So you might put the extension method in a root namespace which has the same name as your project and then it will be available everywhere because all classes are automatically generated in child namespaces (unless you change that).
Answer: Just put you extensions class into System namespace and it will be available for every String object.
namespace System
{
    public static class Extensions
    {
        public static void M1(this string value)
        {
            ...
        }
    }
}

Answer: No, you cannot.
The namespace section of web.config only provides those namespaces to the markup, but not code-behind.
<configuration>
    <system.web>
        <pages>
            <namespaces>
                <add namespace="System.Data" />
                <add namespace="System.Text"/>
            </namespaces>
        </pages>
    </system.web>
</configuration>

You must explicitly add namespaces via the using statement in code-behind or add to one of the already included namespaces like System, but that is not recommended.
Answer: You'll have put a using statement on every code file that intends to have access to the namespace, you can't "gloabally include."
Usually, it's good form to put your various utilities, static classes, and extension classes in a "Common" project that your other projects all have a dependency on.  I've seen this pattern re-used a lot:
Using YourNameSpace.Common.Utilities;


WP 8 app runs fine under native mode debugging (Release mode) but crashes without the debugger

Question: The app in question uses both native and managed code. The managed code provides just the UI layer while it links with a native dll which performs bulk of operations. The native dll links with some other static dlls. Now the issue is when I run the app it crashes non-deterministically. When I debug the app under managed code debugging, it shows that a particular function in the native code threw an "SEH" Exception. Stack trace just shows the current function. The error code that I get in the SEH Exception is EFAIL.
However the app runs fine every time under native debugger. The function which throws the SEH exception is single threaded. It doesn't uses any resources which may be accessed in any other thread. What could be the possible cause for this behavior? How should I go about detecting the origin of the exception in native code. Stepping-in under the debugger doesn't helps since the issue doesn't shows up when the app is running under the debugger.
I am using visual studio 2012.
Answer: Are you using DirectX?
SEH Exception occurres when DeviceContext is using from many threads
at the same time, because DeviceContext isn't thread safe.


Round-robin scheduling and deadlock

Question: Does round-robin scheduling ever cause deadlock? What happens if the CPU scheduling is based on round-robin and at one point in the schedule two different processes request the same file that no process owns? Would that cause deadlock or would the file be given to the process that is supposed to execute in the next step of the schedule?
Answer: The case you describe will not cause deadlock.  Locks are atomic, so only one process can hold one at a time.  Thus, whichever process has control at the time will acquire the lock and the second process will fail.
However, in a more general case, deadlock can occur in RR scheduling.  Consider two processes and two locks.  Process A acquires lock 1 and then yields the processor to Process B.  Process B then acquires lock 2 and attempts to acquire lock 1.  Because lock 1 belongs to Process A, process B will then sleep.  Process A awakes and attempts to acquire lock 2.  Lock 2 still belongs to process B, so neither process can move forward and you have a deadlock.
Answer: rr scheduling can course deadlock.for example,if process A requests and gets a printer but exceeded its time quantum,and processB happens to have its normal cpu burst time equals to its time quantum..then its execution will be completed..then it requests for the printer which process A is still holding..while waiting at the queue tail for entry into the memory still onhold by process B..then deadlock has occured

Round-robin scheduling and deadlock


Is it possible for a rogue to get a second action/bonus action?

Question: I know all characters get one action and one bonus action, but say I want to use misty step (via the Eladrin's Fey Step racial feature) and follow through with my dual swords. I know that misty step is a bonus action, Attack 1 is an action, and Attack 2 is a bonus action (I think). I also know that you can move up to 5 feet as a free (non-normal/bonus) action. At higher levels are there any feats, or are there any magical items that give you another action or another bonus action?
Comment: Not related to the answer, but the moving 5ft thing is not a rule in 5th edition, nor is a free action a thing. I think I remember something vaguely similar in pathfinder, are you sure you are asking about the correct system?
Comment: Welcome to RPG.SE! Take the [tour] if you haven't already and see the [help] or ask us here in the comments (use @ to ping someone) if you need more guidance. Good Luck and Happy Gaming!
Comment: So your goal is to make Misty Step plus two attacks in one turn, is that correct? I mean, getting a second action is a solution, but the goal is..?
Comment: I think this is about dual-wielding.
Comment: @SeriousBri, the 5' step was also in D&D 3e. It's possible this person is new to 5e and has carried some assumptions from the previous version.
Answer: Bonus Actions
The rules for bonus actions state:

You can take a bonus action only when a special ability, spell, or other feature of the game states that you can do something as a bonus action. You otherwise don't have a bonus action to take. You can take only one bonus action on your turn, so you must choose which bonus action to use when you have more than one available.

You don't have a bonus action unless a partiuclar ability gives you one. So even if you have multiple bonus action abilities at your disposal, you may only use one. To my knowledge, there is no item, ability, or otherwise that can give you a second bonus action on a turn.
Movement
Movement up to your speed does not require an action:

On your turn, you can move a distance up to your speed and take one action.

Additional Actions
The fighter class's second level ability action surge grants an additional action:

On your turn, you can take one additional action.

The 3rd level spell haste grants an additional action:

it gains an additional action on each of its turns. That action can be used only to take the Attack (one weapon attack only), Dash, Disengage, Hide, or Use an Object action.

Putting it all together
Now, in your question you describe using misty step and following up with your dual swords. This does not work with two-weapon fighting which states:

When you take the Attack action and attack with a light melee weapon that you're holding in one hand, you can use a bonus action to attack with a different light melee weapon that you're holding in the other hand.

If you have used misty step already, you cannot use the bonus action attack from two-weapon fighting. In order to follow up with your two attacks, you would have to have either the extra attack class feature, such as from being a 5th-level fighter:

you can attack twice, instead of once, whenever you take the Attack action on your turn.

This allows you to make two attacks with your Attack action, or you must have gained an additional action from another source, such as action surge or haste described above.
Comment: I think movement needs more attention - the 5-foot-step reference is clearly a hold-over/misunderstanding from a previous or different system, and you haven't addressed it at all.
Answer: Yes
A thief rogue gets, at level 17, an extra turn in the first round of every combat.  This is at the same level that spellcasters get Time Stop, but it comes with none of that spell's restrictions and takes no resources to use. A level 17 eladrin thief, for example, could use a bonus action to misty step to an opponent's location and take the Attack action, potentially adding sneak attack damage, then take another Attack action on their second turn potentially adding more sneak attack damage, then take a bonus action to disengage and move up to their movement away.
Additionally, the level 13 thief ability, Use Magic Device, allows a thief to make use of spell scrolls, staves, and wands.  While a scroll of time stop-- a legendary consumable item-- is not exactly the sort of thing one wastes for merely an ordinary, if more effective, combat round, it nonetheless does grant the caster 1d4+1 additional turns effective immediately, which is at least good enough to get an extra bonus action-- if you use up your bonus action before casting Time Stop you can have another one as long as you break Time Stop with your action on a turn you haven't used your bonus action yet.
The Haste spell comes at a much lower level of scroll rarity-- 3-- but you could also just have the party mage (or, more likely, their Glyph of Warding) cast Haste on you since it's not a self-only type of thing and it's not super difficult and/or costly to Glyph like 9th level spells are.  It's also available from magic items like the Potion of Speed. Regardless of the source, it gives you an extra action you can use to make a single weapon attack.
There are also spells that involve making multiple attacks, although none of them work very well with the handicap of using two swords.
Beyond those thief-specific abilities, there's also multiclassing into Fighter for Action Surge and/or Extra Attack, as well as companion-dependent options like the Battlemaster's Commander's Strike.
Answer: Reading into what you're going for:

I want to use misty step (As an Eladrin) and follow through with my dual swords.

It sounds as though Eldritch Knight would suit your purposes, although that does mean sinking 15 levels into fighter, and that might be unsuitable for the build you're going for besides what I've quoted above, since you're not really much of a rogue anymore at that point.
Eldritch Knights get a feature at 15th level called Arcane Charge (p. 75):

At 15th level, you gain the ability to teleport up to 30 feet to an unoccupied space you can see when you use your Action Surge. You can teleport before or after the additional action.

You would only be able to do this once per short rest, but then, that's as often as an Eladrin can use Fey Step anyway. When you Action Surge, you will be able to teleport 30 feet (which is what Fey Step can do) and you still have you bonus action, plus two actions to then make a total of 7 attacks (since fighters have Extra Attack (2) by that level).
But like I said, at that point, you're playing an Eladrin fighter, not an Eladrin rogue, so this might not be quite what you had in mind, but for what it's worth, it is a way you can achieve the sequence you are going for (and you don't even need to be an Eladrin; in fact, you could save up your Eladrin misty step and use it to get away again after having made 6 attacks).


setting/properties type setup

Question: I would like to have the possibility of specifying certain "properties" either during setup of my app or afterwards.
In my app I have a connection to my mysql server,currently localhost, but when I am going to install this the localhost will probably change to an IP address or hostname, is there any way that I can create like a properties box that asks the user what he/she wants the ip address or hostname to be to connect to,and then once they change it it should reflect in the code? Or maybe have an encrypted text file with all the settings in or a text file thats hidden with the settings in,not sure what the right approach will be, thank you for your answers and advise
Answer: You can store sensitive data in connection strings by encrypting them, see MSDN Documentation.

setting/properties type setup


How did Royal Navy tactics change after the sinking of HMS Prince of Wales?

Question: On 10th December 1941, the Royal Navy battleship HMS Prince of Wales, and escorting battlecruiser HMS Repulse were sunk near Malaysia by a force of Imperial Japanese bombers. This was a powerful indicator of the vulnerability of surface vessels to aircraft. The question is, how did Royal Navy tactics change in response to this attack?
Comment: [Documenting preliminary research will improve both the probability of an answer and the quality of the answer(s)](https://history.meta.stackexchange.com/a/785/26786)
Comment: Well, how many more UK battleships were lost to aircraft?
Comment: Tactics or fleet strategy?  Pulling fleet units back to Ceylon didn't work out all that well so from there to the east coast of  Africa eventually reduced capital ship losses to Japanese aircraft.  Also one might look at anti-aircraft suites after 1942 as opposed to prior.
Comment: PoW and Repulse were the last UK battleships lost in the war. After the last Japanese raids into the Indian Ocean the UK primarily to the ETO until after VE Day, when the contributed to Pacific ops with the US.
Comment: And, obviously, what do you mean by "tactics"?
Answer: The Royal Navy change its strategy and its tactics in response to this event, and to former events that also had shown the vulnerability of heavy ships to air attacks.
The change in tactic consisted in:

Reinforcing antiaircraft capabilities aboard all types of ships
Forming massive fleets with a lot of light cruisers and destroyers to escort the heavier ships, many more than the few destroyers that were alongside Prince of Wales of Repulse
As much as possible, provide an aircraft carrier or land-based aircraft escort to these fleets

The change in strategy consisted in:

Limiting the use of battleships in big operations close to land, especially in the Mediterranean sea
Focusing battleships on the role of deterrence of German battleships/heavy cruisers in the Atlantic and on the role of far-away escort of convoys, for example in the Barents Sea were destroyers assumed the close escort, and battleships stayed far, ready to intervene if a German battleship should intervene
Answer: I don't see where there was little in a of change of tactics that would have directly resulted from the loss of REPULSE or PRINCE OF WALES.
Most leaders of the major navies were well aware that capital ships were in grave danger from torpedo hauling airplanes in the absence of any sort of air support themselves.
Major navies of the early 1940's were well aware that 1930s era and before anti-aircraft defense suites were inadequate for the job when facing modern aircraft, hence you see upgrades in numbers, quantities, and improved weapons in the major players, RN and USN from 1940 and on.  For the IJN, not as much in the IJN for ships already in service, but their limited new construction, well, that's another matter.
Additional smaller anti-aircraft weapons such as the Bofors 40mm proliferated just about anywhere they could find space.  Compare anti-aircraft suites for USS NEVADA, in 1941 – 12 @ 5 in individual dual purpose mounts, 4 @ 1.1 in AA and 8 @ .50 cal machine guns (Janes 1942).  In 1945 – (from Janes 1945) 16 dual purpose 5 in in twin turrets and over 100 40mm and 20mm.  Or, sticking with the RN, HMS NELSON, for example, in 1941 sported 6 4.7 in AA, 4 3 lbs AA and 3 multiple mount 2 lbs pompom 4 to 6 barrels per mount.   In 1945 you'd see the 6 4.7 inch AA, 16 40 mm Bofors, 42 2 lbs pompom in various mounts and 61 20 mm Oerlikon (all as reported in the 1942 and 1945 Janes).  Obviously, more was better.  Airplanes, especially armed with a torpedo, were ship killers and everyone knew it.
And of course, not immediately, but by 1944 most capital ships, at least RN and USN had the advantage of radar controlled systems, but that's naught to do with the destruction of Force Z.
Increasing the number of escorts, to include anti-aircraft specific cruisers, was already an obvious solution. The RN types such as the DIDO class had already come off the ways starting in 1939, 3 of them in that year, another 3 in 1940 and a last in 1941; the first 4 of the 8 USN ATLANTA class were launched in late 1941 and had joined the fleet by early 1942 the last 4 came to after July 1943.
There was nothing new that could be traced directly to the loss of Force Z.  Everything which came about from 1939 and on, defense weapons, increase escorts, specialized AA cruisers, keeping one's distance, air defense with carrier based aircraft, cruising formations, single carrier task forces to multi-carrier task forces, all were already part and parcel of existing doctrine and strategy or were natural outgrowths of the evolution of naval warfare.
I regret that I cannot point to trusted online availability (at least that I'm willing to venture a trust) of 1942 and 1945 Janes such as I can pull off my shelves.
Comment: So it wasn't poor tactics, it was just that the desired AA resources weren't available? The mission was a calculated risk?
Comment: Right.  Tactics had nothing to do with it from the RN side.  They could try to "comb" the torpedoes and put up what AA fire as they could, but when you are swarmed by torpedo haulers from all directions the outcome is inevitable.  Very rarely does a single action somewhere produce a shift in tactical or operational doctrine.  Even "the Battle of the Ironclads" in March 1862 did not change naval tactics, weapons, yes, tactics, no - they still went out and banged away at each other with the weapons of the era until one side retreated, gave up, or sank – just like Surigao Straits in October 1944.
Comment: The impact of the Repulse/PoW loss (along with other events in Mediterranean sea) was to show that airplanes were so efficient and that small escort was not enough. In Norway campaign or against Italian air forces, British were able to stand with a force of approx. 2 big ships, 5 destroyers against air attacks. It consummated a lot of ammo and could force the fleet to retreat, its ammo exhausted, but the ground could be stood for a while. Now, with the experience of Ju-87 attacks in Mediterranean or the Japanese massive attack that were far more efficient, it did change the mind of the British


How do I remove dd-wrt from a DIR-400 router?

Question: I made the mistake of doing a 30/30/30 on my Dlink DIR400 and now when I access it from my browser it comes up with a page asking me for the file I want to update it with. However, none of the files I tried works. I tried putting DDwrt on it using Putty but when it reaches the load command it just sits there and i have to close the console. I can still ping my router so I am hoping that there is still life in it. Can somebody help please?
Comment: It actually sounds you have bricked your router.
Answer: Download & install the original firmware according to the revision number on the bottom from D-LINK. - Use the same page to upload.
Once the original firmware is installed, go to dd-wrt.com for instructions to reflash.


Details on MSCA projects

Question: Recently I saw an advertisement for a phd position within an MSCA doctoral network. I know the title of the network project  as well as the grant number. Is it possible to get the details of all the individual projects involved with this network?
Answer: You cannot access the full proposal or grant agreement as they are not public but you may find some information on cordis https://cordis.europa.eu/ though the individual project will probably not be there. Your best option is to google the project name or search euraxess to find the job offers and/or the call documents

Details on MSCA projects


Is a rotating object moving or stationary?

Question: Because it rotates in situ, its center of mass does not move, so it is static, but it is rotating, so it is not static, then is it static or moving?
Answer: It depends on your definition of moving. It seems like you aren't picking one, so you are confused.
If you define moving to be any part of the object has motion relative to you, and so then stationary means no part of the object is in motion relative to you, then you would say a rotating object is moving and is not stationary.
If you define moving to be the center of mass has motion relative to you, and so stationary means the center of mass has no motion relative to you, then an object that is purely rotating about it's center of mass would be considered stationary.
I can think of instances where either definition could be useful, so pick your favorite.
Answer: As you pointed out, if an object is rotating around an axis through its centre of mass, then the centre of mass is stationary. Nonetheless, you will not find an inertial frame of reference where all particles of the extended object are at rest to each other.
All the particles of the rigid body that are not located on the axis of rotation would move even if the centre of mass remained stationary. This is also the reason why one often divides the motion of a body into its translational and rotational modes. For the translation of a rigid body it is sufficient to look at the centre of mass only, this is not the case for rotations.
Answer: It is moving, as it has kinetic energy. The center of mass is a point, not an actual measurable piece of mass. Think of a donut spinning like a wheel, you would see the entire donut rotating, and there would be nothing of the donut in it's center of mass, the middle of the donut hole.
Comment: But it doesn't matter if the center of mass is in the object or not for what the OP is talking about. The OP says nothing about this in the post.
Comment: @Aaron Stevens: he does mention the com, we could carry the analogy further, two stars orbiting each other, the systems com is not moving, so are they stationary?
Comment: First I would not discount someone who says the star system as a whole is not moving relative to them, even if parts of the system are moving relative to them. But in any case, that's different than what you are talking about in your answer. I'm not saying the COM is irrelevant. I'm saying the center of mass being within the object is irrelevant for this question. Since your answer is only about this point, I don't think it answers the question.
Comment: @Aaron Stevens: I understand your point, it's just that I would not consider it static if it has kinetic energy in my frame of reference


Can I manually load drivers for a particular device? I have a "Next Engine" 3d model scanner.

Question: I desperately would like to use my Next Engine 3D model scanner(http://www.nextengine.com/) in Ubuntu 12.04.  The software installs nicely using wine, but the device drivers do not install.  I am clueless on how to do this and I would greatly appreciate some direction.
Answer: If the manufacturer doesn't provide Linux drivers, and no alternative drivers exist, then you cannot use the device on Ubuntu. Wine cannot install drivers, because they are too system-level, rather than user-level objects.
If this is a USB device, you can use the device in VirtualBox with USB passthrough. You will need to download the package from https://www.virtualbox.org/wiki/Linux_Downloads, and not the version of VirtualBox in the Software Center, since OSE does not include USB passthrough.
More inforation on USB passthrough can be found in the VirtualBox manual: http://www.virtualbox.org/manual/ch03.html#idp13237504
Comment: If I run virtualbox wont I really have to run windows since the usb device was designed for windows?  Won't this cause resource hogging by having ubuntu and windows running simultaneously?  Sorry, I'm just not familiar with how it works.  Will I be able to close th vb windows once the drivers are loaded?
Comment: @user76770: Yes, unfortunately, you will need a copy of windows to use VirtualBox for this.
Answer: Write a letter to the manufacturer asking for the driver if they won't develop the driver then ask if they would assist for developing it and try to talk to a Kernel developer willing to ask for the needed information. Linux is a community isn't it ?
Alternatively find out if more people need the driver too and you could send the manufacturer a list of the interested people in addition.


In Lisp, code is data. What benefit does that provide?

Question: In Lisp, any program's code is actually a valid data structure. For example, this adds one and two together, but it's also a list of three items.
(+ 1 2)

What benefit does that provide? What does that enable you to do that's impossible and/or less elegant in other languages?
Comment: @Ken I definitely see where you're coming from. However, I'm asking this out of curiosity. I'm already *doing things* in other languages, and I've never felt the need for my code to be data. I'm simply wondering what I'm missing, and Eli did an awesome job of explaining it.
Comment: This will probably be closed as a dupe ...(http://stackoverflow.com/search?q=%5Blisp%5D+macros) Here's the relavent snippet on Wikipedia: http://en.wikipedia.org/wiki/Lisp_(programming_language)#List_structure_of_program_code Practical Common Lisp by Peter Seibel is a really great intro to Common Lisp and includes this early chapter which demonstrates macros: http://gigamonkeys.com/book/practical-a-simple-database.html
Comment: This question seems backwards: you're taking a consequence of Lisp design and asking for what to do with it.  In practice I start with the *doing things*.  (In Java, an int is 32 bits -- what benefit does that provide?  Well, we can probably list some but they'd seem pretty artificial because no Java programmer would think about it from that direction.)
Answer: To make things a little clearer with respect to code representation, consider that in every language code is data: all you need is strings.  (And perhaps a few file operations.)  Contemplating how that helps you to mimic the Lisp benefits of having a macro system is a good way for enlightenment.  Even better if you try to implement such a macro system.  You'll run into the advantages of having a structured representation vs the flatness of strings, the need to run the transformations first and define "syntactic hooks" to tell you where to apply them, etc etc.
But the main thing that you'll see in all of this is that macros are essentially a convenient facility for compiler hooks -- ones that are hooked on newly created keywords.  As such, the only thing that is really needed is some way to have user code interact with compiler code.  Flat strings are one way to do it, but they provide so little information that the macro writer is left with the task of implementing a parser from scratch.  On the other hand, you could expose some internal compiler structure like the pre-parsed AST trees, but those tend to expose too much information to be convenient and it means that the compiler needs to somehow be able to parse the new syntactic extension that you intend to implement.  S-expressions are a nice solution to the latter: the compiler can parse anything since the syntax is uniform.  They're also a solution to the former, since they're simple structures with rich support by the language for taking them apart and re-combining them in new ways.
But of course that's not the end of the story.  For example, it's interesting to compare plain symbolic macros as in CL and hygienic macros as in Scheme implementations: those are usually implemented by adding more information to the represented data, which means that you can do more with those macro system.  (You can also do more with CL macros since the extra information is also available, but instead of making it part of the syntax representation, it's passed as an extra environment argument to macros.)
Comment: This is a fantastic explanation. Thank you!
Answer: My favorite example...  In college some friends of mine were writing a compiler in Lisp.  So all their data structures including the parse tree was lisp s-expressions.  When it was time to implement their code generation phase, they simply executed their parse tree.
Answer: Lisp has been developed for the manipulation of symbolic data of all kinds. It turns out that one can also see any Lisp program as symbolic data. So you can apply the manipulation capabilities of Lisp to itself.
If you want to compute with programs (to create new programs, to compile programs to machine code, to translate programs from Lisp to other languages) one has basically three choices:

use strings. This gets tedious parsing and unparsing strings all the time.
use parse trees. Useful but gets complex.
use symbolic expressions like in Lisp. The programs are preparsed into familiar datastructures (lists, symbols, strings, numbers, ...) and the manipulation routines are written in the usual language provided functionality.

So what you get with Lisp? A relatively simple way to write programs that manipulate other programs. From Macros to Compilers there are many examples of this. You also get that you can embed languages into Lisp easily.
Answer: It allows you to write macros that simply transform one tree of lists to another. Simple (Scheme) example:
(define-syntax and
  (syntax-rules ()
   ((and) #t)
   ((and thing) thing)
   ((and thing rest ...) (if thing (and rest ...) #f))))

Notice how the macro invocations are simply matched to the (and), (and thing), and (and thing rest ...) clauses (depending on the arity of the invocation), and handled appropriately.
With other languages, macros would have to deal with some kind of internal AST of the code being transformed---there wouldn't otherwise be an easy way to "see" your code in a programmatic format---and that would increase the friction of writing macros.
In Lisp programs, macros are generally used pretty frequently, precisely because of the low friction of writing them.


Genuine elementary OS installation

Question: I'm installing elementary OS.
It asked me for a product key and said there must be some Certificate of Authenticity on it, like this:
I have tried visiting URL on this image, but it is replaced with some nonsense. Where is it located?
Answer: elementary OS does not use product keys or prompt for product keys.
Please ensure that what you have downloaded and are trying to install originates from the elementary website and that the checksum matches as per the installation guide.

Genuine elementary OS installation


Xcode 4.5 causing errors in iOS 5 apps

Question: I having working on a timer application since last 3 to 4 months (when there was no sign of iOS 6) but due to some issues could not complete it. Now since the advent of iOS 6.. I am getting error in my code. I recently downloaded the xcode 4.5 and iOS 6 SDK (within it). Now when I run the app. It crashes on different occasions. Sometimes crashes right when it is started. Some times no crashes at all.
Sometimes give me SGBRT error. Sometimes Bad_exc error(memory error). I don't know how to handle this. I have downloaded the iOS 5.1 simulator and on that when i run the app. No crashes at all but when I run the app on iOS 6 simulator. Wham! it crashes right away.
I am in dire need of guidance. Anyone who has experienced the same error and got it troubleshoot please help me too.
Thanks in Advance
Fahad.
-   P.S. I added breakpoints to detect the errors and I was able to catch only one but could not understand why I got this error. Here is the code:
<code>-(void) playAppSound:(NSString *) fName withExt:(NSString *) ext{
  NSString *path  = [[NSBundle mainBundle] pathForResource : fName ofType :ext];
  if ([[NSFileManager defaultManager] fileExistsAtPath : path])
  {
      NSURL *pathURL = [[NSBundle mainBundle] URLForResource:fName withExtension:ext];
      // Instantiates the AVAudioPlayer object, initializing it with the sound
      if(self.appSoundPlayer)
      {
        if([self.appSoundPlayer isPlaying])
        {
            [self.appSoundPlayer stop];
            [self.appSoundPlayer release];
        }
      }
  //Thread breaks down in the next line self. appSoundPlayer...

    self.appSoundPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL: pathURL error: nil] ;

    //self.appSoundPlayer.numberOfLoops = 1;
    [appSoundPlayer setDelegate:self];
    [appSoundPlayer prepareToPlay];
    //[appSoundPlayer setVolume:1.0];
    [appSoundPlayer play];
}
  else{
   //   NSLog(@"error, file not found: %@", path);
  }
}
</code>
Answer: Check Framework versions (SDK 5 <- wrong, SDK6 <-right)

Xcode 4.5 causing errors in iOS 5 apps


Is Manonmani mentioned in any scriptures?

Question: I know Manonmani is the goddess in South India. But, Is any mention about her in Puranas or other scriptures?
Answer: Abbreviation used: Śiva Purāṇa- SP
The Śaivite goddesses, who are either independent manifestations of Pārvatī or the dependent groups of her following, are too many to mention. Some of those names are  Vāmā, Jyeṣṭhā, Raudri, Kālī, Kalavikaranī, Balavikaranī, Balaparamthanī, Sarvabhūtadamanī, Manonmanī etc. These are different synonyms of Śiva, with the female terminations added to them. Here Manonmanī is simply the Śakti (goddess) of Manonmana (Śiva).  (Sastri, 1916, p. 190)
Manonmanī is mentioned in some of the sources below to support this point.

sarva-yantr'ātmikā sarva-tantra-rūpa manonmanī |
māheśvarī mahādevī mahālakṣmī mr̥ḍapriyā || 53 ||

Śrī Lalitā Sahasranāma Stotram (53):  Devī is the soul of all yantras. She is the embodiment of all tantras. She is Manonmanī, the transcendent consciousness. She is the consort of Maheśvara, the Supreme Ruler of the universe. She is the Supreme Goddess, who is Mahālakṣmī and the beloved of Mr̥ḍa (Śiva)

oṁ manonmanyae namaḥ   (207)

Śrī Lalitā Sahasranāma Nāmāvaliḥ (207): Salutations to Her who is Manonmanī, the transcendent consciousness

śivassadāśivaḥ proktaḥ śivā sā ca manonmanī |
śivo maheśvaro jñeyaḥ śivā māyeti kathyate || 39 ||

SP (188.8.131.52): Sadāśiva is Śiva and Manonmanī is Śivā, Maheśvara is known as Śiva and Śivā as Māyā.

kardaleṣu siddhayaścāṣṭau kesareṣu ca śaktikāḥ |
rudrā vāmādayastvaṣṭau pūrvādiparitaḥ kramāt || 33 ||
karṇikāyāṃ ca vairāgyaṃ bījeṣu nava śaktayaḥ |
vāmādyā eva pūrvādi tadantaśca manonmanī || 34 ||
kande śivātmako dharmo nāle jñānaṃ śivāśrayam |
karṇikopari vāhneyaṃ maṃḍalaṃ sauramaindavam || 35 ||

SP (6.7.33-35): He shall conceive the eight Siddhis in the petals, the Śaktis in the filaments, the eight Rudras, Vāma and others from the east, all round in order; the vairāgya in the pericarp and the nine Śaktis in the Bījas, Vāma and others alone beginning with the cast and ending with Manonmanī, the dharma of Śiva in the bulbous root, the Śaivite knowledge in the stem and the zones of fire, sun and the moon above the pericarp.

evandhyātvātha madvāmabhāge tvāṃ ca manonmanīm |
gaurī mimāya mantreṇa praṇavādyena bhaktitaḥ || 64 ||
āvāhya pūrvavatkuryānnamaskārāṃtamī śvari |
dhyāyettatastvāṃ deveśi samāhitamanā muniḥ || 65 ||

SP (6.7.64-65): After meditating thus, O goddess, he shall meditate on you as Manonmanī to my left. Repeating the mantra "Gaurīrmimāya" preceded by the Praṇava he shall invoke you as before and perform the rites ending with prostration. The sage of pious concentrated mind shall meditate on you, O goddess.

śabdādiśaktisphuritahṛtpaṃkajavirājitaḥ |
svaśaktyā vāmabhāge tu manonmanyā vibhūṣitaḥ || 19 ||

SP (6.12.19): He is infused with the power of the word throbbing in the lotus of his heart; he is bedecked on his left by Manonmanī, his own Śakti.

bījānyapi ca tā eva śaktayoṃtarmanonmanīḥ |
karṇikāparavairāgyaṃ nālaṃ jñānaṃ śivātmakam || 28 ||

SP (184.108.40.206): The seeds too are those Śaktis alone Manonmanī etc. within. The pericarp is the greatest detachment and the stalk is the Śaivite knowledge.
In Devī Bhāgavata Purāṇa (12.5.22-24),

mūle tu kuṇḍalīśaktirvyāpinī keśamūlagā || 22 ||
śikhāmadhyāsanā tvaṁ hi śikhāgre tu manonmanī |
kimanyadvahunokttenā yantkicijjagatitraye || 23 ||
tatsarvaṁ tvaṁ mahādevi śriye sandhye namostu te |
itīdaṁ kīrtitaṁ stotraṁ sandhyāyāṁ bahupuṇyadam || 24 ||

Thou art the Kuṇḍalinī in the Mūlādhāra (sacral plexus), the Vyāpinī extending upto the roots of the hairs; Thou art Madhyāsanā on the crown of the head, and Thou art Manonmanī in the Brahmārandhra. O Devī! What need there is in stating these? Suffice it to say that whatever there is seen in this universe, all art Thou; therefore, O Śrī Sandhyā Devī! I bow down to Thee. O Nārada! Thus I have spoken to you about the Gāyatrī-Stotra that gives all successes, destroys all sins, and yields all merits.
Harshananda (2002, p. 124) lists Manonmanī is mentioned among the aspects of Pārvatī and describes her as:

'One who lifts the mind up to the highest state of Yoga.' She is the Śakti established in the cakra in the top of the head, just below the Brahmarandhra. She is pictures as blue or black in complexion and carries a skull cap as also a sword. When she is pleased by the devoted prayers of her votaries, she grants their wishes and terrifies their enemies.

References

Sastri, H.K. (1916). South-Indian Images of Gods and Goddesses. Madras Government Press. https://archive.org/details/cu31924022943447

Tapasyananda. (Ed. & Trans.). (2008). Śrī Lalitā Sahasranāma. Sri Ramakrishna Math. https://estudantedavedanta.net/Sri-Lalita%20Sahasranama-Ramakrishna-Mission.pdf

Shastri, J.L. (Ed. & Trans.). (1950). The Śiva Purāṇa. Motilal Banarsidass. https://www.wisdomlib.org/hinduism/book/shiva-purana-english

Vijñānanda. (Ed. & Trans.). (1921). Śrīmad Devī Bhāgavatam. Subhindranath Vasu at the Panini Office, Bhuvaneshwari Aśrama. https://www.wisdomlib.org/hinduism/book/devi-bhagavata-purana

Harshananda. (2002). Hindu Gods and Goddesses. Sri Ramakrishna Math. https://estudantedavedanta.net/Hindu_Gods_and_Goddesses%20_Swami_Harshananda.pdf


SFP modules and LC-to-LC patch panels?

Question: Simply put, we are joining two sites that are 200m apart using 8 core OM4 Multimode
fibre cable. Am I correct in understanding that lc patch panels on either end of the fibre cable are ok and that relying on the SFP modules on lc sfp networked devices on either end to transmit and receive their relevant signals is sufficient?
Or is there any requirement to "boost" the fibre signal at any point with say extra sfp modules within the link?
All current devices on the existing network like switches etc have lc connections.
Comment: There's no yes or no answer.  It depends on the attenuation of the fiber infrastructure and the type of SFPs.   What type of SFPs are you using?
Comment: Are you actually running Fibre Channel storage protocol or rather just Ethernet?
Comment: Your cable installer should be able to determine if it fits in your loss budget.
Comment: We will have 2 IBM TS3200 LTO Tape drives , one on each site for cross backups. These are linked via a fibre switch with Agilent AFBR-57R5AP SFP modules which are good for 300m with fiber core @ 62.5nm . These will be on a separate fibre circuit to the main ethernet circuit which will use Startech 10GBase-SR SFP+ sfp modules. This is all Multimode shortwave DWDM fibre. Either end of the fibre cable will terminate into a LC patch panel (LC Couplers ) so I am concerned about signal loss at these LC couplers on the patch panels.
Comment: Those FC SFPs are only 4 Gbit/s max, aren't they? Can't really say for sure for FC but it's pretty robust (300m @ 62.5 µm *is* robust), so I wouldn't worry about the patches too much. Do make sure you don't change the run's diameter though!
Answer: OM4 is good for 400 m with 10GBASE-SR or for 550 m with 1000BASE-SX, according to the IEEE standards. (These can often be "extended" but there's no guarantee.)
The link power budget isn't usually a problem with short-range multi-mode fiber (MMF), so you should be good with patching in between - provided the fiber and patch cable quality is decent, and all connectors are clean.
[Edit] Since you seem to be using legacy (FDDI) 62.5 µm fiber: don't patch those to or with more modern 50 µm cables. The cable parameters change causes a significant power drop which will likely make the whole run fail. If part of the entire path is 50 µm and another part is 62.5 µm, I'd use another switch with SFPs (or a suitable media converter) in between to adapt.
Mixing FDDI, OM1, and OM2+ is generally not advised. It works with rather short runs but won't on longer ones. Changing the MMF grade can severely degrade the signal.
Mixing OM2 to OM5 isn't generally such a problem but still decreases the reach somewhat.
DWDM might cost you some reach as well. The optical multiplexing is not completely lossless. Still, 200 m shouldn't be a problem.
Answer: This will depend on the quality of your fiber, patch panels, patch cords, and specific SFP optics. Several examples from my collection of aging ethernet capable FC optics (1/2/4G):
Ethernet1/15
    transceiver is present
    type is 1000base-SX
    name is AGILENT
    part number is HFBR-5710L
    nominal bitrate is 1200 MBit/sec

  Length_50u                      : 0x37  550 Meters

Ethernet1/15
    transceiver is present
    type is Unknown Type-(unknown)
    name is FINISAR CORP.
    part number is FTRJ8519P1BNL
    nominal bitrate is 2100 MBit/sec

  Length_50u                      : 0x1e  300 Meters

Ethernet1/15
    transceiver is present
    type is Unknown Type-(unknown)
    name is Intel Corp.
    part number is TXN31115D100000
    nominal bitrate is 4300 MBit/sec

  Length_50u                      : 0x0f  150 Meters

(Note: all of these optics, and the cisco n3k they're in, pre-date OM4, they have no data for OM4 lengths)
And a 10G optic:
Ethernet1/1
    transceiver is present
    type is 10Gbase-SR
    name is OEM
    part number is 10GB-SFP-SR
    nominal bitrate is 10300 MBit/sec
    Link length supported for 50/125um OM2 fiber is 82 m
    Link length supported for 62.5/125um fiber is 26 m
    Link length supported for 50/125um OM3 fiber is 300 m

SFP modules and LC-to-LC patch panels?


Are hover menus in headers easy to use?

Question: Do users find it easy to use headers/menus like the one displayed below?
Comment: That, of course, depends on the users. You should do a small prototype and test with your kind of users. Our kind of users where I work hate the hover menus.
Comment: My target users are mainly eshop owners and users with experience in facebook and linkedin.
Comment: Saying that it "depends on the users" would work as an answer for most of the questions on this site.  Could you edit your post to include any empirical evidence as to why using hover menus would be be a good or bad choice?
Answer: You get better performance if users click the menu bar to open a menu rather than simply hold the mouse pointer over it. Hover-menus were demonstrated to be a bad idea long before they appeared on the web:

Chaparro BS, Minnaert G, & Phipps C (2000). Limitations of using
  mouse-over with menu item selection. Proceedings of the Human Factors
  and Ergonomics Society Annual Meeting, July  44(2), p361. (nearly full
  text at Mouse-Over vs. Point-and-Click: It Depends!
  )

They're also inconsistent with the tried and true DOD Design Criteria Standard - Human Engineering (aka MIL-STD 1472):

126.96.36.199.8.4 Explicit actuation. A separate, explicit action, distinct
  from cursor position, shall be required for the actual entry (e.g.,
  enabling, actuation) of a designated position

However, once a menu is opened, it is preferred that additional menus open on hover. For more details, see Make web menu bars more usable.
Part of the issue is that to get accuracy as good as click-to-open, you have to put in a delay that's so long that any speed advantage of opening on hovering is negated.
Hover-menus are a textbook case of an intuitively appealing idea that fails in practice. They're also a textbook case that just because something is common on the web doesn't mean it's a best practice.
Comment: @Jon W: Good catch. I've corrected the cite to the  study I meant, a follow-up to Bohan et al. that reports higher error rates for mouse-over menus despite increasing the delay so much it loses its potential speed advantage. Bohan et al. looked at acquiring a single button on the screen rather than menu use and could not measure errors. Now where else have I been citing it wrong?
Comment: Are you sure about the Bohan, Chaparro, and Scarlett reference? Having found [the actual paper](http://pro.sagepub.com/content/42/5/473.abstract) the abstract states that "Results showed that target-acquisition times were significantly shorter for the mouse-over technique..Overall, the results suggest that the mouse-over technique can be an effective alternative to selelcting targets via button press".
Comment: Also, as touch interfaces become more prevalent, hover has little or no meaning. If you want your site to work out of the box on an iPad (or other tablet), use click/press for all the interactions... in addition to the reasons cited for doing it even on the desktop.
Comment: I think it depends. I've tested alternative interfaces with click and hover and some user preferred hove over click; it felt  to them that they had to do less work. Hover also allows faster exploration of what is in the menus if you don't know where to look.
Comment: @Rouben: Using hover after opening the first menu allows fast exploration giving the best of both design options (see Miksovsky link above for details). Otherwise, it indeed depends on what you care about. Users may _feel_ hover is easier and thus prefer it, but the evidence I've seen is that click is _truly_ easier –better speed/accuracy. I believe users will ultimately be happier with more free time and less frustration in their lives, than with living a pleasant illusion.
Answer: Drop down on click is easier to use. In addition, touch screen devices don't have hover.
I would recommend going for click, not hover. Do not forget to add a visual clue (triangle pointing down) to help with discoverability.
Here's some helpful information about possible usability issues with dropdowns.
Comment: It may not be possible literally to hover on mobile, but it's straightforward to get hover menus to work on it just by adding an `ontouchstart` attribute to the relevant elements.  Then clicking on the menus will trigger the hover effects.
Answer: I highly suggest you read the following article from smashing magazine.

Designing Drop-Down Menus: Examples and Best Practices

We found that our users hated traditional skinny drop down menus like the one in your screen shot. However, when we went to wider drop downs with multiple columns, larger margins, better styling, and no sub menus, then they seemed pleased.
Answer: With the prevalence of tablets and mobile devices I feel that we should move away from hover-centric designs.  Touchscreens don't have a "hover" state.
My approach is simple:

Don't try so hard to fit every conceivable link into your header. Instead, design a simple navigation structure with a few broad topics or categories.
Each link leads to a landing page that allows you to drill down into more specific topics.

Last of all, the site needs to be very fast so that this multi-page design doesn't slow down or annoy the user while browsing your site.  So use tools like YSlow and http://www.webpagetest.org to optimize your site.  A fast website is always welcome of course, but this is especially important for mobile users.
Comment: Of course, hover is on it's way to touch too. Thank you very much, Samsung!
Answer: Almost all users will be familiar with the concept as they are omnipresent in Windows and Apple applications (and even though it was redesigned in The Ribbon, it's still a similar concept.)
Wether they like it or not is something you need to find out - it depends on the user, also on how well the menu works. For example, you need a delay to prevent menus hiding when a user moves in a straight line from the top to the menu item. Menus that are difficult to navigate will confuse or irritate the user, even if they are familiar with the concept.
(A difference to note is that the menus on Windows only dropdown on click, not on hover.
Dropping down on hover will make it more discoverable - but also more invasive. Dropping down only on hover (and not on click) can come with problems when visiting the page with a tablet because those have no way of hovering.)
Answer: Hover menus are extremely hard to use with touch devices
(try browsing through LinkedIn without using a smart phones built in browser)
... and often get closed if the user moves the mouse inaccurately over the menu
(e.g. the start menu in older versions of Windows - the "All Programs" in Windows 7's start menu does not use hover menus).
Answer: My experience is that hover menus and megamenus are hard to use. This comes from personal experience and watching other users. This is especially significant if the user has limited dexterity or poor motor skills.
I also agree that they don't seem to work well with touch interfaces.
Comment: You say "As previously mentioned."  Do you have anything to add that wasn't previously mentioned?
Comment: Yes. Limited dexterity and poor motor skills wasn't previously mentioned. I probably should have worded it differently. Touch interfaces was mentioned previously.
Comment: You can edit your answer to explain that more clearly if you'd like.
Comment: Sorry for the late response. I just saw this. I did edit it, but I don't think the downvotes went away.

Are hover menus in headers easy to use?


How to decide whether to write a story as a novel or screenplay?

Question: Any general framework for deciding whether a story should be produced as a novel or screenplay? It seems a screenplay, while ideal for dialogue-rich stories, would regardless still be more sought-after commercially than a paperback
Comment: There are a lot more fiction books published every year than there are feature films released, so from that point of view a novel makes more sense. Screenplays also have far more restrictions than novels in terms of length, storytelling, budget, etc. But it's impossible to answer without knowing your skills and limitations as a writer and what stories you want to write. Dialog isn't the be-all-and-end-all of films - good films tell their story through images - although for much TV, dialog is probably more important. This question seems unanswerable but you may get interesting responses.
Comment: What are you as a writer more comfortable with? Are you "ambidextrous"?
Answer: The people that invest the millions of dollars needed to produce a motion picture have a strong preference for established IP -- stories that already have proven audiences.
If you have no track record that supports that you've created a story that will be popular and profitable, then it is less likely you'll attract the interest of  filmmakers.  It's not impossible, just less likely.
If your story can be told in either prose or cinematically forms, then writing a novel is a good way to start.
But if your story relies  predominantly on sudden visual elements: Prat falls, spit takes, massive explosions, outer space, undersea, or aerial dogfights, car or chariot chases, jump scares, etc., then more than likely it is easier to develop as a screen play.
Answer: I think you've got it wrong. Dialogue is actually sparse in a screenplay, what is preferred is visual stories that require little supporting dialogue.
In screenplay writing advice, it is consistently preferred if information can be conveyed in a visual manner, emotional reactions, action.

Indiana Jones says nothing peering into a cave, with his torch he sees
thousands of rats, he reacts with disgust.
INDIANA
Rats! I hate rats!
He steps into the cave, hating every second, grimacing, pushing rats
away with his feet as he traverses the corridor, startling when a rat
drops on his shoulder.

That may be inaccurate from memory, but the point being, you get a minute of screen time with 4 words of dialogue. He doesn't have to say rats creep him out, we get no words on the screen to that effect, all of this is visual, even comic.
Screenplays rely on visuals far more than dialogue.
That is how to decide. If your story can be translated into primarily a visual experience, then it may be a good candidate for a screenplay. That means virtually zero exposition or explanation about your world or what is going on. Conversations and solo speech more than 25 words or so is frowned upon, and under 10 words for a line is preferred.
You can see this on TV, notice how sparse speech is. How much is left out. How the actors "just get it" when somebody says something a little cryptic.
If your story requires a lot of soliloquies, conversations and exposition, it belongs in a novel. That is true even for the narrator, if they are explaining stuff instead of just describing the setting. Explaining stuff in Supers (text on the screen, a la Star Wars opening) is frowned upon in screenplays.
You need to tell an audiovisual story, sight and hearing. An emotional story, supported by music (composed, not by you, to support the emotions of your scene, which should be made apparent by you).
Thought pieces don't tend to work well on the screen. They want stories that are visually engaging and depend heavily on acting skills, great settings, etc.
Comment: Screenplays are filled with dialogue. Screenwrights for theatre (e.g. Shakespeare) filled their stories with dialogue. Think you got it wrong. Visuals are the exemption, relative to the prevalance of dialogue, because they are statistical outlier box office hits that you're singling out (e.g. Star Wars).
Comment: @user610620 Not compared to a novel. Read some screenplays; 95% of dialogue is short. Even in novels, there is a proscription against "talking heads", long conversations without enough visuals. And Shakespeare's plays were for a different time and audience; if he were not famous and a new unknown writer today, he probably could not sell them as a movie. Although I have no doubt Shakespeare could have adapted to modern entertainment, the works as they stand would not be picked up as a first script from a newbie.