Querying the Apple AppStore?

Question: I'd like to be able to gather information about the apps that a particular user has deployed/registered under their Apple ID.  I know that Apple has an iTunes search API available, but I don't see any way to query given an Apple ID (typically represented as an e-mail address).  Is there any way to do so?  Are there any other search APIs that I've missed that provide this functionality?  I know that I can query for an app using the "artistId" parameter, but can't find a way to map the numeric value for the artistId to an Apple ID.  Thoughts?
Comment: This information is not something Apple makes available through any of their official information sources, including enterprise partner feeds. So Dimtry's answer might be your best bet (i.e. use the artist name)
Answer: I wouldn't expect Apple to give access to private information. The best you can do (if that helps you at all) is search app store for artist, say Tapbots
<code>http://itunes.apple.com/search?term=tapbots&entity=allArtist
</code>
And then use that ID to search all their apps.
Answer: Since the iTunes API is the only search mechanism provides, you'll have to use a combination of filters from http://www.apple.com/itunes/affiliates/resources/documentation/itunes-store-web-service-search-api.html#searching

Querying the Apple AppStore?


Writing data to Hadoop

Question: I need to write data in to Hadoop (HDFS) from external sources like a windows box. Right now I have been copying the data onto the namenode and using HDFS's put command to ingest it into the cluster. In my browsing of the code I didn't see an API for doing this. I am hoping someone can show me that I am wrong and there is an easy way to code external clients against HDFS.
Answer: There is an API in Java. You can use it by including the Hadoop code in your project.
The JavaDoc is quite helpful in general, but of course you have to know, what you are looking for *g *
http://hadoop.apache.org/common/docs/
For your particular problem, have a look at:
http://hadoop.apache.org/common/docs/current/api/org/apache/hadoop/fs/FileSystem.html
(this applies to the latest release, consult other JavaDocs for different versions!)
A typical call would be:
Filesystem.get(new JobConf()).create(new Path("however.file"));
Which returns you a stream you can handle with regular JavaIO.
Comment: more specifically (and run using hadoop jar code.jar {classname})

org.apache.hadoop.fs.FileSystem.get(new org.apache.hadoop.mapred.JobConf()).create(new org.apache.hadoop.fs.Path("however.file"));
Answer: For the problem of loading the data I needed to put into HDFS, I choose to turn the problem around.
Instead of uploading the files to HDFS from the server where they resided, I wrote a Java Map/Reduce job where the mapper read the file from the file server (in this case via https), then write it directly to HDFS (via the Java API).
The list of files is read from the input. I then have an external script that populates a file with the list of files to fetch, uploads the file into HDFS (using hadoop dfs -put), then start the map/reduce job with a decent number of mappers.
This gives me excellent transfer performance, since multiple files are read/written at the same time.
Maybe not the answer you were looking for, but hopefully helpful anyway :-).
Answer: About 2 years after my last answer, there are now two new alternatives - Hoop/HttpFS, and WebHDFS.
Regarding Hoop, it was first announced in Cloudera's blog and can be downloaded from a github repository. I have managed to get this version to  talk successfully to at least Hadoop 0.20.1, it can probably talk to slightly older versions as well.
If you're running Hadoop 0.23.1 which at time of writing still is not released, Hoop is instead part of Hadoop as its own component, the HttpFS. This work was done as part of HDFS-2178. Hoop/HttpFS can be a proxy not only to HDFS, but also to other Hadoop-compatible filesystems such as Amazon S3.
Hoop/HttpFS runs as its own standalone service.
There's also WebHDFS which runs as part of the NameNode and DataNode services. It also provides a REST API which, if I understand correctly, is compatible with the HttpFS API. WebHDFS is part of Hadoop 1.0 and one of its major features is that it provides data locality - when you're making a read request, you will be redirected to the WebHDFS component on the datanode where the data resides.
Which component to choose depends a bit on your current setup and what needs you have. If you need a HTTP REST interface to HDFS now and you're running a version that does not include WebHDFS, starting with Hoop from the github repository seems like the easiest option. If you are running a version that includes WebHDFS, I would go for that unless you need some of the features Hoop has that WebHDFS lacks (access to other filesystems, bandwidth limitation, etc.)
Answer: Install Cygwin, install Hadoop locally (you just need the binary and configs that point at your NN -- no need to actually run the services), run hadoop fs -copyFromLocal /path/to/localfile /hdfs/path/
You can also use the new Cloudera desktop to upload a file via the web UI, though that might not be a good option for giant files.
There's also a WebDAV overlay for HDFS but I don't know how stable/reliable that is.
Answer: It seems there is a dedicated page now for this at  http://wiki.apache.org/hadoop/MountableHDFS:

These projects (enumerated below) allow HDFS to be mounted (on most
  flavors of Unix) as a standard file system using the mount command.
  Once mounted, the user can operate on an instance of hdfs using
  standard Unix utilities such as 'ls', 'cd', 'cp', 'mkdir', 'find',
  'grep', or use standard Posix libraries like open, write, read, close
  from C, C++, Python, Ruby, Perl, Java, bash, etc.

Later it describes these projects

contrib/fuse-dfs is built on fuse, some C glue, libhdfs and the    hadoop-dev.jar
fuse-j-hdfs is built on fuse, fuse for java, and the    hadoop-dev.jar
hdfs-fuse - a google code project is very similar to    contrib/fuse-dfs
webdav - hdfs exposed as a webdav resource mapR -    contains a closed source hdfs compatible file system that supports    read/write
  NFS access
HDFS NFS Proxy - exports HDFS as NFS without    use of fuse. Supports Kerberos and re-orders writes so they are    written to hdfs
  sequentially.

I haven't tried any of these, but I will update the answer soon as I have the same need as the OP
Answer: You can now also try to use Talend, which includes components for Hadoop integration.
Answer: you can try mounting HDFS on your machine(call it machine_X) where you are executing your code  and machine_X should have infiniband connectivity with the HDFS Check this out, https://wiki.apache.org/hadoop/MountableHDFS
Answer: You can also use HadoopDrive (http://hadoopdrive.effisoft.eu). It's a Windows shell extension.

Writing data to Hadoop


Lowercase phi (φ) seemingly used for diameter in diagram instead of Ø?

Question: On a technical drawing for resistors, the lead diameter was given as $\varphi 0.55\text{mm}$. Since they also specify the wire is 24 SWG, and 24 SWG is a diameter of 0.559mm, did they simply use φ (phi) when they should have used Ø, or is this actually accepted notation? And if it is accepted usage, does the usage of φ differ from Ø?
Comment: A picture would speak a thousand words....
Comment: @GlenH7 Wish I had one I could share (NDA). I can tell you the "drawing" in question was nothing more than an orthographic projection of a through-hole (PTH) resistor with "φ0.55mm" in vague proximity to the end of the lead with no other markings. I only figured out it referenced the diameter because elsewhere in the textual spec it said the leads were 24 SWG, which I know has a diameter of 0.559mm.
Answer: As engineers, symbols get re-used due to the fact that there are so many things we need to give a label to, so if someone uses a lower case does it change the thing described?
As long as it is clear what is referred to, then that is what matters. If someone heard verbally " phi " and used lower instead of uppercase...
The table in this link gives the diameter of 24SWG as 0.558mm, see https://www.esr.co.uk/electronics/cable-copper2.htm
Comment: It may well be a case of « who » produced the drawing - based on your other comments, but, as you won't show then all we can do is guess...
Comment: I'm with you on "using what works". In this case, though, there were no other symbols on the drawing. And Ø has no lowercase, nor is it related to phi at all. So are you saying that this usage of phi for diameter is unusual/non-standard? (I've certainly never seen it before, but I'm not an engineer.) It was only because they actually specified the wire gauge three pages later in the spec that I was able to figure out that it was indeed the diameter. So the diagram was either useless, or I'm just not familiar with phi being used for diameter.
Comment: @type_outcast Sure Ø has a lowercase: ø — it's the symbol for diameter ∅ that doesn't have a lowercase. But that is the sort of detail that doesn't really matter. People use "lookalike" symbols all the time, just as you just did. As Mike said, as long as it is clear what is referred to, …


Diffusion velocity

Question: I understand that diffusion is the movement of particles from high concentration areas to low concentration, but what is the cause of that movement atomically? And especially in the case of charge carriers in semi-conductors...
is it related to the charge of the atoms or particles? For example a higher concentration of electrons in a certain area creates a difference in charge relative to its adjacent (we could say "positive") area. Is that what causes the carrier "electrons" in this case to move towards the low concentration area?
Comment: 'Entropic force' deserves a mention: http://arxiv.org/abs/1310.4139
Answer: Random thermal motion (Brownian motion) allows the particles to become ergodically distributed in their phase space. They are scattering off each other and any other particles in the environment. This randomizes the motion. Otherwise they would carry on in the same direction until acted on by a force. It is the randomization nature of scattering events that drive the diffusion process. At $T=0$ diffusion processes stop and the particles would be frozen in space.
Electrons and holes in semiconductors move under the influence of diffusion and field assisted drift processes. But again the diffusion is caused by the motion they pick up from having a non zero temperature. Microscopically they are scattering off other electrons, holes and phonons, and are also scattered by local changes in electric field.
Interestingly, if the particles start in a confined region and are then released, from a statistical mechanics perspective, you could say that entropy is driving the diffusion process. Because they start in macrostate with very few microstates and end up in the macrostate with the most number of microstates. As shown here: https://youtu.be/UC0bKzgQU9g?t=1m45s
Answer: Nothing "causes" diffusion, it is a statistical process. The atoms in any system in thermal equilibrium are constantly moving with velocities of order $\langle v^2\rangle \simeq T/m$. This motion is randomized by collisions on some microscopic time scale $\tau$. The simplest case is a dilute gas, where $\tau\sim 1/(vn\sigma)$, where $n$ is the density of the gas, and $\sigma$ is the collision cross section. Similar formulas hold in all sorts of systems, electrons in metals, phonons in solids, etc.
Now consider a box with high concentration on the left, low concentration on the right. On the left, atoms have a 50-50 chance to move right, and on the right atoms have a 50-50 chance to move left. Since there are more atoms on the left, the net current moves to the right.
Comment: Sorry but that's not enough, or maybe i have a weak background, but go further with me. what would cause the movement of the atoms ? Acceleration cant just be created from nothing, or so i thought.
Comment: Minor edit. At $T\neq 0$, there is always thermal motion.
Comment: Great! That sounds correct, I didnt know about that velocity. Thanks! Another question concerning that velocity, is that related to the entropy(internal energy) .( I studied it in thermodynamics but it wasn't explained).
Comment: Yes, it's thermal motion, related to the internal energy.

Diffusion velocity


Shaitan influence on Prophets

Question: As we normal people are always being influenced by Shaitan to do wrong things and we try to avoid all those things to do following the rules, so similarly could Shaitan also have the power to influence Prophets as well in their daily life?
Answer:
Summary: Prophet Muhammad SAW was safeguarded by Allah against Shaitan, but no definite answer for other Prophets.

Shaitan could if Shaitan had the ability to influence the prophets, but regarding the Prophet Muhammad (SAW)'s case:

A'isha the wife of Allah's Apostle (ﷺ), reported that one day Allah's Messenger (ﷺ) came out of her (apartment) during the night and she felt jealous. Then he came and he saw me (in what agitated state of mind) I was. He said: A'isha, what has happened to you? Do you feel jealous? Thereupon she said: How can it be (that a woman like me) should not feel jealous in regard to a husband like you. Thereupon Allah's Messenger (ﷺ) said: It was your devil who had come to you, and she said: Allah's Messenger, is there along with me a devil? He said: Yes. I said: Is a devil attached to everyone? He said: Yes. I (Aisha) again said: Allah's Messenger, is it with you also? He said: Yes, but my Lord has helped me against him and as such I am absolutely safe from his mischief. (Sahih Muslim)

Source for this hadith: https://sunnah.com/muslim:2815
And in a hadith before it:

Abdullah b. Mas'ud reported that Allah's Messenger (ﷺ) said: There is none amongst you with whom is not an attache from amongst the jinn (devil). They (the Companions) said: Allah's Messenger, with you too? Thereupon he said: Yes, but Allah helps me against him and so I am safe from his hand and he does not command me but for good. (Sahih Muslim)

Source for this hadith: https://sunnah.com/muslim:2814a
From these hadiths we come to know that the Prophet Muhammad (SAW) was safeguarded by Allah against Shaitan.
Regarding other Prophets such as Musa (AS):

And he entered the city at a time of inattention by its people and found therein two men fighting: one from his faction and one from among his enemy. And the one from his faction called for help to him against the one from his enemy, so Moses struck him and [unintentionally] killed him. [Moses] said, "This is from the work of Satan. Indeed, he is a manifest, misleading enemy."
(Surah Qasas - 15, Saheeh International)

Source for this Verse is: https://quran.com/28/15?translations=20,19,85,84,17,101,21,22,18,95
From the above verse we understand that Musa (AS) was mislead by the Shaitan into killing a man, however this was before Musa (AS) received prophethood.
And please remember that my answer could possibly contain mistakes and as such is not infallible.
May Allah grant us beneficial knowledge. Ameen

Shaitan influence on Prophets


Choosing the content of the preprint

Question: A paper was submitted to a journal, and now I am thinking of submitting a preprint on ArXiv. However, I wouldn't want to release publicly one of the examples in the paper yet, and would submit the preprint without that particular example (it's probably 5% of the paper). Could this be a problem given the reviewers might check the preprint? Is there any rule on the level of similarity between the preprint and the journal paper, or they are fully independent?
Comment: Are you sure the journal would allow you to publish a preprint? Not all do.
Comment: I am sure the journal is okay with this, I did it before and others do it. However, so far the preprint contained the same content as the journal.
Answer: I don't see any problem with this. The submitted version and the arXiv version certainly do not need to be exactly the same, although in my experience it is more common the other way around (something in the arXiv version that was omitted from the submission).
A few possible issues this might cause:

A referee might see that there is an arXiv version and assume it is the same, therefore that everything in the paper is publicly available, not realising you are trying to keep that example under wraps.
Once the article is accepted, if you want arXiv to count for "green open access" you would need to update the arXiv version to match the accepted version, including the example.
Seeing the arXiv version might prompt someone else to come up with the same example and write it up (either publicly or just sent to you), assuming you don't know about it.
Comment: Thank you for analysing the possible issues. I will indeed update the ArXiv once the article is accepted. I would say the chance that someone else comes with that example are slim, as they would either need to use my new method in the paper, which would still give me credit, or use a different method, meaning it will have the disadvantages of the existing methods.
Answer: I think that most preprints are papers still a bit "in process". Therefore it is natural that they aren't in the same form as the published version, which is likely to be changed on advice of the reviewers in any case.
So, assuming that the journal permits preprints that they don't control themselves, it should be fine. A preprint isn't intended as an alternate publication method (though used that way often enough) but a PRE print: an early version.
Your usage is a bit non-standard, but no one, including reviewers, will likely notice nor care.
In math, for example, preprints are favored so as to give earliest notice of results that might be useful to others, given the somewhat long publication process.

Choosing the content of the preprint


Does the last villager trade allways boost your reputation in village?

Question: I keep buying the last item options from villagers.

The Wiki states on trading and popularity:

<code>Action                                                        Popularity Change
Trading a villager for the last offer slot on their list      +1
</code>

Does that mean that if I buy 20 name-tags my popularity will be 20? Or, since popularity caps at 10, does that mean I can allways just buy 10 nametags to fix any popularity deficit due to killing villagers or iron golems?
Answer: Probably, because trading in the last slot is the only option to increase your popularity. because the popularity can range from -30 to 10, you would need to buy 40 nametags (or any other item in the last slot) to ensure your popularity is maxed out.


How do I set up permissions for apache to run fastCGI programs?

Question: I am trying to get Apache2.4 to run compiled fastcgi programs on an Ubuntu 14.04-based system.  I am using mod_fastcgi and am getting the errors
FastCGI: can't start server "/var/www/fcgi/fhello.fcgi" (pid 29037), execle() failed: Permission denied
[Sun Jun 14 14:16:23.322632 2015] [:warn] [pid 29022] FastCGI: server "/var/www/fcgi/fhello.fcgi" (pid 29037) terminated by calling exit with status '255'

my apache config block looks like
<IfModule mod_fastcgi.c>
  AddHandler fastcgi-script .fcgi
  FastCgiWrapper /var/lib/apache2/fastcgi
  FastCgiServer /var/www/fcgi/fhello.fcgi -socket /var/www/fcgi/fhello.sock -user www-data -group www-data
  ScriptAlias /fhello "/var/www/fcgi/fhello.fcgi"
  <Directory /var/www/fgci>
    Require all granted
    Options ExecCGI
  </Directory>
</IfModule>

if it helps the fhello code is
#include "fcgi_stdio.h" /* fcgi library; put it first*/
#include <stdlib.h>

int count;

void initialize(void) {
  count=0;
}

int main(void) {
/* Initialization. */
  initialize();

/* Response loop. */
  while (FCGI_Accept() >= 0) {
    printf("Content-type: text/html\r\n"
      "\r\n"
      "<title>FastCGI Hello! (C, fcgi_stdio library)</title>"
      "
FastCGI Hello! (C, fcgi_stdio library)
"
      "Request number %d running on host %s\n",
      ++count, getenv("SERVER_HOSTNAME"));
  }
  return 0;
}

www-data owns and has exec rights to the program, and has write permissions to the fcgi dir for the sock file.  This is my first time setting up anything to run as fastcgi besides perl forever ago and I seem to be lacking in the google-fu to find effective information on this subject.
If anyone can point out what I am doing wrong or what I have missed, please do so.
Answer: So after some face palming the code snippet I was using seg faulted at getenv("SERVER_HOSTNAME") see
  "Request number %d running on host %s\n",
  ++count, getenv("SERVER_HOSTNAME"));

so I replaced that with (also fixed the html)
   "Request number %d running on host host\n",
    ++count);

and in the apache config I simplified it to
<IfModule mod_fastcgi.c>
  AddHandler fastcgi-script .fcgi
  FastCgiServer /var/www/fcgi/fhello.fcgi
  ScriptAlias /fhello.fcgi "/var/www/fcgi/fhello.fcgi"
</IfModule>

letting the server manage the connection.  I still haven't figured out the permissions issue I was getting above, but everything is working as I want it now.


Looping through a json array of objects

Question: I have been trying to follow an example as per another stackoverflow question:
javascript or jquery: Looping a multidimensional object
I am posting this question as a last resort as I have been on the problem for hours!
I have an ajax function that returns a json array.
ajax:
  $.ajax({ url: 'functions.php',
           data: {action: 'getNFCMapping', site: site_id},
           type: 'post',
           dataType: 'json',
           success: function(data) {
            //loop the json to get the
                for (var key in data) {
                      console.log(data[key].nfc_id);
                  }
            } //end success
  });//end ajax

json array:
[{"24":{"nfc_id":"1","description":"sdfgdsg"}},{"25":{"nfc_id":"2","description":"dfgdfgdfg"}},{"26":{"nfc_id":"3","description":"fdgdffg"}},{"27":{"nfc_id":"4","description":"dfgdfgdfg"}}]

What I am trying to do eventually is load a form in the DOM with input fields (pre-populated) in pairs of nfc_id and description, therefore each iteration of the loop should output the two values.
The problem at the moment is that I can't actually access the values in each iteration, e.g. you can see I am trying to log the nfc_id of each iteration but it just appears as object in the console.
In the example ( javascript or jquery: Looping a multidimensional object ), I can see the difference in format of my json, in that I have two closing brackets on each iteration of my array, is this what the issue is?
Please help this is driving me crazy..
Answer: You want two nested .each() loops:
$.each(data, function(key, value) {
    $.each(value, function(k, v) {
       console.log(v.nfc_id);
    });
});

Fiddle
Comment: Just wanted to throw some caution in here because `$.each()` exhibits an exponential difference in processing time as the amount of array/object elements increases. A million iterations of empty array items takes 1500% longer when using `$.each()`. Of course this is going to vary from one CPU to another so my old AMD dual-core is probably below average of modern CPUs. **[My Test](http://jsfiddle.net/3G4vD/)**
Comment: Excellent, worked. Thanks @scrowler. Will accept once time limit passes.
Answer: You data is an array, so you should use for (var i = 0; i < data.length; i++) loop. Each element is an object so you use var key in obj notation:
for (var i = 0; i < data.length; i++) {
    for (var key in data[i]) {
        console.log(data[i][key].nfc_id);
    }
}

Answer: for(var i=0, i<data.length;i++)
$.each(data[i], function(key, val) {
    console.log(val.nfc_id);
    console.log(val.description);
});

Answer: Perhaps try the .each jQuery method? Link
So for your success:
success: function(data){
    $(data).each(function(index, element){
      //log here
    }
}

Looping through a json array of objects


Guide to choosing between REST vs SOAP services?

Question: Does anyone have links to documentation or guides on making the decision between REST vs. SOAP? I understand both of these but am looking for some references on the key decision points, eg, security, which may make you lean towards one or the other.
Comment: http://stackoverflow.com/questions/76595/soap-or-rest is a much better question, with much better answers. This one should be closed as a duplicate of the other, even though this one came in earlier.
Comment: http://nishantshukla001webservices.blogspot.in/2015/09/webservices-soap-vs-rest-json-vs-xml.html
Answer: Google first hit seems pretty comprehensive.
I think the problem here is there are too many advocates of one or the other, may be better of googling and getting more of a handle of the pro's/con's yourself and making your own decision.
I know that sounds kinda lame, but ultimately these sort of design decisions fall down to the developer/architect working on it, and 99% of the time, the problem domain will be the deciding factor (or at least it should be), not a guide on the net.
Answer: Simple Object Access Protocol (SOAP) standard an XML language defining a message architecture and message formats, is used by Web services it contain a description of the operations. WSDL is an XML-based language for describing Web services and how to access them. will run on SMTP,HTTP,FTP etc. Requires middleware support, well defined mechanisam to define services like WSDL+XSD, WS-Policy SOAP will return XML based data SOAP provide standards for security and reliability
Representational State Transfer (RESTful) web services. they are second generation Web Services. RESTful web services, communicate via HTTP than SOAP-based services and do not require XML messages or WSDL service-API definitions. for REST no middleware is required only HTTP support is needed.WADL Standard, REST can return XML, plain text, JSON, HTML etc
t is easier for many types of clients to consume RESTful web services while enabling the server side to evolve and scale. Clients can choose to consume some or all aspects of the service and mash it up with other web-based services.
<code>REST uses standard HTTP so it is simplerto creating clients, developing APIs
REST permits many different data formats like XML, plain text, JSON, HTML where  as  SOAP only permits XML.
REST has better performance and scalability.
Rest and can be cached and SOAP can't
Built-in error handling where SOAP has No error handling
REST is particularly useful PDA and other mobile devices.
</code>
REST is services are easy to integrate with existing websites.
SOAP has set of protocols, which provide standards for security and reliability, among other things, and interoperate with other WS conforming clients and servers. SOAP Web services (such as JAX-WS) are useful in handling asynchronous processing and invocation.
For Complex API's SOAP will be more usefull.
Comment: Haven't you noticed that previous answers have already given this information?
Answer: I Think both REST and SOAP can be used to implement similar functionality, but in general SOAP should be used when a particular feature of SOAP is needed, and the advantages of REST make it generally the best option otherwise. However, both REST and SOAP are often termed "Web services," and one is often used in place of the other, but they are totally different approaches. REST is an architectural style for building client-server applications. SOAP is a protocol specification for exchanging data between two endpoints.
I am very much agree with +Rob Cooper in his post. Yes, there are so many advocates. I have listed the difference between soap and rest.
Answer: There is a good flow chart you can use to help you decide between REST vs SOAP.
Link to flow chart: https://drive.google.com/file/d/0B3zMtAq1Rf-sdVFNdThvNmZWRGc/edit
Link to article: https://www.linkedin.com/pulse/20140818062318-7933571-soap-vs-rest-flowchart-to-determine-the-right-web-services-protocol-for-your-needs
The other two factors that I use to make this decision are:
1) Will clients of the Service require Media Types other than XML (e.g JSON). If yes, then use REST.
2) Is the client of the Service always going to be a Application/Server (e.g. not a RIA or AJAX client). If no, this leans towards REST as it is easier to consume REST services when using AJAX.


How to improve the preservation of the global data structure in UMAP?

Question: I have a dataset, where the features are comprised of points arranged in a regular grid on a simplex. Each of these points are defined as follows: A point $\mathbf{x}$ on the simplex can be represented as a vector in $\mathbb{R}^n$ such that:
\begin{equation}
\mathbf{x} = \left( x_1, x_2, \ldots, x_n \right)
\end{equation}
subject to the following conditions:
\begin{align*}
\sum_{i=1}^{n} x_i &= 1, \quad \text{(Sum Constraint)} \\
x_i &\geq 0, \quad \text{for } i = 1, 2, \ldots, n. \quad \text{(Non-negativity Constraint)}
\end{align*}
I came across a UMAP projections of such a space in the literature and I'm attempting to replicate those results. Unfortunately, there isn't much information available on the specific parameters used to create those plots. As a result, my UMAP projections seem to be somewhat distorted. I'm seeking ways to improve and accurately recreate the desired visualization.
Changing the number of neighbors or the seed does not significantly change the overall result.
The reference plot is:

My plot is however:

The corresponding code is:
import numpy as np
from matplotlib import pyplot as plt
from scipy.special import comb
from umap import UMAP

def simplex_grid(m, n):
    L = comb(n + m - 1, m - 1, exact=True)
    out = np.empty((L, m), dtype=int)
    x = np.zeros(m, dtype=int)

    x[m - 1] = n
    out[0, :] = x[:]

    h = m

    for i in range(1, L):
        h -= 1

        val = x[h]
        x[h] = 0
        x[m - 1] = val - 1
        x[h - 1] += 1

        out[i, :] = x[:]

        if val != 1:
            h = m

    return out

grid = np.array(simplex_grid(6, 14)) / 14

reducer = UMAP(random_state=10, n_neighbors=80, target_metric="l2",
               min_dist=0.05)

trans_grid = reducer.fit_transform(grid)

fig = plt.scatter(trans_grid[:, 0], trans_grid[:, 1], c=grid[:, 0])

ax = plt.gca()
ax.set_aspect('equal', 'box')
plt.axis('off')
fig.axes.get_xaxis().set_visible(False)
fig.axes.get_yaxis().set_visible(False)

plt.show()

Answer: UMAP is a stochastic algorithm. In order to reproduce their results, it's needed that they used the random_state and you need to set the same value as they did.
Given that

Unfortunately, there isn't much information available on the specific parameters used to create those plots

You don't have enough information to reproduce their results.
Comment: I know that UMAP exhibits stochastic behavior. However, altering the random state has minimal impact, as the overall shape remains remarkably consistent across different run with different seed. I want to get the nice hexagonal-shaped plot.


Adding values from a arrayList to shared Preference

Question: Is it possible for me to store and retrieve my ArrayList values using shared preference. Can anyone suggest me with an example.
Answer: It looks like the closest the SharedPreferences can do is save a Set of Strings. If that doesn't suit you should probably look at the alternatives for persisting data.
Answer: You can refer to this : http://androidcodemonkey.blogspot.com/2011/07/store-and-get-object-in-android-shared.html (Thanks to Greg Zimmers that give this tutorial).
The idea is you encapsulate the ArrayList to an Object and then you can refer to link tutorial that I give above and follow the tutorial. If you want to retrieve the ArrayList, you can get the Object and then you retrieve the ArrayList from the Object.


Is a self-introduction of the main character speaking to the reader appropriate to start a novel?

Question: I'm authoring a horror/corruption/murder novel. The book starts off with the Main Character telling the reader about who he is and his physical appearance (now in his 60s), how he got to be financially successful (starting work at age 15), introduces his wife very briefly (2 sentences), and an unexpected catastrophic event which would change his life forever. (Total beginning chapter is 605 words. He does not tell the reader what the book is about other than the unexpected event.)
Comment: The reason I am asking is, I create from an uneducated writing background. I was 'discovered' by a website owner in 2016 from my nightly rants on my social media page about society and its behavior. She liked my ability to tell a story. Well, now...I am trying to write a novel, yet do not have the financial wherewithal to take English courses or unlimited time. At 65 years old, I live on borrowed time. I've accumulated ideas and done brief outlines of over one hundred titles over the last 30+ years. My goal is to finish them. My questions might sound basic, but your answers...help a lot.
Comment: Thank you Wetcircuit for the input. I don't see a problem with it, but after reading so many opinions, I lacked confidence which led to the problem (in my mind) of whether I was doing the right thing. Therefore, I sought input from experienced authors. Upon reviewing your profile, and realizing you have knowledge, I'm going full steam ahead with my gut feeling.
Comment: Question: How is this different to a 'normal' opening chapter in a 1st-person novel?
Comment: We all deserve a little hand-holding and encouragement... Your question doesn't actually ask a 'problem' that needs to be 'solved' (I did not vote-to-close but their reason is 'needs clarity'). I think I speak for everyone when I say that opening sounds fine, not at all weird or controversial, so we're not seeing any reason NOT to open that way.... It's why I asked how it is different to a 'normal' opening chapter, to ask what *you* feel the problem might be.... (If you don't see a problem, and we don't see a problem, there is maybe no problem?) ;D
Answer: The danger here is that you have to catch the reader.  Since you are not starting with engaging action, you need an engaging voice.  One that convinces the reader that if he reads what this character is telling, it will be worth it.
Answer: Consider this second sentence of a novel:

To begin my life with the beginning of my life, I record that I was born (as I have been informed and believe) on a Friday, at twelve o'clock at night.

If it's good enough for Charles Dickens, I'd say you're safe.
Answer: I think you can absolutely start a novel this way, as other novels have also done. But you do need to make it engaging and you don't want it to be an info-dump where the purpose of the introduction is simply to 'fill the reader in.' This introduction should be to pull the reader in, to vaguely clue the reader in to what's going to happen without actually revealing much.
Answer: From the first line of "The Lovely Bones"

My name was Salmon, like the fish; first name, Susie. I was fourteen when I was murdered on December 6, 1973.

Is a great example of a first person narrative. The opening sentence tells you the big details and sets the stakes.  It seizes the imagination with lots of implied questions — who killed her, why did they kill her, and where they caught?
She goes on to describe herself, but obliquely. Her self-description feels very natural. When your character describes themselves, strive to not make a materially accurate or factual, but use that moment to reveal much more about the character and temperament of the character than you do about their height or weight or body build. Think about how you think about how you look.  In your mind's eye. Use that kind of language and it will feel natural and engage the reader because it creates a sense of openness and insight to who the narrator is.
Another point.  While there is no definition of how long they need to be, 600 words seem short. That's two pages, in standard manuscript format. That seems more like a scene. If the rest of your chapters are 2000-8000 words and just this first chapter is a runt, then I can't imagine it matters. But, if all your chapters are that short then I'd be worried you are skimping on establishing the setting and tension and stakes for the character.
Last point, you talk about being "discovered." If that means someone is encouraging you to try writing, then that is great.  If they want you to pay to be published or to market your novels then that is a big red flag. It might be a kind of vanity press.


Derivative with a "mixed" discontinuity

Question: I read that the derivative of a function can never have a "jump" discontinuity, but only essential discontinuity. My question is, can the derivative have a "half essential and half jump" discontinuity, where $\lim_{x\to a^-}f(x)$ does NOT exist, $\lim_{x\to a^+}f(x)$ DOES exist, and $\lim_{x\to a^+}f(x)\not= f(a)$ ?
Comment: I suppose you should write $f'(x)$ in place of $f(x)$ in your question, because you are concerned about the discontinuity of the derivative $f'(x)$ and not $f(x)$.
Answer: The precise meaning of "derivatives can't have jump discontinuity" is the following:
Let $$f'_{-}(a) = \lim_{h \to 0^{-}}\frac{f(a + h) - f(a)}{h},\,f'_{+}(a) = \lim_{h \to 0^{+}}\frac{f(a + h) - f(a)}{h}$$ If $\lim_{x \to a^{+}}f'(x)$ exists then $f'_{+}(a)$ also exists and $$f'_{+}(a) = \lim_{x \to a^{+}}f'(x)$$ and if $\lim_{x \to a^{-}}f'(x)$ exists then $f'_{-}(a)$ also exists and $$f'_{-}(a) = \lim_{x \to a^{-}}f'(x)$$
Thus there are two numbers related to the behavior of $f$ on the left side of $x = a$ and two numbers related to the behavior of $f$ on the right side of $x = a$. Numbers on each side have to be equal if they exist. There can be differences if you compare the numbers on one side to numbers on the other side. Andre Nicolas's answer gives an example of this behavior.

Derivative with a "mixed" discontinuity


Consonants in the same tongue position

Question: the phrase: "Sit down" phonetically looks like [sɪt daʊn]. The "t" and "d" are in the same tongue position. Can we drop the "t" in the first word in this situation in fast/casual speech? like this: [sɪdaʊn]
Comment: By the way, the technical way to say "in the same position" is _Homorganic_, meaning the same organs are involved in the pronunciation. So one speaks of homorganic nasal+stop clusters: [mb, nd, ŋɡ].
Answer: You don't need to be talking fast. Something does happen, and you could call it "dropping", but /t/ isn't necessarily phonologically deleted. If you do delete /d/, you'd get flapping and the result would be the same as if you deleted /t/. Or the tongue gestures overlap in time, giving the same result as segment deletion. I don't think you can do that in British English.
EDIT: BTW, this is not a general process, it's limited to a few fixed expressions. Compare most instances of /t#d/ as in "straight down", "Put Don on the chair", "Hit Darlene", "sit downwind" and so on, where there is no dropping. It's the same lexicalized contraction process that you have in "will not" → "won't", "going to" → "gonna".
Comment: I don't hear the T in this video: https://www.youtube.com/watch?v=x6gPHEAJ-6o and I didn't notice the presence of a held T (the American T that is held, in other words the puff of air is held in and not released).
Comment: Frequently enough in American English, the /t/ appears as glottal stop [ʔ] before some consonants: [ˌɡɛʔ'da̧u̧n]. Other options include flapped [ɡɨɾ'a̧u̧n], especially when followed by ['ɔfə'ðɛɹ] 'geddown offa there'.
Comment: @ZoltanKing, people often don't hear the closure of [t] in "fast speech", but physiological studies have show that it is frequently present, just not audible. Since "dropping" isn't a technical linguistic term, you can use it to refer to a lot of things, ranging from "gesture reduction" to "phonological deletion", and could reasonably used to refer to something being "covered up" acoustically, even though it is articulatorily present.
Comment: @ZoltanKing, no, I don't hear a [t] in the video, either.  Just a flap.  I don't know whether to count the flap as a survivor of the [t] of "sit" or the [d] of "down", though.  Because ordinarily a word-initial [d] before a stressed vowel does not get flapped.  Maybe the [d] is dropped, leaving the [t] in a position where it is subject to flapping.  (Or, to be technical enough for our friend, I should say that the [d] is gesture-reduced down to where there is nothing left of it.)

Consonants in the same tongue position


de or du - what is the correct answer

Question: Dans ce restaurant on sert _____ bon thé. Do we write du or de in the blank. When an adjective precceds the noun in plural we use de instead of des. Ex : Il y a de nouveaux livres. Does this rule apply for singular too.
Answer: You can use both. The rule you cite is correct. But your sentence should be a plural:
Dans ce restaurant, on sert de bons thés.

=> they have good teas.
But you can also say :
Dans ce restaurant, on sert du bon thé.

In that case, you just refer to tea in general : they have some good tea.

de or du - what is the correct answer


Do using proxies and surfing the internet create multiple headers in the packet?

Question: Apologies for these silly questions. As I am new to networking.
For example, If I configured my browser to use proxy of IP address: a.b.c.d and my IP address: e.f.g.h.
And I visit example.com. What does my packet contain to instruct the proxy server to forward to example.com?
Do the packet contains multiple headers such as one with source IP: e.f.g.h and dest IP: a.b.c.d and another with source IP: e.f.g.h and dest IP: example.com?
Comment: The *HTTP header contents* depend on the proxy and its configuration. The *IP packet* just contains the proxy's public IP address as source. Proxies, application-layer protocols and networks not under your control are all off-topic here, however.
Comment: ... and there can only be one header in an IP packet (unless tunneling is involved which is something entirely different).
Comment: Sadly, questions about application protocols like http are off topic here.  You can try asking this question on [su].
Answer: When proxy is handling internet traffic in networks .proxy acts as gateway between your LAN and internet . It is a device or server act as a  intermediate device to serve all outbound internet traffic initial from LAN. Even we can control traffic using proxy like web filtering, traffic shaping etc  ,
Traffic flow
When traffic is initiated from browser. With destination domain example .com a packet is created with L2 and L3 Header with source IP as desktop IP and destination IP example.com domain resolved public IP this entire packet is  enclosed with another header as source IP as desktop IP destination IP as proxy IP which is mentioned in browser settings this enclosed packet  will reach proxy .  Now proxy will reset this connection and this session will be in mute state proxy will remove enclosed header and initiates new session with source as proxy IP and destination as examples .com domain resolved public IP. Once response is received from destination. proxy will again unmute session forward same response traffic to source desktop
So in this process proxy will initiates new session from proxy to destination...
Comment: Your description of a proxy is completely wrong. What you're describing really is a tunneled connection. With an HTTP proxy, the client creates a TCP connection *to the proxy* and only passes the destination host/URL *in the HTTP header*. There is *no* double encapsulation. See RFC 2068 for details.
Comment: i am just explaining users about traffic flow of traffic when internet hosted websites are accessed from LAN network where as proxy is acting as intermediate device for handling traffic
Comment: You're explaining something else, not HTTP via proxy. Do read the RFC.


Substituting xanthan gum for flour

Question: My recipe calls for 1 tablespoon of flour, how much xanthan gum should I use?
Comment: It would likely help to include your recipe, and what the flour is there for. (I'm assuming thickening, but it's just a guess!)
Comment: How much volume does the final dough(?) have? Xanthan gum does horrible things when used to excess.
Comment: Erica is right, without a recipe, we don't have a chance to start making suggestions. If you edit the recipe in, you can flag your own question for reopening.
Answer: Xanthan is not necessarily a substitute for flour.  We would need to know what your recipe is to give you the best answer.  Xanthan increases viscosity when at rest, but thins when stirred (shear thinning).  It is most often used to stabilize emulsions. It also reduces syneresis (the weeping of liquid from gels or purees.  It can be used as a binder in gluten free recipes.  There are a range of concentrations depending on the desired effect, but they generally don't go over 1.5% of the weight of the total recipe.

Substituting xanthan gum for flour


When was eleven players per team decided upon?

Question: A football team must consist of no more than eleven players (and a minimum of seven). When was this number chosen and is there any reason for it?
Comment: People started trying out the game, and that number (and field size) became the most played.  Some sports are played with different numbers on a similar field (such as tennis and volleyball).  While the size/numbers certainly have something to do with the speed of the ball/object and player movement, can't imagine there's any too-straightforward formula for it.
Comment: @JeopardyTempest that means we may see change in number of player as game evolve, with no specific method or formula.
Answer: From this article Players in a football team we can get some hypotheses:

The big change arrived in 1870 with the agreement of the regulations that, amongst other things, established that there should only be one goalkeeper who stayed in a fixed position. Similarly it was decided that the number of players should be 11. The reason why this particular number was chosen is not exactly clear: it is believed that after many trials and tests the conclusion was reached that 20 players were enough to cover the pitch and to this it was necessary to add the two goalkeepers previously mentioned.
For other people the reason behind it is a lot simpler: the football team managers wanted their sport to be as popular as or more popular than the most famous at that time, cricket, so they copied the number of players.

It is indeed interesting to note that many sports have 11 players per team: American football, field hockey, cricket...


How to lay laminate flooring against an exterior threshold

Question: I'm installing laminate flooring in my house and just got to my front door and realized the threshold won't have molding on it. How is this normally handled? The transition pieces are only for interior doorways.
Comment: It depends on the profile of your threshold. Some have a tall vertical against which you can install an L molding. Please post photos from several angles.
Comment: What edge of the laminate is at the threshold, the long edge, a collection of cut ends (short edges), or a long edge ripped to fit the remaining gap?
Comment: For what it's worth I ended up cutting custom transition pieces out of oak.
Answer: Typically, a piece of shoe moulding is used to cover a small gap against a threshold. I prefer my rips out of sight, so when possible, I start my floors at the front of the house and put my rips at the back of the house.
A general rule for installing any type of hardwood flooring is to start on the longest exterior wall.
Answer: What you could do is get a good flexible and durable caulk that can expand and retract with the flooring and use that to fill the gap between the flooring and the threshold.
Alternatively I think I've heard of people using wood filler instead but if you choose this route make sure it can expand and retract with the flooring.
Comment: Caulk and putty are a last resort, IMO. They don't often look professional.
Comment: Depending on the width and finishing you can make it as professional looking as you want. Do remember though that a solid filler will likely crack when (not if) the wood expands and contracts with changing moisture levels.


Implementing a log watcher

Question: I'm wondering how you can implement a program similar to tail -f in C/C++, a program that watches for and processes new lines added to a log file?
Answer: You can use fseek() to clear the eof condition on the stream.  Essentially, read to the end of the file, sleep for a while, fseek() (without changing your position) to clear eof, the read to end of file again.  wash, rinse, repeat.  man fseek(3) for details.
Here's what it looks like in perl.  perl's seek() is essentially a wrapper for fseek(3), so the logic is the same:
wembley 0 /home/jj33/swap >#> cat p
my $f = shift;
open(I, "<$f") || die "Couldn't open $f: $!\n";

while (1) {
  seek(I, 0, 1);
  while (defined(my $l = )) {
    print "Got: $l";
  }
  print "Hit EOF, sleeping\n";
  sleep(10);
}
wembley 0 /home/jj33/swap >#> cat tfile
This is
some
text
in
a file
wembley 0 /home/jj33/swap >#> perl p tfile
Got: This is
Got: some
Got: text
Got: in
Got: a file
Hit EOF, sleeping

Then, in another session:
wembley 0 /home/jj33/swap > echo "another line of text" >> tfile

And back to the original program output:
Hit EOF, sleeping
Got: another line of text
Hit EOF, sleeping

Answer: See here
You could either call out to tail and retrieve the stream back into your app, or as it's open source, maybe try to pull it into your own code.
Also, it is possible in C++ iostream to open a file for viewing only and just read to the end, while buffering the last 10-20 lines, then output that.
Answer: I think what you're looking for is the select() call in c/c++. I found a copy of the man page here: http://www.opengroup.org/onlinepubs/007908775/xsh/select.html. Select takes file descriptors as arguments and tells you when one of them has changed and is ready for reading.
Answer: The tail program is open source, so you could reference that.  I wondered the same thing and looked at the code a while back, thinking it would be pretty simple, but I was surprised at how complex it was.  There are lots of gotchas that have to be taken into account.

Implementing a log watcher


Apply special price to a list of products

Question: I want to apply a percentage special price to a group of products(list of SKUs) without manually going through each of one of them. Is there a way to this in backend or programmatically in magento ?
Answer: you could add those products to a category, then create a Catalog Price Rule and in the Conditions tab, set the Category to the category you just created.

Then in Actions you supply discount amount By Percentage of Original Price
Comment: what's does priority in rule information means ? because it's set to 0 and after clearing the cache i don't see the rule applied on products of that category.
Comment: you might need to reindex. if you have other rules that affect price, you might want to set Stop Further Rules Processing to Yes, see if that helps


What is this shape?

Question:
I want to create a shape like this in MS Office. But in order to find out how to do that, I need to know the name of the shape. Does anyone know what it's called?
Answer: I don't think there's a specific name for this, and no idea about MS Office, but in Adobe Illustrator there is a Warp tool and with the Inflate style at about 15% bend setting, you get this, starting from a normal rectangle.
Answer: This reminds me a lot of tube/CRT television screens. There's probably not a particular name for this shape. You could describe it as a rounded rectangle with the edges slightly protruding outward.

What is this shape?


Forging operations - what is the purpose of this?

Question: I keep seeing the words offline forging and forged mentioned in various Tezos blogs and tutorials.
What is the purpose of forging?
Comment: can you provide examples where you see occurrences of these in the documentations?
Comment: I have updated the question as forging is not mentioned in the official Tezos documentation but is mentioned by various Tezos blogs and tutorials.
Answer: From a high level perspective the purpose of forging is to convert a set of inputs along with the kind of operation you wish to perform (eg: send money, to whom, from whom, how much etc) into a single sequence of bytes which will uniquely represent said operation.
Then the next step for this operation to enter the chain is to sign those bytes with your public key in order to prove publicly that you are the author of such bytes. The output of this will be another sequence of bytes.
Eventually those bytes will be actually pushed to the chain by an injection step.
All of those are performed by various clients/wallets behind the scene when you perform operations.
More details are available here
How to create a transaction
Answer: I will try to make you understand forging programmatically.
I use nodejs and taquito package. Import necessary packages and provide signer to setProvider method.
const input = {
    "destination"       :   "Address of receiver",
    "amount"            :   "Amount in Tez",
    "source"            :   "Address of sender",
    "senderPrivateKey"  :   "Private key of sender"
}

Take the above object as input and estimate gas_limit, storage_limit and fee using the below function.
const estimate = async function(input){
    tezos.setProvider({ signer: new InMemorySigner(input.senderPrivateKey) });
    const estimated = await tezos.estimate
                .transfer({ to: input.destination, amount: input.amount })
                .then((est) => {
                    const estimated = {
                        "gasLimit"     :   est.gasLimit.toString(),
                        "storageLimit" :   est.storageLimit.toString(),
                        "suggestedFee" :   est.suggestedFeeMutez.toString()
                    }
                    return estimated;
                })
                .catch((error) => {
                    console.log("ERROR: Estimation failed!!",error);
                });
    return estimated;
}

Using the getCounter method from RpcClient class of '@taquito/rpc' package, get the counter and increment by 1 to build an operation object like below:
const forgeOp = async function(input){
    try{
        const counter = await getCounter(input.source); // getCounter is taquito rpc method
        const estimated = await estimate(input);
        const block = await getBlock(); // getBlock is taquito rpc method
        const branch = block.hash;
        const source = input.source;
        const destination = input.destination;
        const amount = input.amount;
        const gas_limit = estimated.gasLimit;
        const storage_limit = estimated.storageLimit;
        const fee = estimated.suggestedFee;

        const opObj = {
            "branch": branch,
            "contents": [
                {
                    "kind": "transaction",
                    "fee": fee,
                    "gas_limit": gas_limit,
                    "storage_limit": storage_limit,
                    "amount": amount,
                    "destination": destination,
                    "parameters" : undefined,
                    "source": source,
                    "counter": counter
                }
            ]
        };
        const forgedBytes = await forgeOperations(opObj); // forgeOperations is taquito rpc Method
        return forgedBytes;
    }catch(error){
        console.log({
            "Error"     :   "FORGE ERROR!",
            "message"   :   error
        });
    }
}

By the below function, you will get forged bytes of the operation object.
const run = async function(input){
    const forgedBytes = await forgeOp(input);
    console.log("FORGED BYTES:\t", forgedBytes);
}
run(input);

Once you get forgedBytes, you should sign it using the taquito sign method and inject the resultant sBytes in order to broadcast the operation. Hence bakers will include your operation into a block successfully.


In photoshop cs5 the color of my image changes when I enter full screen mode, how do I fix it?

Question: I am working in PScs5 on a EIZO color edge monitor. When I open my image photoshop displays all of the colors fine. When I change to full frame viewing, the image color becomes very muted and washed out. After this happens if I put it back to normal screen the colors stay muted. I can save the image, close it, and when it reopens the color are back to normal, like nothing happened. What is happening?
I am very frustrated. I have calibrated my monitor twice and nothing has changed. I have never come across this before and I am totally stumped.
Comment: Just a suggestion. Did you check your video card recently? What is your video memory?
Comment: Question: Do you have more than one video card (integrated and discrete) and working on a laptop ?
Comment: I working on a tower (MAC OS X 10.7.4) , but I have two monitors (one is a mac and the other is an EIZO,  the issue happens on both monitors. Im  not even sure where to look to see if I have more than one video card.....
Answer: There has been some posted issues on this problem for CS5 at this link: http://feedback.photoshop.com/photoshop_family/topics/colour_glitches_when_switching_to_fullscreen_mode_in_photoshop
An easy test is to turn off OpenGL Drawing in Preferences and see if the problem goes away.  Hope this helps.
Comment: try to explain tye answer rather than simply putting a link :)
Comment: AHHH! THANK YOU! I think this will solve the problem. I will try tomorrow.
Comment: I tried changing my OpenGL Drawing in Preferences from Basic to Normal and my colors no longer shift. Thanks for the answer.
Comment: Turning off OpenGL Drawing worked for me as well. Nice to know I don't have to return the monitor.


Monitoring AWS Lambda errors

Question: I want to view AWS lambda last hour errors of two types:

Lambda function that finished with an error
Lambda function returned http 500

How should I do that?
Answer: If you have many lambdas, in can be difficult to identify exactly which lambda caused an error. Here is how to find it out, even if you have hundreds of lambdas.
In CloudWatch, go to the Metrics page, then go to the Graph Metrics tab, then navigate to the dropdown menu item "Math expression > Search > Lambda Throttles or Errors."
This will give you error counts per lambda in a graph, mouse over to get the name of the offending lambda.
Comment: Any way to also get a list of the logs containing the errors? Sometimes it's hard to find them when a lambda invokes 10000 times a minute
Comment: We have close to 2K lambda funcs, so this doesn't work for us. We get an error, "maximum number of allowed metrics exceeded"
Answer: Once you launched an AWS Lambda project, automatically that is watched by CloudWatch.

Lambda function that finished with an error

You can see Lambda function errors from monitoring tab on Lambda default view.

Lambda function returned http 500

I guess your Lambda function is WEB API. If your WEB API created by Lambda function, you need to output logs with standard output in order to see logging on CloudWatch.
Please find documents from Accessing Amazon CloudWatch Logs for AWS Lambda
Answer: NOTE: only if you use serverless:
Alternatively, you can monitor your lambda function logs using serverless cli.
For example, to get log in the past 1 hours:
sls logs -f functionName --startTime 1h

You also can filter based on the string 'error' in the past 1 hours:
sls logs -f functionName --startTime 1h --filter error

Please check on the doc.
Comment: This only applies if the OP is using `serverless`. Can you add that to your answer so future readers will not be confused?
Comment: @dashmug Thanks for the correction!  Updated my answer already.
Answer: You could enable X-Ray traces from the lambda dashboard
Lambda Console Enable X-Ray Tracing
The X-Ray service displays trace mappings for lambda execution results. The service is great for checking the results of errors within lambda functions, but if you are looking for detailed error result logs, CloudWatch is your best bet.
Answer: You could also try something like Logbird that processes CloudWatch streams for all errors in AWS Lambda, API Gateway and other cloud services and can trigger notifications.

Monitoring AWS Lambda errors


Requirement for four conered article of clothing  to satisfy the mitzvah of Tzitzis

Question: Are you required to wear a four conered article of clothing in order to satisfy the mitzvah of Tzitzis?
Answer: The Gemara in Shabbos (Lamed beis,amud beis) says because of the Sin of not wearing Tzitzis Children die but the Tosfos there explains that it is talking in their times when the regularly wore clothing of four corners and did not place Tzitzis on them but today we do not wear such clothing so no responsibility exsists but the Tosfos ends it is good to buy such an article of clothing and to make a Bracha every day.
Reb Moshe Feinstein in the Iggres Moshe was asked this question by his son and he answered straight hallachicialy there is no requirement.But since all of Klal Yisroel accepted the Minhag it is Assur do do otherwise as is with any other Minhag Yisroel based on the Possuk "SHEMAH BNI MUSSAR AVICHACA VAL TITOSH TORAS IMECHA"
Plus he adds we know the TZITZIS is counted as if you did all mitzvos and Reb Shimon Bar Yochaisays you will be Zocheh to see the Shechinah  and it will save you from sin and the many other Things mentioned in Shas in Praise of those who are carefull about Tzitzis.
In conclusion according to Reb Moshe it is Required today to wear a four cornered article of clothing in order to satisfy the mitzvah of Tzitzis.
Comment: ORACH CHAIM CHELEK DALED SIMAN DALED
Comment: Where in Igros Moshe?
Answer: The strict mitzva of Tzitzis is "put fringes on your four-cornered garment."  Biblically, it was the norm that people's clothes were four-cornered.
Today, modern fashion has generally done away with four-cornered garments, and thus the technical requirement; nonetheless, we try not to get out of mitzva obligations, so standard practice has become to wear a four-cornered garment with Tzitzis on it.
Between the easy availability of the mitzva; the fact that it has become normative; and various statements in classical sources about the positive effects of wearing tzitzis (and negative effects of avoiding them), it is appropriate ("very strongly should do") to wear a four-cornered garment.
I'm not sure how people interpret the word "required", so I'll leave it at that.
Comment: There is no group in Klal Yisrael lacking the minhag to wear a tallis katan. It most definitely is Minhag Yisrael and the Rambam writes that one who transgresses minhag yisrael on him the verse says "One who breaks down a fence will be bitten by the snake. (Hakdamah LiPirush Hamishnah). Sounds pretty "required" to me. The question is when can it not be worn which is discussed by poskim...


How to exit bash history search mode?

Question: In Ubuntu 12.04 I use CTRL-R to enter a reverse history search. If the command I want is not found (after repeated CTRL-R), how do I immediately exit back to the (empty) command prompt with no historical command entered or executed on the command line?
Comment: I can not believe that I googled this and that it has been asked and answered already :D
Answer: CtrlG
this will abort the search
Comment: Reference: https://www.gnu.org/software/bash/manual/html_node/Miscellaneous-Commands.html
Comment: Both answers here are wrong. This will exit the search, but **not** "back to the (empty) command prompt with no historical command entered". Whatever search result came up will be entered on the command line, and worse, you will now be at that point in the history stack as well. At least as my bash is configured I cannot replicate any situation where **no** result is returned - even entering nonsense will leave me in the history stack at whatever matched the first couple letters.
Answer: You can use:

The Emacs style keyboard quit command, Ctrl-G. Default key bindings in bash are purposefully Emacs-like.
The Vi style return to normal mode key bindings, Esc or Ctrl-[ (they're the same thing) .
Send a SIGKILL signal, Ctrl-C.

The first two have the least visible effect.
Comment: for some reason Esc and Ctrl-C do not work on the Ubuntu systems I have tried (including my current 12.04).
Comment: {Grin}  You can prevent the display of "^C" if you add `stty -ctlecho` to your startup files (.bashrc,.profile,.zshrc, etc)  Now ALL three methods have least visible effect.
Comment: @lornix: I *like* to have visual feedback of Ctrl-C. Just imagine the psychological impact of pressing Ctrl-C before submitting a command like `rm -rf /` (extreme example), going away, then coming back to the terminal. There's practical joke potential in this, of course.

How to exit bash history search mode?


What does "curvilinear" mean?

Question: As far as I can tell, curvilinear is defined vaguely but means the same as nonlinear. Is that correct? Or does curvilinear have a distinct definition?
Comment: I'd interpret it to mean "not linear (in the sense of being curved, not 'linear in parameters') at least continuous and in some sense, smooth" (where smooth might mean something like 'continuous first derivative' perhaps, but there may be other definitions that would feel like they were in keeping with the sense of the word). So I wouldn't call a linear spline 'curvilinear', but I'd certainly call a cubic spline 'curvilinear' (even though it's linear in the sense that it can be fitted with linear regression).
Comment: Strongly related: [How to tell the difference between linear and non-linear regression models?](https://stats.stackexchange.com/q/148638/)
Answer: "Nonlinear" has many meanings, only some of which are (directly) about curves. I would say that I have encountered "curvilinear" to mean smooth curves. So a parabola or a logarithmic curve are "curvilinear," but a bent line (e.g. from a simple threshold or saturation model, "broken stick" model, etc.) are not.
Caveat emptor: word use will vary by context. For example straight lines are themselves a kind of "curve" in some contexts. As always, if there is a specific usage of the word "curvilinear" that you are wondering about, a quote and citation or two would be helpful.
Answer: The lack of clear and consistent terminology is one of my pet peeves, but I don't see how there is any real solution.  For what it's worth, I often use certain words in a vague and hand wavy way to get at general ideas when I don't want to take on all the baggage of technically defined terms (e.g., "variability" instead of variance).  I have used "curvilinear" similarly.  I do like @Alexis' description.  If you wanted a more precisely defined version, I might posit that rectilinear would be a smooth function where the second derivative is $0$ everywhere, and that curvilinear is a smooth function where the second derivative is not $0$ everywhere.
I do want to note that "curvilinear" and non-linear should not be considered synonymous in statistics.  In statistics (e.g., regression modeling) "linear" is shorthand for linear in the parameters.  That is, all the parameters being estimated enter into the model as coefficients.  On the other hand, "non-linear" means that the estimated parameters do not all enter into the model as coefficients.  There are many cases where a function looks 'curvilinear' but is not non-linear (e.g., adding a squared term to a regression model).  This is a subtle point and it trips up a lot of students, so it is worth always stating explicitly.  For more on how a model that looks 'curvilinear' can still be a linear model, it may help to read my answer here:  Why is polynomial regression considered a special case of multiple linear regression?
Comment: Chiming into this excellent answer to add that another meaning of "nonlinear" or "non-linear" is full or partial integration where $y_{t} = y_{<t} + \text{Other Deterministic Stuff} + \text{Random Process Stuff}$. That is models of variables that are functions of their past values are also (sometimes, perhaps often) labeled "non-linear".
Comment: @Alexis, you're right that it is used in still another way in time-series. I stuck with the regression context here. Maybe I should mention time-series in the answer? (I have relatively little expertise in TS, though.)
Comment: All good either way, although time series analysis *is* regression... just regression with particular operators the way I think about it.
Comment: @gung I understand that "nonlinear" means the relationship between Y and the parameters is not linear, so polynomial models are "linear" even though a graph of X vs. Y is curved. But where does "curvilinear" fit. Is a polynomial function curvilinear? How about a true nonlinear function?
Answer: To me, in the context of data analysis, it is always linked with the idea of leaning a topographic mapping of the data, so that samples that are mapped close by, are similar in a given sense. The wikipedia site on Nonlinear dimensionality reduction offers a nice overview. THe paper Laplacian eigenmaps and Spectral Techniques for Embedding and Clustering contains a nice description of a framework where the idea of manifold learning is linked with differential geometry.
In other words, curvilinear is to me related to the problem of learning a distance metric from data. The hypothesis is that the data lies in a smooth, low dimensional manifold. That learned metric correspond to the metric tensor as in the classical sense of the term.
Answer: A Curvilinear Relationship is a type of relationship between two variables where as one variable increases, so does the other variable, but only up to a certain point, after which, as one variable continues to increase, the other decreases. If you were to graph this kind of curvilinear relationship, you will come up with an inverted-U. The other type of curvilinear relationship is one where as one variable increases, the other decreases up to a certain point, after which, both variables increase together. This will give you a U-shaped curve.
An example of a curvilinear relationship would be staff cheerfulness and customer satisfaction. The more cheerful a service staff is, the higher the customer satisfaction, but only up to a certain point. When a service staff is too cheerful, it might be perceived by customers as fake or annoying, bringing down their satisfaction level.
Comment: Welcome to our site, Bonnie. Although plausible (and well explained), this answer seems like a much more restricted sense of "curvilinear" than I have ever encountered.  Behaviors like the ones you describe are often referred to as "U-shaped."  Would you by any chance have a popular and accessible reference in mind that supports your definition?

What does "curvilinear" mean?


Max-min inequality

Question: It is known that
$\underset{x}{\max} \underset{y}{\min} f(x,y) \leq \underset{y}{\min}  \underset{x}{\max} f(x,y)$ .
When does equality hold in this expression?
Answer: Let $\max_x \min_y f(x, y) = \max_x g(x) = g(a)$ and $\min_y \max_x f(x, y) = \min_y h(y) = h(b)$.  We have
$$\max_x \min_y f(x, y)= g(a) \le f(a, b) \le h(b) = \min_y \max_x f(x, y)$$
So for equality, we need an element $(a, b)$ to exist s.t. $\min_y f(a, y) = f(a, b) = \max_x f(x, b)$.
Answer: The inequality is the "weak duality inequality" and when it is equality it is called strong duality equality, see this for more detail.
The strong duality holds for convex functions (which their domain has non-empty interior)
Answer: Equality holds if $f(w,z)$ is convex in w and concave in $z$ (or convex in $z$ and concave in $w$)

Max-min inequality


Wireless 3945ABG [Golan]: Device not ready, fresh Ubuntu install

Question: I have a Wireless 3945ABG [Golan] network adapter in my Gateway NX570X laptop. I just installed Ubuntu 14.04. Ethernet works but wifi doesn't. I've tried several methods to try to get it working but it didn't help at all. I think there may be a problem with the card itself. But I can't understand what the code from dmesg is saying. I don't have any hardware off switch; but i do have the keyboard combo switched on, the LED is on for wifi. It is not hard or soft blocked. Thanks for any help!
lshw output:
<code>*-network DISABLED
   description: Wireless interface
   product: PRO/Wireless 3945ABG [Golan] Network Connection
   vendor: Intel Corporation
   physical id: 0
   bus info: pci@0000:03:00.0
   logical name: wlan0
   version: 02
   serial: 00:1b:77:1a:57:5c
   width: 32 bits
   clock: 33MHz
   capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
   configuration: broadcast=yes driver=iwl3945 driverversion=3.19.0-30-generic firmware=18.104.22.168 latency=0 link=no multicast=yes wireless=IEEE 802.11abg
   resources: irq:29 memory:d6000000-d6000fff
</code>
dmesg output:
<code>[ 2952.041767] iwl3945 0000:03:00.0: Microcode SW error detected. Restarting 0x82000008.
[ 2952.041785] iwl3945 0000:03:00.0: Loaded firmware version: 18.104.22.168
[ 2952.041820] iwl3945 0000:03:00.0: Start IWL Error Log Dump:
[ 2952.041825] iwl3945 0000:03:00.0: Status: 0x000202E4, count: 1
[ 2952.041829] iwl3945 0000:03:00.0: Desc       Time       asrtPC  blink2 ilink1  nmiPC   Line
[ 2952.042057] iwl3945 0000:03:00.0: SYSASSERT     (0x5) 0000006495 0x008B6 0x10A4E 0x00320 0x00000 216
[ 2952.042057]
[ 2952.042074] iwl3945 0000:03:00.0: Error Reply type 0x000000FF cmd C_RXON (0x10) seq 0x0401 ser 0x00030000
[ 2952.042092] iwl3945 0000:03:00.0: Command C_RXON failed: FW Error
[ 2952.042104] iwl3945 0000:03:00.0: Error setting new configuration (-5).
[ 2952.043867] iwl3945 0000:03:00.0: Can't stop Rx DMA.
[ 2952.044244] ieee80211 phy0: Hardware restart was requested
</code>
Answer: Hey what have you already tried? A few steps would be to manually turn off and restart in terminal. Please update with wifi trouble shooting you have done to better help you.
sudo ifdown interface
sudo ifup interface
sudo iwlist scan


Why is there no 斯坦 suffix in 阿富汗?

Question: I know Afghanistan, Kazakhstan, Kyrgyzstan, Turkmenistan and Uzbekistan respectively are 阿富汗,哈萨克斯坦,吉尔吉斯斯坦,土库曼斯坦,乌兹别克斯坦. But why isn't Afghanistan translated as 阿富汗斯坦 with the 斯坦 suffix for "-stan" like the others?
Comment: When the Central Asian countries were a part of the USSR, their names didn't have the -stan suffix. 哈萨克斯坦,吉尔吉斯斯坦,土库曼斯坦,乌兹别克斯坦,塔吉克斯坦 are new translations after their independence. On the other hand, 阿富汗 is an old translations since late Qing dynasty.
Answer: On a Chinese site called 知乎, there are many discussions on this problem.
Like https://www.zhihu.com/question/20367818, https://www.zhihu.com/question/305881042.
A summary is that the translation time of "阿富汗" and that of other "斯坦" are not the same. They follow different translation rules.
"斯坦" is just the sound translation of "-stan", which means "the place of".
When translating "阿富汗", "斯坦" is missing because the people who translated the name think that it is not necessary to translate it. You will find that the names of countries that were translated very early are all very short.
Other "斯坦" appears later in the 20th century. At that time, the translation is just following the sound so there is "斯坦".
There are other explanations and details in the discussions. You can visit the above website for further information.
Answer: From my point of view, it's mainly because of 2 reasons:

哈萨克族, 乌兹别克族 and 吉尔吉斯族(usually written as 柯尔克孜族)are included into the 56 official ethnic groups and there are still large groups of people from those origins living in China. So the official need to put "-斯坦" behind those names when referring to the nation itself. But there are no 阿富汗族 somehow in China so it won't be ambiguous when using "阿富汗"

哈萨克, 乌兹别克,吉尔吉斯 and 土库曼 used to be constituent republics of the CCCP(Soviet Union) and was not independent until 1991. But 阿富汗 has always been as an independent nation for years so the translation rules might be different.
Answer: 阿富汗 (Afghan) is the shortened (and preferred) version of 阿富汗斯坦 (Afghanistan) which is the full transliteration, but no one is using it because Afghanistan was transliterated a long time ago before, 斯坦 was commonly used in the newly formed nations in modern time
We also commonly use 哈萨克, 土库曼, and  乌兹别克 instead of the full transliterations
斯坦-stan just means nation, it can be omitted in Chinese transliteration
Comment: But I don't think I've ever seen 阿富汗斯坦 used anywhere. This article for instance uses both , "阿富汗" and "土库曼斯坦"
  [1]: https://world.huanqiu.com/article/47PaQwoICPo
Answer: The name 阿富汗 is derived from a very similar name "愛烏罕", which exists in Chinese documentation as early as 1759.
Part of north Afghan, called "巴达克山(بد خشان)" was a subject of early Qing dynasty. The country was later conquered by 愛烏罕 (Afghan's Durrani Empire). Those events are documented by the court of Qing.
See the history of Qing (清史稿) for reference.

Why is there no 斯坦 suffix in 阿富汗?


Radiation risk on Mercury?

Question: I would assume the planet Mercury represents a 'worst case' for radiation risk to people.  But how bad is it as compared to, say, radiation workers annual dose limit?
Comment: What type of radiation are you interested in? And why would you assume that Mercury represents a worst case?
Comment: Related: [Mars versus the poles of Mercury WRT colonization](https://space.stackexchange.com/questions/45330/mars-versus-the-poles-of-mercury-wrt-colonization)
Comment: Galactic cosmic rays (GCR) and solar ionizing radiation.  This is in reference to a manned mission to Mercury.  The objective is to understand the danger a crew would face on the surface while deploying their first habitat.  My assumption is based on Mercury's nearness to the Sun compared to all other planets.
Comment: in a manned mission, cosmic radiation would be a minor problem comparing to thermal radiation.
Comment: Are we mainly talking about the radiation risk to humans, or unmanned vehicles/equipment/probes? Consider 95++% of Mercury's surface isn't colonizable since it's not in synchronous rotation with the Sun, so over a Mercury 'day' of 58.7 Earth days and 'year of 88 Earth days, everywhere (except craters of perpetual darkness near both poles) will eventually be enlightened by the Sun at 800ºF/430ºC. So, I think human colonists could only live below the crater rim of the polar craters of perpetual darkness.
Answer: According to this NASA Mercury Facts Sheet, Mercury has almost 7 times the Solar Irradiance that Earth receives (9082.7 W/m^2 versus 1361 W/m^2).  I'm not certain how this value translates to Sievert Units.
Mercury does have a large magnetosphere though, which should protect anyone on the planet from a large amount of the harmful radiation the Sun puts out (similar to Earth.)  I'd wager you'd receive less radiation on Mercury than on the Moon because of the magnetosphere.
Comment: @MercuryPlus I think going at night was NASA's strategy for landing on the Sun as well ;-)
Comment: At night the solar radiations are a non-issue.  A mission could land at night, but the initial work to build a base is much more dangerous in the dark.  Right now the idea is to land just before sunset (say, four days) when temps on the surface are lower and objects vertical to the surface (like astronauts) have vacuum to radiate waste heat into.  The problem with ionizing radiation is more difficult.  What I'm looking for is a figure for how much radiation the crew would encounter during those four days. . .
Comment: @MercuryPlus: please edit all that context into your question.
Comment: According to that same Facts Sheet, Mercury has a rather long day.  Perhaps the mass of the planet might act as an insulator?

Radiation risk on Mercury?


Could the missing antimatter lie outside the observable universe?

Question: While I was reading a similar question asking if other galaxy could be made of antimatter, to which the answer was: if they were, we should detect the radiation from matter interacting with antimatter on that sort of scale. But what if the missing antimatter lies outside the observable universe. Wouldn't that result in the matter dominated observable universe we live in, without any of the radiation from the antimatter lying outside it being detected?
Comment: Well, the universe could still be homogeneous on an infinite scale. The universe is clearly not perfectly homogeneous because you have little clumps of matter (galaxies), and then empty space in between them.
Comment: If antimatters do lie outside of observable universe it will solve the "why is there so little antimatter?" then it also raise questions like why universe is not homogeneous? why we even existed? That's just my opinion lol.
Comment: This is related to the idea of a multi-verse. It would need some way of the asymmetry to vary during inflation. I'm guessing there are some models that could do this, but haven't looked into it in too much detail.
Comment: @user6760 The universe could be homogeneous. What if this is just a statistical artifact from the first seconds of the universe. Like matter was slightly more likely to end up on one part of the early Universe and anti-matter at a different region. By now those regions could lie outside of the event horizon as they are moving apart at the speed if light due to the expansion of space allows object.
Answer: The problem with talking about things that lie outside the observable universe is that they are, by definition, not observable. There could be invisible pink unicorns out there, and you cannot prove they don't exist.
So yes, it is possible the missing antimatter lies outside the observable universe, but in itself this is not a powerful statement. You need something more: a mechanism to explain why all the antimatter got "out there". If the mechanism is well-motivated, makes testable predictions within the observable universe, and is eventually accepted as true, then it might solve the baryon asymmetry problem as well.
In the same way, we rely on GR to calculate what happens within the event horizon of black holes, and we are reasonably confident in the results even though we cannot observe inside a black hole.
Answer: The accepted model for the universe is the Big Bang. It is accepted because it fits data and observations up to now very well, using General Relativity and the standard model of particle physics .
In this model it is CP ( charge and parity) violation which gives rise to particle antiparticle asymmetry, and since the standard model of particle physics cannot account for this large violation the search is on for extending the standard model. In this case the asymmetry will appear during the time of the baryogenesis, by a microsecond from the origin,.
People propose models where the asymmetry appears  as the creation of a universe and an anti universe, as for example here. This would mean that our universe was born with a fixed number of quarks, to make up the large asymmetry. A fine tuning that is not easily acceptable. If no large CP violation is found experimentally in the near and further future, maybe one will have to resort to similar models. At this time, the success of the Big Bang in modeling all known observations leads us to the search for CP violating mechanisms within the universe.
Answer: Your question really breaks down into two elements.

"Missing" antimatter
Antimatter galaxies being outside the observable universe.

Presumably, by "missing" you are alluding to the question as to why we observe matter and not antimatter, if for some reason we wish discount CP violation (covered by Anna).
The thing is, having antimatter outside the observable universe does not really help. We expect (barring CP violation) to have equal amounts of matter and antimatter formed in the early universe. We expect this symmetry everywhere in the form of pair production of matter-antimatter particles, say e+ and e-.
The observable universe is defined as the part of the universe from which we can have received signals such as light. Conversely, it is also the part of the universe which can have received signals from us. This means that the antimatter created here cannot have been somehow separated and moved outside the observable universe.
To conclude: The presence of an excess of anti-matter outside the observable universe would not explain the lack of it around here.
Comment: But immediately after the Big Bang and before inflation, wouldn't the observable universe have included the entire universe? Couldn't a small irregularity in the distribution of antimatter at this point have resulted in the large-scale matter world of today? Well, I mean, I know it couldn't, of course, I'm just wondering why.
Comment: The observable universe is defined as the part of the universe from a signal traveling at light speed can have reached us. Although the universe was indeed "smaller" (but still probably infinite!), there had been a lot less time for a signal to propagate. So, as time progresses the observable universe becomes a "larger" part of the entire universe.
Comment: @keith No, the observable universe is defined as "Universe comprising all matter that may be observed from Earth at the present time". Shortly after the big bang the observable universe was almost the entire universe. However as the expansion of the Universe accelerates, more galaxies appears to move away at the speed of light (or faster). Those galaxies then lie outside of the observable Universe. So the observable universe becomes a "smaller" part of the entire universe. Hence the presents of anti-matter galaxies outside of the observable universe would explain the lack of it around here.
Comment: The regular particle horizon is without inflation, with inflation there was another particle horizon from before the standard big bang which ought to be larger than the regular one.


Recovering the public key from a transaction

Question: Is it possible to get the public key of a user, if we have a transaction from that User in my wallet ?
Comment: The public/private key is unique to the wallet. Each wallet can have multiple public/private keys (accounts). Which wallet are you using?
Answer: There is no such thing as a public key for a user, but there is such a thing as a public key for an address.  The transaction that has been paid to you probably contains more than one address owned by the sender.  First, the bitcoin in the transaction likely came from multiple unspent transaction outputs (UTXOs), all of which were owned by the sender and probably have different addresses.  Next, the transaction likely had a change output, which would be yet another address owned by the sender.
Any of the UTXO's used as inputs to the transaction would have had the public keys of the addresses revealed in the scriptSig that was used for the input to sign the bitcoin over to you.  You can find these scripts by using a block explorer.  They will each contain a public key and a signature.
If the change output has already been spent by the user, you can find that transaction and look up the public key in the scriptSig there as well.
Keep in mind that none of this information is specific to your wallet, as it is all public information on the blockchain.  The only information you have that I don't have is the specific transaction you are referring to.  Given that transaction ID, anyone and everyone can look up this information.


Can a judge amend by interlineation?

Question: If a lawsuit is filed and one side wants to amend it by interlineation, can the judge amend the document and place it in the file or must the lawyer for that party amend it and file it?
Answer: Usually, the person filing a document would ask for permission to amend something and file a substitute document, but it generally wouldn't be anything improper about a judge interlineating an amendment with the permission of, or at the request of a party, particularly in a limited jurisdiction court or where the party was not represented by counsel.
A judge rare does this in a general jurisdiction court that is authorized to hear claims for large dollar amounts, except when an oral request is made on the record during or at the conclusion of a trial to amend a complaint to conform to evidence that was admitted at trial without objection as to its relevance. This is most often done when the name of a party is incorrect in the complaint.
Comment: or, in cases where the counsel switches, switching the word "former counsel" in for "counsel" when necessary in a filing that arrived right after it.

Can a judge amend by interlineation?


how to let maven war plugin to create multiple war file

Question: i used selenium-mave-plugin for integration test, which require the war file named: project.artifactId-version(say: myproj-0.1-SNAPSHOT.war)  while the default war created by maven-war-plugin is project.artifactId.war(say myproj-SNAPSHOT.war).
in order to let selenium plugin, i override the maven-war-plugin in that selenium profile as:
        <plugin>
          <artifactId>maven-war-plugin</artifactId>
          <version>2.1-beta-1</version>
          <configuration>
            <warName>${project.artifactId}-${project.version}</warName>
            </configuration>
       </plugin>

now when i build the project, it failed at rpm:rpm, complaining:
source location ..../myProj.war does not exist

my question is if it's possible to create 2 war files: myProj.war and myProj-0.1-SNAPSHOT.war so both rpm and selenium plugins are happy?  Thanks
Answer: For rpm  plugin, please make sure you use the location directive. If you need further help, please post your full pom.xml.
As for selenium, it doesn't really need to know where your .war file resides. Only the web application server needs to know. Sadly, you didn't provide information in which phase of maven the "does not exist" error occured. So I can only guess it's while starting jetty, tomcat or another web application server.
You should run your full build (including tests) with: mvn clean verify integration-test rpm:prm.


How can I stop people posting on my homepage on Facebook?

Question: I can't seem to find any way to stop people posting on my homepage on Facebook.
Is there a way?
Answer: By "homepage" I guess you mean timeline.
If that is the case then you need to:

Log in to Facebook
Select the drop down menu from the arrow and select Privacy Settings (Fig. 1)
Click the Custom cog wheel (Fig. 2)
In the section called Timeline and Tagging click edit settings
In the popup click the drop down next to Who can post on your timeline? and select No one (Fig. 3)
Click Done

Fig. 1

Fig. 2

Fig. 3
Comment: You can also control posting with the setting under this, "Who can see what others post on your timeline?" -- if they can't see what others post then they are not able to post either.  That is useful if you want to restrict posting to a subset of friends, which you can't do with just the first setting.


How are biometrics tougher to crack than a pin?

Question: When I hear that bio-metrics are tougher to crack, it's left ambiguous as to whether they refer to the term 'hack' as simply getting through the system by guessing the password or mimicking the person. So in terms of technical hacking techniques you use such as SQL injection or something similar where you have absolutely no idea what the password is, where do bio-metrics trump (because at the end of the day you are still entering the correct combination of 1s ans 0s to gain access)?
Answer: The issue with the biometrics is that the data being generated depends heavily on the sensor used to capture the data. I have biometrics recorded on my iPhone, my Android and my bank. As all three uses different sensors, the data they all have on record is wildly different.
Even if someone steals the data from one of my phones, that data cannot be used to attack my bank, for example. The sensor used on the ATM is different, and the binary data cannot be used to reconstruct my fingerprints. Even if I reuse my fingers on all three services.
On the other hand, if I reuse my PIN on all three, and one leaks, the same PIN can be used for attacking all my phones.
The main vulnerability of biometrics is that they cannot be revoked. If someone manages to grab a high quality picture of my fingerprint, they can make a model of my finger and maybe unlock my devices and my account, and I cannot revoke my fingerprint and issue another.
Comment: @yolo that's a pretty strong assumption, I would assume the opposite
Comment: But don't most people use different pins anyway?
Comment: Even so, the question specifies more technical methods of access as opposed to physical forms of access such as SQL injection. I've made it more explicit for your convenience
Answer: "Biometrics" and "pin" are generic terms, you can't really compare them. It'd be like asking why "motorcycles" are faster than "cars". It depends.
PINs are generally numeric passwords with a limited length. You generally don't get much entropy with only a few digits, so PINs are usually considered weak passwords. On the other hand, often PINs are used together with some kind of bruteforce prevention system (like blocking the device after a few failed attempts), so even a weak PIN can become sufficiently secure in some cases.
Biometrics includes a lot of different authentication methods: from keystroke dynamics to fingerprints, from facial recognition to iris scans. This kind of data in theory provides a lot of entropy, so they should be equivalent to a very strong password. In practice though, it totally depends on the specific implementation of the system. Not long ago there were mobile devices with facial recognition that could be unlocked by placing a picture of the owner in front of the camera. Or be unlocked by placing the device in front of the owner's face while they were asleep.
Is biometrics harder to bruteforce? In general, yes, because they usually provide much more entropy.
Is biometrics harder to steal? In general, yes, because PINs can usually be stolen easily by simply shoulder-surfing, or other well-known and easily available techniques (keyloggers). It's harder to make a copy of biometric data (but not impossible).
Is biometrics therefore better? On its own, no, because it has the huge drawback that biometric data cannot be changed. Once it's compromised, the damage is permanent. So while you can get a new card with a new PIN, you can't get a new hand with a new fingerprint.
Comment: So what you're saying is that when it comes to the raw data that is entered (i.e a string of 1s and 0s), biometrics are *as* secure as PINs?
Comment: @yolo, no, I said it's generally harder to bruteforce biometrics because it provides more entropy (more 1s and 0s). PINs are usually only a few digits, so they provide less entropy. In specific cases, what I said might not apply (because as I said biometrics and PIN are general terms).
Answer: Aside from what ThoriumBR said above, it would also just be much more difficult to reconstruct biometric data. For example, you can potentially brute force a pin or dictionary a pw, but it is much more difficult to reconstruct a finger print with a mold, or to duplicate an iris or retina pattern for a scan.


Products not loading in Magento Website

Question: I have created an online store and there are already some products added as the demo and I've also added some products but these are not showing on the homepage of my website.
They do appear when I search them on search bar but my main page of the website doesn't show any products
you can also check www.tedifier.com
I don't have a lot of knowledge about Magento so please answer in simple words
Comment: Please try once reindex all
Comment: You have some Ajax error in page, [![enter image description here](https://i.stack.imgur.com/grtew.jpg)](https://i.stack.imgur.com/grtew.jpg)
Answer: I think you have used any third party theme. You have to first check in category pages where your new products show there or not. If not show on category pages then you have to try re-indexing using System> Index Management.
The second possibility, there is some functionality given by theme to show the product on the homepage(e.g. widget) so you have to look into System> Configuration > Theme Settings.

Products not loading in Magento Website


Should I keep Chiss HSP & Kashyyk Shack dream job bitizens?

Question: I have several bitizens taking up valuable apartment space.  Their dream jobs are Chiss HSP and Kashyyk Shack (which can't be built "yet").  Should I keep them or boot them out the airlock?
Answer: They will have their uses when those levels become unlocked for us all so definitely keep them for now, I still have trouble trying to get bitizens for my Med Bay and Cloth Fabrication levels so any you can get for levels you don't have yet will be needed in the near future.
Answer: The answer depends upon your plans and needs.
If you have an immediate need for bitizens to fill other slots, boot them. More will come, they always do.
If you do not need the slots, keep them, especially if they are level 8 or 9 in a skill that you have a job opening for.
Keep in mind, if you have a level 8 or 9, you can put them to work elsewhere until you get their dream level or someone more qualified comes along (i.e. a dream jobber for that job).
More residential spaces are always coming when you can afford to build them.


iPhone Screenshot Print Size

Question: The current iPhone (non-plus models) have a screen resolution of 1334x750px. If I were to use one of these in a design, what physical printed size could I scale the screenshot to where the resolution would still make an acceptable print?
Comment: "Acceptable" is subjective here depending on how large you intend to make it. You may find some guidance here: **[I need to print an image at a certain size. What dimensions and resolution should I use?](https://graphicdesign.stackexchange.com/q/26354/8708)**
Answer: If you were to print it at 300dpi, which is the resolution usually employed for quality print work in publications, then simply divide the each pixel dimension by 300, to give you the size in inches.
That would be 4.45" x 2.5"
I suppose you could perhaps get away with 200dpi, which would make the image a little bigger, but slightly less quality.

iPhone Screenshot Print Size