How to get SQL Server CPU and Memory read and write usage within two weeks?

Question: Is there any a quick way or quick script on how to get the CPU and Memory usage within a time range (at least two weeks)? I did my research earlier and it seems that the procedures available seems complicated. Any help will be appreciated.
Comment: What `procedures available` are you referring to?
Answer: You can query sys.dm_os_ring_buffers DMV to extract information from it. Please note sys.dm_os_ring_buffers is Undocumented Command but safe to use.
NOTE: These queries are tested on from SQL Server 2008 R2 to 2014. I have not tested them on 2008 or 2005.
To get information about SQL Server memory usage  you need to query sys.dm_os_ring_buffers and filter out for "RING_BUFFER_RESOURCE_MONITOR". Below is the sample query. If the query only produces results for current date and you want for previous date you can use GETDATE() -1 instead of GETDATE() in the query
;with RingBufferMemoryMonitoring
as
(SELECT

 x.value('(//Record/MemoryRecord/MemoryUtilization)[1]',
       'bigint')
       AS Memory_utilization_Percentage ,
       x.value('(//Record/MemoryRecord/TotalPhysicalMemory)[1]',
       'bigint') as [TotalPhysicalMemory_KB] ,
       x.value('(//Record/MemoryRecord/AvailablePhysicalMemory)[1]',
       'bigint') as [AvailPhysicalMemory_KB] ,
x.value('(//Record/@time)[1]', 'bigint')
 as [Record_Time]
FROM  (SELECT Cast (record AS XML)
 FROM   sys.dm_os_ring_buffers
 WHERE  ring_buffer_type = 'RING_BUFFER_RESOURCE_MONITOR') AS R(x)
 )
 select RingBufferMemoryMonitoring.*, Dateadd (ms, RingBufferMemoryMonitoring.[record_time] - SI.ms_ticks, Getdate()) AS
       Notification_time
      from  RingBufferMemoryMonitoring
 cross join sys.dm_os_sys_info SI

Below is another query,I took the query from This Blog, to get CPU utilization history. If you want for previous date you can use GETDATE() -1 instead of GETDATE() in the query
DECLARE @ts_now bigint

SELECT @ts_now = cpu_ticks / (cpu_ticks/ms_ticks)  FROM sys.dm_os_sys_info

SELECT top 20 record_id, EventTime,

  CASE WHEN system_cpu_utilization_post_sp2 IS NOT NULL THEN system_cpu_utilization_post_sp2 ELSE system_cpu_utilization_pre_sp2 END AS system_cpu_utilization,

  CASE WHEN sql_cpu_utilization_post_sp2 IS NOT NULL THEN sql_cpu_utilization_post_sp2 ELSE sql_cpu_utilization_pre_sp2 END AS sql_cpu_utilization

FROM

(

  SELECT

    record.value('(Record/@id)[1]', 'int') AS record_id,

    DATEADD (ms, -1 * (@ts_now - [timestamp]), GETDATE()) AS EventTime,

    100-record.value('(Record/SchedulerMonitorEvent/SystemHealth/SystemIdle)[1]', 'int') AS system_cpu_utilization_post_sp2,

    record.value('(Record/SchedulerMonitorEvent/SystemHealth/ProcessUtilization)[1]', 'int') AS sql_cpu_utilization_post_sp2 ,

    100-record.value('(Record/SchedluerMonitorEvent/SystemHealth/SystemIdle)[1]', 'int') AS system_cpu_utilization_pre_sp2,

    record.value('(Record/SchedluerMonitorEvent/SystemHealth/ProcessUtilization)[1]', 'int') AS sql_cpu_utilization_pre_sp2

  FROM (

    SELECT timestamp, CONVERT (xml, record) AS record

    FROM sys.dm_os_ring_buffers

    WHERE ring_buffer_type = 'RING_BUFFER_SCHEDULER_MONITOR'

      AND record LIKE '%<SystemHealth>%') AS t

) AS t

ORDER BY record_id desc

If you want to read more about how to extract information from  Sys.dm_os_ring_buffers please read Inside Sys.dm_os_ring_Buffers
Comment: +1 for,these queries are tested on from SQL Server 2008 R2 to 2014. I have not tested them on 2008 or 2005.


What is meaningful?

Question: Which propositions are considered meaningful and on what grounds? In other words, when is it correct to predicate 'meaningfulness' of the propositions?
Comment: All propositions have meaning, by definition. They are actually bearers of a specific kind of meaning.
Comment: I'm asking what 'meaning' is. Also, 'all propositions have meaning' is a false claim. 'Red triangular squares are passionate' is prima facie meaningless.
Comment: Well, thats not technically a proposition, which is not the same thing as a sentence. And the definition of meaning is encyclopedic.
Comment: I am thinking of a dictionary.  This is the source mapping meaning to words.  Insofar as a proposition signifies a useful idea or concept, it has meaning whereas if I say "Why does blue smell like vanilla" that is meaningless as it is useless gibberish.
Comment: Yeah, I guess you're correct, Andre
Answer: The meaning of a sentence seems to me to be a relation between the sentence and something which is beyond the sentence. A senseless sentence is just a sentence, a mere sentence . A meaningful sentence is somehow more than a mere sentence. It is so by being related, in a way that a senseless sentence is not. A meaningful sentence is related to "the external world". The "world" is "external" to the related sentence, it is beyond the sentence.
The above raw definition covers both semantic meaning, where one uses terms like 'refer' or 'denote' to express the relation of words to the world; and pragmatic meaning, where the word-world relation is thought to be practical ("meaning is use").
Answer: I agree with one commenter, that all propositions must have meaning. However, the commenter didn't explain why, so I thought I'd elaborate.
A proposition must be true or false. You can't argue either of these if the proposition is "meaningless".
http://en.wikipedia.org/wiki/Not_even_wrong
You can redefine propositions more broadly if you like, and consider "meaningful" ones to be those that can be proven or refuted. However, there is no simple way to tell if a proposition is "meaningful" in this case.
Comment: Why would we need to redefine 'proposition'? As I understand the regular definition, unprovable expressions that are either true or false are also propositions.
Comment: This "regular" definition, can you give us some source that uses it?
Comment: @Keelan Yes, an artifact of the proposed definition is that an unprovable expression won't be considered "meaningful". The broadening is referring to allowing nonsense sentences to be valid propositions.
Comment: But a proposition is not just an utterance, it is not even necessarily a linguistic artifact, that could be said to have necessarily definite syntactical features of any kind. It is bound to some meaning, in that quality..
Comment: We are talking about linguistics, right?

What is meaningful?


Improve mediawiki search by using Solr or similar?

Question: Search on our internally hosted mediawiki installation is very poor. Has anyone found an easy way to get better search capabilities, like Solr integration or some internal spidering system?
Comment: did you find any resources on integrating solr with mediawiki? I'm struggling with the same problem. Looking for a simple starting configuration of solr for mediawiki.
Answer: We installed the Lucene search engine, as used on Wikipedia, and the MWSearch extension that integrates it with MediaWiki.

Lucene: https://www.mediawiki.org/wiki/Extension:Lucene-search
MWSearch: https://www.mediawiki.org/wiki/Extension:MWSearch

Installation is complex, but when it's working, you can basically forget about it and let it run.
An additional optimization is the OAIRepository extension that does incremental updates to your search index, rather than full updates all the time. The docs for OAIRepository are pretty bad, so read the discussion page as well. Again, once it's working, it works great.
Make sure your server has plenty of RAM for building the search index. I recommend 6-8GB for a wiki with tens of thousands of articles.


Differential Drive Robot Control

Question: Edited: I have a differential drive robot that needs to drive down a hall and stay in the center. I have 4 ultra sonic sensors, 2 on each side. Currently, I thought of implementing pure pursuit and having a lookahead distance etc. but I am not sure if this is the correct approach. I have all the lower level PIDs for motor control working, I just need some help in choosing a path planning algorithm? Will pure pursuit work to my needs? OR do people have any suggestions.
Comment: can you elaborate more? What type of sensors you are using for controlling?
Probably you need to have a look at how PID works:

P depends on the present error, I on the accumulation of past errors, and D is a prediction of future errors, based on current rate of change
Comment: I understand the fundamentals of PID... I just am unsure about how to go about the system... For sensors I have two ultrasonic sensors in each side of the robot facing the walls...
Comment: You should start with only the proportional term and see how it goes. If it oscillates, add the derivative term to the controller.
Integral term will be most useful for the error caused by asymmetry of motors/sensors. So you will almost certainly need it as well.
Comment: I edited my question... and once again I understand the requirements for PID and how to tune it. That is not my question... Mine is on the higher level... more of a what is my error? Heading error? lateral error? etc.
Comment: Is the goal of this robot to go down the hall as fast as possible or to minimize the time spent off of the center line?  Do you assume that the hallway is perfectly straight and smooth, or do you expect to adjust your path based on the presence of doorways?
Comment: @user2253546, I hate it when this happens. Even if I put in bold a hundred times in a post that "I'm not asking about X", people still keep responding "for X, you should do Y".
Answer: At the foundation of PID control, there is the assumption that the quantity you are measuring (and using to compute your error) has a direct linear relationship with the quantity you are controlling.
In practice, people frequently bend this rule without things going horribly wrong. In fact this resiliency to modeling error--when our assumptions (our "model") do not match exactly to the real system--is one of the reasons PID control is such a popular and commonly used technique.
In your case, what you are measuring is distances between your robot and the walls, and what you are controlling is the speed of your motors. So your question really boils down to "How can we describe a (hopefully) linear relationship between these quantities?"
First off, we have to deal with the fact that we have at least six different numbers floating around (four sensor measurements and at least two motor speeds), when we'd really like to have just one, to make a simple SISO (Single Input Single Output) PID controller.
For the motors, one way we can accomplish that is by choosing to use the difference between the motor speeds as our control quantity. We will have to control overall speed separately, but it makes steering a lot easier this way.
$\omega = R_\text{wheel speed}-L_\text{wheel speed}$
Next, for combining the range sensor inputs we have a number of different options to choose from. Which one is best for a given situation will depend a lot on the geometry of the robot and where the sensors are pointing. For now, let's just assume we can boil it down to a DISTANCE_LEFT and DISTANCE_RIGHT that tells us how far away the walls are on either side. We can then take the difference and use that as our "error" measurement. Minimizing this error makes the distance to either wall equal and keeps us centered in the hall. So far, so good.
error = RIGHT_DISTANCE - LEFT_DISTANCE

Now for the part where we bend the rules. When we chose to use the difference between left and right motor speeds as our control variable, what we were in effect doing is controlling the angular rate of our robot. The relationship between angular rate and us being centered in the hallway goes something like this:

angular rate --> {integration over time} --> robot heading angle -->
  {cosine of heading angle * forward movement speed} --> movement speed
  toward or away from the hallway center --> {integration over time} -->
  robot position in the hallway

Yikes! That does not look linear. What do we do? Well, we can do what all good engineers do when faced with a complex math problem. We approximate. ;)
For example, if the robot is facing in roughly the direction down the hall that we would like it to go, we can make the claim that our robot's heading (for small heading angles) is (approximately) linearly proportional to it's movement speed toward or away from the hallway center. Now we have:

angular rate --> {integration over time} --> robot heading angle -->
  {approx. linear} --> movement speed toward or away from the hallway
  center --> {integration over time} --> robot position in the hallway

Better, but we're not there yet. We still have those integration operations to deal with. This is where it gets complicated. I'll see about filling out this answer more later, but for now I'll say that the reason this PID controller (might) still work has to do with (a.) the integral and derivative terms in the controller and (b.) interaction between the controller and the dynamic equations governing the motion of the robot itself.
Comment: I really liked your post. It was clear and gave good insight into the relationship between PID input and output. Thank you a lot for your post. :)
Comment: Yeah, except its hugely overkill. Bringing motor speed into it serves no purpose other than confuse the reader. No where in the question do I even see the mention of motor encoders for rotational velocity, other than to say it is already working, someway.  Just goes to show, pretty pictures is what sells on robotics stack exchange, not answers. This posted 2 months after the correct explanation was given.
Answer: error = distance to left - distance to right, goal (set point) is 0.
Comment: I would suggest elaborating a bit more. One-liners are not very beneficial since they are often very unclear.
Comment: It was specifically responding to the comment "I understand the requirements for PID and how to tune it. That is not my question... Mine is on the higher level... more of a what is my error? Heading error? lateral error? etc" Hope that helps.
Comment: Questions and answers will be read by many people, not just the original asker. By providing fully fledged answers with context, stackexchange sites become a resource for others with similar questions in the future.
Comment: I could draw pretty flowers too, if that will help.

Differential Drive Robot Control


When to start applying for permanent lectureships (UK, humanities)?

Question: Last year, I finished my PhD in history and started a 3-year postdoc at a Russell Group university in the UK. I have a few peer-reviewed articles, but haven't published my thesis as a book yet. When is a good time to start applying for permanent lectureships (tenure-track assistant professorships) in the UK?
Comment: Your mentors (e.g. PhD advisor and postdoc advisor) are key here. You'll need their support to land a position (and they are in a much better position to answer your question then us).
Comment: Yesterday. Or earlier. The more you apply, the more you understand how it works.
Answer: There is never a perfect time. There is always something to finish, or something important to do to boost your CV.
You should start applying when you feel ready, or perhaps slightly before that. The job market is extremely competitive -- it might take 2+ years and 100+ applications to get your first offer. Better start early and learn by doing.
Answer: The time to start applying is now. You are in a strong position, fresh out of your PhD and with a 3-year runway in which to get a permanent job (or find a very good second postdoc that will set you up for a permanent job). This means that for the moment you can be picky and only apply for jobs which you think would be particularly good to have, or for which you think you would be a particularly strong fit. Apply more and more broadly as you get towards the end of your postdoc, until in the last round at the start of your third year you're applying for more or less all the jobs out there (that you would actually take).
I realise that having a book is very important in history, and you may well not be in a position to actually get a permanent job until you've published one, but it's still important to start applying regardless.

Partly this is because, as others have said in their answers and comments, that you will learn how to write applications and how the job market works by participating in it, not by simply spectating.
Another reason is that there is a lot of randomness in the job market. For some jobs, you might be more competitive than you think, just because of some alignment of circumstances that makes your profile a particularly good fit even if you're relatively junior. Moreover, opportunities which pass you by now may not come again. The job market in the humanities is very tough at the moment, and may even get worse in the future.
It is also because even if searches are notionally closed, word gets around. Even if a search committee rules you out as too junior, they might still view you as a good prospect, and that could be communicated to other people in the field. Similarly, if you are applying to permanent positions now your letter writers will also have you in mind if the question of hiring comes up (e.g. at conferences—people talk!). It's good for you to be in as many people's minds as possible as a good prospect, even down the line. Starting to apply now sends a message for the longer term.

All this being said, there is a cost involved in being on the job market. It takes a lot of time to prepare good application materials, and more time still to tailor them to particular jobs. This is time you're not spending doing research and publishing your work. That's why I recommended a staged strategy above, starting with fewer applications and ramping up to more as you get closer to the end of your position, when your profile will be stronger and your materials more polished (but also when you'll need to have another job more urgently). There is also an emotional cost, so again, building up over time can help keep that manageable.


Benefits of Contrast Measurement with an External Light Meter?

Question: I'm learning to use a Gossen Digipro F2 light meter and am unclear about the benefits of "contrast measurement." The manual indicates that after "...aiming the meter at various areas of the subject... ...the entire measured contrast range is displayed on the analog aperture scale" from the lowest f-stop to the highest one.  I've consulted several Gossen resources to no avail.  Any help you could provide would be very much appreciated.
Comment: Two words: [Zone System](https://en.wikipedia.org/wiki/Zone_System).
Answer: As example: In a portrait sitting, we generally deploy multiple light sources. A "key" often called "main" lamp is typically placed high to simulate afternoon sun. The placement of this lamp is an acquired skill. The shadows cast by the key light creates shadows that give an illusion of depth that can make our two-dimensional images come to life.
Good technique entails softening of the shadows cast by the key light. Otherwise, the shadows tend to go dark thus void of detail. To accomplish, we use a light meter to allow placing a second lamp so that it illuminates these shadows from the camera's position. This lamp, called the "fill" is normally set subordinate to the key. Such a lash-up sets the contrast range of the portrait.
Should the fill be equal in brilliance to the key, the resulting image will be "flat". The lighting ratio is 2:1. Say the main outputs 1000 units of light, 1000 play on the frontal portion of the face and near zero in the shadows cast by the key. The fill illuminates the shadows with 1000 units plus the frontal areas also receive 1000 units. That's 2000 units on the frontal areas and 1000 units in the shadows thus the 2:1 ratio, this is flat lighting.
If the fill intensity is reduced 1 f-stop to 500 units, the frontal areas receive 1500 units while the shadows receive 500. This is 3:1 lighting, "normal" contrast. A flattering lighting.
Of the fill is reduced again by 2 f-stops to 250 units, the frontal area receives 1250 units and shadows 250 units. This is a 5:1 high contrast lighting.
If the fill is reduced to 3 f-stops subordinate to 125 units, the frontal area receives 1125 units and the shadows 125 units. This is 9:1 ratio, very high contrast (theatrical).
This is just one application, there are many other applications where knowing the scene lighting range allows for creative handling of the exposure setting and/or choice of developing/printing techniques and/or post-editing.
Answer: The German/English Manual for the F2 is here
The only possible benefit is that contrast measurement helps you make the picture you want to make.
It would be useful when you are looking for specific contrast ratios among parts of the scene. For example one stop between the key and fill sides of a head shot portrait...which is relatively straight forward to do without that feature of the F2.
On the other hand if you were working with four or five or more lit surfaces, for example a group portrait then having the entire range of measurements might be useful for adjusting the lighting if possible or deciding how to handle the variation of the lighting cannot be adjusted.
But if it doesn't help you think about how to make the picture you want, then it doesn't provide a benefit.
Answer: I don't think it is of much use in most normal situations; but in certain situations it can be handy.
For instance, say you are wanting to balance the flash exposure of a model indoors with the strong backlighting of a window they are in front of. Normally an incident meter would be used at the model's position pointing back towards the camera, but that won't work here... you need a second/separate reading for the backlighting.
If instead you read the backlighting and the available lighting in contrast mode, it will tell you the difference between the two in f-stops, and therefore how much flash power you need to add/adjust.
This isn't really much different from measuring multiple lights to set a contrast ratio; I just never found that to be very useful (if you know the setting of one light; you pretty much know the setting/ratio of the others in most situations).
The other advantage is that it keeps both measurements rather than having to remember/write down the previous one. So far, I haven't found the need for that in most situations either ;>)


If i changed my phone battery will the data be erased from my phone?

Question: My phone's battery has a problem and I need to replace it. I have a lot of important data in my phone and would like to whether changing the battery erases the data on the device.
Comment: You can "accept" an answer that meets your expectations by selecting the tick mark below the answer. You cannot upvoted since you don't have enough reputation
Answer: No,changing battery doesn't erase phone data.The data won't be erased.
Just switch it off before you remove the battery and insert a replacement battery.
Answer: As per GSMarena, Samsung Galaxy Note 4  has Removable Li-Ion 3220 mAh battery.
So, it doesn't affect your device anyhow if you change your battery to a new one.
Removable battery are easy to change. You can buy one from any Samsung Authorised store nearby. However,
before going to remove battery off the device, make sure to turn off your device to prevent data loss, unwanted changes, irregularities or misbehaviour of device.
For more read user's comment on xda-developer's forum: Is it bad for the phone to pull out battery before shut-down?
Answer: Replacing the battery does not typically erase data on the phone. What phone are we talking about? If it has a removable battery, it should be very easy to swap out and swap in batteries.
Having said that, always power down the phone first, before you take the battery off.
Answer: Some phone after removing battery will reset the system time


Painting gas stove top

Question: I have a gallery series fridgedaire gas stove with several scratches on the stovetop. What kind of paint should I use?
Comment: LMGTFY: appliance paint touch up
Answer: I'll suggest "don't bother" - no paint, including "Appliance Touch Up Paint" has the durability of baked on enamel, and yet that got scratched up.
It can be scratched, scratched but (obviously) painted, or scratched but painted but the paint is getting scratched off again.
It will never "look like new" again, and at least scratched doesn't look any worse when the next scratch goes in...
Comment: Advantage of touching it up is that otherwise the scratches areas may start to rust.
Answer: I have basically the sentiment that Ecnerwal has, although I will tell you what I do in my rentals or pre-selling.
I hit them with grill-grade/fireplace spraypaint.   I use rustoleum brand and do it in white, black or silver.   It looks good (not like new), it last, and you can redo it in 20 seconds.   Silver and white are very noticeable when chipped and you can go either way with black.
Trying to make it like it did before looks like an eyesore and something that thick will certainly not take the heat and sharp pans hitting it.

Painting gas stove top


Icons for drawing architecture diagrams

Question: Do you know any repository of icons for drawing system architecture diagram? Something with nice and tidy server, database, client icons, etc.
Comment: I know programs that have that, but a repository? Nope.
Comment: Is it something other than MS Visio?
Answer: I find IconFinder to be pretty handy for finding icons (imagine that!). Lots of different styles and sizes available for the ones I checked (database, server).
You can tune your search based on the size you want and whether the icons are freely usable or not (they have both kinds).
Answer: See database icons at:
http://www.perfect-icons.com/stock-icons/perfect-database-icons.htm
Answer: I found free OSA Icon Library very useful:
SVG Icon Download,
PNG Icon Download
Preview of library:
Answer: Flaticon should be mentioned as most icons are released under CC BY 3.0. They provide a considerable amount of flat icons for servers and other IT hardware / services that easily fit in a diagram.

Icons for drawing architecture diagrams


Why is POW mining process not affecting PC performance?

Question: So I've been using this site, Moon Bitcoin for a little while (it's a faucet), and recently they have added a feature to do some bitcoin mining in the background, to increase the amount of bitcoin you get to claim. Today, I turned it on, and set it to "very high CPU usage", and sure enough, my processor immediately shot up to 100%. I don't have a powerful computer, I have a Pentium N3700 in my laptop, with integrated graphics. While that mining process was running, I unpaused a YouTube video I was watching, expecting it to lag (when I run a CPU intensive application, or game, YouTube lags). To my surprise though, it played like normal, really smoothly, even normal usage seemed really smooth. My question is, how is my computer running so smoothly, even with 100% CPU usage in task manager?
Answer: The CPU usage just tells you how busy the CPU is. It does not tell you whether some processes would like more CPU time but cannot get it. In Linux/UNIX environments, this is measured using the "load average". You cannot tell whether your PC is overloaded just by looking at the CPU usage.
The mining process is most likely running at a very low priority. This means that it'll get less CPU time as processes with higher priority use more. On the same priority level, processes have equal weight. Scheduling is a very complex topic.


A new type of manifold, is such a construction interesting? Is it relevant for the Euler-Lagrange equations

Question: Recently, I've been wondering how to rewrite the standard Euler-Lagrange equations:
\begin{align}
\dfrac{\partial L}{\partial q^i} - \dfrac{d}{dt} \left(\dfrac{\partial L}{\partial \dot{q}^i}\right) &= 0
\end{align}
(all derivatives being evaluated at appropriate points along a stationary curve of the action functional) without referencing the coordinates $(q^1, \dots q^n, \dot{q}^1, \dots, \dot{q}^n)$ on the tangent bundle. So, I tried to rewrite things as much as possible using only "natural operations" on the tangent bundle, like Lie-derivative, exterior derivative etc. Of course, I didn't succeed (and any articles I tried to search online were too abstract to understand), so what I did was expand the total time derivative:
\begin{align}
\dfrac{\partial L}{\partial q^i} - \left[\dfrac{\partial^2 L}{\partial q^j\partial \dot{q}^i}\dot{q}^j + \dfrac{\partial^2 L}{\partial \dot{q}^j\partial \dot{q}^i}\ddot{q}^j \right] &= 0.
\end{align}
This gave me the idea that perhaps thinking of the Lagrangian, $L$, as a function on the tangent bundle $TQ \to \Bbb{R}$ is perhaps not the most appropriate/natural setting. It seems that the tangent bundle only has coordinates $(q, \dot{q})$, whereas the Euler-Lagrange equations which are second order differential equations, involving $\ddot{q}$. So, it seemed to me that it would be nice to construct a new manifold $M$, from the original "configuration manifold" $Q$, so that on the new manifold $M$, we have local coordinates $(q^i, \dot{q}^i, \ddot{q}^i)$, for $1 \leq i \leq n$.

To formalize this idea of introducing a larger manifold with extra coordinates for higher derivatives, my plan was to mimic the construction of $TQ$ as much as possible.

Let $k \geq 1$ be an integer and let $Q$ be a smooth manifold modeled on a Banach space $E$. Now, we define a relation $\sim_k$ on the set of all smooth curves $\gamma:I \to Q$, where $I$ is an open set in $\Bbb{R}$ containing $0$, by declaring $\gamma_1 \sim_k \gamma_2$ if and only if there is a chart $(U, \alpha)$ of $Q$ such that (the composition below makes sense and) for every $r \in \{0, \dots, k\}$, we have
  \begin{align}
(\alpha \circ \gamma_1)^{(r)}(0) &= (\alpha \circ \gamma_2)^{(r)}(0).
\end{align}
  A tedious, but straight forward induction exercise and chain rule shows that this relation doesn't depend on the choice of chart $(U, \alpha)$, so we're actually justified with using the notation $\sim_k$ without referencing the chart. This is also an equivalence relation. For the lack of a better name, I shall denote the quotient set of equivalence classes as
  \begin{align}
C^kQ := (\text{smooth curves in $Q$})/\sim_k,
\end{align}
  and I shall call it "the $k^{th}$ order contact manifold of curves in $Q$". Given a smooth curve $\gamma$, we shall indicate the equivalence class either as $C^k\gamma$ or $[\gamma]$, whichever is more convenient. Next, I outline how I put a manifold structure.
I realized that this space has quite a bit of structure: we can define a projection map $\pi_k : C^kQ \to Q$ by sending $C^k \gamma \mapsto \gamma(0)$. We can even make this into a smooth manifold as follows: given a chart $(U, \alpha)$ on $Q$, we define the chart $(C^kU, C^k \alpha)$ by defining $C^kU := \pi_k^{-1}[U]$ and $C^k \alpha : C^kU \to \alpha[U] \times E^k$,
  \begin{align}
C^k \alpha([\gamma]) &:= \left( (\alpha \circ \gamma)(0), (\alpha \circ \gamma)'(0), \dots (\alpha \circ \gamma)^{k}(0) \right)
\end{align}
  This is a well-defined map because of how the equivalence relation was defined. It is also easily seen to be a bijective map, and also, if $(V, \beta)$ is another chart on $Q$ with $U \cap V \neq \emptyset$, then using the chain rule, it is straightforward (though tedious) to seem that $(C^k \beta) \circ (C^k \alpha)^{-1}$ is a smooth map between open subsets of Banach spaces.
Also, I only just recently read up about fiber bundles, but I believe that based on what I've constructed, we have that $\pi_k :C^kQ \to Q$ is a fiber bundle, with typical fiber $E^k$, whereby the maps $C^k\alpha$ defined above provide us with the local trivializations. Is this the correct way of using the terminology?

Here are my questions:

Have people considered such spaces $C^kQ$? Are they interesting manifolds to study, and am I right in thinking that these manifolds would be a more appropriate setting to formulate Lagrangian mechanics? I believe that this is true, because if for some reason we decided to consider a Lagrangian which depends on higher derivatives of the curve, then the tangent bundle alone is insufficient to capture such information. In any case, I would appreciate some confirmation/denial along with references (if any).
Is it possible to formulate the Euler-Lagrange equations in a coordinate-free manner, perhaps using such spaces? If yes, I'd appreciate some references (which hopefully aren't too abstract).
For $k=1$, this construction yields precisely the tangent bundle, in which case, the fiber over each point $x \in Q$, namely $T_xQ$ can be given a natural vector space structure. However, for $k>1$, am I right in saying that we cannot endow each fiber with a vector space structure? Of course, if we choose a particular chart $(U, \alpha)$, we can establish a bijection between the fiber $\pi_k^{-1}(\{x\})$ and $E^k$, and hence inherit a vector space structure that way, but I believe that this is not a chart-independent construction. Is this right?
Comment: I didn't read everything you wrote, but the idea of taking the $k$-th derivative tangent vectors is described by looking at the space of $k$-jets $\Bbb R\to M$ at $0$. The language of jets and jet bundles is natural when tracking higher derivatives than $1$. However higher derivatives are messy, and this language is (imo) unpleasant. You can find a short introduction in [these notes by Ballmann](http://people.mpim-bonn.mpg.de/hwbllmnn/archiv/geostr00.pdf) or in [this book](https://www.mat.univie.ac.at/~michor/kmsbookh.pdf) in chapter 4.
Comment: @s.harp I see, so what I've been calling $C^kQ$ is more commonly referred to as the $k^{th}$ jet space $J^k(\Bbb{R}, Q)$. Thanks for pointing me in the right direction regarding some "buzz words" to search, and for the references.
Answer: Regarding your second question, see Equation 8 in Crampin, M. (1981). On the differential geometry of the Euler-Lagrange equations, and the inverse problem of Lagrangian dynamics. Journal of Physics A: Mathematical and General, 14(10), 2567–2575. https://doi.org/10.1088/0305-4470/14/10/012


Is there any way to ecrecover something twice? (I.e. something signed by two different people)

Question: I have a signature. That signature was then signed by someone else.
If I pass this doubly-signed message as an argument to my function, is there a way to recover both signers?
Answer: Depends on how you structure this but I am assuming you have an initial message, and the second signature's message hash is the first signature itself.
If this is the case, you would have to know the dynamically created signature which I presume you pass as the message hash of the second message; then you would have to know the message hash of the first message.
You do this to recover two addresses...but "double signing" would be a bit redundant at that point when you could simply have a function that takes and ecrecover's two separate signatures and get the same result with less complexity.


Hyundai Accent 2006 Hard Start Problems When Cold

Question: I am the owner of Hyundai Accent with a diesel engine. After very cold nights, the mornings are a nightmare. The engine starts fine but a light for check up is on most of time on board, and after gear 3 the engine dies. This is happening ONLY  after a very cold night; when temperature is +1 and over everything is ok...any suggestions?
Comment: +1F? or +1C? I'm gonna assume that you're an American, so that's a cold start problem. If you can get code scanner, you may be able to see what kind of codes the ECU is throwing out.
-17C (+1F) is pretty cold, I'm wondering if the diesel side of things is making it harder...
As an aside, does it have a block heater? If it does, does it help if you used it to keep it warm before starting?
Comment: I would suggest this is not an American car, as I don't think I've ever seen a diesel version of the Accent here in the States. Just a guess on my part. Since I used to sell Hyundais, we never had one on the lot, I'd think it's a pretty good bet.
Answer: Your glow plugs may be bad. "Check Engine" light may also mean faulty glow plug (checked that on 2009 SEAT Ibiza with Ross Tech VAG COM).
Faulty glow plugs may be the case, but you can tell that from the way your engine works. If upon start your engine is shaking (not working very stable) or your revs are a bit jumpy, then it may indicate that fuel in some cylinders are not burned.
If this really is the cause, then after starting the engine try leaving it idle for few minutes. Glow plugs are needed only to heat up cylinders on start, after some time they get hot from all explosions and diesel does not need them anymore (diesel explodes from compression and high temperatures).
Faulty glow plug may also produce smoke (white smoke / unburned fuel) but in cold weather it is hard to know since there will be much more steam coming too.


Can isolated forms be dangerous for my server security?

Question: I'm learning PHP and at the same time I write the examples that I get from the book to .php pages to test them and eventually publish them. My concern is about a bunch of forms that are there to test the codes; these are very basic forms that have no validation code and I would like to know if someone could do bad things into my files/hosting by injecting codes on them. Actually these forms do not point to any important data, they are only there to write on the webpage itself but without saving any information, but I have this concern since I have no knowledge of these web languages.
Comment: Read the OWASP top 10.
Answer: Your main concern, if you can use these scripts to "write back" to the page, is Cross-Site Scripting (XSS). You should also be aware that just because you don't link to a file, doesn't mean someone won't find it on your site. There are tools (e.g. dirbuster) that can brute-force file and directory names on web servers to find interesting things like admin scripts.
Bottom line: don't put test data on your production server, or, if you absolutely must, at least put the scripts in a directory protected by a password (e.g. htpasswd for Apache).
EDIT: Adnan points out that you want to execute arbitrary PHP code on your server, submitted by users. That's the definition of a horrible security hole. The way that other sites get around it is via heavily sandboxing the PHP installation and blacklisting risky commands, but even then it's not perfect. My suggestion? Don't try to do this if you don't have a lot of experience in PHP, Linux administration, and security.
Comment: Well, I had the idea of creating a PHP tutorial and have pages that show both source code and a form to test how it works. How could I have something like that available to the public without being a loophole for malicious users? Is it possible? I'm using just a free account...
Comment: Filter the input so that XSS isn't possible. Take a look at [this](https://www.owasp.org/index.php/XSS) and [this](http://security.stackexchange.com/questions/1368/can-anybody-explain-xss) for more info.
Comment: @Poly That's not what he wants. He wants to create an HTML form that will submit **PHP code** to the server and have the server execute it. XSS is the least of his worries.
Comment: Oh jeebus. Yeah there's no hope here.
Comment: No, no... I don't want the users to send arbitrary PHP code... not that. It is just an example form where you input strings or numbers and it prints it in the same page, just as a demonstration. But I am aware that they could input source codes as well...
Answer: I believe you're asking about a form that will submit data to the server, and the data will be injected in a .php file (or executed on the fly) and then the output viewed back as a way to preview PHP commands in a PHP learning environment. Looking at your comment, it's clear that this is indeed what you're trying to do.
Do not do that. You're basically providing an open eval access to your server. You'll have to spend countless hours filtering malicious PHP statements and function calls, and you won't catch all of them; you'll miss something. There are other smart people who have spent a long time to develop such services in a secure fashion.
Create and read all the tutorials you need, but when you want to let others test it, then when you want to test or let other test, use services that are designed for that. Another possibility is to use something like EasyPHP or XAMPP to have your own development environment on your own computer.
Comment: I'm not making a code simulation environment. It is just a show of source code as plain text and then the result of that code, which in these cases, are forms, so an user coult test how the form works. They are just very simple forms... perhaps adding something like htmlentities() as validation or allowing no more than a very short string to be passed could be enough?
Comment: @SakhalTurkaystan Take code from user + Pass the code to the server + Execute the code on the server + View the result back to the user = **Bad bad bad bad bad bad**
Comment: Yes, I understand. If I replaced the PHP script for a client-based script like Javascript doing the same function, would that be still bad?
Comment: @Sakhal If the code isn't submitted to the server, parsed in the browser using Javascript, and then executed in the browser, and without introducing a feature where the code is inserted using URLs (`#` changes), then you're safe. Whatever the user does will only affect his browser and nothing else. There's a nice project that can help you with that, http://phpjs.org
Answer: The answer to your question is "yes". Depending on how and what you are doing in those isolated tests, and this in conjunction to the fact that you are a newbie in this languages it is quite probable that you end up having a backdoor than allow a malicious user to control the http-user of your server and he will be able to write files, list, modify them...
Tests should be done in controlled test environments. I.E. your own pc =)
Comment: Thanks, i know that I should have the PHP interpreter in my own computer, but it is 64 bits and I found no clear support for this environment. Now I wonder... if I have several subdomains in my hosting space, a succesful attack could access the other subdomains or only the one where the security hole lies?
Comment: @SakhalTurkaystan A successful attack will compromise everything on your server. Also, XAMPP works perfectly on 64bit.


COB LED Dimming via Poentiometer?

Question: I want to create a dimmer for high power LED light's i'm building for video work. I'm using CREE CXB3590 chips, which have run at 36V with a forward current of 3.6A. I am powering these through a 150W 12V power adapter, hookued up to a step up converter that has a separate pot for current and voltage regulation.  I want to create a dimmer for these lights, and I would like to do it as simply as possible. I have a box of assorted resistors and some 100K pots, so the question is, can I use these resistors and a 100K pot to dim my lights, and if so, how would I go about doing so? I don't know how the math works, but I can follow a schematic so I'd appreciate any help the community could offer. Thank you!
Comment: Unsolder the current pot from your step up converter, run wires from the PCB to wherever you want the dimmer knob located. Job done.
Comment: At a minimum you'll need to supply a datasheet link for the power supply. A schematic would be even better. Proof-read your question title too while you're editing!
Comment: Welcome to the site. Please realise that this is not a free design
house, homework-answering service or an on-line technical encyclopedia, copied
out to you on demand. This means we will not provide you with a schematic or do the math for you. People will help you take the next step if your question
shows that you've done as much as you possibly could on your own - which your
post doesn't, I'm afraid. Again, a warm welcome to the site.
Answer: I'd recommend you 86 the 12V power supply and boost driver.
Use a $40 Mean Well HLG-150H-36 CC Driver.  It has a pair of DIM wires where you connect a 100K pot to set the current.  I use 10 resistors and a jumper to select the current.
I have to question your use of the CXB3590.

The typical forward voltage is 38.5V @ 3.6 Amp.
Running it at 3.6 Amp makes thermal management very difficult.

I would only use a CoB if size is an issue.  If you were to use some $4 1200 lumen Bridgelux EB Series Gen 2 strips you will get a much better lumens per watt ratio and thermal management would not be needed. Cost would be less per lumen but would take up about a sq. ft. of real estate strips are 11" x 1". Light uniformity would be better with the strips.
The max lm/W for the CXB3590 is 145 lm/W. The strips are 180-175 lm/W.
Heatsinks and fan for the CXB3590 will add considerable cost.  The CBX3590 will also loose efficiency if you do not keep the temperature down.

COB LED Dimming via Poentiometer?


How do magnetic shields work?

Question: I've come across the fact that magnetizable material can shield magnetic fields. For example, if I put a ferromagnetic plate between the magnet and a nail that is hanging on a thread pulled towards the magnet, the nail will eventually fall down when the plate covers the path between them.
How exactly does this work? The descriptions I've found via google so far don't make sense to me.
Probably there is a difference between static and dynamic fields, I'm mostly interested in the static case though.
Answer: The intensity B of the magnetic field, given a fixed position, is proportionnal to the inverse of the permeability $\mu$ of the material. However, $\mu = \mu_0\mu_r$ where $\mu_0$ is the permeability of the void (it is a constant) and $\mu_r$ is the relative permeability of the material. Then,
$$ B \propto \frac{1}{\mu_r}$$
However, for air, $\mu_r \approx 1$, and for iron or ferrite (and many other materials) it can be more than 1000, which strongly diminish the intensity of magnetic field.
Comment: Thank you for your answer. I'm not sure if I got it correct though: I see that $\mu_r \approx 10^4$ is a reason for the field intensity to decrease. But only inside the material, right? The field behind the plate should still have the same intensity which is not the case.
Comment: The material acts like a shield (like when using your phone on a tunnel: the electromagnetic signal can't go through the mountain you're under, but it can travel through air; however, it can't escape the tunnel), so event after the plate, the field is weaker.
Comment: That was exactly my question: WHY is it weaker? Only because there is one spot where the field intensity decreases because of some material, the field won't be globally weaker instantly, or am I mistaken here?
Comment: To find the electromagnetic field caused by a source on a given point, you can use quantum electrodynamics. According to this theory, you have to integrate along all the possible path that go from the source to the given point to find the resulting field. Here, you can see the the field on a given point depends on the whole space configuration. However, I couldn't tell you more than that about this  topic.
Comment: Oh wow, that's interesting! I was hoping for some kind of comprehensible phenomenological explanation rather than an abstract theory. But I guess there is none so I think I'm okay for now. Thanks for helping!
Comment: @user424862: Here is a more detailed computation https://physics.stackexchange.com/a/146314/17354 for which this answer serves as a summary.
Answer: Perhaps you know that magnetic fields are closed loops. So if you influence such a magnetic field by another material the magnetic field lines take a different path.

I've come across the fact that magnetizable material can shield magnetic fields.

Any material is magnetisable but in different strength. This has to do with the magnetic dipole moments of the subatomic particles of the material. If the particles could be aligned easily - like this is the case for ferromagnetic materials -the field lines are going along the shape of this material and in some regions outside the shape the magnetic field gets very weak or is not observable at all. By this

the nail will eventually fall down when the plate covers the path between them.
Comment: Thank you for your answer as well. But unfortunately you didn't really explain what I was asking for. So let's say the field lines are following the shape of the material. Why would the intensity then decrease outside of the material? To me, changing the direction of the lines doesn't implicate a decrease in intensity. But I'm clearly not an expert so I would be glad if someone could elaborate.

How do magnetic shields work?


Customized time stamp / clock

Question: Is it possible to create a customized time stamp on the video? By customized I mean an arbitrary hour:minute:second that would count up time (24 fps)? The Metadata stamp is useless for this purpose, since it will stamp current system time at the end of each frame render, which depends on render time anyway.
Comment: Related http://blender.stackexchange.com/a/26644/15543
Answer: Metadata should give the following:

Time gives timecode as HH:MM:SS.FF (This will depend on the framerate you set in the render settings.)
Date gives the system date and time.
RenderTime gives the time taken to render the frame.
Frame gives the frame number.

You could affect the timecode by sliding your scene to the desired timepoint in the VSE and render from there.
Comment: Yes, indeed, that's seems to be the easiest way without coding but Blender has a limit of starting frame at 300,000. And to achieve a time stamp of let's say 5:30, starting frame must be 475200.
Comment: You can probably rig something up with this then: https://github.com/leomoon-studios/blender-text-counter/blob/master/README.md

Customized time stamp / clock


What manga chapters of Minami-ke are serialized in anime and OVAs?

Question: I just saw that it's still an ongoing manga, so I was wondering what chapter was the last serialized. Also, what other chapters of the manga are serialized and what's left out?
Answer: According to MangaUpdates:

Starts at Volume 1, Chapter 1 (Season 1)
Ends at Volume 6, Chapter 118 (Season 3)

These is a season 4 on top of that, but I couldn't find what it adapts.
Apparently the second season deviates from the manga or more accurately, includes non-manga episodes/content.
An excerpt from the link above:

It is also different in storytelling as it uses material not from the manga

As of August 2014, 12 tankōbon volumes of the series have been released, which as you say is still ongoing.


How to deal with bad sectors?

Question: Bad sectors will eventually occur, but how should I deal with them? If a bad sector occurs, does that mean that the data in that sector is irrecoverably lost, and I should restore it from backup? Is there any way to automate finding out which file belonged to that sector and at which offset, and to automate that recovery? Is there anything I can do on the filesystem level to make my life easier? (ECC?)
Comment: You have backups, and you replace the disks when failures occur.  You can setup RAID help help deal with media failures.  You can use filesystems with checksums to detect failures (ZFS, BTRFS)
Answer: You do not deal with bad sectors. Your hardware, server configuration, and internal procedures protect you from their effects.

Every modern hard drive anticipates a certain amount of bad sectors, and internally remaps them. This process is completely transparent to the user/OS, until such time as the remapping space is all used up (at which point you start seeing bad sectors).
Long before you see bad sectors your drive will start crying - SMART or equivalent technology causes the drive to report faults to the operating system (which you are of course monitoring for, right?).
If you love your data (and who doesn't) then you don't just trust it to one hard drive.
All your important data is on RAID volumes (hardware or software - makes no difference for the purposes of this discussion).
RAID gives you two or more redundant hard drives, so that when one disk fails you have the opportunity to replace it without losing any data.
Because you know that RAID Is Not A Backup, you also make regular backups (and periodically verify that you can restore them successfully), so that even if you lose enough drives that your RAID array is trashed you can still get your data back.

As with all good strategies, this is Defense In Depth:
The hard drives do their best to safeguard your data by handling errors/bad sectors gracefully.
Should the hard drive fail, RAID keeps your data safe until you can fix the hardware problem.
If the RAID fails to protect you your backups are a final chance to save your data.
Ideally you use all of these techniques all of the time (at least for important data), but you always have at least one layer of the onion (even laptop hard drives are S.M.A.R.T. these days).
Comment: A remapped sector ***IS*** a bad sector - it's just one the hardware has dealt with for you transparently (most of the time with no data loss). When you start *seeing* bad sectors on a modern drive (with a tool like `badblocks`, or in your logs) it means all the remapping area has been used -- at that point you should consider the disk dead and replace it.
Comment: Alright, I didn't know that a remapped sector is not the same as a bad sector. I thought bad sectors get remapped. So when the disk is degraded so much that a sector cannot be remapped then it becomes a bad sector? And if it *was* remapped then no data was lost at that point in time?
Comment: There is a purpose, because i like to use my old clunker drives in raidz2 configuration, and when one of the drives goes faulted to reallocated sector count being too high, i like to ensure those sectors are marked bad, then resilvere it again.  Rinse and repeat until it turns itself to shrapnel.  One caveat, if you use too much of your drive up with unusable sectors, it wont be large enough for the stripe.
Answer: Every time a hard drive writes a sector, it also updates a checksum (stored immediately after the sector data). When a sector is read from your hard drive, it's expected that the sector checksum will match the sector data, if that is not a case, something went wrong during the write operation, that's called a bad sector.
There are two common reasons for bad sectors:

Power failure during write.
Hard drive is malfunctioning.

I have published a free program that allows you to test your disk for bad sectors, and see whether you should replace your hard drive, or simply wipe the bad sectors of a healthy drive, you're welcome to download it here.
As for your second question, I usually store an MD5 checksum of each of my important files in an NTFS alternate data stream, I have written a nice program that helps me hash and verify my files, and it had helped me on more than one occasion, check it out here.
p.s. RAID will not save you from bad sectors during power failure (unless you have battery backup), I know this from first hand experience. moreover, you may be required to wipe out the bad sectors to allow the array to be rebuilt successfully.
Comment: I would have voted this up for the information about the checksum, if you would not have included links to your programs that I am not sure are working or correct or whatever.
Comment: Sorry! Updated URLs
Comment: :) I meant an answer is not the place to advertise for personal stuff.

How to deal with bad sectors?


Can i create image of my current installed ubuntu so that i can install it on other machine?

Question: I am running Ubuntu 12.04 TLS. Is there a way to produce an ISO installable image of my current system so as I could burn the image on a flash drive and be able to install it on an other PC ? Please provide details. thanks
Answer: I'd love to provide you with this answer, and particularly with details.  You see, there are two popular and equally correct answers, and I'm prepared to offer both to you, with the understanding that the one which sounds easier is much much more dangerous to your data, while the one which sounds slightly more complicated is immensely safer, while also being easier.  Given the choice I'm a big fan of both fast and easy.  Neither method is significantly slower than the other.
Also please see my bio and take my word for it that the program I use for cloning is in fact the slightly more complicated sounding solution.  So lets get started.
The solution I wish to recommend to you is CLONEZILLA
Clonezilla is a program which comes to you as a downloadable ISO which you burn to a cd and boot your computer to in order to operate it.  After several text menus, it gives you the stupid easy choice to back up your drive (or just partitions) to an image file on external usb media (in most cases) or directly to another drive entirely.  I recommend the image transition, if only because I'm fond of backups.  Using an intermediary takes longer, but I think it is worth it.
The other solution uses a utility built into Ubuntu called dd.  I have heard that dd official stands for data description, although it is commonly referred to as "drive duplicator" but that it's ambiguities which causes people to copy blank drives over full drivers resulting in Data Destruction.
Comment: I find this site so confusing.  I don't understand how my answer somehow scored me MINUS FIFTEEN.
Comment: I am having similar task. I have a dual boot(Ubuntu 14.04 within Windows 10) , ubuntu is being installed on windows 10, I mean their is no seperate partition for ubuntu. Now, I would like make bootable backup on USB with only ubuntu. I have looked at clonezilla but it may clone both windows and ubuntu both.
Can you help me.
Comment: @gyropyge the first two paragraphs are basically "blah blah", that might be why.
Answer: You can easily move any Linux installation by just moving its folder, as long as you don't alter the files or their rights. So it is 'tar caf /ubuntufolder archieve.xz' but there are difficulties:

You MUST do the archieving while booted from LiveCD or another Linux installation OR exclude pseudofolders like '/proc' '/tmp' and whatever else.
After unpacking, you will have to reinstall bootloader and check '/etc/fstab'.
Comment: Dear Barafu Albino. please explain it in a little more details.
Comment: Those are basics. I am afraid explaining them will take pages of text. For example [here](https://help.ubuntu.com/community/LiveCD) is some info on how to boot LiveCD. Search Internet for relevant instructions. May be follow different advice. This one is the simplest as in "requires no special software".
Answer: You need a program that can produce an iso file, and this is Remastersys.
This set of instructions helped me install and run successfully remastersys on Ubuntu 14.04.1 32bit and also successfully make a bootable flash drive with the custom iso I made.

Open the Terminal (Press Ctrl+Alt+T) and run
sudo apt-get install plymouth-x11

Go to this link and download remastersys version for 32bit or 64bit system
IMPORTANT: I downloaded version 3.0.4-1 i386 and it WORKS
I checked 3.0.2- version and it doesn't work.
Open 'Software & Updates' (search in Dash or in the System's parameters)
In 'Software & Updates', go to "Other Software" tab and press "Add..." button
Copy/paste this
deb http://www.remastersys.com/ubuntu precise main

and press OK
Now look for two lines with "www.remastersys.com/" in the list you can find on the Other tab and make sure you check both boxes. Enter a password if you are asked to.
Switch back to Terminal and run
sudo apt-get install remastersys-gui

To open remastersys-gui, you always need root privileges. So do it in the Terminal
gksu remastersys-gui

Comment: As a note: remastersys was abandoned and remastersys.com is just some random link collection website now, there is a fork available called Linux Respin available under remastersys.org


Collection using reference equality

Question: In Java is it possible to create HashMap that uses reference equality (i.e. ==) instead of the equals() method?
Answer: Use the IdentityHashMap class.  This is a variant of HashMap in which == and System.identityHashCode() are used instead of Object.equals(Object) and Object.hashCode().
Note that this class intentionally violates the API contract of java.util.Map which requires that key equality is based on equals(Object).
Answer: The IdentityHashmap class comes with standard Java. From the JavaDoc:

This class implements the Map interface with a hash table, using reference-equality in place of object-equality when comparing keys (and values). In other words, in an IdentityHashMap, two keys k1 and k2 are considered equal if and only if (k1==k2). (In normal Map implementations (like HashMap) two keys k1 and k2 are considered equal if and only if (k1==null ? k2==null : k1.equals(k2)).)

Be aware that many functions that take Maps do so assuming that they will use equals, rather than reference equality. So be careful which functions you pass your IdentityHashmap to.
Answer: You can override the equals method of the objects you insert into the HashMap to test reference equality.
As in:
public boolean equals(Object obj) {
    return this == obj;
}

Collection using reference equality


Amused vs Bemused

Question: what is the difference between Amused vs Bemused
Answer: Bemused seems to be confused with amused a lot but they're actually different and not similar at all.

Bemused means "confused, bewildered, or baffled" and has nothing to do with amusement or humor or anything funny at all.
Amused means "finding something funny or entertaining."

To answer the question, bemused is used to describe something as confusing while amused describes something as being funny.

Amused vs Bemused


how long should I wait to hear back?

Question: I went to a job interview for a factory. (This is going to get confusing so bare with me) I applied for a machine operator, and they interviewed me for a line worker. Well after looking over my resume the superintendent saw how much Manager experience I have and suggested I apply for the superintendent position saying I was overqualified and over dressed for the position in which I was being interviewed, but I could have the job if I so wished but I wouldn't be able to get the superintendent position, and he wasn't able to interview me for a position equal to his (Obviously). So I submitted an application for the superintendent position and have been waiting. I waited about 3 days and then I called to get some feedback but was sent to voicemail. I left a message with my number to call me back but never received a call back. A few days later I called again and got the same voicemail, so instead of leaving a message I decided to stop by the factory. How ever nobody in personnel was able to give me any information on what would happen just simply stating I would receive a call. Yesterday was Christmas and it has been over a week that I've been waiting for this call. What should I do? Should I go back and ask for the lower grade position? I've submitted applications to other companies but nothing seems as promising. Or should I wait? I'm very anxious to get this job and I want it so badly. I do not want to bug but I am very confused. Would they give me a call back to let me know they are not interested?
Comment: Also, this is holiday season. Don't expect prompt answer.
Comment: You may want to contact their HR to find out if they do have a superintendent position open or not. Either send an e-mail a phone call.
Comment: You seem to have the "following up" part down pat but that may be too much of a good thing. Don't pile up the calls - they'll remember you but not in a good way. At some point, you are going to get obtrusive.
Comment: A week is nothing. It can take months to fill a position.
Answer: There are several questions you should ask yourself:

If the company is this disorganized, do you really want to work there? Maybe it is only their HR department, but normally this is a symptom of a company-wide culture, in this case not a good one.
If you take the line worker position, how much patience do you have to wait for a promotion to the superintendent position? It is not the worst start if you first get to know the company from the position of a line worker. However, if they are disorganized I wonder how well they do in promoting the right people internally.
How desperate are you to join this company?
What are your other options?

Since probably the key people are on vacation until early January, I am afraid you will need another week of patience at least. Also keep in mind that the suggestion you should apply for the superintendent position was just the opinion of one manager. Probably other people in the company see things differently.
You didn't say much about questions 3 and 4, but they are the key to deciding what to do (settle for line worker or insist on the superintendent position) and how much time to give them for a proper response.
Comment: We are fairly sure of the position being available. My brother-in-law saw an online posting for the position along with a couple people verifying the position was open.
Comment: also the manager that interviewed me was also a superintendent and said he started at line workers position and it took him 8 years to be promoted.

how long should I wait to hear back?


Could my engine be damaged

Question: My daughter first notice the sound when she drove my car. I couldn't hear it at first, drove home from Detroit to Indianapolis then yes, I could hear it. Come to find out I had very low oil, car kept cutting off when I'd come to a stop light, so I sat idle in neutral until the light changed. In that time, could I have damaged my engine?
Answer: Change the oil as soon as possible and check how much metal debris is in the oil. A good mechanic can tell you if there is an abnormal amount. If there is excessive metal int he oil, damage may have occurred. If there is no excess metal, I would say if the car runs fine, do not worry about the incident.
Answer: That is certainly not good for your engine, but it's hard to say how much damage has been done. With some luck your car will be fine. Don't drive it again until you refill the oil obviously. Check the oil weekly until you have more confidence around how often you need to check it.
Answer: My brother let the oil drop too low on an old car 35 years ago.  After driving it for a few days, it permanently made a knocking sound while sitting at the stop lights.  A mechanic said it was damaged wrist pins.  I can't say how long the engine lasted because my family sold it shortly thereafter.
Comment: I did take get two opinions. Result-I need to replace the fuel pump. I did get my oil changed, no metal shavings, thank you God.

Could my engine be damaged


Can you play as your Amiibo in SSB4?

Question: In the commercial it showed a group of kids playing as their Amiibos, so I bought an Amiibo resembling a DLC character, however I found out that I couldn't play as the Amiibo. I can play with/against them, but not as them. Isn't there a way to play as my Amiibo?
Answer: You can't play as your Amiibo since they are controlled by the game.
You can play with and against them, though.
Answer: Unfortunately, no. They are known as figure players, and they are controlled by an AI, which is modified as it learns. It battles without any input from you, though it learns strategies as it is fought. Amiibo are allies or opponents, not players.
Sadly, some of the features that were shown were never implemented, such as being able to tap them in mid-match and using them in online play. This is one of the features that didn't make it. Though I think Nintendo may have done that for reasons, like tapping them in mid-match could give you an edge that would unbalance the game, and all the boosts from feeding them equipment could make you overpowered if you could control them. I figured this out all on my own, both from the help section titled "What's an Amiibo?" and my experiences with my Pikachu Amiibo.
If that answer was too long and complicated the short version is: No, you can't. They are computer controlled characters that learn from experience, and they were going to be able to be controlled, but that idea was scrapped, along with the ability to tap them in mid-match and being able to use them in online play.

Can you play as your Amiibo in SSB4?


Can I submit a paper to a call for paper and a call for workshops for the same conference?

Question: I am applying to a top tier ML/Data-Science Conference and I feel that I might have a higher probability getting accepted in the call for workshops over the call for papers.
Can I submit the same idea/algorithm to both the call for papers and the call for workshops?
Answer: Well, since papers are generally for finished work, and workshops are for improving work in progress, it might be looked at as an odd situation. If you submit a paper for what you have done already and a workshop proposal that is related, but, perhaps, an extension to the other then it would be more natural.
So, in the exact form you suggest, I'd recommend not, but a variation might work out for you. A workshop is also valuable in that it would put you in contact with other researches with similar interests.
Answer: It really depends on the conference and the workshop. Some workshop chairs (myself included) will not accept papers that are already accepted to the conference itself. This is because of a preference towards showcasing works from sister conferences. However, the practice is not in itself frowned upon in my field.
Workshops often set the workshop submission deadline after the acceptance notification deadline of the conference itself: this is done in order to ensure that people who submit workshop papers don't retract them because they can't travel without an accepted paper in the main conference, and to let people submit their work there. Thus it's not really that common (at least in my field) to see close deadlines for the conference and colocated workshops.
Multiple submission policies are generally spelled out very explicitly in the submission guidelines. Read them carefully and see if they answer your question. If not - the best thing would be to email the conference/workshop chairs and ask.


need to obtain the public IP of the user but getting the IP of the server where the app is deployed

Question:
Possible Duplicate:
Finding out your website visitor IP address in Java

I want to maintain logs for my website. For that I need to store the public IP of the visitor. How can I do that ? Till know I this was what I have been doing :
         URL ip = new URL("http://api.externalip.net/hostname/");
        BufferedReader br = new BufferedReader(new InputStreamReader(ip.openStream()));
        String publicIP = br.readLine();

but this returns me the IP of the server , I guess where the page is hosted. For example I always get the IP as : 76.xxxxxxxx but when I check from whatismyip I have something like 106.xxxxxxx .
How can I get this IP ? Which is the public IP of the user from which it visits the website.
Answer: With every Request to your web application, client's IP is sent too. So all you need to do is to have Filter over Requests. Gain and store any information you like.


Idiom for unheard individual voices banding together to become a group with a voice that is heard

Question: Consider for example many tiny little charities that are too small to have their concerns recognized when there is a threat to them. They band together and create a bigger organization and through that, they are taken seriously and begin to be consulted. What is a quick and elegant way of expressing this strategy?
Comment: there is power in numbers
Comment: E pluribus unum
Comment: "Grow or die" may sound a bit harsh for your situation, but it is an established idiom and directly addresses strategy. It is strongly associated with heavy-handed capitalism, which may not align well with the sensibilities of charity groups.
Comment: [United we stand (divided we fall)](https://en.wikipedia.org/wiki/United_we_stand,_divided_we_fall)
Answer: Union is strength comes to mind:

This proverb means that 'sticking together is a source of strength'. If people join together, they are more powerful than if they work by themselves.

(The Free Dictionary)
Comment: Accepted this answer because it was the one that was chosen for an article by the editor on whose behalf I was asking this question. Many thanks for the suggestion!
Answer: there is strength in numbers Merriam-Webster defines this as:

used to say that a group of people has more influence or power than one person
Answer: In psychology this is a special feature of social change called the Snowball effect, whereby the minority group influences or becomes the majority group. The minority group can start as an individual, before slowly growing, being heard and eventually being accepted into the "majority group":

Social change occurs when a whole society adopts a new belief or behavior which then becomes widely accepted as the 'norm'. [...] Social change is usually a result of minority influence. This is when a small group of people (the minority) manage to persuade the majority to adopt their point of view.
[...]
It has been found that once the minority begin to persuade people round to their way of thinking, a snowball effect begins to happen. This means that more and more people adopt the minority opinion, until gradually the minority becomes the majority.

Examples of social change:

Martin Luther King and Nelson Mandela led civil rights movements and were consistent in their views against apartheid for many years, which helped bring about social change. The results of Moscovici's (1969) research highlight the importance of consistency in minority influence.
When Rosa Parks refused to give up her seat to a white male passenger in the 1950s, she was arrested for violating US law. This event helped trigger the civil rights movement to end the racial segregation laws in America. The case of Rosa Parks demonstrates that people who are willing to make a sacrifice (in her case being arrested) show their commitment to their cause and as a result are more influential.

Interestingly, the idiom "snowball effect" (different to the Snowball effect theory in psychology, but uses the same principles) is attested for here:

A situation in which something increases in size or importance at a faster and faster rate:

The more successful you become, the more publicity you get and that publicity generates sales. It's a kind of snowball effect.

https://dictionary.cambridge.org/dictionary/english/a-snowball-effect

A situation in which the results or consequences of an action grow at an increasingly faster rate over time.

Once the video game hit the market, word of mouth caused a snowball effect that made it the most popular and top grossing game of all time.
She ignored her debt for so long that now, she's experiencing a snowball effect that threatens to crush her financially.

https://idioms.thefreedictionary.com/snowball+effect

I believe you can use the same idiom "snowball effect" if you give us an example sentence where the idiom will be used.
Comment: Anyone who downvoted can they say why?
Comment: Though I can't be sure, it's probably seen as being too ballpark, broad, hypernymic. Note the debt snowballing, to acceptably broaden your last example. 'Strength in numbers' is closer, as it's rarely applied to non-sentients. Why haven't you upvoted that?
Answer:
They form a common front/amalgamate/come together to create a higher profile.
They unite - They adopt a policy/philosophy of "strength in numbers."
Answer:
"Sticks in a bundle strengthen each other." ("In unity is strength.")
~ Aesop
The Bundle of Sticks
A certain Father had a family of Sons, who were forever quarreling among themselves. No words he could say did the least good, so he cast about in his mind for some very striking example that should make them see that discord would lead them to misfortune.
One day when the quarreling had been much more violent than usual and each of the Sons was moping in a surly manner, he asked one of them to bring him a bundle of sticks.
Then handing the bundle to each of his Sons in turn he told them to try to break it. But although each one tried his best, none was able to do so.
The Father then untied the bundle and gave the sticks to his Sons to break one by one. This they did very easily.
"My Sons," said the Father, "do you not see how certain it is that if you agree with each other and help each other, it will be impossible for your enemies to injure you? But if you are divided among yourselves, you will be no stronger than a single stick in that bundle."

A proverb of Classical Greek origin.

Link to reference tale


How to process large shapefiles faster in ArcGIS for Desktop?

Question: I have huge line and polygon shapefiles that I want to edit with some geoprocessing tasks (clip, buffer, erase,...). Altough my computer is not that slow, I am annoyed of waiting up to 15 hours for one of these tasks.
Some people say that importing the shapefiles in a File Geodatabase will help. Are there any further hints? Is there any difference whether I perform such ArcGIS for Desktop tasks through the ArcCatalog or ArcMap applications?
Comment: Are you running Background Geoprocessing (64-bit)? It speeds things up considerably.
Comment: How big are we talking here?
Also maybe post your computer specs?
Comment: The shapefiles are between 1.5 and 3.0 GB large. I am working with 10Gb of RAM, i7 CPU and SSD.
The hint with the Background Geoprocessing sounds promising!
Comment: 3Gb? A shapefile should not exceed 2Gb! Limitations are discussed [here](http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//002t0000000m000000). You don't tell us anything about your data other than it's lines and polygons. 15 hours is along time and suggests to me its more to do with your data than arcmap. Are they over-lapping within a featureclass? This would negate any performance provided by spatial indexing. Please edit your question and describe your data a bit more.
Answer: ESRI has a blog post - aptly titled Dicing Godzillas - about processing feature classes with large amounts of vertices. It discusses the Dice tool, which splits up a shapefile's features into smaller features with less vertices.
You won't find much of a difference (if any) running in ArcCatalog vs. ArcMap. However, you might find some improvement by running it entirely outside of either by using Python. If your data would benefit from being split up, you could use Python for multiprocessing, which is discussed here.
Still another option (that can be leveraged via scripting or ArcMap) would be to use the in_memory workspace. This doesn't always work for really large files as you'll get memory overflow errors, but it might be worth a shot if you will be processing this dataset multiple times.
Depending on your data, you can try combining all of the above to see what works best for your situation and data.
Other than that, running it overnight is always an option. Good luck!
Edit @SeaJunk's comment: If you are running ArcMap 10.1 SP1 or above, definitely take a look at Background Geoprocessing. Great tip!
Answer: Any time you are looking at a heavy process consider scripting it out with python.
By scripting you do not have to worry about ArcMap or Catalog having to load all of the other overhead (such as the UI) that you do not need while running your process. If you have multiple steps, the script can launch right in to those with out waiting for you to click the button (you don't want to be there just to click the button at 1 am to get the next step going).  Finally, by scripting it you make it easier to rerun the entire process in the future for any reason.
Yes, these last two can also be accomplished with a model, but you have to deal with the extra overhead of ArcGIS Desktop, you also lose out on better error handling and the flexibility that Python has to offer.
As for the file format, I recommend you get your data in to one of the geodatabase formats.  The geodatabases seem to be less prone to file corruption than shape files.  Up to 1GB you can use either the Personal Geodatabase (.mdb) or File Geodatabase (.gdb).  Bigger than that the .mdb geodatabase starts to get flaky due to the design limitations of MS Access.
Answer: Another thing that will help significantly is storing your shapefiles (and your output files) on the computer's SSD, though it sounds from your comment like you're already doing that. Converting your (huge) shapefiles to file geodatabase feature classes will definitely help too, but not nearly as much as splitting your shapefiles into smaller chunks and processing them separately as Paul suggests.
Comment: No. Coordinate processing complexity is O(N*M), where N and M are the number of vertices in the compared shapes.  If you cut shape vertex count, even by adding more shapes, you significantly reduce processing time.
Comment: Whilst all the chunks would have to be processed after another, wouldn't that add up to the same amount of time?
Answer: Select a subset of your FIDs, like 20,000 at a time, do the geoprocessing, and then merge the results back together.   I believe the geoprocessing tools are getting wound in the spatial tiling algorithm.
Answer: I am not sure if this will help you or not, but I have realized that if you have a very big polyline shapefile and you want to for example reshape it, it would be much more faster if you split it into smaller parts. To do this you may use a sort of paneling or a mesh polygon to split the polylines. This is going to reduce the process time considerably and in the end you have the option of merging them together.


Difference between "antworten" and "beantworten"

Question: Is there any difference between "antworten" and "beantworten"? In which situations should I use one and in which another?
Answer: Ich antworte auf etwas (I reply to something), but Ich beantworte etwas (I answer something).

Ich antworte auf Deinen Brief (I reply to your letter)
  Ich beantworte Deine Frage (I answer your question)

In German, both is used equivalently, but you need to make sure to use the correct form (see the auf above).
Comment: @usr128787 Writing "Du, Dich, Dein, etc." or "Sie, Ihre, etc." with capital letters in letters is actually a form of polite salutation. While I think that today you don't need to do this anymore, it used to be a rule. Many people keep doing this even after the spelling reform. The question why I wrote "Du" instead of "Ihren" - well, I assumed this was a personal letter to a person I know. In a business letter you'd of course have used "Ihren".
Comment: In retrospect, I noticed that *beantworten* is close to *answer*. I changed my answer accordingly.
Comment: It puzzles me the fact that you wrote "Deine" with a capital "D". It is not a Sie-form as you should have used Ihren instead. So why?
Answer: Just to add a little further detail and perhaps simplify the other fine answers, think of it this way:
"Antworten" is an intransitive verb, not performing direct action upon something and thus needing help to transfer the action either by using an auxiliary word followed by the Accusative case or else simply the Dative case without the auxiliary word.
"Beantworten" is a transitive verb, performing direct action upon something by using the Accusative case with no need of further help from an auxiliary word.
"Be-" is a common prefix to change an intransitive verb into a transitive one.
Comment: Nice answer. I like the analytical insight.
Comment: @Alexey  It can, I suppose, but remember that **_beantworten_ is a transitive verb**, so it must always take a direct object, which, of course, is in accusative case.  Whether or not you choose to add an indirect object (a dative component) is up to you, but I think the construct would be really awkward.  Z.B.: Without dative component: _Beantworten die Frage_ (Answer the question.)  And with: _Beantworten mir die Frage_ (Answer me the question ... who talks like this?)  More commonly you'd say, "Answer the question for me."  (_Beantworten für mich die Frage._)
Comment: @Alexey  So, yeah, I think you're right, Alexey, _beantworten_ doesn't naturally take a dative or indirect object.  To confirm the transivity of a verb, I often use WordReference.  [**Here is its entry for _beantworten_.**](https://www.wordreference.com/deen/beantworten).  The other contributions to this this thread may help you as well.
Comment: _Beantworten_ does not take dative, right?
Comment: Thanks! Word Reference looks very helpful:

_Peter beantwortete die Frage **der Lehrerin**._

So instead of saying **to whom** we answer, we say **whose** was the question. That clarifies everything.
Answer: If you reply to a question or answer someone then you go with antworten which means to respond, to be responsive. If you answer a question or a request then you go with beantworten which means to give an answer. Additionally if you response to a letter you also use beantworten which now means to give a written response.
In almost most cases you can replace beantworten with antworten auf, i.e. when leaving out the prefix be you have to use the preposition auf.

Ich beantworte seine Frage nicht. - Ich antworte auf seine Frage nicht.
Er beantwortet jeden Brief. - Er antwortet auf jeden Brief.
Der Lehrer antwortet dem Schüler mit anschaulichen Beispielen.

Note that beantworten carries the connotation of fully or, at the very least, sufficiently answering the question, antworten auf only suggest that you reply but this response may not be satisfying.

Ich habe auf deine Frage geantwortet. Ist diese damit beantwortet?
[=I replied to your question. Is this question answered?]

Thorsten Dittmar's answer made me aware of something I just missed. English reply to something is the equivalent to German auf etwas antworten while English answer something is the equivalent to German etwas beantworten.

In German:
Man kann auf eine Frage antworten oder jemandem antworten [=reagieren, erwidern], aber eine Frage oder eine Anfrage beantworten [=Antwort geben]. Außerdem kann man auch einen Brief beantworten [=schriftliche Reaktion abgeben].
Man kann nahezu immer beantworten durch antworten auf ersetzen, verändert dadurch aber leicht die Aussage. Beantworten bedeutet, dass die Frage vollständig oder zumindest ausreichend beantwortet wurde, antworten sagt ausschließlich aus, dass auf die Frage reagiert wurde, aber die Frage ist möglicherweise noch nicht zufriedenstellend beantwortet.
Answer: Let's try and get beyond a single example and understand the structure of how German words are formed.
The German prefix be- is one of several prefixes that turn another word - often an intransitive verb - into a transitive verb. The only reason this particular prefix is tricky for English speakers is that English has mostly lost it and now does the same thing without any prefix. Though there are still plenty of English words in which the prefix has survived - some of them very antiquated. Some random examples from this list:

To bewrap an object means to wrap a material around the object. A typical use is when the object that is bewrapped is more relevant than the material that is wrapped around it.
To bewrite an incident means to write a report about the incident. A typical use is when the incident that is bewritten is more relevant than the report that is written about it.
To beclothe a person means to fit clothes around the person. This transitive verb is derived from a noun. Modern English does these derivations without the prefix.
To behead a person means to take the person's head away. Again derived from a noun. For this particular shade of meaning, German uses a different prefix - ent- - though for this particular verb it goes without any prefix.
To bereave a man of his fortune means to reave his fortune from him. A typical use is to mention the bereft man but not the fortune that was reaved. The verb seems to be held alive primarily by the participle bereft.
For an adult to befriend a child means that the adult makes himself or herself a friend of the child.

(I have used specific terms such as "object" or "material" - not to restrict the definitions in their applications, but to make the references perfectly clear.)
Some parallel prefixes with different shades of meaning are still alive in English. You can use them to make up new verbs on the spot, though in many cases you would only want to do it for comic effect:

What has been drunk cannot be undrunk. What has been sung or spoken cannot be unsung or unspoken, etc. Note that whereas drink, sing, speak can all be used either transitively (with a direct object) or without one, undrink, unsing, unspeak can only be used transitively. It should be clear what it would mean to unglass a drinker or to unhandkerchief a rheumy person.
If you whelm someone too much with some unmentioned goodness, you overwhelm them. If you burden someone too much, or put too much burden on them, you overburden them. If you provide them with too much joy, you overjoy them and they become overjoyed. Everybody can guess what it would mean to overparrot a bird collector.
If you put someone on a list, you enlist them. Before some consonants, the prefix becomes em- for phonetic reasons: If you give a person the power to do something, you empower them. It is clear what it would mean for Lego to embrick a personality. It is equally clear that if Montrésor, the hero of Poe's The Cask of Amontillado, does the same it probably amounts to en-graving the person - with en-graving an easily discernible pun. This prefix, like be-, is relatively neutral in meaning and therefore isn't normally used with verbs nowadays.
Like be-, the English prefixes for and fore (corresponding to German für- and vor-, which also tend to be conflated) are no longer productive.

Re-, a loan prefix from Romance languages, could be added to this list. However, when you apply it to an intransitive verb you can still use the result without a direct object. This is why it's not a very good example.
(Nowadays you can also use the other productive prefixes to construct intransitive verbs. For example the infamous overexaggerate can be used intransitively. But this is a relatively recent phenomenon.)

Now let's apply the theory to (be)antworten. The basic word is the noun Antwort, which translates to the English noun answer and can be analysed roughly, but quite obviously and logically, as anti-word, i.e. opposite word. In German, the noun can be turned into an intransitive verb just by adding the appropriate ending, or into a transitive verb by also adding the prefix be-:

Ich antworte (auf einen Brief). I reply (to a letter).
Ich beantworte einen Brief. I answer a letter.

In the first example I used reply, a synonym of answer that can only be used intransitively. There is no English synonym of answer that can only be used transitively, but removing einen Brief from the second example would make the German sentence ungrammatical. For some other German verbs there are full English analogues:

Ich arbeite (an einem Brief). I am working (on a letter).
Ich bearbeite einen Brief. I am processing a letter.
Answer: The other answers do almost cover it all... but some is missing so here is my try:
beantworten is always done to the question.

Ich beantworte deine Frage.

You may or may not add the person. The translation that is closest in grammar to that is to answer.

I answer your question.

Note however, that beantworten NEEDS an object. So the following wouldn't work.

Answer me!
Beantworte mir!

Antworten itself without auf cannot be done to the question (it is intransitive). Thus, the closest translation grammar-wise is to respond.

Answer me! / Respond!
Antworte mir!

Now, others have pointed out antworten auf. This is correct but there is a difference between antworten auf and beantworten in that the former is really just a response, while the latter implies that it is complete and the matter is settled. If I beantworte a question, it is answered. The question is no more. If I antworte auf a question, my answer can ambiguous, incomplete or even a counter question. It is really more a response than it is an actual answer.
For those who are interested: I have discussed this very question in my blog in more detail.
Answer: The distinction between "Er beantwortete meine Frage" and "Er antwortete auf meine Frage" is actually much the same as that between "He answered my question" and "He replied to my question". The former implies that the answer dealt satisfactorily with the question, whereas the latter doesn't.
Answer: In terms of the semantic differences, I can't really do better than what has already been posted, but as a student of the German language, I find it immensely helpful to look at frequencies because I don't have time to learn 10 different ways to say one thing.  Before I commit to studying a word or phrase, I usually take the time to find out if it is the most common way of saying something before proceeding, especially when I find the semantic differences to be very small.  In the case of antworten and beantworten, I find it a very interesting case because frequencies of the infinitive do not match frequencies of these two words in context.  At least not as found with the Google Ngram.  Let me show you what I mean.  Here are frequencies of these two words in the infinitive:

However, if I put these two words in context (to include adding an object), you will see that this changes:

This difference is even more pronounced when using third person singular (and second person plural informal):

And even more interesting than that is this:

No n-grams are found at all for antwortest auf die Frage!
You can proceed as you like, but for me, for so many reasons (e.g., brevity, frequency, simplicity), I am much more likely to try to put into practice this phrase using some form of beantworten and leave it at that if I am referring to a question.  Note how all of this changes if you change "question" to "message."  (I opted for message over your example "letter" because letters are becoming a thing of the past in this age of technology.  When was the last time anyone sent or answered a "letter"?  But we read, answer, and send messages every day.)

Results were similar when comparing first person singular.  As with the previous example, no n-grams were found with antworten in this context in second person singular.
This reversal made me even more curious than ever, so I was compelled to try it with your original example — the letter.  Well, results were a lot closer, but forms of beantworten came out ahead.
Overall, despite the Nachricht examples, it still looks as if beantworten has a slight edge in terms of frequency.  Reverso backs this up.

Now why would this be?  I have no idea, but I think this answer from Oliver lends a clue.  In it, Oliver writes:

The distinction between "Er beantwortete meine Frage" and "Er antwortete auf meine Frage" is actually much the same as that between "He answered my question" and "He replied to my question".

And if we compare this to English, are we more likely to answer questions and reply to messages and letters?  I think that answer is "yes":

To enlarge image, open the page in Chrome, right click the image, and open it in a new tab.
Comment: "as a student of the German language [...] I don't have time to learn 10 different ways to say one thing" What is your goal in learning German?
Comment: @infinitezero Well, the ultimate goal for me WRT any foreign language I'm learning is to get so good that I could translate, interpret, or be, in some other capacity, useful, to someone or something, for having taken the time and effort to study the language to a level of that proficiency. At such a level, I _would_ need to know, perhaps 10 different ways to say something, but in the beginning, I just want to learn the basics and learn them well. Z.B., in the beginning, it's sufficient to learn just one word for "dog."  Down the road, I can learn Dackel, Dalmatiner,  Deutsche Schäferhund, etc.


What kind of being was Huwawa?

Question: Humbaba was the guardian of the Cedar Forest and was fought by Gilgamesh.
Some say Humbaba is a monstrous giant and some say he was a dangerous mechanical monster (like a robot).
For example in Flying Serpents and Dragons by R. A. Boulay we can read:

Is it true that he was a robot? If it's not, what kind of being he/it was?
Comment: I just laughed so hard that coffee snorted up my nose. I was a bit uncredulous at "launch platform" but "rocket preparation building at Baalbek" and "launch tower" sounds like serious business. Is this meant persiflage that textual interpretation may be *a little* arbitrary? Boats seems like a more probable interpretation. This comment is meant to serve discoverability, because images are hardly accessible to search engines.
Answer:
Clay mask of the demon Huwawa, The British Museum. From Sippar, southern Iraq, about 1800-1600 BC.
Huwawa was a demonic creature, of neither mortal nor godly origin, created by Enlil to guard the forest of Lebanon :

I never knew a mother who bore me, nor a father who brought me up! I was born in the mountains...

He is described in The Epic of Gilgamesh, tablet 2, as:

Humbaba's roar is a flood, his mouth is death and his breath is fire! He can hear a hundred leagues away any [rustling?] in his forest!

He was not, however, a mechanical creature such as a robot, as such things did not exist in Ancient Mesopotamia. He had human characteristics, and a physical body which Gilgamesh could capture:

they pulled out his insides including his tongue.
(tablet 5, The Epic of Gilgamesh)

And:

Huwawa bared his teeth at him [...] He tied up his arms like a captured man [...] Huwawa sat down and began to weep, shedding tears...

He is also easily slayed by Enkidu:

Enkidu, full of rage and anger, cut his throat...

Furthermore, Enlil adds further evidence to Huwawa's mortal characteristics when, upset by Huwawa's death, he cries out:

He should have eaten the bread that you eat, and should have drunk the water that you drink.
(all quotes from Gilgamesh and Huwawa unless mentioned)

He appears, then, to be a monstrous but mortal creature. Parallels have been drawn between the stories of Huwawa and Medusa(1), because of their similarities of a hero beheading a demonic creature.

Source:

Clark Hopkins, "Assyrian elements in the Perseus–Gorgon story," American Journal of Archaeology 38 (1934:341-ff)

What kind of being was Huwawa?