List of websites/domain name that's registered daily

Question: I want to know if there is a website that can provide me a list of domain names that is registered on a certain date. For example today or last week thursday? Does that website which can provide me such info exist? I really appreciate it if you can point out that web URL to me. Google is pointing me to different and irrelevant websites. I saw the whois but it don't display a list. Any help?
Comment: You can get a list of all registered domains, dropped domains, and newly registered domains at http://www.domaindatapro.com - also, this service provides you with daily lists of newly registered domain names and their whois contact information: http://www.easywhoispro.com
Answer: You can try dailychanges.com, it does provide a list of domain names on a certain day.
However Dailychanges doesn't give access to a relevant search form, so you have to manually type the following url pattern :
<code>site:http://www.dailychanges.com/{web hosting company}/{YYYY-MM-DD}
</code>
For example if you want domain names registered on March 05, 2011 and hosted at gandi.net :
http://www.dailychanges.com/gandi.net/2011-03-05/


molding an object in the shape of another object

Question: im trying to create a daz custom face morph. i have a custom face from another model i want to apply it on the genesis 8 fem model in blender. but i cant cut and past it straight away because i need to preserve original model vertices count otherwise it wont import into daz as morph. so im thinking perhaps there is a tool that molds an object in the shape of other object without changing the vertices or polygons count. i already extracted the custom face mesh. now all thats left is to mold the original genesis model face in its shape. something similar to how clay molds work in real life.
Answer: If I understand your question correctly,you are looking for the Shrinkwrap-Modifier. Add the modifier to the model you want to change and choose your "desired face" as the target. For further reading consult the manual.
However there is no way to get more detail than your polycount allows. That means the Shrinkwrap-Modifier might produce artifacts if the polygon-density of your model is far less than that of your target.
Answer: TheBeautifulOrc technically has the right answer. However, based on my personal experience, I would say that the shrinkwrap modifier, while very useful in some cases, could be problematic in your case. It may actually be easier to take the Genesis 8 model from Daz Studio, import it into Blender, take your custom model also, and import that into the same scene in Blender, and then use the custom model as as a visual reference only while you try to actually manually sculpt the changes in shape onto the Genesis 8 model directly. Depending on how much of a difference there is between the two to begin with, this may not actually be a lot of work. It may actually turn out to be very much MORE work trying to get the Genesis 8 model to take on the exact shape of the custom model instantly by relying on a shrinkwrap modifier. This is because, more than likely, the various parts of each face and head is just not going to line up, no matter what you do, leading to the possibility that one will end up crooked and smashed against the other in a terrible way that you just can't seem to fix. So this would be an alternative approach, IF you need it. :)


Can NaCN or HCN be used as sources of cyanide ion in substitutions?

Question: When cyanide ions act as nucleophiles in substitution reactions, why is KCN the reagent of choice? Would some other source of cyanide such as NaCN or HCN work equally well in the reaction, since they should dissociate to give cyanide ions as well?
Comment: KCN and NaCN are essentially interchangeable as reagents and very much easier to use as nucleophiles than generating CN- from HCN.
Comment: @Mithoron You could take 2 minutes to improve it, instead of finding a duplicate that isn't a duplicate because it doesn't actually cover HCN.
Comment: I don't, however, see why this question should be downvoted.
Comment: @orthocresol Poor formatting, lack of research?
Answer: NaCN is quite alright. The main problem with HCN, on the other hand, is that it's a relatively weak acid which is barely dissociated (pKa 9.71). So, trying to use HCN as a source of CN− is like trying to use H2O as a source of OH− ions, which is not likely to work. On top of that, it's gaseous, and getting it into your reaction without killing yourself can be quite tricky.
Comment: @Mithoron Maybe the OP tried to research and couldn't understand as the literature he/she may have found wouldn't have been very easy to understand. Also I believe SE aims to answer questions which the users face trouble with (If they aren't very basic but that again is subjective from person to person) and all question which are asked aren't necessarily open questions or award winning questions. At different stages of ones studies one can have different understanding and maybe a beginner might find the same page much difficult to read than someone who does so on a regular basis.
Comment: Well, then why actually NaCN, or other salt isn't used? Why is this one of these cases that potassium salt is common and not sodium? BTW if OP did his research he wouldn't ask about HCN.
Comment: @Mithoron not sure what you're aiming for. NaCN is used quite regularly http://commonorganicchemistry.com/Common_Reagents/Sodium_Cyanide/Sodium_Cyanide.htm
Comment: Well, it sure is used, but I think KCN is *the* stereotypical cyanide.


z score with nan values in matlab (vectorized)

Question: I am trying to calculate the zscore for a vector of 5000 rows which has many nan values. I have to calculate this many times so I dont want to use a loop, I was hoping to find a vectorized solution.
the loop solution:
for i = 1:end
   vec(i,1) = (val(i,1) - nanmean(:,1))/nanstd(:,1)
end

a partial vectorized solution:
zscore(vec(find(isnan(vec(1:end) == 0))))

but this returns a vector the length of the original vector minus the nan values. Thus it isn't the same as the original size.
I want to calculated the zscore for the vector and then interpolate missing data after words. I have to do this 100s of times thus I am looking for a fast vectorized approach.
Answer: This is a vectorized solution:
% generate some example data with NaNs.
val = reshape(magic(4), 16, 1);
val(10) = NaN;
val(17) = NaN;

Here's the code:
valWithoutNaNs = val(~isnan(val));
valMean = mean(valWithoutNaNs);
valSD = std(valWithoutNaNs);
valZscore = (val-valMean)/valSD;

Then column vector valZscore contains deviations (Z scores), and has NaN values for NaN values in val, the original measurement data.
Answer: Sorry this answer is 6 months late, but for anyone else who comes across this thread:
The accepted answer isn't fully vectorised in that it doesn't do what the real zscore does so beautifully: That is, do zscores along a particular dimension of a matrix.
If you want to calculate zscores of a large number of vectors at once, as the OP says he is doing, the best solution is this:
Z = bsxfun(@divide, bsxfun(@minus, X, nanmean(X)) ,
                   nanstd(X) );

To do it on an arbitrary dimension, just put the dimension inside the nanmean and nanstd, and bsxfun takes care of the rest.
nanzscore = @(X,DIM) bsxfun(@divide, bsxfun(@minus, X, nanmean(X,DIM)), ...
                                     nanstd(X,DIM));

Answer: anonymous function:
nanZ = @(xIn)(xIn-nanmean(xIn))/nanstd(xIn);
nanZ(vectorWithNans)
Answer: vectorized version of below anonymous function (assumes observations are in rows, variables in columns):
nanZ = @(xIn)(xIn-repmat(nanmean(xIn),size(xIn,1),1))./repmat(nanstd(xIn),size(xIn,1),1);
nanZ(matrixWithNans)


Solutions to the interacting Dirac equation

Question: The Pauli equation can be obtained by taking the non relativistic limit of the interacting Dirac equation (https://en.wikipedia.org/wiki/Pauli_equation, 2). In the process, you remove a phase of
$$e^{-imc^{2}/\hbar}.$$
Starting from the solution to the Dirac equation (positive energy and spin Dirac equation solution)
$$\Psi_{\uparrow,\mathbf{p}}^{+}(\mathbf{r},t)=\left(\begin{array}{c}
1 \\
0 \\
\frac{cp_{z}}{\mathcal{E}_{p}+mc^{2}} \\
\frac{c(p_{x}+ip_{y})}{\mathcal{E}_{p}+mc^{2}}
\end{array}
\right)e^{i(\mathbf{p}\cdot\mathbf{r}-\mathcal{E}_{p}t)/\hbar}.
$$
In the non relativistic limit,
$$ \mathcal{E}=mc^{2}\sqrt{1+\frac{p^{2}}{m^{2}c^{2}}}\approx mc^{2}+\frac{p^{2}}{2m}.$$
Hence the overall phase in the Dirac equation can be expressed as follows:
$$e^{-i(\textbf{p}\cdot\textbf{r}-\mathcal{E}t)/\hbar}\approx
e^{-imc^2/\hbar}
\exp\left(\!-\frac i\hbar \left[\textbf{p}\cdot\textbf{r}+\frac{p^2}{2m}\,t\right]\right).$$
In the derivation of the Pauli equation, you cancel the phase explicitly containing the rest mass energy. Since the only explicit time dependence in the wave function after this cancellation is in the phase, which is now expressed in terms of kinetic energy, applying the energy operator of the Pauli equation gives
$$i\hbar\,\partial_{t}\psi=\frac{p^{2}}{2m}\,\psi.$$
For a free particle, the energy operator is giving the total energy.
However, clearly if there is potential energy, the energy operator still will only return kinetic energy, and not the potential. So, my question is related to solutions to the interacting Dirac equation; what does $\mathcal{E}$ in the phase represent? Should it be contain extra terms, to account for the potential energy?
Answer: In a relativistic context, all energy is kinetic. Potential energies alter the dynamics, which then manifests itself as a change in kinetic energy. The reason is simple: energy is a label that comes from one of the Casimir operators of the Lorentz group ($P_{\mu}P^{\mu}$), and the Lorentz group knows nothing about potential energies. It knows only about movement in space-time (i.e, kinetic energy)
Comment: Would you consider rest mass energy to be kinetic energy?
Comment: Yes. Think of it as the kinetic energy associated with time-like geodesics.
Comment: So how would one obtain potential energy from the non relativistic limit of the relativistic dispersion relation? ($\mathcal{E}^{2}=m^{2}c^{4}+P^{2}c^{2}$)
Comment: It is not possible to do this. In a general quantum field theory, the potential energies felt by the particles can be computed by inserting the propagators of the gauge bosons in the relevant Feynman diagrams. That is, it depends on the dynamics of the theory and it is not captured by the physics of any individual particle. Your confusion seems to come from the fact that energy in classical physics plays a very different role than in a QFT. For example, why can't we solve scattering problems by conservation of energy in QED if we can do it for billiard balls collinding? Think about this.
Comment: TL;DR, that is not where the potential energy comes from.
Answer: Your formulas do not seem to make sense other than for free Dirac particles. However, you are asking what will happen if, for example, a Dirac particle has potential energy. Then you should start with a solution of the Dirac equation in an external field, for example, electric field.


Do a pair of parallel edges form a cycle in a graph

Question: Whenever there is a back edge, a cycle is detected.
Then, do a pair of parallel edges form a cycle in a graph? If no, why it is not a back edge?
Comment: Have you tried applying the definitions? e.g., https://en.wikipedia.org/wiki/Cycle_%28graph_theory%29
Answer: Graph theory is notorious for having nonequivalent definitions of the same term being used by different authors in different places, so it is important to check the definition of the terms in your case. If you use the definition I'm familiar with
\begin{align*} &\text{A }\textit{cycle }\mathcal{C}\text{ is an alternating sequence of vertices and edges, beginning with a vertex }v_0\\ &\text{ such that no vertices or edges repeat except that }v_0\text{is both the first and last element}\\ &\text{of the sequence} \end{align*}
In that case if $G=(V,E,f)$, $v_1,v_2\in V$, $e_1,e_2\in E$ and $f(e_1) = f(e_2) = \{v_1,v_2\}$ then $v_1e_1v_2e_2v_1$ is a cycle in $G$.


Scene with passport connected to wires

Question: in "The Bourne Legacy" what was Aaron Cross doing in the scene where he had the camera and wires connected to the passport?
Comment: *emphasized text*Thank you. I've been stumped on that one But it shows her getting passport pic taken after she's on the run when the CIA team is watching for her
Answer: He is using High Voltage to de-magnetize a hidden identifying strip in the passport.  Since the lack of the presence of this strip doesn't cause any issues at the Airport, we are to assume that her passport had this magnetic identifier because of her job, to keep tabs on her travel.  By disabling it, she is able to use the passport and garner no additional attention.
addition
He still needed to use her passport as a base to work from, in providing her with credentials to travel with.  Using a new picture on the old passport and/or altering the document would be easier than obtaining a new passport.
Comment: 2.5 years later, thank you. Totally didn't see that last time I watched it.
Comment: Looks like [RFID-Zapper](https://www.rfidjournal.com/articles/view?2098) - source of electromagnetic pulse for killing an [RFID](https://en.wikipedia.org/wiki/Radio-frequency_identification) tag.
Answer: If you freeze the image as he is putting the putty and wires on the passport, you can see her picture on it with the name June Munroe clearly visible typed onto the passport.  It looks to me like he is adding her photo to one of his dummy passports with the fake name June Munroe already on it.  I have no idea what he is doing with the voltage and the wire, other than possibly destroying its ability to be read by a scanner.  Since the name June Munroe is typed into this passport, then he could not be using her real passport as the base to work with as suggested.

Scene with passport connected to wires


In a trigger, telling the difference between a new Chatter File and a Link to an Existing one

Question: I like using Chatter Files for Attachments because they are prettier and searchable. The downside is that, when you add one to an Opporutunity, you don't see it as an Attachment on the Account like an old-skool Attachment would.
So I am working on a trigger where, if a user posts a Chatter File to an Opportunity, it also links it up to the Account. Sample code is below. I am successfully checking for it being a Chatter File (ContentPost) and only running when linked to an Opportunity, but the trigger runs whether I am adding a new file and also if I am associating an existing file to an Opportunity.
Any ideas how to determine whether the ContentPost is using a new Chatter File or an Existing one?
for (FeedItem f: fis){

    String parentIdString = String.valueOf(f.parentId);

    if (parentIdString.startsWith(Opportunity.sObjectType.getDescribe().getKeyPrefix()) && f.type == 'ContentPost'){
        Opportunity o = [select id, accountId from Opportunity where id = :f.ParentId limit 1][0];
        if(o.AccountId != null){
            FeedItem newFI = new FeedItem();
                newFI.Type = 'ContentPost';
                newFI.RelatedRecordId = f.RelatedRecordId;
                newFI.ParentId = o.AccountId;
                newFI.title = f.title;
            insert newFI;
        }

    }

}

NOTE: I am already aware of the issue with querying and DML in the loop. I will fix that later. I am mostly concerned with getting the scenario correctly handled.
Thanks, StackExchange!
Answer: Are you writing your trigger on a FeedItem? If so, you should be able to leverage the after insert parameter to only have the trigger get invoked on creation.
trigger FeedItem_afterInsert on FeedItem (after insert)
{
    //define list of FeedItems connected to Account to create
    List<FeedItem> feedItemsToInsert = new List<FeedItem>();
    for (FeedItem f : [SELECT Id, RelatedRecordId FROM FeedItem WHERE Id =: Trigger.new])
    {
        //check if Id record ID matches an opportunity. If so, do work
    }

    insert feedItemsToInsert;
}

Answer: I figured it out and blogged about it at my blog. The approach is to...

Create an AFTER INSERT trigger on FeedItem
Call an @future event that only works for new ContentPosts
The new file is linked to via the RelatedRecordId field on the FeedItem
Gather the IDs of other places this file should be linked be new ContentPosts.
Eliminate IDs that are already linked to the file
Create new FeedItems

The blog post has all the code. There are some other good best practices in there for wrapped @future calls in triggers and it uses the technique to prevent recursion of a trigger.
Answer: From my analysis, the best I can think of is to compare the following 3 dates either to be the same or maybe within a practical range of each other (1 second?):

Create Date on FeedItem
Create Date on ContentVersion (obtained by querying it using FeedItem.RelatedRecordId)
Create Date on ContentDocument (obtained by querying it using ContentVersion.ContentDocumentId)

Thoughts? Wish there was a flag I could check, but this seems to be the only way I can find.
Comment: Realistically, could only check ContentVersion. Maybe make sure IsLatest == true and/or VersionNumber == 1 for extra certainty.
Comment: This is not a good solution. Went with another.
Answer: I think I have come up with a better approach. However, there is one issue that I read was a bug getting fixed in Winter 13. We'll see about that.
The new approach is not to rely on Create Dates. That seemed a little hackish (in a bad way) anyway.
Instead, the new approach is to trigger on AFTER INSERT for FeedItem, use the RelatedRecordId value to query for ContentVersion and then use the ContentVersion.ContentDocumentId to query ContentDocumentLink. ContentDocumentLink is the table holding the linkage between a piece of Content and records.
The code will then use the records that content is already linked to and compare that with IDs we potentially want to link to (e.g. the account for an Opportunity, the contact and the account from a Case, etc.) For any IDs where there is no linkage, we'll create one by adding a new FeedItem record against that ID.
This approach seems clean. The only thing stopping it from working now is that the ContentVersion query never comes up with any records even though I know the records are there.  I found some reference somewhere that this is a bug and is being fixed.
Thus, I'll wait for my Sandbox to be updated to Winter 13 and, when it is, I'll see if it's fixed. If so, I'll deploy after Winter 13 comes out.
Comment: I went with this approach, but will post in a new response.


How do I hang a wall accessory fitted with 'Wall Grabbers' by Pinnacle?

Question: How is this shelf meant to be hung? Should I just use two screws into the drywall? It won't be supporting anything heavy, but screws don't seem like they would make the shelf mount flush to the wall.
Answer: The manufacturer has a video on their website that demonstrates how to hang their products that incorporate their Wall Grabber technology.
pinnacleframe.com -> Products ->  Gallery Solutions -> Click to watch video
or
http://blog.pinnacleframe.com/Pinnacle_Video/GallerySolutions_Pinnacle.mov


How to open separate named firefox instances with isolated settings?

Question: What would be a convenient way to open Firefox in a separate, named instance which doesn't use my current preferences, whats the best way to do this?
Answer: If you specify an alternate home directory in a separate shell and run a new instance of Firefox from that same shell, that will achieve the outcome you're looking for.
i.e.;
export HOME=~/some_alternate_dir && exec firefox --new-instance

I use a script which does this but also gives me the option of running multiple alternate named instances of firefox (these named instances are also re-usable):
#!/usr/bin/env bash

# Check for a maximum of one arg
[ "$#" -gt 1 ] && echo "Usage: \"ffalt [alternate name]\", or;" && \
echo "\"ffalt\" to run default firefox alternate session" && exit

# Alt name = first arg; otherwise alt name = "default"
alt_name="$1"
[ "$alt_name" == "" ] && alt_name="default"

# If XDG_DATA_HOME is set then use this:
alt_ff_home="$XDG_DATA_HOME"/firefox_alts/"$alt_name"
# Otherwise:
[ -z ${XDG_DATA_HOME+x} ] && alt_ff_home="$HOME"/.local/share/firefox_alts/"$alt_name"

# Ensure that the firefox alternates data dir exists
! [ -d "$alt_ff_home" ] && mkdir -p "$alt_ff_home"

# This is where the magic happens
export HOME="$alt_ff_home"
exec firefox --new-instance &

Edit:
Based on @xenoid's answer, you could replace the last two lines in the script above with:
exec firefox --profile "$alt_ff_home" --new-instance &

Answer: Use the --profile option to tell firefox to use another user profile:
firefox --profile /path/to/the/alternate/profile

Note that this firefox instance won't have any of you current bookmarks, saved logins, or plugins.


Microsoft Word Plugin for Web Mail

Question: I am 100% positive that I recently saw on the Internet a new plugin for MS Word which allowed the user to choose a Web Mail service such as Gmail or Ymail instead of Outlook or Live.  Am I totally losing my sanity, and "it's just my 'magination runnin' away with me"?  Thanks!
Answer: Affixa makes your webmail account part of Windows.

Affixa allows you to use you web mail
  service from within Windows just as if
  it were a desktop email client.
If you right click on any file and
  select "Send to mail recipient" then
  Affixa automatically creates an email
  in your webmail account drafts folder
  with the file attached. You can then
  open that mail and send it whoever you
  want.
If you have several attachments you
  can create a "collection" to be
  emailed.  If the attachment is too
  large for your web mail service Affixa
  offers to deliver the attachments via
  the free Drop.io web service.

Affixa is free of charge for personal use.
Answer: You might be thinking of accelerators for IE8.

Microsoft Word Plugin for Web Mail


ADXL345 GY-291 weird measures

Question: currently I am trying to connect several ADXL345 to an Arduino Nano. I followed the Sparkfun Tutorial on how to do this (https://www.sparkfun.com/tutorials/240). Long story short, I connected two ADXL345 to the Arduino and can read the measures from it, but the values seem to be completely wrong.
So when I lay bot flat on the table, I'd expect the measures to be approx 0,0,1g (x,y,z).
When I lay both of them flat on the table I get:
SelectedChip: 9- -0.5460000038,-0.4679999828,-0.0077999997
SelectedChip: 10- -0.2262000083,-0.5460000038,-0.0077999997

When I turn around both Chips 180°, I'd expect the measures to be approx 0,0,-1. But I get:
SelectedChip: 9- -0.6006000041,-0.3977999877,-0.0077999997  <-- Z-Axis does not change at all with this one
SelectedChip: 10- -0.2574000120,-0.4368000030,2.9873998641

When I tilt both to 90° I' expect the measures to be approx 0,1,0. But I get:
SelectedChip: 9- -0.5460000038,-1.6223999023,-0.0077999997
SelectedChip: 10- -0.1949999904,-1.7081999778,-0.0546000003

When I shake them I get the following:
SelectedChip: 9- -3.3539998531,-3.9935998916,-0.4835999965
SelectedChip: 10- 0.1715999984,-0.0077999997,-0.0077999997
SelectedChip: 9- -0.0311999988,-0.4368000030,-0.0077999997
SelectedChip: 10- -1.8017998695,2.4570000171,-0.0077999997
SelectedChip: 9- -0.2417999982,-0.6083999633,-0.0077999997
SelectedChip: 10- -0.9671999931,-3.4085998535,-0.2963999748
SelectedChip: 9- 0.7409999847,-0.6941999912,-0.0077999997
SelectedChip: 10- -0.7487999916,-3.9935998916,-0.1559999942

Am I doing something wrong? Or am I thinking wrong? Do you think the sensor is working correctly? I mean even if my code would be wrong, it should be wrong for both sensors, shouldn't it.

I'll also add the code here, but it's mostly the Sparkfun sample code:
//Add the SPI library so we can communicate with the ADXL345 sensor
#include <SPI.h>

//Assign the Chip Select signal to pin 10.
//int CS=10;
int CS_1=10;
int CS_2=9;

//ADXL345 Register Addresses
#define DEVID   0x00  //Device ID Register
#define THRESH_TAP  0x1D  //Tap Threshold
#define OFSX    0x1E  //X-axis offset
#define OFSY    0x1F  //Y-axis offset
#define OFSZ    0x20  //Z-axis offset
#define DURATION  0x21  //Tap Duration
#define LATENT    0x22  //Tap latency
#define WINDOW    0x23  //Tap window
#define THRESH_ACT  0x24  //Activity Threshold
#define THRESH_INACT  0x25  //Inactivity Threshold
#define TIME_INACT  0x26  //Inactivity Time
#define ACT_INACT_CTL 0x27  //Axis enable control for activity and inactivity detection
#define THRESH_FF 0x28  //free-fall threshold
#define TIME_FF   0x29  //Free-Fall Time
#define TAP_AXES  0x2A  //Axis control for tap/double tap
#define ACT_TAP_STATUS  0x2B  //Source of tap/double tap
#define BW_RATE   0x2C  //Data rate and power mode control
#define POWER_CTL 0x2D  //Power Control Register
#define INT_ENABLE  0x2E  //Interrupt Enable Control
#define INT_MAP   0x2F  //Interrupt Mapping Control
#define INT_SOURCE  0x30  //Source of interrupts
#define DATA_FORMAT 0x31  //Data format control
#define DATAX0    0x32  //X-Axis Data 0
#define DATAX1    0x33  //X-Axis Data 1
#define DATAY0    0x34  //Y-Axis Data 0
#define DATAY1    0x35  //Y-Axis Data 1
#define DATAZ0    0x36  //Z-Axis Data 0
#define DATAZ1    0x37  //Z-Axis Data 1
#define FIFO_CTL  0x38  //FIFO control
#define FIFO_STATUS 0x39  //FIFO status

//This buffer will hold values read from the ADXL345 registers.
char values[10];
//These variables will be used to hold the x,y and z axis accelerometer values.
int x,y,z;
double xg, yg, zg;

//Convert the accelerometer value to G's.
//With 10 bits measuring over a +/-4g range we can find how to convert by using the equation:
// Gs = Measurement Value * (G-range/(2^10)) or Gs = Measurement Value * (8/1024)
float gMultiplyer = (8/(2^10));

void setup(){
  //Initiate an SPI communication instance.
  SPI.begin();
  //Configure the SPI connection for the ADXL345.
  SPI.setDataMode(SPI_MODE3);
  //Create a serial connection to display the data on the terminal.
  Serial.begin(9600);

  //Set up the Chip Select pin to be an output from the Arduino.
  pinMode(CS_1, OUTPUT);
  pinMode(CS_2, OUTPUT);
  //Before communication starts, the Chip Select pin needs to be set high.
  digitalWrite(CS_1, HIGH);
  digitalWrite(CS_2, HIGH);

  //Put the ADXL345 into +/- 4G range by writing the value 0x01 to the DATA_FORMAT register.
  writeRegister(DATA_FORMAT, 0x01, CS_1);
  writeRegister(DATA_FORMAT, 0x01, CS_2);
  //Put the ADXL345 into Measurement Mode by writing 0x08 to the POWER_CTL register.
  writeRegister(POWER_CTL, 0x08, CS_1);  //Measurement mode
  writeRegister(POWER_CTL, 0x08, CS_2);  //Measurement mode

  delay(1000);
}

void loop(){
  printValuesFor(CS_1, HIGH);
  printValuesFor(CS_2, HIGH);
  delay(10);
}

void printValuesFor(int selectedChip, boolean printG){
    //Reading 6 bytes of data starting at register DATAX0 will retrieve the x,y and z acceleration values from the ADXL345.
  //The results of the read operation will get stored to the values[] buffer.
  readRegister(DATAX0, 6, values, selectedChip);

  //The ADXL345 gives 10-bit acceleration values, but they are stored as bytes (8-bits). To get the full value, two bytes must be combined for each axis.
  //The X value is stored in values[0] and values[1].
  x = ((int)values[1]<<8)|(int)values[0];
  //The Y value is stored in values[2] and values[3].
  y = ((int)values[3]<<8)|(int)values[2];
  //The Z value is stored in values[4] and values[5].
  z = ((int)values[5]<<8)|(int)values[4];

  //Convert the accelerometer value to G's.
  //With 10 bits measuring over a +/-4g range we can find how to convert by using the equation:
  // Gs = Measurement Value * (G-range/(2^10)) or Gs = Measurement Value * (8/1024)
  xg = x * 0.0078;
  yg = y * 0.0078;
  zg = z * 0.0078;

  //Print the results to the terminal.
  Serial.print("SelectedChip: ");
  Serial.print(selectedChip, DEC);
  Serial.print("- ");
  if(printG){
    Serial.print(xg, DEC);
    Serial.print(',');
    Serial.print(yg, DEC);
    Serial.print(',');
    Serial.println(zg, DEC);
  }else{
    Serial.print(x, DEC);
    Serial.print(',');
    Serial.print(y, DEC);
    Serial.print(',');
    Serial.println(z, DEC);
  }
}

//This function will write a value to a register on the ADXL345.
//Parameters:
//  char registerAddress - The register to write a value to
//  char value - The value to be written to the specified register.
void writeRegister(char registerAddress, char value, int selectedChip){
  //Set Chip Select pin low to signal the beginning of an SPI packet.
  digitalWrite(selectedChip, LOW);
  //Transfer the register address over SPI.
  SPI.transfer(registerAddress);
  //Transfer the desired register value over SPI.
  SPI.transfer(value);
  //Set the Chip Select pin high to signal the end of an SPI packet.
  digitalWrite(selectedChip, HIGH);
}

//This function will read a certain number of registers starting from a specified address and store their values in a buffer.
//Parameters:
//  char registerAddress - The register addresse to start the read sequence from.
//  int numBytes - The number of registers that should be read.
//  char * values - A pointer to a buffer where the results of the operation should be stored.
void readRegister(char registerAddress, int numBytes, char * values, int selectedChip){
  //Since we're performing a read operation, the most significant bit of the register address should be set.
  char address = 0x80 | registerAddress;
  //If we're doing a multi-byte read, bit 6 needs to be set as well.
  if(numBytes > 1)address = address | 0x40;

  //Set the Chip select pin low to start an SPI packet.
  digitalWrite(selectedChip, LOW);
  //Transfer the starting register address that needs to be read.
  SPI.transfer(address);
  //Continue to read registers until we've read the number specified, storing the results to the input buffer.
  for(int i=0; i<numBytes; i++){
    values[i] = SPI.transfer(0x00);
  }
  //Set the Chips Select pin high to end the SPI packet.
  digitalWrite(selectedChip, HIGH);
}

Comment: (a) EE.SE members may want to check your [duplicate question on the Arduino forums](http://forum.arduino.cc/index.php?topic=409433.0) for any updates there; (b) I would reduce testing to one module and use known-good code; the SparkFun tutorial code which you linked, seems to have "corrections" in later comments, so in your situation I would look for simpler code (displaying raw values) elsewhere; (c) I'm concerned that `-0.0077999997` is reported so often - that is likely telling you *something*, though without more time I can't say *what*; (d) try running the self-test on each module. HTH
Comment: @SamGibson thank you very much for your reply. (a) Sorry about that. (b) Yes, I started with one sensor, but the readings were weird, so I added a second sensor for comparision. I also tried the corrections in the comments and used this lib (https://github.com/ograff/ADXL345---SP), which again is basically the Sparkfun Code with the correction. I am not sure were to find "known-good code"? (c) Yes, that is esentiall digital `1 * 0.0078`. So the sensor is always returning 1 or with the correction the sensor always returns 511. (d) Thanks for the hint, haven't thought about that.
Answer: Ok, I found the issue. The gy-291s, that I bought seem to be completely uncalibrated. I used them with a +-4g range. But especially the z-axis is oftimes off by about 8g. Therefore, the measures were completely weird. I also switched to the adafruit library, since it seems to be the better solution compared to the sparkfun code. The lib can be found here: https://github.com/adafruit/Adafruit_ADXL345/.
Hope this helps anybody with the same issue.

ADXL345 GY-291 weird measures


Expired panko bread crumbs

Question: A couple of days ago, I used some expired panko bread crumbs (expired by at least 5 months) for chicken tenders. They had this bad stale oil smell to them and I decided to take a risk. They had previously been opened but I'm very careful in closing them back up and storing them in a cool dry place.
As the first step of the recipe, I lightly fry the panko bread crumbs in a little oil and that removed that bad oil smell instantly. The chicken tenders smelt and tasted fine as well.
I read this and it says that bread crumbs don't spoil, the thing is
though that it definitely smelt pretty bad. So, is the stale oil smell or the expiry something to worry about?
Answer: That "stale oil" smell was probably the small amount of fats in the crumbs going rancid and forming butyric acid. I usually do not cook with anything that smells bad, my thought is that it just isn't worth the risk, but risk tolerance varies.
Answer: I use panko bread crumbs, but not that often, so they end up sitting around on the shelf for long periods of time. I've never noticed any kind of smell or staleness about them.
You don't say if the package had been previously opened or not. If it was, it's possible that the breadcrumbs were exposed to something in your kitchen which then sat in the package for a long time and ended up giving the bad smell to them.
Comment: They had previously been opened but I'm very careful in closing them back up and storing them in a cool dry place. So I don't think they picked up anything from the kitchen.

Expired panko bread crumbs


Is it a bad idea for family members to give each other referrals?

Question: My mom works at a company that I am applying to and I'm going to be applying there soon. Would it be a bad idea for her to give me a referral? I understand it comes off as being biased, which is why I'm thinking that it might be a bad idea.
Comment: Be allowed and bad idea are two different things.
Answer: It's fine so long as she lets people know about the relationship. A referral which has "this is my son, I think he's great" lets people know that she might not be entirely unbiased.
A referral which says "jerry is the best young person I've ever met. I would wholeheartedly recommend him for his role, and recommend an immediate pay rise" without mentioning the relationship is deliberately concealing important information and is not ok.
Comment: Wrong.  You might as well tell them my referral is worthless because my son is the best EVAR.
Comment: I disagree.. Submitting a referral from you mom shows that you very immature and have no clue how the workplace works. If can't possibly help and it can surely harm.
Answer: As with all referrals, there's a credibility in function and a credibility out function.
A referral from a parent who is him/herself highly credible in the organization is likely to be respected to some degree. If I know you do very good work; honestly look out for the company and team's best interests; never compromise on quality; treat everyone with respect regardless of your personal relationship; view issues objectively; and so on — I'm likely to take your description of your son or daughter seriously.
If, on the other hand, you take a somewhat lackadaisical approach to your own work; you often blame others for issues; your ideas about whether or not an idea will work are often inaccurate or biased; you haven't invested in relationships with your team; and so on — I'll probably shrug when you tell me how great your son or daughter is.
That's the credibility in function. If it's high enough, an interview might take place. The credibility out function, then, is how much said son or daughter goes on to fulfill expectations. Hence, as Kilisi said, if you are hired, make sure your conduct and conscientiousness proves your mom right.
My aunt works at a large property development firm. She was headhunted from a previous firm where she had done great work. At the new firm, she quickly confirmed her reputation as a serious and competent employee. Her son, my cousin, just finished an undergrad degree in mechanical engineering. She asked her manager to take a look at his résumé. The manager, knowing his mom to be a trustworthy person, agreed after some insistence. He turned out to impress the manager in the interview, so they hired him.
Answer: Anyone can refer anyone.
Normally it's a good idea to trust your mothers judgement. Both for the sake of getting ahead and peace of mind.
Regardless, if you do get the job, don't let her down.
Answer: When a company sets up a system where current employees can refer people they know, they are trying to find a way to get quality candidates. They may be good because you have worked with them for years. They may be good because they have similar work ethics.
Not everybody recommended will be hired. Not everybody recommended will be a good candidate. It is Ok to recommend a family member. In almost every case the recommendation comes with bias. The two people know each other. Nobody believes them when they say this person is the best underwater basket weaver in the world. They are just their favorite currently unemployed basket weaver.
Now if the company is small they may have a policy about hiring family members at all. Even big companies may not allow family members work too close together. So it is possible that this recommendation may not go anywhere.
Answer: I once hired someone in an American public sector position and it almost got derailed when she told HR that one of her references was her cousin. He was in an appropriate position to give her a recommendation, professionally (being in a line of work that matched the job we were hiring for), but there are anti-nepotism laws and policies in many places, and sometimes they're not clear until the end of the process.
Referrals aren't references, but the policies might apply.
I would recommend finding someone else to give the referral, but being open, if you're hired, about your mother being an employee (nothing wrong with it as long as she didn't influence the hire.)
Answer: It is okay if you make it transparent. That is not to just repeat Philip Kendall's answer - she is an adult and she stakes her professional reputation on that referral. If you turn out to be an entirely unfit candidate and it actually wastes company resources as opposed to grabbing your average Joe from the streets, it will be on her.
Past that, it depends on the country/culture a lot: there are places where entertaining some light nepotism is considered okay or even virtuous (hiring young relatives to give them job experience for better-than-McDonald's pay but still acceptably low for an entry position). Crucially, in this scenario it is your mother who has her reputation at stake and who has made this decision. You are entering this arrangement basically risk-free. Respect her decision and her help and you will be fine.
Answer:
Would it be a bad idea for her to give me a referral?

YES, very bad idea.
Your mother is clearly biased (as she darn well should be). A reference from her can't be viewed as an objective assessment and hence it's useless for the interviewer.
Providing a reference from your mother would be very tone deaf. It can very well be interpreted as "this candidate is still being helicoptered by their parents".
Keep your personal/family life separate from your professional life.
Comment: References and referrals are different things.  I agree using your parent as a reference is a bad idea.  Using them as a referal isn't-  its common to refer family members and family friends to jobs, it's then HR's job to filter through to the decent ones.  Any referal is inherently biased, you're not going to refer someone you dislike.


Install/upgrade to Apache ant 1.8.2

Question: How to install/upgrade Apache Ant 1.8.2 with apt-get on Ubuntu natty. I tried sudo apt-get upgrade ant and sudo apt-get install ant(after removing the already installed version ie.,1.8.1) but nothing works. Every time it installs Ant 1.8.1 only.
Answer: As you have found - you cannot "upgrade" this way.  Repositories are usually stable code bases updated only with stability and security fixes - rarely newer versions of applications.
The eclipse team have packaged v1.8.2 of ant via their PPA.
If you want to go down that route
sudo add-apt-repository ppa:eclipse-team/debian-package
sudo apt-get update

Comment: It should be noted that PPAs aren't "Official" and can result in a broken system. Please use them sparingly and only when you trust the author.
Comment: Agreed with Marco.  You should only use PPAs if you ***absolutely trust the source(s)***
Comment: To supplement this, if your version of ubuntu doesn't have `add-apt-repository` you can install it with `sudo apt-get install python-software-properties`
Answer: 1.8.2 hasn't been packaged for Natty yet, the most recent packaged version of Ant in the Natty archives is 1.8.1-1. 1.8.2 has been packaged for Oneiric, so you can either wait for Oneiric release, or you could follow the Backport request process and request that the Oneiric packages get backported to Natty.
You could also compile Ant from source, if you liked, but that could cause issues if you ever want to go back to getting Ant through the repos.

Install/upgrade to Apache ant 1.8.2


The shape of mRNA

Question: I was wondering about the shapes assumed by mRNA. I have read some sources quoting that it is linear (quora, so not very reliable) and also a source that says a hairpin shape is common (nature, so I would rather go with this one).
I was also wondering what additional factors or features ensure the mRNA has this shape. For instance, the first source says that the mRNA 'is linear so that the ribosomes can bind to it'. But, clearly, all that is required for this is that the ribosome binding site is exposed. In that case, the remainder of the mRNA may either spontaneously unravel as it is being translated, or there may be something slightly more specific taking place catalysed by the ribosome, or there may be an additional enzyme that associates and catalyses the unfolding of the mRNA as it is being translated.
The thing is, I just find it difficult to belive that the mRNA would not fold up on itself, but on the other hand if it did, perhaps it would be too stable and would not be degraded sufficiently easily. We would have accmulation of mRNA in the cell, unless there was a protein that specifically degraded it.
My only other hypothesis, if it truly is the case that the mRNA does not fold up, is that it is down to the DNA in the nucleaus being 'too dense' to permit the mRNA folding in the nucleus, and once it exits via a nuclear pore it is immediately being translated and forming a polyribosome complex. So then it can no longer fold.
I do not think that the DNA content in the nucleus is sufficiently dense for steric effects like this. I have seen electron micrograph images in a book (Molecular Biology of the Cell) of mRNA exiting a nuclear pore. It seems quite coiled up. Unfortunately, I have been unable to find a clear representative image online or the associated paper. But perhaps the mRNA can coil up in the nucleus, but is straightened out as it is pulled throught the nuclear pore. Proteins and factors associated with the nuclear pore may catalyse the breaking of the hydrogen bonds.
Any details on this would be much appreciated.
Comment: Possible duplicate of [What stops messenger RNA from binding to itself?](https://biology.stackexchange.com/questions/52776/what-stops-messenger-rna-from-binding-to-itself)
Answer: Unfortunately it is often taught that mRNA is linear, but this is not true at all. Nucleotides within mRNA can form intra-molecular hydrogen bonds with other nucleotides, creating secondary structures, interactions between these secondary structures results in tertiary structures. mRNAs have highly variable secondary structures, primarily due to differences in the sequence of the ORF, so there is not a consensus structure adopted by mRNAs. However, codon degeneracy is important in producing more ordered and stable mRNA secondary structures in ORFs, resulting in increased mRNA half-life. Nucleotides in positions one and two in codons are the most conserved, whereas the third nucleotide position is the least conserved and has elevated GC content, thus making the greatest contribution to the stability of the secondary structure. The 5' UTR typically contains lots of secondary structures, which may help in modulation of translation initiation, whereas 3' UTRs contain fewer secondary structure, resulting in structural instability around binding sites for proteins and miRNAs, enhancing miRNA and protein binding. The start and stop codons are less frequently base-paired than the rest of the mRNA, suggesting they exist in local secondary structures which lead to efficient initiation and termination of translation. However, the sequence immediately downstream of the stop codon has a high GC content and an in increase in frequency of base pairing. It has been hypothesised that this strong secondary structure is present to interrupt post-termination ribosomal scanning. Whilst increasing stability of mRNA increases half-life, low secondary structures around binding sites within the mRNA suggests that thermodynamic stability of mRNA is optimised and not-minimised in all scenarios.
With regards to translation initiation there is quite a lot of cool work on dynamic secondary RNA structures for regulating translation initiation, this work primarily revolves around riboregulators and riboswitches. I won't go into detail about them here, but for a great paper on riboregulators see: Green, A. A., Silver, P. A., Collins, J. J. & Yin, P. Toehold switches: de-novo-designed regulators of gene expression. Cell 159, 925–39 (2014)
References:
Comparative analysis of orthologous eukaryotic mRNAs: potential hidden functional signals. Nucleic Acids Res. 32, 1774–82 (2004).Shabalina, S. A., Ogurtsov, A. Y., Rogozin, I. B., Koonin, E. V & Lipman, D. J.
Duan, J. & Antezana, M. A. Mammalian Mutation Pressure, Synonymous Codon Choice, and mRNA Degradation. J. Mol. Evol. 57, 694–701 (2003).
Shabalina, S. A., Ogurtsov, A. Y. & Spiridonov, N. A. A periodic pattern of mRNA secondary structure created by the genetic code. Nucleic Acids Res. 34, 2428–2437 (2006).

The shape of mRNA


When did Bruce organize his will and the new Bat signal?

Question: What do you think the timeline looked like after returning from the Pit in The Dark Knight Rises, specifically when and how did Bruce get his will set up and the new Bat signal put on the MCU building? I have been pondering it and would like some other suggestions.
Comment: I need to see the movie again, but my impression was that it happened after Batman "died".
Comment: It's awfully hard to edit and sign your will AFTER you "died" and stay dead.
Comment: It's been months since I saw the movie, but I don't recall *Bruce* dying - just Batman in the supposed explosion.
Answer: He did all of this before he went to face Bane in the tunnel. When Alfred speaks to him and leaves, Bruce gets the picture. He cannot and does not want to be the Batman, but he knows that he can't walk away, leaving the city without a hero. When, however, he meets Robin - John Blake - he knows that he can hang up the cape. That's when he changes the will and fixes the autopilot. In the eyes of the city, he has to be dead. Batman has to give them everything, so that Bruce can have something.
Comment: That's a logical explanation. Is there anything in the movie or extra materials that backs up this theory?


Lifetime of eMMC device

Question: I have better knowledge about the NAND and NOR memory devices as I'm currently working with them. Now I have heard that eMMC device is going to be used in one of my upcoming project.
What is the assured lifetime(write or erase cycles) of eMMC device compared to conventional NOR and NAND flashes?
Answer: A wikipedia article lists 1 million read/write cycles for eMMC flash memory, and lists the comparisons you ask for.
This question is now extremely important for a second reason.  A new line of laptops (eg, HP stream 13 or Chromebook) is using 32GB eMMC in lieu of a hard drive.  With a fixed read/write cycle, these seem to be "disposable" laptops that you can only use for a while before their main storage just stops working, especially if the eMMC unit is not replaceable, or cannot be restored from system restore or backup media.

Lifetime of eMMC device


Need an applet to report web sites unavailability

Question: Is there a gnome applet that will let me configure a list of URLs to be verified and report when some is unavailable ?
Preferably using notifiations.
The validation must use HTTP GET or HEAD .
Answer: You could write a small bash script to throw notifications at you... Something like:
#!/bin/bash

for site in $(cat ~/.sites); do
    if ! ping -c 1 -w 5 "$site" &>/dev/null ; then
      notify-send "$site is down!!"
    fi
done

Your list of sites to check lives in ~/.sites.
Then you just need to cron that up to run. You might need to export DISPLAY=:0 in cron so the notification shows up in the right place.
Note that if you use a DNS intermediary like OpenDNS, if a domain name you ping doesn't exist, it'll hit their no-domain search server. Therefore it's probably safer (though less informative) to use IPs.
oli@bert:~$ ping asasdslfkjsdlff.com
PING asasdslfkjsdlff.com (18.104.22.168) 56(84) bytes of data.
64 bytes from hit-nxdomain.opendns.com (220.127.116.11): icmp_req=1 ttl=54 time=33.1 ms
64 bytes from hit-nxdomain.opendns.com (184.108.40.206): icmp_req=2 ttl=54 time=32.8 ms

Answer: Maybe you can take this as a base (needs python-appindicator and python-notify):
import gtk
import gobject
import urllib2
import pynotify
import appindicator

urls = ["http://askubuntu.com",
        "http://not.available.com"]

ind = appindicator.Indicator("url-checker", "indicator-messages",
                              appindicator.CATEGORY_APPLICATION_STATUS)
ind.set_status(appindicator.STATUS_ACTIVE)
ind.set_attention_icon ("indicator-messages-new")
menu = gtk.Menu()
# yadda yadda yadda
ind.set_menu(menu)

def update(urls, ind):
    err = ""
    for url in urls:
        try:
            if (urllib2.urlopen(url).getcode() != 200):
                err += "%s is down\n" % url
        except urllib2.URLError:
            err += "%s is down\n" % url
    if err:
        ind.set_status(appindicator.STATUS_ATTENTION)
        pynotify.Notification("Bad news:", err).show()
    else:
        ind.set_status(appindicator.STATUS_ACTIVE)

    return True

update(urls, ind)
timeout = 300000 # 5 minutes
gobject.timeout_add(timeout, update, urls, ind)
gtk.main()

Comment: It just needs a config dialog and it's perfect ;)
Comment: That, a menu indicating which page is offline in case you missed the notification, a possibility to exit, nice icons, packaging, etc. etc. - unfortunately I'm way too unmotivated. :P
Answer: You can install the link-monitor-applet
 (see the homepage) which puts this functionality on your gnome panel very elegantly.  Link Monitor is in repositories, so :
sudo apt-get install link-monitor-applet

However, I suspect that since you said "URL" you might be looking at something that does a GET to the websites, reporting if it doesn't get a response?  Can you clarify if a simple ping is enough?  Some websites, for example, won't let you ping them.  Worse, getting a ping doesn't guarantee that the website is actually up.
Since you've specified that you'd like this solution to be URL-based, you can use Oli's solution above, but first :
sudo apt-get install httping
And the script becomes :
#!/bin/bash

for site in $(cat ~/.sites); do
    if ! httping -c 1 -g "$site" &>/dev/null ; then
      notify-send "$site is down!!"
    fi
done

NOTE : This wasn't working for me until I realised that I had configured my home router to use OpenDNS.  This means that timed-out sites are redirected to the OpenDNS landing page instead, meaning that this script never generated an on-screen notification!  One to watch.
Comment: I do want a GET and check for an HTTP 200 (ok) reply.


How do I add a custom button next to the "Add Content" button?

Question: How can I add a button next to the + Add Content button on /admin/content, in Drupal 8?
Answer: You have to provide mymodule.links.action.yml in your module.
This is an example from core for the Add content action button from your question:
node.links.action.yml
node.add_page:
  route_name: node.add_page
  title: 'Add content'
  appears_on:
    - system.admin_content

Reference: Providing module-defined actions
Comment: Perfect! that works well, on a side note, do you know how to use that button to create form overlay for users to input data and then process that data?
Answer: To further the answer above, if you want to theme the button you added from MODULE.links.action.yml you need to implement the following hook in you MODULE.module file:
function MODULE_menu_local_actions_alter(&$local_actions) {
  $local_actions['ROUTE.NAME']['options']['attributes'] = array(
    '#target' => '_blank'
  );
}

The above hook will add the attribute target="_blank" to the link


If T and S are bounded linear operators and T is compact and S*S<T*T, show that S is compact.

Question: Exercise 14 section 9.3 Erwin Kreyszig. I don't know how to prove it, please help.
Answer: $S^{*}S< T^{*}T$ implies $\|Tx\|^{2} \geq \|Sx\|^{2}$ for all $x$. Let $\{x_n\}$ be  a bounded sequnece. There exists $n_k$ increasing to $\infty$ such that $Tx_{n_k}$ converges It follows that $\|Sx_{n_k}-Sx_{n_j}\| \leq \|Tx_{n_k}-Tx_{n_j}\| \to 0$. Thus $(Sx_{n_k})$ is Cauchy, hence convergent. This proves that $S$ is compact.
[$S^{*}S<T^{*}T$ means $\langle S^{*}Sx, x \rangle \leq \langle T^{*}Tx, x \rangle$ which means $\langle Sx, Sx \rangle \leq \langle Tx, Tx \rangle$ or $\|Sx||^{2} \leq \|Tx\|^{2}$ for all $x$].
Answer: Kavi's answer is the straightforward one and it should be accepted. Here I want to show a less obvious way of proving it.
From this answer we see that there exists a contraction $C$ such that $(S^*S)^{1/2}=C(B^*B)^{1/2}$. Now write $S=V(S^*S)^{1/2}$ via the Polar Decomposition. Then
$$
S=VC(T^*T)^{1/2},
$$
and as $T$ is compact, so is $T^*T$, so is $(T^*T)^{1/2}$, and thus so is $S$.


need for 1000 dpi non PDF image from powerpoint

Question: The journal does not want pdf nor 300dpi. They want 1000 dpi. How do I get there from mac powerpoint?
Comment: Welcome to Ask Different. It would help us if you provided additional info, such as the types of devices, OS, etc.  Also let us know what you've already done to solve the problem yourself.  Please see [ask] for how to ask good questions that have a better chance at being answered. - From Review
Comment: @Dominique Just to clarify, you have an image in Powerpoint (and nowhere else) that you want to extract and it has to be at least 1000dpi?
Answer: Journals ask for esoteric and often silly image requirements all the time*. Unfortunately you're starting with an image in PowerPoint. It isn't a graphics program though, it's a slide deck program and your options are limited. This time, you will need to export as a vector (PDF), open in Preview, and then export as the DPI desired by the journal.
Start here for help: Changing the target DPI when saving slides as images in PowerPoint 2011
Note that if your image is just that - an image, NOT a chart or graph or text, but literally a photo - exporting at higher DPI will just give you a blurrily-enlarged version of your current image, NOT a crisp, clear, high-resolution file. In that case, you'd need to re-create your image at a higher resolution starting from the original source files, which (if they are not at or above 1000 dpi) might literally be not possible.
...and next time, use a proper graphics program to create your images. If cost is an issue, open source ones exist, such as Inkscape or GIMP, that will get you closer to what a journal wants when it comes time to publish. The MS Office suite is ubiquitous but that doesn't mean it's the proper tool for the job.
(*The journal requirement is silly, really, because PDF is a vector format - which means it's resolution-independent, and looks good at any size. Most journals prefer vector images. Some refuse them, for no good reason. The ONLY time a vector isn't superior is where the original artwork is something other than lines and curves, such as photographs/photomicrographs. For graphs and charts, vector is much superior.)


String replacement in filenames in linux

Question: I have a tonne of files called File30_i.txt for i=1, 2, 3, 4, 5...
Is there an easy way to quickly rename then File20_i.txt for example?
Answer: There is a tool for that called rename:
rename 's/File30/File20/' *.txt

For a preview run with -n:
rename -n 's/File30/File20/' *.txt

Answer: My preferred way would be to use sed to generate a script for it, for example:
ls -1|sed 's/File30_\([^.]*\).txt/mv & File20_\1.txt/'|bash

This should rename as per the filenames you gave in the question. To preview the commands, you can do:
ls -1|sed 's/File30_\([^.]*\).txt/mv & File20_\1.txt/'

Answer: renamer works on Windows, Mac and Linux:
$ renamer --find Find30 --replace Find20 *.txt


How Can I Tell If I Bought a Pirated Pokemon Game?

Question: I bought a copy of Pokemon Fire Red off Amazon. Shortly after I bought it, I read several reviews stating the person bought a pirated copy. I was wondering... how can I tell if I purchased a pirated game?
Comment: I'm not familiar with this personally, but this looks promising: http://www.ebay.com/gds/Identify-pirate-GBA-Pokemon-games-/10000000178146398/g.html
Comment: Also helpful information: http://forums.penny-arcade.com/discussion/2044/how-can-i-spot-a-bootleg-gba-cartridge
Comment: haha this is definitely legit:  http://i.ebayimg.com/00/s/NDgwWDUwMA==/z/LMQAAMXQlgtS6xLt/$_1.JPG?set_id=2
Answer: Pirated copies often have internal damage messages at the beginning of the game.
This is most often characterized in a message stating that the battery is out of power, or 'run dry', yet states that the game can be played.
Other messages can include corruption and data damage messages.
If you are willing to open it up, it is a dead giveaway when there is a pirated copy.
Their innards are completely different from normal, Nintendo manufactured copies.
For one, there will be no Nintendo copyright on the circuit board above the connector pins.
If you Google the normal innards of a cartridge, you will see instantly whether yours is pirated or not.
There will also be no hard codes pressed into the cartridges.  These may be hard to find or see on an original copy, so don't immediately assume you have a false copy.


Burning Bonfire Ascetic multiple times in the same bonfire will increase difficulty each and every time?

Question: The title is self-explanatory. I'm wondering what happens if I burn Bonfire Ascetic multiple times in the very same bonfire.
Answer: It will continue to increase the difficulty of the area permanently. All Enemies will return to 'full health' even if they had not yet despawned. This carries across playthroughs as well. If you beat the game and end up in NG+, that area will also respawn as 1 more '+' than it was before. So if you had burned two Ascetics in your first playthough it will be NG+++ in your NG+ playthrough.
Answer: To add to Reafexus' answer, you can see the level of the bonfire in the travel menu. There will be a little number in the bottom right corner of the thumbnail for the bonfire indicating the bonfire's 'intensity'. Burning an ascetic increases this intensity by one permanently. Starting an NG+ raises every bonfire's intensity by one. These two effects stack. So, if you burn an ascetic at Crestfallen's Retreat (for whatever reason) in NG, it's intensity will raise to two. Then starting an NG+ will raise every bonfire to two, and that one to three.
Answer: To add to the previous two answers, it does continue to increase the difficulty, but only to a certain point, at which difficulty remains static. This point is when the counter reaches 8, I believe. That's either NG + 7, or burning a Bonfire Ascetic 7 times (or some combination of the two). Past this point, burning Ascetics will respawn despawned enemies, but will not increase their difficulty, as this is (and has always been across the Souls series) the difficulty cap.


Multisite features

Question: I was thinking about creating a network of user-created blogs. I've read somewhere about wordpress multisite feature, and i was wondering if this is what i'l looking for...
What i need to do is create a website where users register and create their onw blog.
Does wordpress multisite offer this feature out of the box ? If not, would manually implementing this feature into wp be doable, or should i start from 0 or another platform ?
Thank you!
Answer: Yes, the MultiSite feature handles your desired setup, out of the box.
Answer: WordPress multisite sounds exactly like what you are looking for. It takes a little work to get multisite set up, but once that's done, the options for allowing anybody to register and create a new site are built right in. See http://codex.wordpress.org/Create_A_Network for setting up a multisite instance.
Comment: thanks! and can it be set up not to use subdomains ? meaning insted of newuser.mysite.com to be smth like mysite.com/newuser ?
Comment: Yes, multisite can be set up to use subdirectories instead of subdomains.

Multisite features


drivers for Dell Dimension 8200 Desktop?

Question: I am getting ready to install Ubuntu on my dekstop Dell Dimension 8200.  This is my first experience with Ubuntu.  Do I need to download any additional drivers?
Answer: According to a post on the Ubuntu Forums, you need to select nomodeset before booting. Insert the CD, press the up and down arrow keys, select language, press F6 and select nomodeset with the arrow keys. Then select Install Ubuntu with the arrow keys and press enter, and you should be good to go.


Analytic Number theory in TCS

Question: Are there any applications of analytic number theory in TCS?
Comment: This is actually a fascinating question, one that I have wondered about for a long time. I'm not sure why it's closed, could be a good community wiki question... Other than the one current answer, I can think of Algebraic Geometry codes that are built on top of lots of tools that in turn use analytic number theory (such as Weil conjectures), or explicit construction of Ramanujan graphs built using the Ramanujan conjecture. But nothing substantial I'm aware of that directly uses the ANT techniques, rather than taking a result from the area as a black box. Voting to reopen.
Comment: I know that Laplace's method and saddle point method are sometimes used in combinatorics and probability (for example analytic combinatorics). But I'm not aware of any other applications of techniques from ANT in TCS.
Comment: Modular forms (not exactly ANT but a central tool there) have also recently been applied to lattice packing problems (optimality of Leech and E_8), which are related to the first answer below.
Answer: Codes/Lattices are certain combinatorial objects that are commonly used within TCS. A basic question for both of them is finding "short" codewords/lattice points, known as the Minimum Distance problem/Shortest Vector problem (MDP/SVP).
Both have been known to be NP-hard under randomized reductions for 20+ years. Roughly 10 years ago, the NP hardness proof for MDP was derandomized using some Analytic Number Theory (Weil's Character Sum bound).
SVP has still not been derandomized, but can be derandomized if the following result in analytic number theory is proven:

For any $\epsilon > 0$, there exists $c\in\mathbb{N}$ such that for all sufficiently large $n$, the interval $[n, n + n^\epsilon]$ contains a square-free integer with no prime factors larger than $\log^c(n)$

Details of both of the above are described in Micciancio's paper Locally Dense Codes.
It's worth mentioning that this "existence of smooth numbers in short intervals" question is known within analytic number theory. For example, section 1.2 of Smooth numbers: computational number theory and beyond mentions that a slight relaxation of the problem (no prime factors larger than $n^\epsilon$) implies Vinogradov's conjecture, a problem in analytic number theory with no progress in 40 years.
There are definitely recent publications on this problem (say this), but I am not an expert, and can't say what the limits of current techniques are.

Analytic Number theory in TCS


What is coFrameDiv and coToolbarFrame in Chrome Inspect Element?

Question: Only recently I have noticed some extra code being adding to my page when I look at it via the Chrome Inspect Element tool. It may have been there all the time but I just noticed it.
What is it? Is it normal and I missed it or is a Chrome extension or is it malware?
It does not show up on my code when I view source.
Below is the code:

Answer: Any toolbar may be installed in chrome like Norton Toolbar. So these extra chunks of code added to your page. you can check at chrome://extensions/ if "Allow in incognito" option has not been selected for that toolbar, you will not see these extra bit of piece of code.
View source will not show dynamic generated HTML for a html, that's why it's not showing there.


IPTG and lac operator with e coli for foreign gene question

Question: We did an experiment were we have e coli with a plasmid with a gene from another bacteria in it, and we put in IPTG in for induction. Will after looking up more about IPTG online I see it's related to the lac operator, which from what I've found just deals with lactose. Is there some other function that has? How can this be related to or effect the thing we put in and what we're doing? I'm missing the connection here.
Answer: The lac operon contains genes which are important for the metabolization of lactose as an energy source - normally glucose is used for this purpose. Usually the operon is tighly regulated and as long as there is another source of energy it is kept in an inhibited state.
The presence of lactose removes the lac repressor from the lac operon and allows the expression of the genes and thus allowing the metabolization of lactose. The mechanism can be turned on and off depending on the presence of lactose.
IPTG is a substance which mimicks the presence of allolactose (a metabolite of lactose) and it can activate transcription from the lac operon. As IPTG (in contrast to allolactose) cannot be hydrolyzed by β-galactosidase, it's concentration in the cell stays the same. Using the lac operon and IPTG enables you to switch on the expression of the gene on your plasmid and to start the overexpression.
Comment: So does the lac operon effect other things then lactose to that could have any affect on our protein? Or would there be something in the plasmid to let it be controlled by the lac operator? Is the presence or lack of the repressor having some effect? I mean what we're doing isn't related to lactose so I just don't get how messing with the lac repressor as an effect on what we put in the cell.
Comment: @windy401 In your plasmid (an artificial construct), the gene of interest will be under the control of the lac operator. Lac repressor can be expressed constitutively from another gene on the plasmid.
Comment: Finally found this, and after reading it and the rest of the pages(http://www.mfa.od.ua/page274.htm), I get it now.

"The essential element involved in lac-mediated protein expression is not the lac genes, but rather the lac regulatory apparatus. Generally, a gene selected for over-expression is cloned into a plasmid vector behind the lac promoter. Expression of this gene is then under lac control, either as an independent gene or fused to a fragment of lacZ or other genes."
I just wasn't seeing how/why our gene was being controlled by something that just controlled lactose stuff.
Comment: You only use the promoter of the lac operon, sorry for being unclear here. This allows the control of the expression of your target gene. I will edit the answer later.


Fireplace main burner not lighting . .. .pilot is fine

Question:
I have a very similar problem with my Napoleon HD40 fireplace to what another user had posted on.  My fireplace is using a Dexen 6K module and 6003 3v valve.  The pilot ignites fine using the wall switch with either the transformer or 3v battery pack.  However the main burner never lights up.  I can also bypass the wall switch at the fireplace by shorting the SW1 contacts together . . . giving me the same result.  The voltage from TP -> TH/TP is about 480mv after the pilot has been on for a minute or so. If I pull the TH wire from the valve there is no change.  So I'm unsure if a) the ignition module isn't sending the TH wire what it needs or b) if the valve itself is defective.  How can I tell?  What reading should I have at TH on the valve?
Comment: Is the gas valve actually opening?  What is the resistance across the coil terminals of the main valve?
Comment: I'm not sure how to tell if the valve is opening.  Wouldn't the main burner ignite if it was?  Also, which terminals at the valve (TP, TH and TH/TP) should I be measuring . . . . and what should I expect to find if it is good or defective?
Answer: I ordered a new ICM and that fixed the problem.  In checking the voltages at the valve TH to ground is now 1.92v.  Also, the red and green LEDs on the battery relay are now brightly illuminated.  With the defective ICM they were very dim.  Thanks for all your input.  Hopefully this will help others in the future.
Answer: In millivolt systems which use a mercury switch the problem is that the switch was
designed as 125- 50 VA operation not at 480 mv. The switch contacts need to
be cleaned up! Remove the switch from the fireplace. Make a jig with a 20 watt bulb  and a 110 volt source
and have the bulb turned ON and OFF with a flame source (BBQ or torch).
With a voltmeter you will find that the contact resistance is now below
1 ohm when it was some 60 ohms in my system before the aboe "cleaning".

Edit: This solution will work in millivolt system (450 mV-open,~220 mV closed). the current in this case is about 0.450 ma. The switch contacts get contaminated under this regiment. Using a jig to have the switch operate under. 125 volts 40 va range will clean the contacts. This is not the wall switch, it is located inside the fire place and its role is to sense if the pilot is lit. For safety remove ths switch from the fireplace when working with 125 volts.
Comment: OK now you've really lost me :)  I'm pretty sure that the wall switch is not the problem.  If I bypass it completely (shorting the 2 SW1 leads right at the fireplace) the problem is the same.  Or are you referring to a different switch?  Where would the mercury switch be in this fireplace?  This is a 3V IPI system . . . or am I totally wrong on this ...?
Comment: The OP bypassed the switch with no change so it is not the problem.
Comment: I guess I'm still trying to figure out what I should be seeing at the valve contacts (volts/amps/ohms) when it should be turning on.  If I'm seeing the correct voltage between TP/THTP . . . which I think I am (~480mv) . . . is that what turns the main valve on?  Or does TH/THTP need to be activated somehow?  If so, how . .. . what am I expecting to see between those contacts, etc.???  Anyone ???
Comment: I know nothing about 3V IPI systems. The above solution may not apply.


Is there a way to restrict automatic statistics updates to a certain timeframe?

Question: I have an Azure SQL Database that runs on average at < 10% DTU capacity. It seems that at random times during the day large statistics update queries will execute on the database, causing DTU (specifically data IO) resources to spike.

I have confirmed that these are statistics updates coming from the system by looking at the "Query performance insights" graphs and reports.

For example, one of these queries is:
<code>SELECT StatMan([SC0], [SC1], [SC2], [SB0000]) FROM (SELECT TOP 100 PERCENT [SC0], [SC1], [SC2], step_direction([SC0]) over (order by NULL) AS [SB0000]  FROM (SELECT [UserId] AS [SC0], [OrganizationId] AS [SC1], [Id] AS [SC2] FROM [dbo].[Cipher] TABLESAMPLE SYSTEM (1.064647e+000 PERCENT) WITH (READUNCOMMITTED) ) AS _MS_UPDSTATS_TBL_HELPER ORDER BY [SC0], [SC1], [SC2], [SB0000] ) AS _MS_UPDSTATS_TBL  OPTION (MAXDOP 16)
</code>
Sometimes these statistics updates can have a negative effect on the production application running on top of this database. Execution times against the database and application can increase.
Since I cannot predict when these daily statistics updates will happen, it is not possible for me to schedule a maintenance window where I can increase system resources to help them complete faster. Obviously at < 10% average resource usage I am not at a point where it makes sense to increase resources and pay for a costlier tier 24/7.
I already run a scheduled job weekly during off hours (on the weekend) to rebuild indexes and update statistics manually, yet these automatic updates still seem to happen on a daily basis, often during peak times.
Is there a way I can reduce the impact of these automatic statistics updates during peak application times? Or is there a way I can better predict when they will happen? Ideally I would like to handle these types of impactful maintenance tasks during a planned window.
Answer: I would disable these auto statistics update and schedule a sql job to do on-demand stats update based on my defined rules, such as when the data change % is more than a threshold or when index fragmentation is more than a threshold.
Actually for big tables (100+ million rows), I always do this way because auto statistics update usually use a very small sampling rate for the big tables, and it often can cause more harm than good.
Comment: I thought about disabling the auto statistics, however, everything I read always ends up saying that it is a bad idea. Do you have any recommended script examples that I can reference for monitoring these types of metrics to trigger stats updates? Or, some reference material on what type of metrics I should be monitoring and when triggering stats updates would be important?


Is there a fuel cell that uses electricity to split water?

Question: What I mean by that, is instead of using the fuel cell to produce electricity, is there a product where the fuel cell is used to split water and half the gas is used for the ICE and the other goes back into the fuel cell to power it? Is there a product like that I can buy?
Comment: You'd have to pressurise or cryongenically cool the hydrogen to store it for reuse. That's not really feasible in a small space like a car's engine bay. I don't think it is available.
Comment: So, you could investigate how much energy is needed to separate Hydrogen and oxygen? will the amount produced be sufficient to power the ICE AND the fuel cell?
Comment: I want to know will it be enough to power and ICE while also generating enough power to power it self.
Comment: I read your question with the idea you are looking for perpetual motion - so again : research the energy it takes to break the bonds between hydrogen and oxygen etc
Comment: Well i wont say its perpetual motion as you would stil need energy to split the water. But thanks for the guidance
Comment: "still need energy to split the water " exactly the point I was making in my original answer...
Answer: Actually, a fuel cell won't produce hydrogen. Electrolysis will.
So, what you are suggesting is using hydrogen to power a fuel cell and the obtained electricity for electrolysis to obtain hydrogen.
Now, the problem is that if you divert half of the obtained hydrogen to an internal combustion engine, only half of the energy remains in the rest. So, every cycle of this machine will mean you have less and less hydrogen.
The system will work only if you have a big hydrogen tank somewhere. The tank will eventually be depleted. Now, if you have a big hydrogen tank, why don't you directly power an internal combustion engine by using the hydrogen, or better yet, power the fuel cell and use all of the electricity in electric motors, without trying to waste the electricity in electrolysis?
Answer: No. The energy you get from burning hydrogen cannot possibly be more than the energy you spend splitting it. Perpetual motion machines are physically impossible.
Also, when you burn fuel in an ICE, it will at best recover about 35% of that energy as motion, driving the wheels and/or a generator. The remainder is lost (to friction, exhaust gas velocity etc.)
There have been a few hydrogen ICEs (BMW had a few 7-series converted as test vehicles), they all used high-pressure gas bottles or a metal hydride tank as storage.


How to reduce variables in logistic regression?

Question: I am running a logistic regression to predict Yes/No. I have more than 200 independent variables. I have tried to input all the variables, the result is terrible. It is obvious that one variable will effect to the other variable.
1. Is there any way to reduce the variables?
2. How do I know which variables are important and which are not important?
3. I know there is a way called stepwise. But it seems doesn't work for me.
Thank you
Answer: There are many approaches to the very general problem of attribute selection you're facing here. However, the two methods me and my fellow consultants have successfully applied many times in real-life projects involving logistic regression are:
1) Predictor ranking. We investigate relationships between every single predictor and the target variable, using dependency measures such as univariate logistic regression , Cramer's V or Information Value. After this preliminary step, we keep only a selected number of highest-ranking variables (e.g. having a highest IV score or lowest p-value in logistic model). One may argue that we do not account for possible interactions that way, but in practice that approach worked pretty well for me on large medical and credit scoring datasets.
2) Representative selection. Peform a principal component or factor analysis on the whole set of independent variables to find groups of highly correlated ones. From each such group, pick only 1 or 2 variables, thus reducing the total number. Again, there are many fields where typically you have several related variables and therefore this approach provides good results.
Hope some of these suggestions will prove useful.
Comment: Hi Jacek, thank you so much for your ideas. I don't know univariate logistic regression , Cramer's V or Information Value before, but I will have some try. If I want to use R or Python to do this, could you please let me know which package should I use?
Comment: You can do logistic regression using glm method in R. The Cramer V and Information Value measures can be foudn in 'lsr' and 'woe' packages, respectively.


Why do we feel sad when feeling sad is bad?

Question: Everyone in the world feels sad. I also feel sad but I cannot understand the function and cause of this feeling. Can anyone tell me? Like, when someone scolds me, even if he is scolding me for some good reason, I feel sad. Why?
Comment: "....scolding for some good cause"... Perhaps the world's problems seem overwhelming to young people and they get sad. Try to have a physical goal every day, something you do with your hands. Organize one of your drawers, throw out some old stuff, clean something, whatever. Working on small problems with your hands  is the first step to working on larger problems. Also try to have a small intellectual goal to fulfill each day. If you seem busy with your hands and your mind, people are less likely to scold you.
Comment: You say you think sadness is bad. It is a judgement. However people fall into sadness _before_ any judgement about it. They become sad for some period because they find meaning being sad, and that meaning arises and is apprehanded before judgements can be made; not to say that it is completely unconscious, only that it is _precogital_ at nascending. And sadness is very much tied with the relation with _body_ at this stage.
Comment: "This being human is a guest house.
Every morning a new arrival.

A joy, a depression, a meanness,
some momentary awareness comes
as an unexpected visitor.

Welcome and entertain them all!
Even if they are a crowd of sorrows,
who violently sweep your house
empty of its furniture,
still, treat each guest honorably.
He may be clearing you out
for some new delight.

The dark thought, the shame, the malice,
meet them at the door laughing,
and invite them in.

Be grateful for whoever comes,
because each has been sent
as a guide from beyond." - Rumi
Answer:
feeling sad is not good i think

Feeling sad is not a bad thing always.  Almost all of us can give so many instances for this.  Often, solutions to many problems are found because of sadness.  Sometimes this sadness with slight variations becomes sympathy or empathy and this leads to many good activities/inventions.
We often listens only to what our senses bring to us. Sadness sometimes becomes a cause to find out the thing/world within us. Sometimes you might have already got instances for this from your/somebody's life.  You know that Arjuna was in distress and overwhelmed with grief on the battlefield.  You can read this in the first chapter of the Bhagavad Gita -- "Arjuna Vishada Yogam".  The questions he asked to Krishna (and the thing he could realize also) was about the greatest secrets of life.

i cannot understand the reason to feel sad. can anyone tell me?

Often you feel sad because you have many desires to be fulfilled.  Uneasiness of your body or mind can also make you sad.
If you don't know the truth fully, it would also make you sad.  Sometimes knowledge of the truth would be the villain.  Fear of something would also make you sad. (All these are also a part of uneasiness of one's mind.) But the 'knowledge' of the Ultimate Truth or strong faith in God rubs off sadness.

when someone scolds me even if he is scolding for some good
cause,i feel sad, why?

This is because you are not quite sure whether that is a good thing and also  that (good thing) would happen smoothly. Something that works against your ego would also make you sad. But this depends on your character. Otherwise the outcome would be in the form of rage.
Answer: According to some studies depressed people estimate actual likelihood of outcomes better than people in more normal moods.
Starting from that observation, there is a theory that even outside of the systematic sadness of depression, proper temporary sadness suppresses a natural excess in optimism ordinarily found in humans and makes you more careful, more observant and more open to learning from your mistakes.  There are times when this is the right way to be.
According to this theory, since we evolved from animals and spend time as children, and those prior generations and previous versions of ourselves have difficulty adapting their thinking by logic, before we had logic to apply to social situations and language to share information about them, we needed a switch for turning on and off our natural excessive optimism, and sadness was that switch, which automatically responds to a variety of triggers.
Given the other symptoms of sadness, which seem wasteful and are hard to relate to this purpose, the mood may have originated for some other purpose, like inducing hibernation or promoting rest so that we don't waste energy when we need help but others are not available to take care of us.  But (again assuming this theory) this triggering of carefulness and openness to self-doubt long ago became its primary purpose.
No one can tell you why you, in particular are sad without a lot more information.  But you may want to take the theory seriously and search your environment for things or situations from which you are failing to learn some lesson.
Answer: People who are sad may be sad for a reason; they might have lost their home or some other disaster might have happened; this is sadness that is anchored on a real life happening.
However, a melancholic disposition was one of the four classical personality types. They tend to be more realistic than optimistic people. Today, melancholia has been medicalised and called depression.
If someone is being scolded for good reason then being upset seems a reasonable response. If it's without good cause then being annoyed or irritated seems reasonable. Human beings are full of passions, we are emotional beings. A man or woman or child who expresses no emotions, who is affectless would be seen as strange and alien; we express our emotions, and so daily we express both joy and sadness, happiness and unhappiness. It's what makes us human. We commiserate or celebrate.
Answer: Feeling sad is not "bad" per se. That is a misunderstanding.
Pain is not something we enjoy, but it is necessary to prevent damaging the body (physical dimension). It can't be said that pain is "bad". Feeling pain causes a reaction intended to protect the body.
Sadness is the equivalent, but for the emotional dimension: feeling sad causes a reaction intended to improve the emotional self.
The main difference between pain and sadness is the complexity of the reactive process. Pain can be said to produce a simple reaction. If I feel pain because my finger is burning, I just move it away. Likewise, if I feel sad because my wife treats me bad, I will tend to get away from such situation, to improve my emotional state. Sadness is the negative indicator which produces the repelling reaction.
If I feel sad because someone died, my brain is telling me that the lack of that person is something negative. So, I should try to improve the situation.
In the first case, a divorce is the solution, and that could ease my sadness quite fast. But in the second case, the solution is not that simple. Sadness could last.


spectral measure

Question: how to calculate spectral measure for a given normal operator for example right shift operator?
Comment: This looks like a homework problem, so don't be surprised if your question is closed - see the faq. You'll find a lot of information on how to calculate certain parts of the spectrum of certain operators in the book Reed/Simon: "Methods of Modern Mathematical Physics", Volume 4: "Analysis of Operators".
Answer: There is an example in
MR1483073 (98g:46001)  Meise, Reinhold ;  Vogt, Dietmar . Introduction to functional analysis.
Translated from the German by M. S. Ramanujan and revised by the
 authors.
Oxford Graduate Texts in Mathematics, 2. The Clarendon Press, Oxford University Press, New York,  1997. x+437 pp. ISBN:
The spectral decomposition for the unbd. operator $-i d/dx$ can be computed from that of a multiplication operator via the Fourier-Plancherel transform. That's in Kato's book on functional analysis.
Another way is to compute first of all the polynomial calculus  for your operator $T$, which sometimes is doable and then make a guess about how $f(T)$ looks like for say continuous functions f (of course you must then find a proof and show that if polynomials $p_n$ tend to $f$, then $p_n(T)$ goes to $f(t)$.  If you send me an email, I can send you some examples.

spectral measure


How can I simulate JPEG quality degradation?

Question: I am writing a report about file formats in images & their properties. In the report I want to talk about how file formats have lossy compression rather than lossless compression & I wanted to create an image which could show how the quality of an image decreases over time when saving. I tried doing this by saving a JPEG image as & naming it something else so I had all of the images with the various qualities. However, the file only decreased its size the first time I saved it.
Is the file just not getting compressed again?
Is the same data being compressed so there is no change?
Do I need to make changes to the image so it gets compressed?
If so how would I do this to show quality degradation ?
Thank you to anyone who helps me with this, I am not very good with image editing & I am very grateful for all of your help,
Pi Net
Comment: Are you decreasing the quality each time you "Save As…"?
Comment: did you always open the last saved jpeg and save it again?
Comment: Of interest, perhaps: http://regex.info/blog/lightroom-goodies/jpeg-quality
Answer: tl;dr
The JPEG implementations used by most graphics software is designed specifically to prevent degradation when a block is saved over and over if the content does not change. Every 8x8 block will remain the same if re-encoded on the same settings as long as no pixels in the block have been changed.
To simulate this, rack the curves or levels center point up and down a value, or convert from RGB to Lab and back to introduce minor changes that need to be re-compressed.
Some basics on JPEG compression steps and compression vulnerability
The process goes through six distinct phases:
Color Space Transformation (1) and Downsampling (2)
The color space transformation and downsampling are usually bypassed in images saved at a high quality. The short explanation is it separates the luminence from the color data, then downsamples the color channels to reduce the raw data load with minimal data reduction. If this is in the process, it's a major source of degradation on re-saves, but most implementations in graphics software will preserve the full-resolution RGB channels.
Block splitting (3)
Block splitting is lossless except at the extreme edges of an image where dummy data is added, but better algorithms will fill in those blocks with data to minimize artifacts when possible. This cuts the images into 8x8 pixel blocks for compression
Discrete cosine transform (4)
In most modern implementations made for image storage, it's steps 4 and 5 that cause the degradation.
Discrete cosign transformation is too complex to describe here in a way that does it justice, but I recommend you read up on it at some point. To summarize any 8x8 block of pixels can be perfectly represented by linear combination of the 64 8x8 blocks shown below. In most photo type images, the broader detail patters are much stronger than the finer detail blocks. This is not a lossy process, but each final value is rounded to only a couple of digits after the decimal.

Quantization  (5)
With the values organized in this way, we can take advantage of how the human eye and brain resolve detail, which is that it favors broad detail over narrow detail. This is where most of the compression actually occurs. The lower detail blocks both affect the output less, and that affect is less than noticeable to the human brain, we can just clip some of these smaller values to 0 and ignore them. The quantization matrix is added to the file, every algorithm provides their own, but they are preserved between saves. The raw values are divided by the values in the quantization matrix and rounded to the nearest integer. This rounding is a primary component of the lossiness.
Entropy coding (6)
Entropy coding organized the final matrix from the most significant corner to the least significant corner, generally this groups the 0's at the end of the list. After that, those 0's can be truncated and the results encoded into the file. This, again, is a basically lossless process, but saves a lot of space.
Running a jpeg through this process again, the final compressed blocks will be identical because the removed detail data is not there to be filtered away. Because this is done on 8x8 blocks, this even works on any unedited portions of image that are changed between saves.
Answer: Take a look at the linked post. This question will probably get closed because the other one answers one of your questions. Saving several times with the same compression. What factors cause or prevent "generational loss" when JPEGs are recompressed multiple times?
But if you want to document different compression settings, start from the original file, assign one setting (Best quality) and save as 01-BestQuality.jpg then take the original image, assign new compression values and save it as 02-NotTheMestQuality:o).jpg

But here is another related question: "Optimal" size of a JPEG image in terms of its dimensions
You can read in the answers that you need to take into account the content of the image.
A flat image of a pure blue sky will probably stop to have noticeable compression because some good degree will be done on the first level.
But an image of a forest can potentially show more compression each time because there is a detail to be compressed.
On this old page (which I eventually upgrade and translate) https://otake.com.mx/Apuntes/Imagen/PruebasDeCompresion2/3-CompresionJpg10Porciento.php you can see how the compression affects areas of detail, where flat areas remain with not much change.
Comment: "But an image of a forest can potentially show more compression each time because there is a detail to be compressed." – If the same quality setting is used, eventually steady state is reached and the image will not changed no matter how many times it is resaved, which can be verified with file hashes.


Fast-forward merge is not possible. To merge this request, first rebase locally

Question: Recently, I have created newbranch and created a merge request to Master branch. Before TeamLead accept merge request into Master branch another team member was committed another fix to the same branch(newbranch). After that I committed my local changes and pulled the changes in newbranch to local branch. And I pushed my local commit to newbranch

My TeamLead told me to rebase my branch to an earlier version.
And resolve conflicts.
I don't know what to do now. Any idea?
Answer: Starting on your newBranch:
git checkout master to get back on the master branch
git pull origin master to get the most up-to-date version of the master branch
git checkout newBranch to get back on your newBranch
git rebase origin/master -i to perform an interactive rebase. The command will take you through and let you pick commits, rename them, squash them, etc. Assuming you will want to keep them all, it will pause when there are merge conflicts and then you'll have to resolve them in your text editor, it will tell you where (in your text editor) that the conflicts occur. You will have to add those files after fixing them then do git rebase --continue to proceed with the rebase.
When you're done with the rebase your newBranch will be synced up with master and have any commits in master that weren't there when you started your work, and all merge conflicts will be resolved so that you can easily merge your newBranch.
Answer: It seems that your GitLab is configured to not allow feature branches with merge commits to be merged into the master branch.  This is where you took a wrong turn:

After that I committed my local changes and pulled the changes in newbranch to local branch.

What you should have done is to commit your work, and then pull via rebase from the remote newbranch branch.  To remedy the situation, I suggest nuking the merge commit which happened when you pulled from GitLab.  A merge commit is likely what happened, because git pull by default uses the merge strategy, not the rebase strategy.  Check git log, and see how many commits were introduced due to the incorrect pull.  Assuming there were only a single merge commit, then the following should do:
git reset --hard HEAD~1

Verify again that git log looks correct.  You should now see only your latest commit on the top of the branch.  Assuming you do see this, then you are good to pull via rebase:
git pull --rebase origin newbranch

This will bring in your colleague's commit, then replay your latest commit on top of the branch.  Finally, you may push the branch out, and the problem should be resolved:
git push origin newbranch

Note that doing a hard reset as I have suggested above is generally not a good thing to do.  But in your case, no one has seen that merge commit yet, because GitLab rejected your attempt to push.  So you should be safe in removing it.
Comment: Thanks for the idea. First I created branch from master and pulled changes and merged it to newbranch. And resolved conflicts. And force pushed it.
Answer: I've suffered a lot from it, and today I found an EXTREMELY SIMPLE way:
For example, assuming you want to pass the content:
From a branch called feature/NativeSubmodule
To a branch called develop .
Download and install SourceTree [ https://www.sourcetreeapp.com ], then open your project in it, and follow the steps in this image:

And then:

If you want to just Replace the destination branch(develop) with the Origin branch content(feature/NativeSubmodule), you just don't have to do the "Extra)" step. :D
Answer: In my case this happens when I send merge request without pulling and merging  all new code from develop branch.
I just wrote this in console
git add .
git commit -m "my commit"
git push

Without change branch to develop and pull (after merge) everything from it.
For work you need to pull actual code from develop and  merge it to your branch
git add .
git commit -m "my commit"
git checkout develop
git pull
git checkout <branch_name>
git merge develop
// if have any  conflicts fix them and push it
git push  // or if need set upstream git push --set-upstream origin <branch_name>

Answer: Staying on current branch:
git pull -r origin master
This pulls the current branch and rebase on origin-master branch. This is a fast-forward operation. If it doesn't work on the first try, then open VSCode and manually accept/decline the changes.
git status will show still rebasing.
git rebase --continue will add the new commits.
git push --force will complete the rebasing and pipeline will start to build.