Add up my week hours from selected schedules

Question: I would like to have my day schedule to be linked to its day hours so that it produces my total week hours.
For example: Schedule is selected from drop down list which is connected by data validation from 'Support Sheet', column "Schedules". Next to each Schedule is its Hours.
I would like its Hours to correspond to its Schedule so that when it is selected from drop down list on 'database sheet' it will add all the day Schedule Hours to be populated automatically into "week hours" column.
I have tried to use Function Sumif= but it only allows me to put one drop down cell in the function as criteria. I tried Sumifs= which uses multiple criteria but won't work, just sums to 0.
Comment: Is there anything you tried yourself? Please edit your question to include this info.
Comment: Sumifs WILL work, but it will only produce a result of "8". It's because you are forced to add values in the Support sheet rather than the Data sheet. Thought the values in the Data sheet appear identical, they are in reality seven unique values. I would suggest a nested query &/or seven Vlookup formula to get the total. Have you tried anything like that?
Answer: I am sure that there are several ways to answer this question.
This answer offers two options, but it is possible that there are other methods and/or more efficient methods.
Option#1 - Nested Queries
=query({query({$K$12:$L$13},"select Col2 where Col1 !='' and Col1 contains '"&A2&"'"),query({$K$12:$L$13},"select Col2 where Col1 !='' and Col1 contains '"&B2&"'"),query({$K$12:$L$13},"select Col2 where Col1 !='' and Col1 contains '"&C2&"'"),query({$K$12:$L$13},"select Col2 where Col1 !='' and Col1 contains '"&D2&"'"),query({$K$12:$L$13},"select Col2 where Col1 !='' and Col1 contains '"&E2&"'"),query({$K$12:$L$13},"select Col2 where Col1 !='' and Col1 contains '"&F2&"'"),query({$K$12:$L$13},"select Col2 where Col1 !='' and Col1 contains '"&G2&"'")},"select Col1+Col2+Col3+Col4+Col5+Col6+Col7 label Col1+Col2+Col3+Col4+Col5+Col6+Col7 ''")

copy this down as many rows as there is data

Option#2: Vlookup Query
=query({query({ARRAYFORMULA({VLOOKUP(INDEX( QUERY({flatten(A2:G2)},"select Col1, count(Col1) where Col1 != '' group by Col1 order by count(Col1) desc label Col1 '', count(Col1) ''",0),,1), $K$3:$L$4, 2, 0),  QUERY({transpose(A2:G2)}, "select   count(Col1) group by Col1 order by count(Col1) desc LABEL count(Col1)''")})},"select Col1*Col2 label Col1*Col2 ''")},"select Sum(Col1) label Sum(Col1) ''")

copy this down as many rows as there is data

Sample
Comment: Thank you very much! I used Option#2 which worked just like i needed.


Change node size gephi 0.9.1

Question: I have looked everywhere but I don't seem to able to get the answer for the latest version of Gephi (0.9.1).
All  I want to do is change the node size based on its in-degree for all the nodes on the graph. This used to be something I could do with the ranking tool but since this has been merged into the 'Appearance' tab I can't figure out how to do it.
Answer: Bit late but even if you have found it, it might help someone else. Check the highlighted areas
Comment: Well it really depends on the attribute. Attributes like _In-degree_, _Centrality measures_, _PageRank_, etc. are produced only after you run the corresponding command from the **Statistics** panel. If you need a custom attribute you need to go to the **Data laboratory** and run _Add column_. This allows you to enter values (numeric or categorical) for your custom attribute
Comment: How is it possible to add a new attribute to this list, like a column in the node file? When I open available examples in Gephi one of them has such attributes, but the two others do not have.
Answer: Weird but works: In Overview, in the Appearance tab, click on the mini icon for color (not for size). Diagonally down to the left, you should see a little icon of some colored blocks. If you mouse over them, the pop-up says,"Switch to ranking". Click that. Then above toe the right, click on the icon for size instead of color this time. Now when you select to modify the node appearance by attribute, it should let you do it by your custom column.
See https://github.com/gephi/gephi/issues/1479, where rbsam wrote in 2016, "On Appearence/Attributes by color you can set the attribute to Partitioning to Ranking on the botton left of the window. If the attribute is set to Partitioning it will not appear on Size attribute. If it is set to Ranking it will appear on Size attribute."

Change node size gephi 0.9.1


Is the total current inside a BJT constant?

Question:

I know the total current inside a BJT has to be constant all throughout the device, but the figures above seem to suggest that the total current in the emitter should be larger than the total current in the collector. Since we have extra hole current in the emitter going the opposite direction as the electron current (the conventional current for both have the same direction), shouldn't it be that the current in the emitter region is higher than the current in the collector region?
Comment: I am not sure why you are talking about hole currents going in the opposite direction of the electron current. It's much simpler than that. The emitter current is higher than the collector but that's because the current in the base also flows through the emitter, regardless of whether you choose to look at hole or electron current. Your diagram above shows that too. I am not sure what you mean when you say "*total current inside a BJT has to be constant all throughout the device*"
Comment: What I thought was that just as the total current is the all throughout inside a pn diode (shown in the very last figure in the link https://www.pveducation.org/pvcdrom/pn-junctions/example-1-general-solution-for-wide-base-p-n-junction), the total current inside a BJT should be the same. Is this not the case since it is a three terminal device?
Comment: That entire link is talking about a PN junction, not a BJT. An NPN BJT is two PN junctions mashed together so I *guess* one way to think about it is some of the N junction belongs to one P and the rest of it belongs to the other P And the N has a terminal to it so current can sneak in and out of it without making it to the next P. The BJT doesn't break Kirchoff's Current Law.
Comment: Node laws applies inside the BJT too. Emitter collector *is* greater than the collector one since it has base current too but *often* you simplify saying they are *equivalent* since base current is way lower than collector current.
Answer: The current in the emitter region is indeed larger than in the collector, because the emitter current has to be equal to the collector current plus the base current. That's just KCL.
Just like \$β\$ is defined as \$\frac{I_c}{I_b}\$, you can also define \$α=\frac{I_c}{I_e}\$, which is always less than one--i.e., \$I_c<I_e\$. (α is also often seen defined as \$\frac{β}{β+1}\$, which can be derived from the definitions given above and KCL.)
Answer: You are correct, emitter current is base current + collector current.  In fact, emitter current is
I(emitter) = I(base) + I(collector)
And you can calculate Beta from measured values...
Beta = I(collector) / I(base)
Then calculate exactly how much current is in each part of the transistor.
Comment: And @hearth posted essentially the same answer as I was typing.


Should I attach my published paper to an e-mail when following up with a professor about a PhD position?

Question: I have written a professor from the USA about a Ph.D. position with my CV. He replied saying its excellent and I should apply in the next fall. Now I have some queries which I will ask him in my next mail and one of my paper has been published today in a very good journal (which I wrote 'submitted' in my CV). Should I include my paper in my next mail saying you can have a look? Will it add extra value or a good impression?
Comment: Are you just trying to make a good impression, or are you actually looking for feedback on your work? Either way, you should be clear about why you're sending him the paper, as "can you have a look?" gives no indication about what you're hoping to achieve from the exchange.
Comment: Is there a problem with attaching the pdf? I didn't think that would be a big issue?
Comment: I wasn't sure whether you question meant mail as in email or snail mail...
Comment: Why are you emailing him again?
Answer: Honestly, I find the whole discussion in the comments and the other answer rather strange. There are two options:

The professor doesn't care about reading the paper. If you sent the paper attached to the email, he can just ignore it.
The professor wants to read the paper. If you attached it, perfect. If you didn't, either he has to go look for it on the journal's website, log in the publisher's website because many don't do IP-based authentication anymore, and eventually find the "PDF" button behind all the crap that publishers put on journals' website these days; or ask you to send it to him in case it's not public yet (e.g. it was accepted today and it will be months before the journal even mentions it publicly) or his university doesn't have a subscription to the journal. That's a complete waste of time.

We're in 2019. Getting a 5 MB attachment in one email is completely insignificant. If the professor is on a roaming data plan in Belize and hasn't set his email client to not download attachments automatically, it's his own fault, and he will rack up hundreds of dollars in charges anyway from all the email a professor routinely gets every day.
My opinion: write your email with your additional queries and so on, and conclude with something like "By the way, the paper 'XXX' that was listed as submitted on my CV is now accepted in journal 'JJJ'. I have attached it to this email in case you would like to take a look." Unobstructive, no pressure.
Comment: Well, hey, even if you find it strange, I'm someone who gets emails from potential PhD students and attachments annoy me. We're in 2019. We don't have to attach every single thing to an email when the internet is right there.
Answer: Just send the link with a "By the way, if you are interested in seeing more of my work, I have just had this paper published in X journal: LINK"
Comment: Or in the case that the paper isn't online, just include a statement that the paper has been published and give its title and the journal ref, offering to send a copy if requested. But wait for the request.


A Book for Multiple Regression and Multivariate analysis

Question: I have done a course in Simple Linear Regression and I am aware of linear statistical models (I follow the book by C.R. Rao). Keeping this background in mind, please suggest some good book(s) for multiple regression and multivariate analysis. The book(s) may contain only a well-written comprehensive chapter on this subject : I have no objection to that, though a book written on this only, is preferable. I have no idea about Multiple Regression and Multivariate Analysis, hence it will be great if the book(s) concerned DEVELOPS the subject from the basics and then delves deeper into the theory. A large number of exercises (good quality) is preferred, though not mandatory (if the theory itself is very good). Thanks!!
Comment: I really like Applied Regression Analysis by Draper and Smith. It covers also topic in which you might not be interested (ridge regression, nonlinear estimation, GLM...), but the parts on linear regression are outstanding, in my opinion. The chapters on the geometry of least squares are probably the best part of this book.
Answer: I suggest Methods of Multivariate Analysis by Alvin C. Rencher and William F. Christensen.
Comment: Thanks. any specific reason why u like it?
Comment: I think it is a good compromise between theory and practice, and I like the way things are explained!
Answer: If you need to choose "only one" book I would go with Applied Linear Statistical Models by Neter, Kutner, Nachtsheim and Wasserman. I never owned it (always someone else in the office did) but it never failed to provide me with the some of the best reference material on the multiple regression.
It started from Simple Linear Regression proceeded to Multiple Linear Regression and Non-linear regression to move onto Single and then Multiple Factor Analysis Studies to finish off with Specialized Design Studies (eg. Latin Squares, Response Surface Methodology, etc.). Take notice this is not a small book; at ~1400 page is one of the largest Stats book I have seen.
(I have noticed the "Applied Linear Regression Models" suggested earlier. I have not seen that book I suspect the cover a lot of common ground so +1 to that!)
As a second choice a "golden oldie" that was (somewhat) recently rewritten is:  Linear Regression Analysis by Seber and Lee. It is a bit theoretical and less applied than the Neter et al. book. If more of a theory is your thing it will worth your time. Do not worry it is not full of asymptotics; just it is less "practical" than the Neter et al. book. :)
I liked the book by Seber more because I found it more concise and easier to use if you already have some basis on linear regression. I accept that it might be less friendly to a newcomer though. Given you have already done a course on simple linear regression you will not have a problem I believe (your Linear Algebra is OK right?).
Comment: Yes my linear algebra is quite okay. Thanks for the comprehensive answer. Just what I needed. :)
Answer: Are you asking about a theory book or an applied one?
For an intermediate book on applied linear regression models, I'm in total love with Applied Linear Regression Models (5th edition) by Kutner. It builds from scratch, and it's certainly a comprehensive book on the subject. It explains every theoretical aspect you should know and it teaches you the usual flow of model building, selection, validation, diagnostics and remedial measures.
The only topic it failed to explain is power transformations. While it is treated on several parts of the book, it doesn't have the depth I needed.
I'll insist you should't miss this book. At least, give it a good read at the table of contents to see if it fits your needs.
Comment: Thanks. Theory and applications both are desired. Theory maybe a tad bit more than application. Anyway shall check it out.
Answer: You could try the combination of Cohen and Cohens Applied Multiple Regression/Correlation Analysis and John Mardens free online book/notes on multivariate analysis, Multivariate - Old School.
The first book covers multiple regression in an applied sense very well, while the second is good on multivariate theory, and many skips many of the practical matters that Cohen&Cohen cover.
Answer: My personal favourite for beginners is Muirhead (1982). It is much more intuitive and clearer than any other book I have encountered. It covers all bases of MANOVA, ANOVA etc. and the first three chapters will give you the toolkit to understand incredibly deep concepts.
Also there is Anderson's textbook but that is very dense and less useful. Johnson and Kotz is mainly a reference to look things up.
Muirhead is here. Also Clive Granger has a very good reputation for writing textbooks if you're into time series.
Conclusion: go with Muirhead's book. It will make you understand things and is much better suited to beginners.
Comment: I also like Muirhead, but what is your definition of a beginner?


Test domain access module

Question: I have used the domain access module to create 2 domains that our business use, and I wanted to test them in the CI cycle. How do I test them in CI that they are active and each domain uses the correct theme?
Answer: You can easily craft a test that uses CURL to hit your site using domainA and another curl request to hit your site using domainB. What I would do is make sure each theme contains its own favicon (even if the actual favicon is the same, duplicate the file and put a copy in each theme). Then you can just look at the path to the favicon in the result of your CURL and you'll see the name of themeA or themeB and voila. You know it worked (or didnt).
Answer: If I understand correctly, your only problem is that the CI system isn't accessible via the production domains, which point at the live system.
It sounds like the best way to do this would be to craft HTTP requests to the CI system directly, setting the appropriate HOST header each time.
(This could be done both manually eg. with a client like Postman, and automated as part of the CI tests.)

Test domain access module


Can smartphones with the same camera sensor have different image quality?

Question: Xiaomi Mi 9 and Redmi Note 7 Pro have the same camera sensor — Sony IMX586 Exmor RS.
Does this mean both smartphone have same image quality output when pictures are taken?
Answer: Note: This is a simplified answer. It does not go into detail, and therefore, please do not take it as authoritative answer on specifics about the exact processes that take place inside a digital camera.

The same sensor does not necessarily mean equal pictures. The sensor is one component of the whole process - the others are the analog-to-dicital-conversion (ADC) and the digital signalling processor (DSP) with its algorithms.
The sensor is 'just' a converter - it converts incoming light into electricity. The ADC then takes that electric signal and interprets according to a look-up table (i.e. a curve), as sensors are not perfectly linear, so there are dents and spikes in the signal that need to be corrected in order to get a picture that is close to the expectation of the user. The DSP then does de-noising and certain 'image enhancements'.
If any of these components change, the picture might look different.

Also note that one of the most important factors is the lens: focal length is a very important factor, and image quality can suffer greatly from an (extremely) bad lens.
Comment: The lens is also a significant component of the imaging system!
Comment: Also, AFAIK the Exmor sensors have the ADC within the sensor, so the DSP does only things that can be done by software anyway, as the signal is already digital. But, it's a valid point that image processing differences can be there between the cameras.
Comment: I think a great example of the power of software in post processing is the Google Pixel phones. If you look at the specs, the cameras they use should be way worse when compared to the flagships of other brands like Samsung and Hauwei. However, if you go over to  gsmarena, you can see side by side comparisons of the same photo taken by two different phones. The Pixel photos always look outstanding to my eye, and a huge portion of that is simply due to the software they use to process the images
Comment: @juhist Sure thing....will change to ADC instead of DSP, as it is less ambiguous. Thanks for noticing!
Comment: @DavidRicherby True. Will include that, too. Thanks!
Comment: @bremen_matt In a similar vein: many years ago, I used to have a ZTE Blade.  About 6 months after I bought it they released a software update that (among other things) improved the camera image quality.
Answer: To take a digital picture you need:

Optics
Sensor
Image processing (CPU and algorithms)

As you see, sensor is just a one link in a chain, and the chain is as weak as it's weakest link. Currently, we are experiencing great technological progress in the third stage. Compared to DSLRs, smartphones have abysmal both optics and sensors - however the extraordinary image processing allows some smartphones to almost close this huge gap under favorable conditions. It is notable that one of the highest photographically ranked phones (namely Pixel) doesn't even have the best optics nor sensor, yet it outdoes it's better-equipped competitors by a large margin. Even using different camera app can drastically alter image quality, as shown by Pixel camera app being hacked into running on non-Pixel phones.
If sensor quality would be the most important to final image quality, then Sony smartphones would be the best - as they make the best sensors, proven by everyone else using Sony sensors. But they're not, Sony smartphones are outdone by competition running Sony sensors.
So, to answer your question:

Does this mean both smartphone have same image quality output when pictures are taken?

No.
But as they come from one manufacturer, it's possible that other components are exactly same.
Comment: Nitpicky point: "If sensor quality would be the most important to final image quality, then Sony smartphones would be the best - as they make the best sensors, proven by everyone else using Sony sensors." - there's more to sensors than just their dynamic range and/or their SNR. Granted, Sony does make excellent sensors, but for certain applications, other manufacturers do a better job.
Answer: Probably the same image quality, but not necessarily.
It's not only the sensor that takes the picture. It's also the lens. The sensor doesn't have an integral lens, it's the camera manufacturer that selects the lens.
It is for example possible that the field of view on both cameras is slightly different due to slightly different focal lengths (although typically camera phones have normal focal lengths so the difference would be small). The aperture also changes the depth of field, although quite frankly with these small sensors the DoF is nearly infinite.
Additionally, it's possible that one camera uses higher quality optics than the other. If this is the case, the camera with higher quality optics wins.
See if you can find information about the optics: focal length, aperture, manufacturer of the lens. I'd also advise that:

If the camera feature is important to you, find some reviews of both phones with camera tests
Phone cameras typically only have digital zoom, so zooming in reduces picture quality
Remember always that a phone camera with a small sensor is not equivalent to a "real" camera, i.e. DSLR or mirrorless.
Answer: They can have hugely different image quality also depending on the post processing. A great example of this is the Google Pixel's "Night Sight" mode, which allows Google's phones to take some pretty impressive photos in very poorly lit areas, without any modifications to their camera's sensor or lenses.
This article has some comparison pictures and some more details about using that mode https://www.droid-life.com/2018/10/23/google-pixel3-night-sight-camera-download/
These two pictures aren't even different phones, they're the same exact phone, the only difference being the post processing of the images.

Source: https://www.theverge.com/2018/10/25/18021944/google-night-sight-pixel-3-camera-samples


Varnish configuration advise

Question: I am having a few issues with my VPS. Something happened on it which my hosts are unsure of and so I am having to go through an ordeal to try and reconfigure a few things. One of those things are Varnish... I posted a question here: https://webmasters.stackexchange.com/questions/89506/http-header-if-not-modified-help/89507?noredirect=1#comment109928_89507 whereby I am using WP Super cache to create static HTML files of pages using Mod_rewrite to reduce server load. I am then putting these static pages through Varnish to further reduce load.
The issue I'm having is that WP Super cache is sending a max-age=3 which obviously, after 3 seconds is recorded as a miss in Varnish for another 3 seconds. So really, pointless using Varnish.
However, if setting the max-age of the content to being longer, means that if I change a CSS or dynamic page in WordPress, the content is stale in the browser which obviously I don't want.
I was wondering (correct me if this isn't the right way to go) if that by following this guide: https://www.varnish-cache.org/trac/wiki/VCLExampleLongerCaching Varnish can strip out the headers sent by .htaccess in WordPress, then Varnish caches for a week (unless purged either via SSH or via the WP HTTP purge plugin, I guess) and the browser cache is kept low at 15 minutes so if anything changes, it'll only be 15 minutes out of date but after that 15 minutes, the next request will still come from Varnish, not from Apache.
Some of the websites I look after are photography websites so I really don't want to cache GBs of images in Varnish so I have currently told my VCL not to cache these. I only want to cache the pages so I can then get rid of extra caching plugins used by WordPress.
I have tried to see if there was a way to have a long Varnish cache time then WordPress would send a header that it would store in browser for a max-age of say 1 day but if the content is updated (a web page or CSS file for example) then this would be updated in the browser. I haven't seem to have found an answer for this so maybe I'm asking too much.
Here is my VCL:
backend default {
  .host = "public IP";
  .port = "8080";
}

acl purge { "localhost"; "127.0.0.1";}

sub vcl_recv {
    if (req.request == "PURGE") {
    if (!client.ip ~ purge) {
    error 405 "Not allowed.";
    }
    return (lookup);
    }

#set req.grace = 60m;
if (req.request != "GET" && req.request != "HEAD" && req.request != "PUT" && req.request != "POST" && req.request != "TRACE" && req.request != "OPTIONS" && req.request != "DELETE") {
 return (pipe); }
if (req.request != "GET" && req.request != "HEAD") {
 return (pass); }
#if (req.http.Authorization || req.http.Cookie) {
#return (pass); }
return (lookup);
# Set X-Forwarded-For header for logging in nginx
remove req.http.X-Forwarded-For;
set req.http.X-Forwarded-For = client.ip;

# Remove has_js and CloudFlare/Google Analytics __* cookies and statcounter is_unique
set req.http.Cookie = regsuball(req.http.Cookie, "(^|;\s*)(_[_a-z]+|has_js|is_unique)=[^;]*", "");
# Remove a ";" prefix, if present.
set req.http.Cookie = regsub(req.http.Cookie, "^;\s*", "");

# Either the admin pages or the login
if (req.url ~ "/wp-(login|admin|cron|cart|my-account|checkout|addons|administrator)") {
# Don't cache, pass to backend
return (pass);
}
if (req.url ~ "/administrator") {
  return (pass);
}
if ( req.url ~ "\?add-to-cart=" ) {
 return (pass);
}
if (req.url ~ "/(contact-us|contact|get-a-quote|upload-files|competition)")
{
return(pass);
}
# Never cache PUT, PATCH, DELETE or POST requests
#if (req.method == "PUT" || req.method == "PATCH" || req.method == "DELETE" || req.method == "POST") {
#return (pass);
#}
# Remove the wp-settings-1 cookie
set req.http.Cookie = regsuball(req.http.Cookie, "wp-settings-1=[^;]+(; )?", "");

# Remove the wp-settings-time-1 cookie
set req.http.Cookie = regsuball(req.http.Cookie,
"wp-settings-time-1=[^;]+(; )?", "");

# Remove the wp test cookie
set req.http.Cookie = regsuball(req.http.Cookie,
"wordpress_test_cookie=[^;]+(;)?", "");

# Static content unique to the theme can be cached (so no user uploaded images)
# The reason I don't take the wp-content/uploads is because of cache size on bigger blogs
# that would fill up with all those files getting pushed into cache
if (req.url ~ "lib/themes/" && req.url ~
"\.(css|js|png|gif|jp(e)?g)") {
unset req.http.cookie;
}

# Even if no cookies are present, I don't want my "uploads" to be cached due to their potential size
if (req.url ~ "/lib/uploads/") {
return (pass);
}

# any pages with captchas need to be excluded
if (req.url ~ "^/contact/" || req.url ~ "^/links/domains-for-sale/")
{
return(pass);
}

# Check the cookies for wordpress-specific items
if (req.http.Cookie ~ "wordpress_" || req.http.Cookie ~ "comment_") {
# A wordpress specific cookie has been set
return (pass);
}

# allow PURGE from localhost
if (req.request == "PURGE") {
if (!client.ip ~ purge) {
error 405 "Not allowed.";
}
return (lookup);
}

# Force lookup if the request is a no-cache request from the client
if (req.http.Cache-Control ~ "no-cache") {
return (pass);
}

# Try a cache-lookup
return (lookup);

}

sub vcl_fetch {
#set obj.grace = 5m;
#set beresp.grace = 60m;

}

sub vcl_hit {
if (req.request == "PURGE") {
purge;
error 200 "Purged.";
}
}

sub vcl_miss {
if (req.request == "PURGE") {
purge;
error 200 "Purged.";
}
}

sub vcl_deliver {
# multi-server webfarm? set a variable here so you can check
# the headers to see which frontend served the request
#   set resp.http.X-Server = "server-01";
   if (obj.hits > 0) {
     set resp.http.X-Cache = "HIT";
   } else {
     set resp.http.X-Cache = "MISS";
   }
}

So currently, varnish purges for 5 minutes but my max-age in .htaccess on the sites are 3 seconds which is just pointless.
Am I thinking in the right direction? Hopefully I've made sense. Hopefully someone can show me the light!
Thanks!
Comment: further to my post above, I tried implementing the code from Varnish-Cache for longer caching which seems to give the desired effect. However, all it does it give a max-age of 900 to the browser (which is okay I guess) but still the first initial visit of the page is reported as a miss in Varnish despite my visiting that specific page on another devise so in theory it should already been in the cache…Can anyone offer any advise?
Answer: Since you're using Varnish, I would suggest taking out your custom .htaccess caching headers on the backend and control the caching headers from within Varnish. That VCLExampleLongerCaching example on the Varnish site should do this correctly for you.
I find that curl is very useful for making test requests to websites to see what caching headers come back. You can do this to see just the headers returned for a given request:
curl -s -D - http://www.example.com -o /dev/null

I have tried to see if there was a way to have a long Varnish cache time then WordPress would send a header that it would store in browser for a max-age of say 1 day but if the content is updated (a web page or CSS file for example) then this would be updated in the browser.

This is a very common requirement and how many sites handle it is by adding a unique hash to the end of each CSS/JS file's URL in the page source. Each time the file changes, the unique hash changes too, so that asset now has a new, uncached URL. So you just need to clear the HTML page from Varnish and any changes to referenced assets will get updated automatically. It appears that Wordpress uses this technique too - I just had a look at a random Wordpress site and see that date string like "?v=20150727" is at the end of each CSS file in the source.

Varnish configuration advise


Who "invented" the standard error of the mean?

Question: I need the earliest available source. I already searched statistic books of Andy Field, Bortz & Schuster, Rasch & Friese, Wikipedia, Google and I asked 3 colleagues who teach statistics.
Comment: I might have found something on page 15 at "standard deviation error" http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.233.3718&rep=rep1&type=pdf
But I cannot get a hold on the original of "Yule, G. U. (1897). On the theory of correlation. JRSS, 60, 812-854."
Answer: Like many ideas in the history of statistics, it's not as simple as that; the standard error of the mean doesn't burst sui generis from a single mind. The term is only about a century old but the underlying concepts are considerably older.
It seems as if the term "standard error" was first used by Yule in 1897 in relation to the standard error of a residual. This is only 3 years after the first use of the term standard deviation!
Yule then used the term "standard error" in relation to other statistics in his 1911 book. However the concept of the standard error of the mean already existed at that point (without the name); for example Student was discussing estimating it using the sample-based estimate $s/\sqrt{n}$ three years earlier. However actually dividing $s$ by $\sqrt{n}$ is considerably older than that - much older than the term standard deviation (though the concept was much older) -- but previously $s/\sqrt{n}$ was generally multiplied by a constant ($\Phi^{-1}(\frac34)\approx 0.67448975$, which converts $s$ to an estimate of the mean absolute deviation from the mean for a normal population) and the result was called the probable error of the mean. In that context, the use of $s/\sqrt{n}$ dates back at least to 1853.
So the notion of measuring uncertainty in the estimate of the mean already existed at least 40 years prior, and the $s/\sqrt{n}$ calculation itself was already there. Essentially as soon as statisticians moved to focus more on standard deviation rather than mean deviation as their primary measure of spread, they simply dropped multiplying "$s/\sqrt{n}$" by "0.67448975" from the calculation of the probable error of the mean, but it was already a calculation in long use.
References:
Student, (1908),
"The Probable Error of a Mean"
Biometrika, Volume 6, Issue 1, March, Pages 1–25,
Earliest Known Uses of
Some of the Words of Mathematics
(several entries by John Aldrich)
https://mathshistory.st-andrews.ac.uk/Miller/mathword/
Comment: In *"On the algebraical and numerical theory of errors of observations and the combination of observations"* Airy describes the mean (absolute) error, the mean squared error and the 'probable error'. This latter one is not the same as standard deviation, at least not in Airy's work, but is the median of the absolute error.
Comment: It is also interesting to note that the first appearance of standard deviation, only 3 years before the appearance of standard error, was actually using 'standard deviation' as meaning 'standard error'. Karl Pearson was working with the 'error-curve' (which he renamed normal curve and that is the name that we use now). He introduced standard deviation as being equal to the mean square error: *"Clearly each component normal curve has three variables: (i.) the position of its axis, (ii.) its
"standard-deviation" (Gauss's "Mean Error," Airy's "Error of Mean Square"). and
(iii.) its area."*
Comment: Thanks @SextusEmpiricus for that information. Very useful.
Answer: Just by using some logic:
The standard error (SE) of a statistic (usually an estimate of a parameter) is the standard deviation of its sampling distribution or an estimate of that standard deviation. In other words, the standard error of the mean is a measure of the dispersion of sample means around the population mean. See this Wikipedia page for more details.
Suppose you are talking about the standard error of the mean in the context of normal distribution. If that is the case, then you would not go entirely wrong by even citing Gauss (1809) when he first introduced the normal distribution in his monograph. This is because normal distribution is defined by two parameters: the mean and variance. The square root of the variance is the standard deviation. And, when we are talking about the distribution of sample means in the population, the standard deviation is the standard error.
Hence, I would use the following citation:

Gauss, C. F.(1809). Theoria motvs corporvm coelestivm in sectionibvs conicis Solem ambientivm [Theory of the Motion of the Heavenly Bodies Moving about the Sun in Conic Sections] (in Latin).

Important edit:

If you want to be extra technical when it comes to attributing the notion of normal distribution to Gauss, you may want to say a couple of sentences about De Moivre (1738) and his book the Doctrine of Chances. Some believe that he should be credited with the introduction of normal distribution rather than Gauss (Johnson, Kotz & Balakrishnan. 1994; Le Cam & Lo Yang, 2000). However, this history subsection of the Wikipedia page on the concept of normal distribution provides some compelling reasons challenging such an alternative view. One of the main arguments was that De Moivre lacked the notion of probability density function.

References:
De Moivre, A. (1738). The Doctrine of Chances.
Gauss, C. F.(1809). Theoria motvs corporvm coelestivm in sectionibvs conicis Solem ambientivm [Theory of the Motion of the Heavenly Bodies Moving about the Sun in Conic Sections] (in Latin)
Johnson, N. L., Kotz, S., Balakrishnan, N. (1994). Continuous Univariate Distributions. Wiley.
Le Cam, L., & Lo Yang, G. (2000) Asymptotics in Statistics: Some Basic Concepts (second ed.). Springer.


Is the adjective "maledetto" current usage in Italian? Where in Italy is it used?

Question: The adjective "maledetto" is translated into English as "accursed", "damned" or "cursed".  Is it current usage in Italian?  Is it a regional term?  Is it a swearword?
Comment: @Centaurus I am from northern Italy and I use it often. I have no idea why anyone would tell you it is a regionalism.
Comment: It's a normal, standard Italian word. What makes you single it out?
Comment: It has nothing regional; it's an adjective derived from the past participle of *maledire* (to curse), and the corresponding noun is *maledizione* (curse). Normal, Italian words.
Comment: @DaG  A few years ago there was an Italian tourist using it all the time here where I live. Another Italian who has lived here for a long time said it's a regionalism and that most people in northern Italy never use it.
Comment: @DenisNardin  Nor do I.
Answer: Maledetto is a perfectly correct and widely used word with the meanings you suggested.
It is not technically a swearword but rather an expression of outburst, sometimes with an irritated tone sometimes joking, towards someone else that is procuring you bother or annoyance:
Cosa pretende ancora da me, quel maledetto?
(What does that unbearable man expect from me yet?)
and in a more colloquial form:
Vinci sempre tu a poker, maledetto!
(You always win when playing poker, bastard!)
Another use is with a religious meaning, and in this case the English translation would be cursed, damned:
Andate via da me, maledetti, nel fuoco eterno preparato per il diavolo e i suoi angeli
(Depart from me, you who are cursed, into the eternal fire prepared for the devil and his angels)
Answer: The Collins Dictionary entry may be helpful also. Note that the usage is mainly in the figurative sense in common contermporary speech.
Maledetto
past participle of verb maledire
(adjective)

(dannato) accursed
(nelle imprecazioni) cursed, damned
(figurative, informal) damned, blasted, confounded

avere una fame maledetta to be damned hungry
spegni quella maledetta radio! turn off that damn radio!
ho una paura maledetta dei ragni I'm scared stiff of spiders
è stato un giorno maledetto it's been a bloody awful day
non vedo l'ora di finire questo maledetto lavoro I can't wait to finish this damn work.
Comment: Yes, though in the case of food it would sound offensive to those who prepared it. You would probably say "cibo maledetto" if it made you feel bad.
Comment: Written Italian is sometimes very easy for me to understand.  "Não vejo a hora de terminar este maldito trabalho"  would be the Portuguese translation of your last sentence.
Comment: Can I use it with reference to "food", "radio", "spiders", "cold weather", whatever bothers me, without offending anyone?
Answer: Sometimes maledetto! is used often as a funny or friendly way to say something like you are smarter than me! That way is often used as a joke, there I could understand what your Italian friend said saying that his use was "regional".
Answer: I would also say that it is pretty common, but not amongst the newer generations. They use different words to convey the various meanings of maledetto and these are in many cases vulgarisms.


magneto 2 migration tool installation error

Question: time of installing migration tool in magento2.2.7 getting error "vertex/sdk 1.0.0 requires ext-soap * -> the requested PHP extension soap is missing from your system". But soap is already installed and enabled.
Answer: You need to confirm this things.

The soap install properly and working properly or not.

Better try to reinstall it again.


What type of cat do you swing?

Question: I've heard that the cat which there may not be enough room to swing actually refers to a type of whip. Is that true? What is the actual origin of the phrase not/barely enough room to swing a cat?
Comment: Does this expression really need an explanation? Isn't it possible it could have arisen even if swinging cats was never a standard practice.
Comment: When swinging cats, sailcats fly the furthest.
Comment: **Dead** cat swinging has really come up in the world since 1980: https://books.google.com/ngrams/graph?content=swing+a+dead+cat&case_insensitive=on&year_start=1800&year_end=2008&corpus=15&smoothing=3&share=&direct_url=t1%3B%2Cswing%20a%20dead%20cat%3B%2Cc0
Answer: Personally, I know two explanations. The first is provided by Phrase Finder:

Whether the 'cat' was a real moggy or the flail-like whip used to punish sailors in the British Navy isn't clear. Many reports claim that the cat in question is the 'cat o'nine tails'. As so often though, they don't supply evidence, just certainty. As a candidate for folk etymology goes the 'cat o' nine tails' story has it all - plausibility, a strong storyline and a nautical origin. That's enough to convince many people - the actual evidence shows the theory to be highly dubious. The phrase itself dates from at least the 17th century. Richard Kephale's Medela Pestilentiae, 1665:

"They had not space enough (according to the vulgar saying) to swing a Cat in."

The nature of that citation makes it clear that the phrase was already in use prior to it being committed to paper. The 'cat o' nine tails' isn't recorded until 1695 though, in William Congreve's Love for Love:

"If you should give such language at sea, you'd have a cat-o'-nine-tails laid cross your shoulders."

If those dates are in fact the earliest uses then the 'cat o' nine tails' theory is wrong.

However, as the post says, there is  a possibility that this explanation is not true, if the cat-o'-nine-tails was invented after the phrase was invented.
The second explanation, which comes from my personal reading, is a veterinary practise.
I read, in James Herriot's accounts of his life as a veterinary in 1950s, that it seems that when trying to resuscitate a cat, or a dog, the vet would take the cat by the hind legs, and swing the cat around and around. This came from his book, Vets might fly, if my memory serves me correctly. The phrase could possibly have evolved from this practise. That is another possible explanation.
Comment: I have a copy of *Vets Might Fly*. I'll have a look.
Answer: The American Heritage dictionary of idioms writes:

This expression, first recorded in 1771, is thought to allude to the cat-o'-nine-tails or "cat", a whip with nine lashes widely used to punish offenders in the British military.

This section in Origins of the Specious: Myths and Misconceptions of the English Language recognizes that the above is the typical story, but argues that the phrase is in fact earlier:

So the "cat" may have originally been a literal cat, which in Elizabethan times was used as a toy. However, more sources like to report that the phrase really does refer to a whip. Either way, the phrase seems to be earlier than the American Heritage Dictionary reports.
Answer: The "cat" referred to is a cat boat. A type of smallish sailboat with it's mast stepped right in the bow. The swing referred to is the room nescessary for the anchored boat to move, or "swing" with the tide or current without fouling the lines  other moored or anchored vessels
REf When a Loose Cannon Flogs a Dead Horse There's the Devil to Pay: Seafaring Words in Everyday Speech
by Olivia Isil (Author)
Comment: The big problem with this etymology is that [cat boats](http://en.wikipedia.org/wiki/Catboat) date from the 1840s, and people have been swinging cats (or at least talking about doing it) since the 1660s.

What type of cat do you swing?


pivot hinges on kitchen cabinet doors preventing removal for refurbish

Question: help, trying to remove kitchen cabinets with pivot hinges and screws that are hidden on top by the top of the cabinet wall.  Is there a way to get at the top screws on a pivot hinge without demolishing the cabinet?
Comment: Could you post a picture?  My guess is that you can drill an access hole or , yes, you'll have to remove...
Answer: If you are particularly interested in keeping the same door hinge system then it may become necessary to take down the cabinet sections where the hinges need to be removed. You already know that the cabinets were installed in a modular manner after they were built due the pivot hinge mounting. Taking down the cabinet would involve first emptying them out. Then search for screws inside the cabinet that go unto the wall studs behind the cabinet or screws that go up into the ceiling or cabinet soffit. In some cases there may be wood strip trim pieces along the cabinet edges against the wall or ceiling that need removing.
Answer: A specialty tool might do the trick if it's just an inch or 2 from the ceiling. Don't worry they're cheap. A right angle screwdriver or a flexible sleeve for a power drill.
However, if you're starting at the top then you actually want to start at the bottom, if the door pin goes up into a cup. This means when you detach the bottom the door will just fall out & you never need to get involved with the top nor demolishing nor taking the cabinet down.


Why can't we define absolute rest?

Question: If, according to the theory of relativity, as objects gain velocity and approach the speed of light then time for them slows down, why can't we define absolute rest as the inertial frame in which time is running the fastest?
Comment: If I run past you at $0.99$ times the speed of light, you see my clock ticking very slowly *and I see your clock ticking very slowly*. From my point of view, you are zooming past me at $0.99$ times the speed of light. It's symmetric. (Posting this as a comment because I don't have a link to a duplicate at the moment, but I know this has been addressed before on Physics SE. Maybe searching for the keywords "time dilation" and "symmetric" will lead you to other posts that answer your question.)
Comment: Time doesn't slow down for objects as they accelerate. Because, an object is always at rest, relative to itself (i.e. in its own frame of reference). It is everything else that is moving.
Comment: We can in a closed universe: https://physics.stackexchange.com/questions/353216/twin-paradox-in-closed-universe/353230#353230 - and: https://physics.stackexchange.com/questions/361/symmetrical-twin-paradox-in-a-closed-universe
Answer:
why can't we define absolute rest as the inertial frame at which time is running the fastest?

We cannot define absolute rest in that manner because it is not unique. In Abe's reference frame Abe's time runs the fastest and Bob, Cam, and Don's times all run slower. But in Bob's frame Bob's time runs he fastest and Abe, Cam, and Don's times all run slower. Similarly for Cam and Don.
The thing is that these are not mere differences in opinion. Each can use the same experimental techniques to prove unambiguously that their clocks run the fastest in their frame and that everyone else's clocks are slow in their frame. So every frame has equal right to be called the absolute rest frame by that criterion.
Comment: So if each Abe, Bob, Cam, and Don have an atomic clock that sends a ping to the others every 1 second,  then each receiver of the ping would calculate that the others ping took longer than a second even after correcting for distance?
Comment: Yes. That is correct.
Answer: Your reasoning is an example of begging the question. That is, by stating that

objects gain velocity and approach the speed of light then time for
  them slows down

you're assuming that an absolute rest frame exists (for the object to gain velocity relative to) as a premise in order to conclude that an absolute rest frame exists
As a comment points out, an object with speed near $c$ in some inertial frame of reference is stationary in its own inertial frame of reference. Thus, according to the clocks at rest in either frame, it is the other, relatively moving clocks that run slow.
Yes, this symmetric time dilation is counter-intuitive which is why your question (and variations on the theme) are frequently asked questions here.
That's why John Rennie created this question and answered it:  How can time dilation be symmetric?
Answer: It is in no way possible to tell, whether inertial laboratory is truly "moving" or is "at rest", or to detect "ether drift", or "absolute frame".
Lorentz's Ether theory was created between 1892 and 1895 and was based on a completely motionless aether. It explained the failure of the negative aether drift experiments to first order in v/c by introducing an auxiliary variable called "local time" for connecting systems at rest and in motion in the aether. In addition, the negative result of the Michelson–Morley experiment led to the introduction of the hypothesis of length contraction in 1892. However, other experiments also produced negative results and (guided by Henri Poincaré's principle of relativity) Lorentz tried in 1899 and 1904 to expand his theory to all orders in v/c by introducing the Lorentz transformation. In Lorentz theory one – way speed of light is isotropic only in the Ether, and in all moving in Ether inertial frames it is ansotropic, even though observers in these laboratories in no way are able to detect any anisotropy.
Special relativity assumes, that "preferred" frame does not exist even in principle and one-way speed of light is equal c by definition in all inertial reference frames. In a sense every observer's frame is "rest frame" and all other stuff moves relatively to it, not vice versa. Hence, relatively moving inertial observers will draw different conclusions about the simultaneity of spatially separated events (relativity of simultaneity).
Because the same mathematical formalism occurs in both, it is not possible to distinguish between LET and SR by experiment.
In this regard, the remark of a proponent and popularizer of the theory of relativity, M. von Laue, should also be clear, who wrote: "…it was experimentally impossible to make a choice between this theory (the Lorentz theory) and Einstein's theory of relativity, and if the Lorentz theory nonetheless took a back seat – even though it still has proponents among physicists – this then undoubtedly occurred due to reasons of a philosophical nature"
This paper simulates all kinematic effects of SR by simplest methods of classical mechanics.
It is important to note, that it is not possible to measure the one – way speed of light even in principle. We can only measure by means of a single clock round – trip speed of light, which is always equal to c (look for Michelson – Morley experiment)
Inertial observers (say Ben and Tom) conduct measurements by means of synchronized clocks. Before conducting any measurement, these observers must synchronize clocks in their frames. As I have already mentioned, SR employs Einstein – synchronization, which assumes isotropy of speed of light, that leads relativity of simultaneity. In that case, if Ben and Tom synchronize clocks by Einstein,  Ben will measure that Tom is "slower and shorter" and  Tom will  see that Ben is "slower and shorter" .
In his first paper on the special theory of relativity, Einstein indicated that the question of whether or not two spatially separated events were simultaneous did not necessarily have a definite answer, but instead depended on the adoption of a convention for its resolution.
Conventionality of distant simultaneity allows another, broader synchronization convention (Reichenbach's),  that allows anisotropic one – way speed of light but keeps round-trip speed of light  isotropic.
According to foregoing, inertial observers may adjust their tools (synchronize clocks) the way they wish. They can even introduce universal time (like absolute time in Lorentz theory). In this case Ben's clock may be Einstein – synchronized and Tom's Reichenbach – synchronized.  In this case Ben will measure, that Tom is "slower and shorter", but Tom (since he moves in Ben's frame)  will measure, that Ben is "faster and longer".
Hence, even though Ben and Tom cannot know which frame is "the absolute one", by employing different synchronization procedures they can make "the other clock" ticking at any rate they wish; slower, faster or even at the same as his own.
The same applies to the relativistic Doppler effect
If someone insists, that "Tom is definitely slower than Ben and Ben is definitely slower than Tom", please ask the following question:
Tom is in the center of circumference of arbitrarily large diameter and is holding a source of monochromatic light. Ben is rotating around Tom. Will Ben see Tom's clock ticking faster or slower? Why?  Purely inertial Huck moves tangentially to the circumference. When Huck is "touching" the circumference, he momentarily coincides with Ben. At this moment Huck is moving tangentially to wave front.  Will Huck see Tom's clock ticking slower of faster? Why?
Answer: In special rativity there is no absolute rest. Time runs equally fast in any inertial reference frame. However, if you insist, you could use the cosmological microwave background to fix a unique reference frame. Also no laboratory can be isolated from gravitational waves, so it will in principle always be possible to detects its speed with respect to the rest of the universe.
Wikipedia:
CMBR dipole anisotropy
From the CMB data it is seen that the earth appears to be moving at 368±2 km/s relative to the reference frame of the CMB (also called the CMB rest frame, or the frame of reference in which there is no motion through the CMB). The Local Group (the galaxy group that includes the Milky Way galaxy) appears to be moving at 627±22 km/s in the direction of galactic longitude l = 276°±3°, b = 30°±3°.This motion results in an anisotropy of the data (CMB appearing slightly warmer in the direction of movement than in the opposite direction).
Comment: *"From a theoretical point of view, the existence of a CMB rest frame breaks Lorentz invariance even in empty space far away from any galaxy."* No it doesn't. You cannot have a *privileged* frame, but you are certainly allowed to have *preferred* frames. A privileged rest frame is detectable inside a lab that's totally sealed & isolated from the external environment. You need to receive photons from the CMB in several directions in order to determine the CMB rest frame, and you can't do that in a sealed lab.
Comment: *"the frame of reference in which there is no motion through the CMB"* I know what you mean, but that could be a little misleading. The CMB is made of photons, which obviously move at *c* in any inertial frame. But you can say that the CMB rest frame is the frame in which the mean momentum of the CMB is zero, and hence there is no CMB dipole anisotropy in that frame.
Comment: @PM2Ring I agree with all that and stated so in my answer. I just point out that all normal matter of the universe was coupled to the field that became CMB and does have a rest frame. So far no deviation from a special relativity has be found so I agree that the wikipedia article needs to be made clear on this.
Comment: @PM2RING A laboratory cannot be isolated from gravitation, so gravitational waves will give away its speed with respect to the rest the universe after all.
Comment: True, you can receive gravitational waves in your lab, but that kind of feels like a loophole to me. But even if you have a compact gravitational wave detector that's several orders of magnitude more sensitive than LIGO, how do you use it to make local measurements which determine your velocity relative to the source(s) of those waves?
Comment: @PM2RING You need to keep the spectral data of a few sources in your closed off lab. Then the red shift will tell you the speed.

Why can't we define absolute rest?


Any Latent Semantic Indexing?

Question: Is there any open source implementation of LSI in Java? I want to use that library for my project. I have seen jLSI but it implements some other model of LSI. I want a standard model.
Comment: Thanks for adding the comments about jLSI.
Answer: Have you considered LDA (Latent Dirichlet allocation)? I haven't really either, but I encountered the same problem with LSI recently (patents). From what I understand LDA is a related/more powerful technique. http://en.wikipedia.org/wiki/Latent_Dirichlet_allocation apparently has some links to open-source implementations.
Answer: A google search for java LSI leads to a similar question that recommends SemanticVectors.  A package built on top of Lucene that is 'similar' to LSI.  I don't know if it's closer than the jLSI implementation.
That thread also mentions that LSI is patented and there aren't a lot of implementations of it.  So if you need a standard implementation you may have to use a language other than java.
Answer: The S-Space Package has an open source version of LSA, with bindings for the LSI document vectors.  (Both approaches operate on the same term-document matrix and are equivalent except in the output.)  It's a fairly scalable approach that uses the thin-SVD.  I've used it to run LSI on all of Wikipedia with no issue (after removing the infrequent terms with less than 5 occurrences).
As Scott Ray mentioned, the SemanticVectors package also has a good LSI implementation that recently switched to using the same thin-SVD (SVDLIBJ), so you might check that out as if you hadn't before.
Answer: a google search for NLP tools provide this slides which i think helps ...
Answer: I believe that LSA/LSI was patented in 1989, which means the patent should have just expired. Hopefully we will see some nice open source applications soon.
Answer: Have you tried the Semantic Vector package?
http://code.google.com/p/semanticvectors/

Any Latent Semantic Indexing?


sfdisk don't like partitions - want to dump another hard drive to restore software RAID

Question: I'm using Cent OS 6.5.
I have two Hard Drive which are exact copies of each others (/dev/sda and /dev/sdb).
/dev/sda failed and had to be replaced.
I am trying to copies everything from /dev/sdb to /dev/sda.
When I try to execute the command sfdisk -d /dev/sdb | sfdisk /dev/sda, I get the following result :
Checking that no-one is using this disk right now ...
OK

Disk /dev/sda: 121601 cylinders, 255 heads, 63 sectors/track
Old situation:
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

Device Boot Start     End   #cyls    #blocks   Id  System
/dev/sda1          0       -       0          0    0  Empty
/dev/sda2          0       -       0          0    0  Empty
/dev/sda3          0       -       0          0    0  Empty
/dev/sda4          0       -       0          0    0  Empty
New situation:
Units = sectors of 512 bytes, counting from 0

Device Boot    Start       End   #sectors  Id  System
/dev/sda1   *      4096  41947135   41943040  fd  Linux raid autodetect
/dev/sda2      41947136 1952468991 1910521856  fd  Linux raid autodetect
/dev/sda3     1952468992 1953519615    1050624  82  Linux swap / Solaris
/dev/sda4             0         -          0   0  Empty
Warning: partition 1 does not end at a cylinder boundary

sfdisk: I don't like these partitions - nothing changed.
(If you really want this, use the --force option.)

parted -l returns the following :
Model: ATA Hitachi HUA72201 (scsi)
Disk /dev/sda: 1000GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start  End  Size  Type  File system  Flags

Model: ATA ST1000DM003-9YN1 (scsi)
Disk /dev/sdb: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos

Number  Start   End     Size    Type     File system     Flags
1      2097kB  21.5GB  21.5GB  primary  ext4            boot, raid
2      21.5GB  1000GB  978GB   primary  ext4            raid
3      1000GB  1000GB  538MB   primary  linux-swap(v1)

I have also tried sgdisk -R=/dev/sda /dev/sdb but the command returns absolutely no output or error message.
What should I be doing?
Answer:
The requirement to align to cylinder boundaries has been gone for a
  long time now. With the introduction of drives with 4k blocks and SSDs
  with 128k erasure blocks it has become neccessary to align to
  multiples of those instead. An alignment to 1MiB boundaries seems to
  become the new standard and is what DI uses in squeeze.

Source
You can use the --force option if you think that the alignment is OK.


Blowing up a singular variety

Question: Let $f:X\rightarrow Y$ be a proper surjective morphism. Suppose X have only normal crossing singularity. Let H and E are two irreducible components of the singular locus of X i.e, $Sing(X)=H\cup E$. So clearly H and E are codimension 1 sub varieties. Suppose $f|_{X\setminus E}$ is an isomorphism i.e f is isomorphism outside $E$. Also suppose $f|_E$ is a $\mathbb{P}^n$ bundle over $f(E)$. Is it possible that f is not a blow up along f(E)?
Answer: Yes, it is possible.
Well, it is kind of cheap, but if $f$ is not projective, then there is no chance of it being a blow-up, so you might as well say that $f$ is projective. Also, I assume you mean $f(E)$ with the reduced subscheme structure.
Let $Y$ be the quintessential example of a non-Cohen-Macaulay surface: Take a smooth surface and glue two of its points "transversally". By this I mean that $Y$ along its only singular point would be analytically locally isomorphic to $Y'=Z(x,y)\cup Z(z,t)\subseteq \mathbb A^4_{x,y,z,t}$.
For the following computation this is what matters, so I will assume that $Y=Y'$. Blow up the singular point of $Y$: the two components (branches, really) separate and you get a $(-1)$-curve on each. Now glue the two surfaces together along their just created $(-1)$-curves to form a normal crossing singularity. This glued together "double" $(-1)$-curve is your $E$ and the glued surfaces together is $X$ (if you started with an irreducible $Y$, then $X$ will also be irreducible). If you must have an $H$ as well, then blow up another point on $E$, but $H$ is really a red herring.
Anyway, the original blow up morphism on each component gives a morphism
$f:X\to Y$ which contracts $E\simeq \mathbb P^1$ to a single point, that is, to the singular point of $Y=Y'$. However, if you blow up that point, then the two components (branches) get separated, so $f$ is not the blow-up of $f(E)$.
If you really want a $\mathbb P^n$-bundle with $\dim f(E)>0$, then just take a product of all of this with your favorite smooth variety. If you want $n>1$, then do this with higher dimensional smooth varieties meeting in a single point.

References for your questions in the comments below:

Gluing two surfaces along a curve should be pretty simple, but one could also just appeal to Karl Schwede's paper Gluing schemes and a scheme without closed points, especially Theorem 3.4 and Corollary 3.9.
See [Hartshorne, III.7.17].
Comment: Let $E_1$ and $E_2$ are two -1 curves in your example. Then $\mathcal{O}(-E_1-E_2)$ descends as a Cartier divisor to the glued scheme, which is trivial outside E. Actually this situation Gets complicated when there is another H intersecting E. In this case it is not clear whether $\mathcal{O}(-E_1-E_2)$ descends as a Cartier divisor.
Comment: And your point is?
Comment: Kovacs Thanks...actually this is almost like my setting. Anyway I have several questions: 1. when you say that glue the -1 curves, is it some general result that this gluing gives a scheme or surface in this case?( like for example it may be two copies of $\mathbb{P}^n$ which are being glued up.).It is not clear why it is a scheme in general.       2. Another thing is in your counter example is it possible that f is a blow up along a $\textbf{fractional ideal }$ supported on $f(E)$. Is there some general theorem of Grothendieck? Because I have heard people casually saying that...thanks
Comment: for 2. a reference will be very helpful if the answer is positive
Comment: See the edited answer.

Blowing up a singular variety


Do I have to call timeBeginPeriod before timeSetEvent when using Windows multimedia timers?

Question: The declaration for timeSetEvent contains a uResolution parameter:
MMRESULT timeSetEvent(
   UINT           uDelay,
   UINT           uResolution,
   LPTIMECALLBACK lpTimeProc,
   DWORD_PTR      dwUser,
   UINT           fuEvent
);

But my understanding is that, to set the timer resolution, timeBeginPeriod must be called first:

The timeBeginPeriod function requests a minimum resolution for periodic timers... call this function immediately before using timer services...

Do I have to call timeBeginPeriod before timeSetEvent?
If yes, then what is uResolution for?
Answer:
Do I have to call timeBeginPeriod before timeSetEvent?

No, you do not have to call timeBeginPeriod in this case.
Microsoft's documentation is misleading. Indeed, the documentation for timeBeginPeriod states:

Call this function immediately before using timer services... call the timeEndPeriod function immediately after you are finished using timer services...

Which has lead to the ubiquitous coding pattern:
call timeBeginPeriod
call timeSetEvent
do stuff...
call timeKillEvent
call timeEndPeriod

In this pattern, the calls to timeBeginPeriod and timeEndPeriod are unnecessary. Mike Wasson, who wrote SDK documentation for Windows multimedia APIs, clarifies this in a forum post:

Internally, timeSetEvent calls timeBeginPeriod, so the uResolution parameter in timeSetEvent acts just like timeBeginPeriod. When the timer is cancelled (either by calling timeKillEvent for a periodic timer, or after a one-shot timer expires), internally it calls timeEndPeriod.

My evidence-based recommendation
Unless there is good reason, timeBeginPeriod/timeEndPeriod should not be called when using timeSetEvent/timeKillEvent. Doing so only increases the risk of timeBeginPeriod being called earlier than necessary, or timeEndPeriod being called later than necessary, or worse still timeEndPeriod not being called at all (a risk that absolutely exists in complex code using multiple timers). In all these cases system performance and power usage can be negatively impacted if high resolution timing has been requested:

Setting a higher resolution can improve the accuracy of time-out intervals in wait functions. However, it can also reduce overall system performance, because the thread scheduler switches tasks more often. High resolutions can also prevent the CPU power management system from entering power-saving modes.

Notes
Microsoft warns that timeSetEvent is obsolete and recommends using CreateTimerQueueTimer. However, this alternative timer might not be suitable for precision timing:

Callback functions are queued to the thread pool. These threads are subject to scheduling delays, so the timing can vary depending on what else is happening in the application or the system.

So it seems that, for now, the "obsolete" timeSetEvent function is still the only practical option for precision event/callback-based timing.
Windows 10 2004 April 2020 attempts to ameliorate some of the system-wide impacts of applications that use multimedia timers at high resolutions. The linked article contains important information for folks who use timeBeginPeriod for its system-wide "side-effect" benefit e.g. higher resolution for Wait and Sleep functions.


is there an ownerof function equivalent for ERC1155?

Question: I would like to be able to call all the addresses for a specific tokenId in an ERC1155 contract in order to airdrop those with a specific token.
I know ERC721 has the function ownerof to allow for this, is there an equivalent for ERC1155?
Answer: There is no function for this on ERC1155.
Because a token is not necessarily unique, it can have multiple owners.
Same as ERC20 there is no function to list all the holders.
On ERC1155 _balances mapping is like this:
mapping(uint256 => mapping(address => uint256)) private _balances;

Simple representation:
TokenID => holder => amountOfTokenID

For one TokenID you can have multiple holders
To answer your question: It is not possible to retrieve this information from the smart contract.
However, it is possible to get this information off-chain using events with the right logic / filters
Or via TheGraph.
Comment: The mapping you mentioned is available in the ERC1155 standard?
Comment: yes it is taken from Openzeppelin


How to solve two implicit functions with two variables and parameters

Question: I have two functions given as;
u[c_,d_] := Sinh[a b^2 c^2 + 3a b d] and  v[c_,d_] := Log[a b^2 c^2 + 3a b d + d^2] - d. I want to find the root of these two functions that maximise another function say w[c_,d_]:= 2a b c + 3b c - 2c d^2 + c*Exp[a+b].
Here, a and b are parameters that lie between [-3,3] and [1,2] respectively, while c and d are the variables of interest. I am able to solve for c and d when I use the FindRoot command and fix a and b (example, a = 1 and b = 0.7).
a=1; b=0.7;
FindRoot[{u[c,d]== 0,v[c,d]== 0},{c,0},{d,0}]

When I do this I get only one root of the problem and as I change the initial point I get one of the other roots and so on. And I am also able to determine the c and d that gives the max of w[c,d]. But this is what I want to do;
I want to be able to estimate c and d over the entire space of a and b and find the point ({c,d}) which maximises w[c,d]. Also, to plot the surface of u[c,d] with the c and  d that gives the maximum of w[c,d].
I am new to mathematical and your help is much appreciated.
Answer: u[c_, d_] := Sinh[a b^2 c^2 + 3 a b d];
v[c_, d_] := Log[a b^2 c^2 + 3 a b d + d^2] - d;
w[c_, d_] := 2 a b c + 3 b c - 2 c d^2 + c*Exp[a + b];
NMaximize[{w[c, d], u[c, d] == 0, v[c, d] == 0, -3 <= a <= 3,
  1 <= b <= 2}, {a, b, c, d}]

{98.4569, {a -> 2.99992, b -> 1.14721, c -> 1.35641, d -> -0.703619}}
Comment: Your response is very helpful. Thank you!


Getting Serenity HTML reports during execution

Question: I am using Serenity with Cucumber. Here the HTML report created for each scenario is with a random string.
My questions:

Can we rename those individual HTML report by scenario name?.
Is the HTML report generated right after the scenario is completed? Or after the whole execution?
If an answer to the 2nd question is yes can someone please explain the report generation flow?
Can we get the result during runtime? Or only at the end of the test run?

My requirement is to get test results parallel as soon as each test/scenario/feature is completed.
Thanks!
Answer: The report is generated by running mvn serenity:aggregate and is based on your surefire/failsafe report. Usually you call this at the end of your whole test suite.
I would suggest you provide quicker feedback by watching the target/surefire-reports/.*xml files. The these are created after each class executed. If you really need html reports, you can theoretically create a report after each executed class. I am convinced, this is to much overhead though.
Another strategy would be to use execution in parallel batches with every batch running a aggregate and publishing the result.


Custom scaffolding logic for database first Entity Framework Core

Question: I'm new to Entity Framework Core as I'm currently migrating over from EF6. We use a database first model.
I've created a .Net Standard class library where I've imported EF Core and have used the scaffolding command in VS to import one of my tables as a test - which worked.
We have a couple of different replica databases that we use for geo-redundancy and reporting purposed, but all have the same model.
I've set up the different connection options, somewhat like point 2 in the answer in this post Using Entity Framework Core migrations for class library project so we can support connections to the different databases.
Now I want to go about adding the rest of the tables in. I have seen mention of Migrations, but that seems to be for code first models.
I then tried to use the "-Force" command on the scaffolding, which did import an additional table, but I lost my multi-database support.
In EF6 I had this logic in the Context.tt file, so when I retrieved updates from the database it would retain the custom connection options I had.
Is there a way to replicate this in EF Core or something I am missing?
Also, for something as simple as a new column on a table, should I still run the same command?
Thanks in advance,
David
* UPDATED *
I ended up using EF Core Power Tools which is a great package and allows complete control over the model, much like the context.tt file used to.
For anyone looking in future, I reverse engineered and used the Handlebars templates in EF Core Power Tools. I pass the 3 connection strings I use in the startup of the application and can then set optional booleans to indicate which connection to use - an enum may be more elegant for anyone starting again but this makes migration easier for us.
In the DbConstructor.hbs, I updated it to:
{{spaces 8}}public {{class}}(bool ReadOnlyDatabase = false, bool ReportsDatabase = false) : base()
{{spaces 8}}{
            if (ReadOnlyDatabase)
                _connectionString = ReadOnlyContext;
            else if (ReportsDatabase)
                _connectionString = ReportsContext;
            else
                _connectionString = ReadWriteContext;
{{spaces 7}} }

The DbContext.hbs file is:
{{> dbimports}}

namespace {{namespace}}
{
    public partial class {{class}} : DbContext
    {
        public static string ReadWriteContext = "";
        public static string ReadOnlyContext = "";
        public static string ReportsContext = "";

        private readonly string _connectionString;
{{{> dbsets}}}
{{#if entity-type-errors}}
{{#each entity-type-errors}}
{{spaces 8}}{{{entity-type-error}}}
{{/each}}

{{/if}}

{{{> dbconstructor}}}

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            optionsBuilder.UseSqlServer(_connectionString);
        }
{{{on-model-creating}}}
    }
}

Answer: Supply a DbContextOptions to the constructor:
    public MetadataContext(DbContextOptions<MetadataContext> options)
        : base(options)
    {
    }

Maybe EF Core Power Tools can help you? (I am the author)
Comment: Thanks so much @ErikEJ, this is a fantastic package and gives me all the functionality I used to have with the EDMX file!
Comment: How do I go about doing that?
Answer: You need to post more of your code so we can see what's going on. At a guess it sounds like you are customizing the generated context class. It will be overwritten with each scaffold operation and as you note the migration support is there to drive db Schema updates from model changes. I.e. it's for code first.
The db first scaffold approach seems that to be written with the expectation that the scaffold will be done once and thereafter models and contexts will be manually updated.
We have a workflow that involves re scaffolding the DbContext in response to db schema updates and consequently do three things:

scaffold a localhost or SSPI db so the embedded connection string contains no passwords of value.
tolerate the annoying warning in CI/CD about the connection string the scaffolder generates each time that cant be disabled.
we use extension methods to add functionality to the DbContext when necessary so we never need to alter the generated code.

Now I would not suggest extension methods to initialize the different connection strings.
Those I am sure are already coming from config but if not, and you are making a console rather than asp.net core app which makes configuration driven creation of DbContexts really easy I would really suggest learning how to use at least Microsoft.Extensions.Configuration to configure your DbContext instances from an appSettings.
I can't share a code sample of initializing a DBContext with an DbOptionsBuilder directly because my guilty secret is I always get the DI in Asp.net Core to do it for me.
Comment: EF Core Power Tools can remove the connection string for you - and scaffold from a database project (SSDT)
Comment: I'll check it out. Our DBs are built using sql scripts deployed with DbUp though, not SSDT but just the connect string removal is useful.
Comment: Extension methods are a good idea. OP should take note that EF Core is not designed to support a "Database first" model like you said. Everything is based around code-first migrations with scaffolding only meant as a starting point.


post request Error parsing media type 'application/xml' with netbeans

Question: I have implemented some rest webservices with netbeans IDE , but when testing the post request I get some exceptions like the following :
<code> POST RequestFailed RequestFailed --> Status: (500)
 Response: { ......
 javax.ws.rs.WebApplicationException: java.lang.IllegalArgumentException: Error parsing media type ', application/xml'
 Content may not have Container-Containee Relationship.
</code>
and the code associated to the post method is
<code>@POST
@Override
@Consumes({"application/xml", "application/json"})
public void create(Mobilereading entity) {
    super.create(entity);
}
</code>
Normally everything seems to be correct but I don't know where is the problem ? any solutions plz *
Answer: modify our code as
<code>@POST
@Override
@Consumes({"application/xml", "application/json"})
public void create(JAXBElement<Mobilereading> entity) {
    super.create(entity);
}
</code>


Unanswered questions with just comments

Question: I'm looking through a lot of the unanswered questions and it appears some of them have answers in the comments. So what is the solution for these?
Answer: 4 options that I see

Ask the commenter to add the comment as an answer
Add the comment as an answer, and assign to community wiki
Add the comment as your own answer, and try to grab a couple of rep points for yourself
Ignore it, and continue on
Comment: Note that for both 2 and 3 you should give credit to the commenter for the content which is theirs, and should probably prefer 2 over 3 unless you are adding more than just what was in the comment.  If you are adding more detail/examples/etc. then getting rep for that is perfectly appropriate.
Comment: And note that just adding the comment as an answer might be a risky thing to do. You have to make sure it's a good answer. Which in most cases will mean at least some editing is needed. Comments rarely make good answers.
Answer: You could leave a comment, asking the author to make it an answer.
If that results in nothing, and if you can construct a good answer based on the information in the comments, by all means go ahead. Keep in mind though that comments don't always make for good answers. So try to avoid merely copying the comment into an answer.
Answer: Comments are mean to clarify question and give suggestion for answer, but it does not mean that it is correct answer.
If it's comment, than user who commented might be not sure with answer.
Also, SO have restriction for comment, so all new users cannot comment..
But anytime user who has questioned can ask the user who commented to put it as answer and mark it as correct answer and mark it correct.

Unanswered questions with just comments


While editing fields in a modal, does it really need to have the Save or Update button appear already?

Question: I am not sure if i need to let user see it already eventhough he has not change in the fields. Why on some modal or forms, they already appear? whats the reason behind it? What to save when user has not edited or updated the fields.
Comment: The modal needs to be closed and the values saved. If they are not committed  to the backend "save" is a bad word, the button to close the dialog should represent what it will do.
Comment: What i mean is that if user has NOT change some fields yet or did some action or to edit, the buttons will not appear. But as the user typed or clicked a radio buttons or switched sliders, the button appears.
Comment: how woukd you cancel without typing?
Comment: There is an (x) close button at the top I assume as what mostly do.
Comment: or click on the outside with confirmation if made changes, but thats a diff topic.
Comment: you could always disable the save/submit button until the user has actually entered something into the form, and then enable it
Answer: I feel the save button helps serve two purposes
1. Reduce confusion
Users are used to seeing a "submit" kind of button at every form. The sudden absence of it, might lead to some confusion. "What happens after I start typing?", "Will it directly start syncing to cloud or something once I type" or "Maybe there's a glitch with this website and it hasn't loaded entirely. In all cases, the user might not be quite sure on what happens next.
Point 1 and 3 of Top 10 Application-Design Mistakes elaborate on this quite well.
2. Creates a perception of control
In continuation of the previous point, a user would feel more in control when they see, well, controls. When a users seeing the "save" button missing might assume an "automatic sync" might be triggered once they start typing. This might make them skeptical about typing at all. However the presence of it, assures they can click it, as and when they feel the forms are appropriately filled.
The Perception of Control is a good read about this. While it does focus more about deception to create a perception of control. It does talk about how important that perception is and how "placebo buttons" can help.

Buttons that do nothing are known as placebo buttons, and they exist
  everywhere: at crosswalks, in subway stations, and on thermostats.
  They serve no function, other than to provide the user with the
  perception that he or she has some control over an automated system.

Technically the save button is a "placebo button" until the user types something into the form.
Answer: These buttons already appear to give users a guidance or structure to follow, a simple sequence of form fields to fill out and either to confirm or cancel the input. This is a common pattern to support usability as stated by e.g. Jakob Nielsen (1995, 10 Usability Heuristics for User Interface Design). Rather than messing around with such a well-known pattern you could easily change the visual style of your form, as displayed in the attached image, to keep following the standard and make it more appealing.
Comment: the image doesn't have any buttons though


In mongodb cluster, Can I shut down one config server and one data server in the shard at the same time

Question: I have one mongodb cluster, including 3 config servers, and one shard (3 data servers in this shard). One data server and one config server are on the same machine. Can I shut both of them down to upgrade the cluster without stop the service?
Answer: The normal rules of replica set elections apply.
If your shard is backed by a 3-node replica set, then you can have any single node down while still being able to maintain a primary. A strict majority of nodes must be available, so 2/3 in the 3-node example.
If the data-bearing server you are planning to restart happens to be a replica set primary, I would shut it down gracefully with db.shutdownServer() to minimise down time (and make sure there is an eligible secondary whose oplog data is within 10 seconds of the primary). db.shutdownServer() runs the shutdown command against the admin database.
Comment: Can I show down one config server and one data server in the replication set **at the same time**?
Comment: Yes, you can do this. As noted, if you want to maintain availability in your replica set the normal rules for election apply (i.e. have a majority of nodes available).
Comment: Please note that running a config server and a data bearing node in one instance is discouraged and that shutting down a config server prevents chunk splits and migrations, which might lead to the dreaded, non-movable jumbo chunks.


Is Immortality a Relative Property?

Question: People talk about immortality like they know what it is. They say it is "living forever". But we can imagine somebody who experiences life getting asymptotically slower and slower, so that they never experience their own death (or perhaps experience it "after omega"!). But somebody else would see the person die, and declare that they were not immortal. Likewise, if someone was immortal in the normal sense, but experienced life getting faster and faster, they could "burn through" an "infinite" amount of time. What I am getting at is that time in isolation might just be a topological interval, and that it is our minds that institute a distance on it, evolutionarily springing from the other laws of physics. So, is immortality a property relative to experience?
Comment: If so, any "mortal" could achieve immortality by travelling at the speed of light. Or better yet, by entering a black hole (what a twist!) :)
Comment: I wonder if the view-comment/answer ratio means I am on to something.
Answer: Well I was thinking about this question for a while and here's what I came up with:
The main problem is that you define immortality using time ("living forever"), and time is relative in its very nature, whether we look at it as a physical property or from a more common point of view. So what causes immortality to appear as relative in your example, is the fact that it's defined using time. On a side note, I don't think you can define an absolute value, when you base your definition on a relative one.
Let's see what happens, if we define immortality as "not being able to die", a definition that also comes natural. It implies, that if anyone can see you die, you're not immortal, but in fact, dead. This fixes the black hole paradox, because living forever doesn't equal immortality in the above definition, as long as you can be seen dead by any observer in any circumstances.
Translating it to a more mathematical definition: a person P is immortal if and only if for each observer O in time and place P is not seen as dead by O. In other words: a person P is not immortal if and only if there exists an observer O that can see person P as dead.
My hypothesis is that the 2nd definition describes the concept of immorality that can be found in the culture better. And although in most religions it is said that afterlife is "living forever", it is also said that souls cannot be killed or destroyed, and that is what grants the afterlife immortality. And more than that: spirits and souls are not bound by any laws of physics, including time (at least in Christianity, I'm not a religion expert). Also, note that you don't even have to be seen as alive to be immortal in the 2nd definition.
So, assuming my hypothesis is correct, immortality is not a relative property.
By the way, here's another paradox: is the Shrodinger cat immortal? It lives forever, if you never open the box (immortal in the 1st definition). But it's dead at the same time, so it's not immortal in the 2nd definition.
Comment: But then the last person is immortal!
Comment: @JacobWakem no, assuming that you see your own death (or realise you're dying).
Comment: I do not see that in the definition, but at any rate if its a flaw it is not a fatal flaw.

Is Immortality a Relative Property?


Speakers playing faint white noise when turned on

Question: My speakers are constantly playing a a faint white noise when they are turned on, it only started happening when i put Ubuntu on it as well. My machine is a new Lenovo Thinkpad X1 Carbon. Other questions similar to mine aren't helping either. Thanks!
Answer: I will try to help. Do you have a soundcard? If you do, type alsamixer in the Terminal. There you will be able to tune it a little, and hopefully get rid of the white noise.
If that doesn't work, you might try upgrading your kernel. I am still learning, but these are some suggestions that I have discovered.


integration with website with search

Question: I have a task to integrate our SF org with this website: https://www.nsopw.gov/ , in which you can simply search somebody's name and find out of whether or not they are a sex offender. We would just want to pass the first and last name of some of our records in SF. Is this possible, and how is the best way to do it? Has anyone done something similar?
Answer: Per their FAQ:

Does NSOPW offer a web service or an application programming interface (API) so searches can be done programmatically?

No. The browser interface is the only way to search for sex offenders on NSOPW.

In theory, you could write some code to post the form and then parsing the resulting HTML, but it's a very manual process and may break if they change their DOM. What you're asking for is essentially not possible at this time.
Comment: Appreciate it- thank you! If I were to go the manual process, is there an example I can look at where such a thing is done? And would it be able to be done all with apex?
Comment: @MichaelM You can do this with Apex using the HttpRequest and HttpResponse classes to load the data, then the Dom.Document object to load and parse the HTML.

integration with website with search


How to trigger a email based on particular field (boolean) changes in DE by cloud pages

Question: I need some help & clarification about - how to trigger an email based on particular fields changes in Sendable DE by custom cloud landing pages? - Can I go to triggered email option in email studio interaction tab or create an send email event in automation studio & journey builder (which one is simple) and where can I track email info?
Thanks in advance
Comment: Do you need to trigger these emails when the field are being updated or it can be an automation running every hour/day?
Comment: I need to trigger these emails immediately when the field updated.
Answer: If you want to trigger an email using cloudpages you mainly have two options:

Trigger the email via AMPscript and the SOAP Web Service API
Use Cloudpage with Smart Capture to push people in a journey

Example of option 1:
<code>SET @ts = CreateObject("TriggeredSend")
SET @tsDef = CreateObject("TriggeredSendDefinition")

SetObjectProperty(@tsDef, "CustomerKey", "TriggerSend_Name")
SetObjectProperty(@ts, "TriggeredSendDefinition", @tsDef)

SET @ts_sub = CreateObject("Subscriber")
SetObjectProperty(@ts_sub, "EmailAddress", @Email)
SetObjectProperty(@ts_sub, "SubscriberKey", @Subkey)

IF NOT IsNull(RequestParameter("Prenom_Contact")) THEN
    SET @attr = CreateObject("Attribute")
    SetObjectProperty(@attr, "Name", "Prenom_Contact")
    SetObjectProperty(@attr, "Value", @Prenom)
    AddObjectArrayItem(@ts_sub, "Attributes", @attr)
ENDIF

AddObjectArrayItem(@ts, "Subscribers", @ts_sub)
SET @ts_statusCode = InvokeCreate(@ts, @ts_statusMsg, @errorCode)

IF @ts_statusCode != "OK" THEN
       RaiseError(@ts_statusMsg, 0, @ts_statusCode, @errorCode)
ELSE
ENDIF
</code>
Comment: Thanks for the response, @Jeremy. Actually, I designed the cloud pages fully custom subscription center replica for multiple brands and to store data in DE. so I can't go with 2 ones. In 1 option there, we defining triggeredSend Definition - I have some doubt 1. how to choose email?
Comment: You don't choose the email but the trigger send. See my example.
Comment: If I can't select an email means - which email are getting triggered by your example.  @jeremy


MOSFET and LED Circuit

Question: I am trying to use a MOSFET as a switch for my LEDS. I have 6 LEDS in series connected from 9V to gnd and for the gate of the mosfet i will be connecting from a microcontroller. This will be providing 1.5-5.5V. Just asking will this mosfet work well? IRFZ44R Data sheet
Answer: Your concept is not completely wrong, but there are some things to keep in mind:

9V may not be sufficient to supply 6 LEDs in series, since the total voltage drop will be the sum of the individual forward voltages. Consider connecting two series of 3 LEDs in parralel instead.
An LED's significant operating parameter is its current, not the voltage applied. As the voltage across an LED decreases with rising temperature, the LED current will increase due to self heating, which leads to a thermal runaway and possible damage to the LED. Use a series resistor (or a constant current source) to limit the LED current to a reasonable level.
In the datasheet you linked in your question, RDS(On) is only specified at VGS = 10V. At VGS = 5.5V, RDS will most likely be low enough for your application. However, at VGS = 1.5V, RDS will not allow any significant current flow through the LEDs, resulting in a faint glow at best. A logic level mosfet like the IRLI520 requires a lower VGS value to reach its minimal RDS.
Comment: I will take the number of LEDS in mind (I can reduce it to 3 or 4 or 5 pretty easily, 6 is not the set number). As for your last point I tried to find another mosfet easily accessible to me and I came up with this.
http://www.irf.com/product-info/datasheets/data/irl3303.pdf

If I am correct this has 2 turn on voltages 1 at 4.5V which should be low enough for me. Correct?
Comment: Yes, it will work. RDS will reach the specified value at VGS=4.5V.

MOSFET and LED Circuit


git rebase a branch which is based on several branches

Question: I have the following minimal example:
---M---A-----D1---D2---D3
   |\       /|
   | B1---B2 |
   \         /
    -C1---C2-

Here,

M is master at the moment,
there are features

A,
B (consisting of B1, B2), and
C (consisting of C1, C2)

under development and on top of all those a feature

D (consisting of a series D1, D2, D3).

Now feature A was accepted to go into the master branch, therefore I have to rebase everything to A. This means, I want
---M---A-----------D1'---D2'---D3'
       |\         /|
       | B1'---B2' |
       \           /
        -C1'---C2'-

Of course, it is easy to rebase B (B2) at A, and also C, alone/separately.
But how do I rebase my branch D (including B and C), keeping the merge D1 (as shown above)?
Answer: You'll want to pass the flag --preserve-merges into your rebase command. This looks like:
git checkout D
git rebase A --preserve-merges

I'm far from an expert in the algorithm used by git to preserve merges, so I don't know what sort of conflicts you may or may not run into, but this will cause git to attempt to reconstruct your merge commit D1 during the rebase.
Answer: You could rebase branches B and C individually and then use grafts (or git-replace) to re-attach the new rebased branches to the merge commit. using grafts I would do
# rebase the individual branches
git rebase M B2 --onto A
git rebase M C2 --onto A
# replace old branch heads with rebased branch heads
echo $(git rev-parse D1) $(git rev-parse B2') $(git rev-parse C2') > .git/info/grafts

The grafts will make your git history appear as if D1 has parents B2' and C2'. If you remove .git/info/grafts, D1 will have its original parents again.
To make this permanent, use filter branch to rewrite your history:
#make it permanent
git filter-branch -f --tag-name-filter cat D1'

A more elaborate explanation can be found in this answer on prepending the past to a git repository. It also explains how you should use git replace instead of grafts. I gave the example with grafts because I have a bit more experience with those.
git replace would rather be along the lines:
# rebase the individual branches
git rebase M B2 --onto A
git rebase M C2 --onto A
# replace old branch heads with rebased branch heads
git replace B2 B2'
git replace C2 C2'
#make it permanent
git filter-branch -f --tag-name-filter cat D1'

Comment: joshtkling's solution beats this one hands down in simplicity


How can you change a picture on the iPhone to make it look comicy or black and white?

Question: I was wondering, are there any libraries on the iPhone that allow you to take an image and apply some sort of filter to it so the image turns out black and white, or to make it look comicy, or to skew it?
Comment: Use a toonshader when rendering the image.
Answer: Start by taking a look at CoreImage.  Its available in iOS5.  You'll probably want to explore third party options too.
Answer: Check out OpenCV. It's an open source library that can be compiled for iOS (there's plenty of tutorials all around the net) and it's specifically made for things like image manipulation.
While it's harder to set up, it's a lot more powerful than CoreImage will be!
There's also plenty of sample code around the net that does things like turn images comicy/black and white/find image outlines/thresholds images etc. There's a small learning curve, but for what you want to do, it's more than worth it :)


Profile picture displays improperly on new dashboard

Question:
I looked at other sites but I don't have the new profile on any of those
Answer: Yeah, so... That page isn't even close to being done. There's a setting to control visibility, and... somehow it got set to the wrong thing.
On the one site that gets the most traffic.
For a brief moment, we thought maybe no one noticed. Sorry for doubting you!
It's off now, and will stay off until it's actually somewhere near done - and then it'll be enabled for testing on Meta first.
Comment: Dammit. I missed it. :(
Comment: After / when / during... I don't know what the timeframe is gonna be like for this, given it's been under development for many, many months thus far @lostsock - [here's the most recent discussion though](http://meta.stackexchange.com/questions/231112/profile-page-makeover-part-2-the-prototype), if you're interested in chiming in.
Comment: so it'll be enabled for testing on meta first AFTER it is brought to the community for discussion?
Comment: I'm fairly aware of that post since I received a great answer badge for my answer there. I was under the assumption that the general consensus was that it wasn't worth redoing the redesign like this, since the about me section is hideous, and that our goal shouldn't be more user centered *(facebookish)* instead of content centered. Sure if they want a apps/projects section, just add another tab to the current layout. However, if they've been working non stop for the last 3 months on this, then I'd like to see how improved it is and possibly re-evaluate my popular opinion.
Comment: As you might be able to tell from the screenshot, the old design has been scrapped/reworked a few times since then @lostsock - it's still not exactly *finished*, although I'd have to say it's inching closer to being usable. Once there's something reasonable stable again, I'm sure there'll be a repeat of the past discussion.