Split the string on dot and retrieve each values from it in C++

Question: I need to split the string on . in C++..
Below is my string -
@event.hello.dc1
Now I need to split on . on the above string and retrieve the @event from it and then pass @event to the below method -
bool upsert(const char* key);
Below is the code I have got so far after reading it from here -
void splitString() {

    string sentence = "@event.hello.dc1";

    istringstream iss(sentence);
    copy(istream_iterator<string>(iss), istream_iterator<string>(), ostream_iterator<string>(cout, "\n"));
}

But I am not able to understand how to extract @event by splitting on . using the above method as the above method only works for whitespace... And also how to extract everything from that string by splitting on . as mentioned like below -
split1 = @event
split2 = hello
split3 = dc1

Thanks for the help..
Comment: http://stackoverflow.com/questions/236129/how-to-split-a-string-in-c
Comment: http://stackoverflow.com/questions/5167625/splitting-a-c-stdstring-using-tokens-e-g
Answer: You can use std::getline:
string sentence = "@event.hello.dc1";
istringstream iss(sentence);
std::vector<std::string> tokens;
std::string token;
while (std::getline(iss, token, '.')) {
    if (!token.empty())
        tokens.push_back(token);
}

which results in:
tokens[0] == "@event"
tokens[1] == "hello"
tokens[2] == "dc1"

Answer: First off, you can change what is considered to be a space for a stream. The approach to do is to replace the std::ctype<char> facet in a new std::locale and then imbue() this newly created std::locale into the stream. However, the approach is a bit involved the the task at hand. In fact, to extract the first component of the string separated by a . I wouldn't even create a stream:
std::string first_component(std::string const& value) {
    std::string::size_type pos = value.find('.');
    return pos == value.npos? value: value.substr(0, pos);
}

Answer: Create a ctype facet something like this:
#include <locale>
#include <vector>

struct dot_reader: std::ctype<char> {
    dot_reader(): std::ctype<char>(get_table()) {}
    static std::ctype_base::mask const* get_table() {
        static std::vector<std::ctype_base::mask> rc(table_size, std::ctype_base::mask());

        rc['.'] = std::ctype_base::space;
        rc['\n'] = std::ctype_base::space; // probably still want \n as a separator?
        return &rc[0];
    }
};

Then imbue your stream with an instance of it, and read strings:
istringstream iss(sentence);

iss.imbue(locale(locale(), new dot_reader())); // Added this

copy(istream_iterator<string>(iss),
     istream_iterator<string>(),
     ostream_iterator<string>(cout, "\n"));

Answer: You can use the strtok function : http://en.cppreference.com/w/cpp/string/byte/strtok
You can use by doing something like this :
 strtok(sentence.c_str(), ".");

Comment: You should mention that `strtok` overwrites the string you pass in.  And that you can't pass the result of `c_str()`, which is `const char*`, to `strtok`, which requires a non-`const`.


generate video from images without storing on disk ffmpeg .net

Question: I want to generate video file from images(memory stream bitmap or image object) without storing on disk with ffmpeg .net.
I found a link which is for python,but i don't know about python.
Can you "stream" images to ffmpeg to construct a video, instead of saving them to disk?
Comment: possibly pass them through a named pipe to ffmpeg.exe?
Comment: can you please give me some sample.I am really stuck on it
Comment: in that python example, they're basically opening a pipe to "ffmpeg.exe" and instructing ffmpeg to read its input from "-" (which is its stdin).  You should be able to do something like that in C# as well, gl!
Answer: Not sure what interface to FFmpeg you're using (not familiar with C# interface), but the FFmpeg video encoding API expects the encoded frames from memory, not from disk. So when you call avcodec_encode_video2 you pass the image in memory, not the disk file.
Comment: I'm not getting,what you want to say. Can you please give me sample which convert multiple image stream to single video without storing on disk .(.mov/.flv)
Comment: The question seems to concern streaming image data from a .NET based application to ffmpeg.exe using a named pipe rather than using the API to do a similar piece of functionality.


Does YouTube reuse old defunct video IDs to new videos?

Question: I've stumbled across a few YouTube video lists in the past which were supposed to have soundtracks to a game or a movie but somehow had random videos in-between expected videos (only a few were like that). I wonder if it was a mistake or intentional, or if those videos (being soundtracks) got taken down and after several years were reassigned to new videos. Does YouTube ever reuse video IDs/urls?
Comment: Related: [Identifying redundant Youtube links](https://webapps.stackexchange.com/questions/112135/identifying-defunct-youtube-links.)
Answer: No, I don't think YouTube ever reassigns old video IDs.
YouTube isn't running out of video URLs any time soon. In his video Will YouTube Ever Run Out Of Video IDs?, Tom Scott calculated that YouTube could generate over 73 quintillion video URLs. For reference, that's 73,786,976,294,838,206,4641 unique possibilies.
So while it's theoretically possible that YouTube is reusing video URLs, it is highly unlikely.  Mainly because they don't have any reason to reuse old URLs.
1The number of unique URLs may actually be 18,446,744,073,709,511,616. Either way, it's still a stupidly large number.
Comment: That doesn't answer my question, unfortunately. Please, read it carefully again, there's not too much text.
Comment: @user1306322 My answer is no, I don't think video URLs get reassigned when a video is taken down
Comment: Well, what are your sources for thinking so? Such an answer is as good as no answer at all.
Answer: Unfortunately, only a person who works with youtube can say this with confidence... But I will give here the answer I believe to be the most likely according to what I've been studying:
My answer is: NO!
Why?
Simple, reusing IDs will hardly bring advantages, in most cases it will only bring disadvantages.
I will quote 3:

Reusing IDs weakens (even minimally) the unlisted video system, in which an unlisted video could take an old url, and some people may have saved the url and decide to look again and end up finding a video that it should not have access (probably). This might seem a bit impossible, as the video would have to take a url that existed and should still be unlisted, very unlikely, but still possible.

Youtube has dedicated a lot of its video service to children's videos, so they must be extremely careful with what happens on youtube (especially Youtube Kids). Imagine the following case: a child video is posted and gets a lot of views (obviously from several children), in some cases this child's parents will save the video url for later. Then the video is deleted and another one takes its place, but some user has placed a +18 content that was not blocked by the algorithm and then several parents use the link and have an unpleasant surprise.

According to Youtube, your ID is opaque, that is, it does not provide any information regarding the video or internal things, but, in a smaller case, reuse could reveal the average number of videos that Youtube receives, taking the Video IDs that have been reused and the total number of possible ID combinations it is possible to make a probabilistic deduction of how many videos it receives.

Maybe you might think that some of the drawbacks I mentioned aren't relevant and will never happen, but since this is an app that anyone can use, keep this in mind: if the user gets a chance to make your app don't work as it should, it will!
Anyway, conceptually an ID should neither repeat nor be reused (even with deleted records), future problems will have a high chance of occurring and to fix them will be a huge effort and will increase the code complexity unnecessarily.
How to create a simple algorithm to prevent the reuse and collision of IDs even with deleted records?
Easy! In a database, the primary key will cause duplicates not to occur, so just delete the record data that will not be used and put a "tag" that indicates the record has been deleted (boolean), keeping only what you need to know stored about the respective record (mainly metadata like timestamp).
You might think like this: "But wouldn't I be storing unnecessary information?", well at first it may seem so, but what is an 11-character ID, a boolean tag and some metadata compared to a video? This value is irrelevant, 1 video can be equivalent to millions of deleted records. Furthermore, it is possible to use this information in order to improve the search on youtube using your metadata about the deleted video.
Conclusion
Finally, I believe Youtube does this and maintains some metadata.


How big can innodb_doublewrite_file grow?

Question: When I use the enable innodb_doublewrite_file ...

How big can this file grow ?
How can I calculate the optimal disk size, if it would be used only for this file?
Answer: Please look at the following view of the InnoDB/XtraDB Architecture

Please notice the Percona Server Documentation on This

Performance Impact of the Doublewrite Buffer
In usual workloads the performance impact is low-5% or so. As a
  consequence, you should always enable the doublewrite buffer because
  the strong guarantee against data corruption is worth the small
  performance drop.
But if you experience a heavy workload, especially if your data does
  not fit in the buffer pool, the writes in the doublewrite buffer will
  compete against the random reads to access the disk. In this case, you
  can see a sharp performance drop compared to the same workload without
  the doublewrite buffer-a 30% performance degradation is not uncommon.
Another case when you can see a big performance impact is when the
  doublewrite buffer is full. Then new writes must wait until entries in
  the doublewrite buffer are freed.
How to Choose a Good Location for the Doublewrite Buffer
Basically if you want to improve the I/O activity, you will put the
  doublewrite buffer on a different disk. But is it better on an SSD or
  a more traditional HDD? First you should note that pages are written
  in a circular fashion in the doublewrite buffer and only read on
  recovery. So the doublewrite buffer performs mostly sequential writes
  and a few sequential reads. Second HDDs are very good at sequential
  write if a write cache is enabled, which is not the case of SSDs.
  Therefore you should choose a fast HDD if you want to see performance
  benefits from this option. For instance, you could place the redo logs
  (also written in a sequential way) and the doublewrite buffer on the
  same disk.

What can we learn from this ?

The doublewrite buffer is a circular buffer. It is subject to pending writes when it is full.
The fact that the doublewrite buffer can get full proves that growth is never an issue.

CAVEAT
Looking at the InnoDB/XtraDB Architecture, it says that the Undo Logs can grow unllimitedly. That is the source of uncontrolled growth in the system tablespace.
Your Actual Question

How big can grow innodb_doublewrite_file? How to calculate optimal disk size, if it would be used only for this file?

Nothing in the Documentation states a way to set a size or know its limitations. It only recommends placing the doublewrite file on a fast HDD.
CONJECTURE (OK I am guessing at this point)
If there is no limit on the doublewrite buffer size, then the number of blocks that make up all the data and index pages would be the maximum size. You would run this query:
SELECT
    ibbytes InnoDBSpace,
    ibbytes/POWER(1024,1) InnoDBSpaceKB,
    ibbytes/POWER(1024,2) InnoDBSpaceMB,
    ibbytes/POWER(1024,3) InnoDBSpaceGB,
    ibbytes/POWER(2,14)   InnoDBBlocks
FROM (SELECT SUM(data_length+index_length) ibbytes
FROM information_schema.tables WHERE engine = 'InnoDB') A;

These numbers assume that every block of data and index for InnoDB has a place in the doublewrite buffer to go to.
A more realistic number may be this:
SELECT
    ibbytes InnoDBSpace,
    ibbytes/POWER(1024,1) InnoDBSpaceKB,
    ibbytes/POWER(1024,2) InnoDBSpaceMB,
    ibbytes/POWER(1024,3) InnoDBSpaceGB,
    ibbytes/POWER(2,14)   InnoDBBlocks
FROM (SELECT (variable_value * POWER(2,14)) ibbytes
FROM information_schema.global_status
WHERE variable_name = 'Innodb_buffer_pool_pages_data');

These numbers are going by the actual working set in the InnoDB Buffer Pool
I hope this little explanation helped you !!!


Does Ireland have any other MEPs than Claire Daley and Mick Wallace, and why does it have such antiwar MEPs compared to seemingly

Question: Claire Daley and Mick Wallace are both extremely anti NATO and anti war. And they are both from Ireland. Is such sentiment really simply so strong throughout the electorate of the ROI? Is there some other explanation? Do they constitute 100% of the Irish MEPs? Do all countries have an equal number of representatives? Otherwise how are they allocated?
Comment: Why don't you just Google such basic facts as Ireland MEP? The first link goes to the Wikipedia page. And I have copied the link, but it is so basic that I refuse to even pasting it.
Comment: You need to pick one question and focus on it.
Answer: First question:
Ireland is not the only country with anti-war MEPs. Clare Daly and Mick Wallace are members of the GUE/NGL, which has 37 MEPs from about a dozen countries. A number of member parties of the GUE/NGL are critical of NATO and the Western defense assistance to Ukraine.
However, the election did take place before the Russian escalation of the 'frozen' conflict in 2022, so that cannot be used to gauge the mood of the electorate.
Second question:
The number of Irish MEP is extremely easy to google. The number of seats is set by treaty, and smaller countries are somewhat over-represented on a per-capita basis.
Answer: Ireland has 13 MEPs. I don't know a lot about their positions on broader topics like NATO etc., but on a quick search, the two you've mentioned stand apart on some Ukraine war issues, as Irish Times reported on Jan 19:

Clare Daly and Mick Wallace were among 19 members of the European Parliament to vote against a resolution calling for the establishment of a special international tribunal to prosecute Russia's leadership for the crime of aggression against Ukraine.
The resolution was passed with 472 votes in favour and 33 abstentions in a European Parliament plenary session in Strasbourg on Thursday. Two of Mr Wallace and Ms Daly's fellow Left group MEPs, Sinn Féin's Chris MacManus and Independent Luke 'Ming' Flanagan, were not present for the vote. All other Irish MEPs voted in favour.

And according to Wikipedia, Daly and Wallace often travel together and embraced other "leftist" (or better said anti-Western) causes like Assad in Syria, Maduro in Venezuela, attacked the Belarus opposition (essentially embracing Lukashenko) etc. The two were among the 13 MEPs that voted against condemning Russia's invasion of Ukraine. (If you're curious, Greece "bested" Ireland on that with 3 MEPs opposing--two far-left and one far-right. But Greece has 21 MEPs in total.)
Furthermore, the 4 Irish MEPs in the Left (EU) group actually come from different Irish parties. Daly and Wallace are both from Independents 4 Change (I4C), which is more like a protest party that has very little national representation, but (like many other protest parties) does better in secondary elections like the EU ones. I4C attracted 0.4% of the (first pref.) vote in the 2020 national elections (and has one TD out of 160), but 7.4% of the (first pref.) vote in the 2019 EU elections. I4C did a little better in the 2016 national elections, when they got 1.5% of the (first pref.) vote, and so had 4 TDs back then. (Somewhat hilariously, Sinn Féin has only one MEP, but the 2nd greatest number of TDs in the last election, 37, and they had the highest share of the [first pref.] votes in that election, 24.5%. Sinn Féin performed [more] poorly in the 2019 EU election though, with only 11.7% of the [first pref.] vote.)
I don't know where Flanagan stands on Ukraine or NATO, but according to his Wikipedia page he was elected on an anti-EU platform, so it seems he's also a "protest vote", basically. Among the few positions that Wikipedia details about him, is that he wants Ireland to leave the eurozone.
Comment: What is a "secondary" election?


How to remotely degug msgina.dll?

Question: I have a fully customized msgina.dll in module i need to remotely debug it? Ho will i achieve this
Abdul Khaliq
Answer: For remote GINA debugging you can use the instructions on the following site:
http://pluralsight.com/wiki/default.aspx/Keith/GinaDebugging.html
The site was down when I visited it so take a look at the  Google Cache version
You can also do it using a single computer using the instructions at the link below.
http://support.microsoft.com/kb/260901
Answer: It's been some time since I last dug into GINA development.
What I did: was create a virtual machine with a version of windows for debugging (you'll also need the symbols I think)
You can map the serial port of the virtual pc and let WinDbg (debug tool that came with the windows SDK) connect to it.
I was able to succesfully debug and receive message from the moment windows started up. (and I used windows XP for development and the target OS, without any isseus)
This technique works even without the initialization of your GINA working, which is necessary in the technique explained in: http://pluralsight.com/wiki/default.aspx/Keith/GinaDebugging.html
A quick google turned up following detailed description to setup what I explained:
Using VMWARE:
http://www.etdot.com/2008/04/16/windbg-and-vmware/

How to remotely degug msgina.dll?


What does it mean for a Symplectic Form to be invariant under Group Action?

Question: This should be a very basic question for people familiar with differential manifolds. I'm more or less new to the field so let me apologize in advance for ill-defined questions if arising.
I split the question into 3 more specific ones.
Let $\mathcal{M}$ be a Differentiable Manifold and $\omega$ a Symplectic Form on $\mathcal{M}$.
I read the definition of a Symplectomorphism: A map $\phi:(\mathcal{M},\omega)\to(\mathcal{N},\omega ')$, s.t. $\phi^*\omega=\omega '$ where $\phi^{*}\omega(X,Y)=\omega(d\phi(X),d\phi(Y))$.
The Group Action $\Phi:(G\times\mathcal{M})\to\mathcal{M}$ of the group $G$ can be regarded as maps $\Phi_g:(\mathcal{M},\omega)\to(\mathcal{M},\omega)$ with $g\in G$.

Is the meaning of "invariant under Group Action $\Phi$" the same as "$\Phi_g$ is a Symplectomorphism for all $g\in G$"?

Example: $\mathcal{M} = \mathbb{R}^3$;
$\omega=\varepsilon_{abc}x^c dx^a \land dx^b$, $\varepsilon$ being the Levi-Civita symbol. (I know that on $\mathbb{R}^3$, $\omega$ cannot be a Symplectic Form, but on $S^2 \subset \mathbb{R}^3$ it should be.)

How do I show this form is "invariant under SU(2)"?

I found this statement in literature. I guess the statement implies the action on $\mathbb{R}^3$ should be taken "naturally" as SO(3) matrix muliplication.(?) To really understand what's going on I would like to see two ways of showing this: a very abstract way and a coordinate-oriented "just-calculate" way (only if possible of course).

If $\omega$ is a Symplectic Form then there is a corresponding Poisson Bracket via $\{f,g\}:=\omega(X_f,X_g)$ where $X_f$ is a Hamiltonian Vector Field.

How does the invariance of a Symplectic Form relate to its corresponding Poisson Bracket? More specific: There should be an equivalent equation for the poisson bracket expressing the invariance of the symplectic structure. How does it look like?

Thanks, that's it.
Answer:
Yes.
If $\omega$ is a volume form on $M$ and $f:M\to M$ a diffeomorphism then $$\left(f^\ast\omega\right)_x=\det d_xf\cdot\omega.$$ In particular, if $\det d_xf=1$ for all $x\in M$, then $\omega$ is $f$-invariant.
It's the case of the action of $SO(3)$ on $S^2$ by multiplication.
A diffeomorphism $\varphi : (M,\omega)\to(M,\omega)$ is a symplectomorphism iff it is a Poisson map, i.e. for all $f,g\in C^\infty(M)$:
$$\{f,g\}\circ\varphi=\varphi^\ast\left(\{f,g\}\right)=\{\varphi^\ast f,\varphi^\ast g\}=\{f\circ\varphi,g\circ\varphi\}$$


Does the number of files affect fsck's performance?

Question: Will a 100GB disk with 1,000,000 files take longer than a 100GB disk with 100 files when running fsck?
Comment: To be clear: Would the 1,000,000 files and the 100 files occupy the same amount of space?
Comment: @Dennis Yes, same space occupied.
Comment: most likely it will be slower.  It has to go through the list of filenames 1 at a time and verify they are correct.  How much slower is also dependent on the file system, and hard drive speed and processor speed.  Also if the filesystem code is code for multi threaded or not.
Answer: That depends on the file system and the switches you use with fsck.
What fsck Checks and Tries to Repair gives a pretty detailed explanation of what fsck does when invoked without switches.
Some of the checks take a constant amount of time (e.g., super block check),  many of them depend on the number of inodes fsck has to process (e.g., link count checks), others on the file system's size (e.g., regular data block checks).
Without the -c switch, fsck does not check the contents of regular files, so the size of the files is irrelevant. Even when checking for bad blocks, the execution time only increases with the file system's size. Which portion of the of the partition is occupied does not affect the execution time.1
The number of inodes of a file system is constant, i.e., decided upon at creation time. Each file's metadata is stored in one of such inodes. According to ext4, unused inodes are marked as such in ext4, but not in ext3. Thus, fsck's execution time increases with the file count in ext4, but is constant (and high) in ext3.
The following figure illustrates this:

Observe that the different file counts are represented by different colors. The graphs for ext3 with 2.1 million, 100 thousand and even zero files are identical. The graph for ext4 with 2.1M and 100k files respectively show a significant difference.
In contrast, execution time increases with the number of inodes with ext3, while unused inode do not impact execution time with ext4.

1 Verified empirically by running fsck -c on an empty partition.


Should I rewrite a large portion of code to make it more organized for my web application?

Question: I've been working on a LAMP application(a social network), and am about 4000 lines of code in, and have a working prototype. I learned PHP this way, and thus it isn't programmed very well, and am now realizing I should've used a MVC framework; either my own, or better yet, a pre-made one such as Laravel or CakePHP. If I plan on continuing to work on this project, should I go back and fix it?
Comment: IMO this is not a large portion of code, and you should refactor it right away if necessary.
Answer: Certainly. If you're only learning, it's more important that you rewrite code to learn from your mistakes, instead of trying to finish by force a poorly written system that competes with the thousands of other social networks out there.
The "build one to throw away" philosophy works very well for learning, less so when you're financially dependent on the system being finished.
Refactoring heavily (even throwing parts away completely, 4000 LOC is nothing) also allows you to identify problematic areas where you know you've done things in a clumsy way, put some questions to codereview.stackexchange and improve your code quality at the same time as learning a proper framework. I'm not a PHP developer, but I believe that Laravel is a popular and widely used framework.
Answer: It's ultimately a judgement call. For example, if your functional requirements are still somewhat of a moving target, then refactoring now may well be a waste of time -- later on, new or changed requirements may suggest another altogether different functional decomposition. That's what usually happens to me on the first cut of any new development project.
A more balanced approach may be to "mess around" with your code for a while, until you get a reasonably good feel for the project's ultimate "destination". Then you can better think about the best way to get to that destination. Of course, at that point you may have a (much) larger "mess" of code to refactor. That's the judgement call part.
Refactoring should better express the functionality as reusable abstractions, i.e., as intuitively sensible abstractions that can be composed in a reasonably straightforward way to implement the desired functionality. So, when is the functionality well-enough and stably-enough defined to permit that?
If you refactor too early, you'll either have to do it all over again, or you may be tempted to live with your first, sub-optimal, refactoring effort. Either choice is bad, or unfortunate. Alternatively, as mentioned, refactoring too late involves juggling a bigger mess.
I've done both. Indeed, you can't really ever get it exactly right (if there is such a thing). Since you're asking the question, I'm guessing you don't have much experience at this sort of thing. And in that case I'd further guess you maybe should "mess around" a little more. Refactoring at the first moment the idea crosses your mind is (I'd guess) likely too early. 4000 lines of code may sound like a lot, but it really ain't.


What causes electronic shutter to be permanently selected on an FZ300?

Question: I have a Lumix DMC-FZ300, my silent mode is off. The flash and shutter type are both grayed out and my shutter type is stuck on electronic shutter so my flash won't work. How do I make it so neither are grayed out?
Comment: What mode are you in? If you're in iAuto the camera takes control. Try it in Program, Aperture or Shutter Preferred
Answer: 4K Photo Mode forces the shutter to electronic. In any case, the flash simply cannot keep up with 30 FPS shooting.
The 60 FPS Burst mode which captures images at 60 FPS also forces the shutter to electronic.
Should none of these apply, Resetting the camera is a decent option. You will have to set it up again but that will make you figure the culprit.
Answer: There's actually a separate setting to control the shutter type.
Menu > Rec > Shutter Type
Below is a link to the page in the user-manual, in case you would like more information.
https://www.manualslib.com/manual/1048484/Panasonic-Lumix-Dmc-Fz300.html?page=159
Answer: The camera will not access certain functions when the current mode is incompatible. The pop-up flash needs a manual shutter, not the electronic shutter. But manual shutter also needs 'Silent Mode' to be 'OFF'.
So, to get the flash working:

turn Silent Mode to 'OFF' (in the Custom Settings tab)
change Shutter Type to 'AUTO' or 'MSSHTR' (in the Rec Settings tab)
pop up the flash and shoot.

Note that the lens hood partially obscures the pop-up flash, so it will need to be removed to get a proper photo.
Other modes may also render the flash and/or manual shutter inoperable/inaccessible.
Comment: OP stated: "silent mode is off".


scanimage on ADF not working with --batch

Question: I want to scan multiple file with an ADF.
This is my device:
luca@luca-server:~$ sudo scanimage -L
device `xerox_mfp:libusb:001:006' is a Samsung SCX-3400 Series multi-function peripheral

If I run this command:
luca@luca-server:~$ sudo scanimage --batch --format=tiff

It scans correctly the first page on the ADF.
But then it flushes all the other pages!
This is the output on a test with three pages on the ADF:
luca@luca-server:~$ sudo scanimage --batch --format=tiff
Scanning -1 pages, incrementing by 1, numbering from 1
Scanning page 1
Scanned page 1. (scanner status = 5)
Scanning page 2
scanimage: sane_start: Operation was cancelled

The --batch-prompt option does not solve the problem because it only says that the ADF is empty on the next page that has to be scanned. (Because it flushed all the pages after the first scan)
How can I solve the problem?
Answer: scanimage --source ADF --device-name=$device --resolution $resolution --mode $mode --format=tiff --batch=scans/out%d.tiff --batch-start=10
worked for me
Comment: --batch-start=10 <--- for better sorting


Documentation for Usage of the API Key in AtTask

Question: The countdown dashboard released by AtTask makes use of the API key. There is no documentation on how to use this, what level of security it provides or if there are any other features associated with it. It appears that usage is as simple as adding &apiKey=thekeyhere to the URL.
Does anyone have any more detailed documentation on this feature?
Answer: I have since figured this out. For anyone with a similar question, all you need to do is add apiKey= to the URL. For example
https://idt.attask-ondemand.com/attask/api/v4.0/task?apiKey={your API key here}
That's it. Please keep in mind that an API key is linked to an admin account and will have the effect of giving admin access to any user working in the tool you have created. Obviously this only applies to functionality that you expose to the user.


how many years will it take to achieve six-sigma quality?

Question: Suppose a business is operating at the three-sigma quality level. If projects have an average improvement rate of 50% annually, how many years will it take to achieve six-sigma quality?
Comment: That's a homework?
Answer: What do you mean by "average improvement rate"? If you mean that the number of faulty products are halved every year, then it is simply an exponential model that you are looking for.
$3\sigma=66,807$ faults per $1,000,000$
$6\sigma = 3.4 $ faults per $1,000,000$
An exponential model of faults is then given by
$f(t)=f(0)(1+r)^t$, with $r = -0.5$, which can be solved as follows:
$3.4=66,807*0.5^t \leftrightarrow {3.4 \over 66,807} = 0.5^t \leftrightarrow \log({3.4 \over 66,807})=t\log(0.5) \leftrightarrow  \\ {\log({3.4 \over 66,807}) \over log(0.5)} = t$
$t=-9.8859/-0.693 = 14.265$ years. Or 14 years and 97 days.
Comment: Then **t** = -2.34 ? There might be an error. :(
Comment: Please see the edit by Tacio above.


What is the range of ECM jammer in Payday 2?

Question: What is the range of ECM jammer in Payday 2? Let's say I put it in the middle of the jewelry store's shopping room in the Jewelry Store Heist mission, how far it will reach?
Answer: One Jammer will cover the entire map.
There is further discussion about the topic in the above link on the PAYDAY 2 Forums, but the people who HAVE tested it believe that it covers the entire map.
Comment: I would like to see more confirmations, but since this is the only answer with at least some suggestive investigations done in the given link, I'm accepting it as an answer.
Comment: Interesting.  That being, a precision that might worth it, from the thread you mentioned: *Exception here. The camera who's "turn off" temporaly needs to be on the building with the jammer*
Answer: The exact range of ECM is unknown, however, the range is limited and might or might not cover the whole map depending on its size. Update #12 shed some light on this question with the following.

Buffed the ECM jammer by increasing the range -- source


Syncing photos Android -> Mac

Question: I would like to accomplish the following, which, in today's technological ecosystem, seems like it should just happen anyway:

I take a photo on my Android phone

The phone uploads it somewhere automatically (presumably Google Photos)

My Mac downloads it automatically into a folder

In other words, I want the photos on my android device to seamlessly appear in a folder on my Mac, without me needing to do anything besides take the photo.
I have Google Drive installed, but my photos don't seem to be there. I tried installing "Google Backup and Sync", but it crashed immediately and I can't get it to work. (I'm on OS X 10.11, so maybe that's why. I don't intend to upgrade until I get a new machine.) I've head that Google Backup and Sync is quite complex and fiddly to use anyway.
Is there any other way that automatic photo sync between Android and Mac can be accomplished? If possible, I'd prefer not to use Dropbox, because mine is nearly full and I already pay for additional space on Google Drive, so I don't want to upgrade Dropbox as well.
Answer: One way to accomplish this is with Microsoft OneDrive. The main barriers to this method are:

You need a paid Office365 account to get the 1 TB storage
You need to be on Mac OS 10.12 or newer

It has the same functionality as Google Photos where you can have all your photos automatically upload from you phone. Then you can sync them to your computer using OneDrive for Mac.
Sounds like you weren't planning to upgrade Mac OS, but if you already have an Office365 subscription and the upgrade would make the difference, this could be an option.

Syncing photos Android -> Mac


How long did the Mercury astronauts have to stay in the isolation tank?

Question: Among the many things Mercury astronaut candidates had to go through, they had to go through a sensory deprivation experiment and spend some time in a sensory isolation tank. How long did they have to stay in the isolation tank to qualify?
Answer: Three hours, according to Space Medicine in Project Mercury, p. 55:

Isolation: Subject goes into a dark, soundproof room for 3
hours to determine his ability to adapt to unusual circumstances
and to cope with the absence of external stimuli.

There's a picture of Deke Slayton taking the test on p. 56.  It's a chair in a dark room; there's no tank.
Comment: It's kind of hard to see what's going on in that picture!


How to know "your number" for a machine haircut in a foreign country?

Question: When traveling for an extensive period of time, you may need to get a haircut in a country where you do not speak the language.
I usually get a machine haircut and just saying or showing the number (length) is easy enough (you would think).
However while in the UK I usually get a 'five' and that also works in the United States and many countries in Asia, the same length in Germany is a 'twelve'.
I just came back from a haircut here in Morocco and it seems they are using 'the Spanish system' and what seems to be the same length of hair cut was a 'two'.
Is there a system behind this madness? What do these numbers actually mean?
Is there a table somewhere online that compares the different numbers and lists the countries they are used in?
Comment: I think in Germany they are using mm, in morocco they are using cm...in the US they are using the fifth trimmer guard which is around this length (2 cm). I am just guessing.. most likely I am wrong.
Comment: I'm not sure what a "machine cut" is, but one strategy might be to show the barber a picture of you with your hair at the desired length.
Comment: I was pleasantly surprised numbers in Croatia were (at least approximately) the same as back home in the USA--and subsequently quite confused that the numbers in Singapore have the opposite relationship with hair length (#4 is shorter than #3, for instance)!
Comment: Hmmm, sixty-some years and i never heard of a number system.  I described in detail how long I wanted it, reinforced with pointing where it should end, and the guy did what he wanted anyway.  .... Oh, I'm a little slow; you're talking about thickness or depth, not length.
Comment: I would assume pointing with two finger would be universal? Better than the numbers, which are also confusing for clothes, shoes, etc.
Comment: Depends on what the number means. 5 could mean 5th  setting of the machine (which could be totaly random), 5mm, 1/5 Inch, or something completely different. I always tell them the length in mm which is pretty universal. If someone doesnt know what mm means,  you could explain or show with your fingers.
Comment: In a barber shop in Japan, I was asked by an elderly lady who owned the barber shop and was cutting my hair "Longu? Shortu?" I got out my mobile phone in typed the kanji for middle ("中").
Comment: I won't put this in for a bounty, but to directly answer your question, you carry the clipper attachment from your native country with you. It's plastic and its weight is negligible. You can show it to the barber and be confident that the correct size will be used.  As a big time advantage, you don't even need to know the language!  Show and tell :)
Comment: @GayotFow - that's a great idea. But by now I'm not doing clipper cuts anymore. A scissors cut is the same price and I actually like the fact that I don't know what I get at the end. And every gram counts.
Comment: I tried that in Laos once, it went horribly wrong.
Comment: I admit I always thought the number was standard... never really thought it changed from place to place... I just learned something today
Comment: @NeanDerThal: "I think in Germany they are using mm" - indeed, in Germany, mm and cm are used. In fact, I have never heard anyone here refer to this as a (unitless, abstract) "number" rather than explicitly referring to "hair length" and saying "10mm", "11mm", or "1.2cm", etc.
Answer: In Spanish Wikipedia, Hair clipper article has an explanation about that. I'm Spanish and I have always seen this system:
(roughly translated)

Each number means 3 mm or 1/8 inches (= 3,175 mm).
Number 1: 3 mm - 1/8".
Number 2: 6 mm - 2/8" (1/4").
Number 3: 9 mm - 3/8".
Number 4: 12 mm - 4/8" (1/2").
Number 5: 15 mm - 5/8".
Number 6: 18 mm - 6/8" (3/4").
Number 7: 21 mm - 7/8".

Now I'm living in Italy and I bought here an electric clipper (Philips) that uses this same system.
If you went to Morocco and they used this system and nº2 is equivalent to a UK&US 5, it's pretty probable that you measure it in millimeters (maybe you already know it, anyway it is only my guess), but I have no idea what German number (12) can mean.
Maybe people from these countries can tell us how many millimeters it is "a number".
EDIT:
Unfortunately I can't speak German but I have googled for understanding UK & US notation and I have found this web. It seems to be American and, although it depends of the clipper brand, as an example this is the representation:

Blade - Length:
00000 - 1/125"
0000 - 1/100"
000 - 1/50"
0A - 3/64"
1 - 3/32"
1A - 1/8"
1.5 - 5/32"
2 - 1/4"
3.5 - 3/8"
3.75 - 1/2"

So my supposition above was wrong.
This other page, maybe American too, or perhaps international, shows a system like the Spanish one.
Answer: What I usually do is use pictures instead. The next time you get a good haircut, ask a friend to take a few pictures of your head or take some selfies. Then every time you go to a barber shop in any country show them these pictures and they will know what to do. A lot more reliable than trying to guess the local number system :)
Answer: This is a very old question but the truth is there is no real answer
All counties have different systems, having said that all (usually) follow a simple rule - which do they use day to  day? imperial or metric? If its metric its 3mm per grade and 1/8 if imperial. This is the only answer to this kind of travel problem without listing every single country
Overall the best way of dealing with with this problem is to show them a photo
If you like this please also like @machlas answer as its absolutely correct (as far as it can be) but offers no solution to the problem - so while it doesn't answer the question you should take a photo if you are unsure and think you will stay long enough to need a haircut
Comment: 3mm and 1/8" are close enough to make no difference. That is *not* what this question is about.
Answer: In the US we use the 8th inch system:
1 = 1/8 inch
2 = 2/8 inch
3 = 3/8 inch
4 = 4/8 inch
5 = 5/8 inch
6 = 6/8 inch
7 = 7/8 inch
8 = 1 inch
However, I live in Rome, Italy and when I go to a barber sometimes they use this system and sometimes they use another system, which may just be millimeters. I had a really bad surprise this way last time I went and lost all of my hair. In both the US and Rome most barbers I have seen use Wahl brand clippers.


Escaping only what is necessary, is that possible?

Question: I am working with a team of developers on a website. The website will be using classes. I am in charge of creating the data access layer for the classes. There is an understanding that all user input will be escaped upon retrieval (from the post or get). Having little control over the input level (unless I personally review everyone's code), I thought it would be cool to throw in escaping on my end as well (right before it hits the database). The problem is that I don't know how to use mysql_real_escape_string without adding even more slashes.
Since user input may very well contain a slash I can't check to make sure there are slashes in it. I might be able to check for all the things that need escaping and make sure they have a slash in front of them, but that doesn't seem like the best way to do it.
Any suggestions?
Answer: There is no way you could add an automatic decision to escape or not if you don't know if the input has been escaped. You can attempt to analyze it but it will never be good and you will encounter double backslash pairs and such.
Take the decision once that data sent to your access layer should be clean and handle the escaping in one place. If you do, the other developers will not have to worry about it (they probably don't want to anyway) and it will be much easier to move to another database in the future. It will also give you the freedom to move over to prepared statements at any time.
Edit: Forgot this:

Having little control over the input
  level (unless I personally review
  everyone's code)

I think it is worth the pain to have them discover it themselves if you just make it very clear that escaping is something that belongs to the database layer and should not be done elsewhere.
Comment: +1 for 'handle the escaping in one place'. Wish I could give you +5 for this ;-)
Answer: Have you considered not escaping the data until it hits the data access layer? I ask, because their are some gotchas with the approach your team is taking:

If you need to display form data to the user (e.g., to redisplay the form with an error message because some validation failed), you need to de-escape the data (because ' is not special to HTML) and then re-escape the data (because < is special). If you need to display form data to the user pulled from the database, you mustn't do that de-escape step (because it was done by the database, when the data was saved), but still must do the HTML escape step. If you make a mistake and do the wrong procedure, you corrupt data or worse introduce security problems.
You can deal with the different formats from different sources problem by decided all data passed around your app will be escaped. So, your data access layer will re-escape the data upon getting it from the database. But, as different parts of the app need slightly (or completely) different escapes, this quickly leads to a lot of de-escape/re-escape nonsense. Grab the data from the database, escape it, de-escape it, escape it for HTML, output it.
Your front-end form handling code has to have intimate knowledge of your database. For example, what does \' mean to your database? How should a ' or \ be escape — if at all? If you ever change your database engine, or even change its settings, those may change. And then you have a bunch of escaping/de-escaping code to find. Missing a single escape/de-escape may lead to SQL injection.
Alternatively, you can take that knowledge of the database out of the front-end code by having the database layer do a de-escape/escape cycle to convert from your app-standard escape sequence to your database's. But this seems rather silly!

There is another way: Let whichever layer needs the data escaped escape it itself. Data is always passed between layers in raw, unescaped form. So your data access layer does all database escaping. Your HTML output code does all HTML escaping. When you decide you want to generate PDFs, your PDF code does all PDF escaping.

Now, when you do form output, its clear what to do: always HTML escape the data. No matter where it came from. Never run a de-escape.
There is now no de-escape/escape nonsense, as everything is passed around raw. It is only escaped when necessary.
Your front-end code doesn't care about the data access layer's implementation. The data access layer stores and returns any arbitrary string.
You have only one place to look in your app to make sure you have no SQL injection problems.
You can easily make use of database driver features such as placeholders. Then not even your data access layer needs to be aware of each database's escaping requirements; the database driver handles it.
Answer: If I were in your position, I would not be lazy enough to not review everyone's code.  Even if you're not reviewing for the escaping of the user input, you still might want to see if their code is done efficiently.  Or perhaps, it's not you to do the reviewing, but someone has to do it.
I've experienced an almost similar setup no so long ago where we divided the tasks by layers.  One worked on the model, I worked on the controller, and the other one worked on the views.  Because we trusted everyone so much that everybody else's code will work the way we expected it to work, we didn't bother reviewing the other's code until the time that we needed to merge them.  What happened was we discovered inefficient code in the model late in the development. And it wasn't just inefficient, it didn't work! Because of that, we had to overhaul huge chunks of the code which cost us more time.
I suggest that you create a technical requirements specifications document where it is specified in it the acceptable inputs from the users. This document should be followed by the ones who will code the part that will accept the user input.  Better yet, create unit tests to see if those requirements are being followed strictly so you do not have to worry if the data they're going to pass to you is invalid.
Another thing... since you're using PHP, why not use a good framework? Most available frameworks come with their own DAL where you no longer need to worry a lot about escaping database input (well, not that much).  The frameworks should do it for you.
Also, you might want to look at 'prepared statements'.


Can't update extension: "You will not be able to install/upgrade Edit Line Item Extension until you have installed the org.civicrm.afform extension"

Question: My Edit Line Item extension stopped working.  It looks like it needs an update, but update fails with the error "You will not be able to install/upgrade Edit Line Item Extension until you have installed the org.civicrm.afform extension".
On the face of it, it seems I have exactly this same problem (Can't upgrade Mosaico Extension from 2.8XXXX to 2.9 without Afform but no Afform Ext. Available in Joomla)
But I do have Form Core installed and up to date (I think? says it's a prerelease version).
Details:
Joomla
CiviCRM 5.66.1
Edit Line Extension v2.6 (wants upgrade to 2.7)
Form Core 5.66.1
Based on other research, it seems Afform/Form Core was an external extensions that became part of core? So maybe this is an out of date dependency problem?  Anyway, how do I fix it? Do I simply need to update Civi to the latest?
Thanks as always!
Answer: Afform is shipped with core and is now automatically enabled.  I'd upgrade Civi then try again.
Comment: Thanks Aidan, will do so today and see how it goes.
Comment: It took a while but eventually I did update Civi to 5.70.0, and was able to install the extension.  (The extension itself isn't working properly, but that's another issue....)


Data migration from MS Dynamic 2011 to Salesforce

Question: How to migrate the data from MS Dynamic 2011 CRM to Salesforce? is there any API? Please help me on this.
Comment: Data migration is a huge subject - in simple terms it is a case of map the Dynamics Data Model to Salesforce then deal with the issues identified, such as missing fields, different formats, picklist values, etc. Then extract all the data into a compatible format like .csv and then load it. There is not a specific API for migration. This is far too broad for a question here. please see [ask]
Comment: Hi, and welcome to SFSE! I'd like to take a moment to invite you to read about what's on topic ([help/on-topic]). Specifically, we don't do product recommendations here. If you want help, consider asking about two or three specific products and/or features, so as to narrow down the scope of the question in a way that allows a potentially objective answer.
Comment: Hi sfdcfox, thank you for your reply. And, i have updated my question. Can you please help me
Answer: Depending on the complexity of the data, it might be as simple as exporting the data as a CSV, then using the Data Import Wizard, or slightly more complicated, by way of the Apex Data Loader. Both tools require the data in particular formats, which you can read about in the related help topics for each of the above links.
If that ends up being too complicated, you might start looking on the AppExchange. As long as you can get the CSV data, there are lots of options on the AppExchange. Please note that you'll need to do your own research here, as we don't do product recommendations.
Finally, doing a simple search on the internet for "migrating dynamics crm data to salesforce" should yield a lot of useful results. For example, there are some applications that can connect to both systems and act as a two-way bridge for the data. There are various costs (usually subscription-based or volume-based), so you will need to do research for the product(s) that suit your needs and are within your budget.
There is no "one right way" to do migration, and what works for me or someone else might not work for you, so if you do decide to purchase/subscribe to a service, make sure you research a few alternatives first. It is entirely possible to migrate all your data for free, but the Data Import Wizard and Apex Data Loader takes some time to learn and get used to; if you just want to "get it done," you're probably going to have to pay someone for the service.


Income Tax Filing for Invoices that are for client supplies/infrastructure

Question: Can someone provide me information on how taxes are impacted in the following scenario:

I am a web developer
My clients are charged for infrastructure setup
fees (such as hostnames, servers, etc)
These fees are reflected in my invoice in addition to my hourly rate Paypal sees it all as
income, but a large percentage is not income since it is fees for
infrastructure/supplies for my client (that they could have paid for).

Is there documentation on how I file this difference come tax season? Is it really all considered income since I am not actually gaining any profit? I am using Paypal to do invoicing (so they send me a 1099-K).
Thanks
Answer: You'll include the various costs you incur as expenses when you file your taxes and they won't be included in your taxable income.


Allow access only to specific request

Question: I have an iOS app that communicates with an Apache 2.2 server. I would like to restrict the access to several directories so that only the app will be able to access them (no browser access, no crawlers, etc). What are my options?
Answer: Run Apache on a non-standard port, like 8574. This first step will eliminate 99% of the "noise" you're expecting from robots and scripts.
The specific piece of configuration you want in Apache is mod_authz_host. It'll let you filter requests for access based on a variety of factors that Apache terms "environment variables," including the user agent. You could Allow from your custom user agent, then Deny from all.
CAVEAT: With all of that said, filtering based on user agent is not the correct way to implement what you want. Server-side controls are only the beginning of securing your application against unauthorized access. Authenticating to a web service (such as what you are developing) should be implemented using some kind of API key. Many REST APIs do exactly this. If you are not sure as to how to implement key-based cryptography, consult an expert (or face the consequences).
FOLLOW-UP: Implementing public-key cryptography is one of many ways to do the job correctly. Before you dig in, let me say that you're in for a world of hurt. Check out the indispensable "Everything you need to know about cryptography in 1 hour." Note that he says the phrase "consult a cryptographer" six times in the presentation. At its simplest, your server should be able to answer the following questions in the affirmative for any request:

Can I guarantee that this request came from the iOS app?
Can I guarantee that this message hasn't been tampered with?
Can I guarantee that this user is who they claim to be?
Can I guarantee that this user is authorized to do what they're asking to do?

As you can see in the presentation, even well-known APIs like Amazon's don't always get this right. I believe you need an expert on your team, at least to get this part of your application correct.
Comment: OK, so the *right* way to do it, is to limit the access to the webservices using a public/private key? The app ALLWAYS sends the public key when it makes an request? Can you please give an example in a nutshell?
Comment: Pretty much this, though I'd add a bit: it really depends on _how much_ you actually want to hide it. User agent check would be bare minimum since it can be easily changed by the user. An upgrade of that would be requiring custom headers to be sent by the user - while technically not harder to implement on their own, it would be a bit harder to do from within a browser (at least for most users). What you'll choose really depends if you really want to make it 100% to anyone not using the app or just have very hard to access from a regular browser.
Comment: @Joel, I'm trying to learn myself, why would I ask a question on SO otherwise. Plus, the protected info is not vital (doesn't cost $$ if lost), still I would like to do my best to protect it.
Comment: Unfortunately since we can write a book on the topic, it's off-topic. http://serverfault.com/faq#dontask You are highly encouraged to learn all you can about cryptography and ask more specific questions once you've done some legwork! Check out the Security site at http://security.stackexchange.com

Allow access only to specific request


What happens when contributions exceed IRS Retirement Savings Plan (RSP) limit?

Question: IRS has Retirement Savings Plan (RSP) limit of $19,500 for year 2020. What happens if I make more contributions than this limit? Do I need to pay additional tax now? (I am less than 50 years old, having only 1 full time job.)
Comment: How many jobs do you have?
Comment: only one job, fulltime
Answer: Your employer will typically not allow more than the limit to go in there. Your contributions simply stop when reach the limit.
Note that this is not a good plan to try - if your contributions stop, the employer match stops too for the rest of the year, so you could lose out. Make sure to not reach the limit before the end of the year, so you can still get employer matching.
Comment: Agreed. Unless the employer has a "true up" policy. Which should be somewhere in the company's benefit policy docs.


Strange use of dynamical programming principe

Question: I am in a finance seminar and yesterday evening we had a lecture from a quant in a big bank about shortcomings of Heston model.
He was deriving the Heston PDE. (I know how to derive the Heston PDE when you set up a portfolio with cash and two options etc, but I have a problem with this new method.) He took a portfolio (self-financed for sure but he did not mention it) where we sold an option and we delta-hedge it with a "functional" quantity $\Delta$.
Noting $S$ the underlying and $V$ the variance he noted $U(t,S_t,V_t)$ the P&L of that portfolio. (He did not mention why that P&L is necessarily a function of $S$ and $V$, I guess it has to do with the fact that the Heston model is a markovian model, but I don't succeed it proving that the P&L must have this form. Same question for $\Delta$ I guess.)
After that he defined $$m(t,S_t,V_t) = \mathbf{E}\left[ \left. U(t,S_t,V_t) \right| \mathscr{F}_t \right]$$ and $$W(t,S_t,V_t) = \mathbf{V}ar\left[ \left. U(t,S_t,V_t) \right| \mathscr{F}_t \right]$$ and he said that he was going to derive PDE's satisfied by $m$ and $W$ and that from these PDE's he will then derive a PDE satisfied from the option's price.
To derive the PDE for $m$ he wrote that we start to write the dynamical programming principle as follows : $$m(t,S_t,V_t) = \mathbf{E}\left[ \left. \left( U(t+dt,S_t + dS, V_t + dV) + \Delta \left( dS_t - rS_t dt \right) \right) e^{-rT} \right| \mathscr{F}_t \right].$$
I don't understand at all what he meant by that.
Answer: I think it's hard for anyone that wasn't there to answer but if I had to guess I think he referred to Bellman's principle of optimality.
Comment: It is possible to formulate the Dynamic Hedging problem as a Control Theory problem (that is dynamic optimization over time). The goal is to choose $\Delta$ to maximize the discounted P&L of the hedged position. As mentioned by Bob Jansen the equation above can  be derived from  Bellman's Principle.


Why doesn't a short-circuit immediate consume all voltage?

Question: If we assume a short circuit, with zero resistance (not even within the battery), would this 'infinite current' deplete all voltage within the battery? For example, if I "short" a 9V alkaline battery, it will run for about an hour (though the wire gets pretty hot, if not melts) until it depletes all its power. Is this only because the battery has internal resistance, or why does the battery 'keep running'? Additionally, does a battery ever give its Amp-hours or how long it can run?
Comment: If the wire has 0V across it, how can it be getting hot?
Comment: somewhat related: [Short circuit = zero voltage?](https://electronics.stackexchange.com/q/360161/7036)
Answer: Because in the real world there is nothing such as a perfect wire or a perfect battery. There are parasitic resistances, inductances, and capacitances everywhere.
Plus there is the issue of the chemical reactions in the battery that is taking place to produce that electricity. That can only happen so fast even if you had a battery with zero parasitics.
Also, I find it pretty hard to believe that your shorted 9V runs for an hour. What is your definition of depleted? Batteries are considered dead long before they reach 0V in the same way you are too tired to do useful work long before you drop dead from exhaustion. I can only assume you are talking about reaching 0V across the terminals for purely academic purposes.
Comment: yes, something like 0V. Also, I didn't let it go down all the way to zero, I stopped it a bit before to do a few measurements on it when it cooled down.
Answer: Just so this actually has an answer: yes, it is because the battery has internal resistance and because your wire is not an ideal short circuit.
Information about the capacity of a given battery can be found in the battery's data sheet, which should be available from the manufacturer. However, batteries are generally not designed to used with an extremely high load current like this so the actual capacity with a (near) short circuit is probably much less than what the manufacturer has specified for a more reasonable load scenario.
Answer: The bigger the battery in a single cell, the lower it's internal resistance. Of course battery chemistry like electrolytic caps has a wide range in ESR (effective Series Resistance)  So shorting its voltage across it's internal ESR will produce the short circuit current.  This is dangerous on Lithium cells and lead acid cells due to the energy stored.  Voc/ESR=Isc  But for Alkaline which has almost the same energy of Li Ion cell it is safe since Alkaline has a higher ESR.  We call the voltage drop with load resistance, Load Regulation Error, measured @ Amp with % V error also being a ratio of ESR to Load R.
For bigger battery short current pulsses Isc must be safely. It is not necessary to go to 0V to measure ESR, since you now understand where Load regulation comes from with ESR=ΔV/ΔI.
Although this image has slightly more energy than a Lithium cell both have a thermal runaway effect, once the activation energy threshold is reached. It accelerates to fuel a lower resistance with exothermic reactions of heat to ever increasing currents.  In the case of a nuclear bomb, it takes a hydrogen bomb to Trigger it. Once triggered it has a negative incremental ESR , so the rise time is so short, it's equivalent bandwidth BW=0.35/Tr  reaches gamma wave frequencies.
Comment: Skill Testing question. How many cells are in a 9V alkaline battery. If the total resistance was 9 Ohms what is each cell's ESR?


Changing grid label style in ArcGIS for Desktop?

Question: In  all my maps the grid labels looks like:

I try to find a way to change it to that label style:

I work with version arcview 10.3. I seek in data frame properties-->grid-->style - but didn't found any suitable example.
Answer: There is a Make Grids And Graticules Layer tool that may enable you to do this:

Creates a grouped layer of feature classes depicting grid, graticule,
  and border features using predefined cartographic specifications. Grid
  layers are ideal for advanced grid definitions which are scale and
  extent specific.

I have not used this tool personally, so you may need to experiment with it.


How do I verify that my CSRF fix is successful using Burp?

Question: I know I can use the the Generate CSRF PoC feature to test whether I have a CSRF vulnerability but once I mitigate this, how will Burp recognize this fix on the next scan? I need to be able to demonstrate to the client that the vulnerability is no longer present by running a Burp scan.
Answer: For any CSRF issue, the general demonstration of prevention is showing that repeating the same request with the same preventative token, or with no preventative token, doesn't result in any data on the server changing.
Therefore, perform a legitimate request, send it to repeater, and try performing it again. If it works, the CSRF protection isn't working.
Then remove the CSRF token and send it again. If it works, the protection isn't working.
Comment: That doesn't solve the problem. With a session based token, replay attacks are still possible, since the token doesn't change on each request. It's harder to abuse, but still possible.
Comment: OK I see. But we would use a session based token. Not a request based token.
Comment: Right but how does one do request based tokens with pages with dozens of ajax calls?
Comment: I have seen systems where each call returns a token, and later calls use the previous response. It tends to be a bit of a nightmare of nested calls though. I'd suggest limiting the validity time of each token and refreshing it every minute or so, and combining it with a check on suspicious behaviour (depending on your app, might be possible to do lots of bad things in a minute!) - the specific solution would be app specific though


Basis for solutions hypergeometric differential equation

Question: In the book "Theorie der gewöhnlichen Differentialgleichungen" by Bieberbach, page 240, there is a solution to the hypergeometric differential equation
$z(z-1)w^{\prime \prime}+(2z-1)w^{\prime}+\frac{w}{4}=0$.
This equation corresponds to the hypergeometric function $F(\frac{1}{2},\frac{1}{2},1;z)$. In general, a basis for the solution of the hypergeometric differential equation $$z(z-1)w^{\prime \prime}+(z(1+\alpha+\beta)-\gamma )w^{\prime}+\alpha \beta w=0$$ is given by $F(\alpha, \beta, \gamma;z)$ and $z^{1-\gamma}F(\alpha-\gamma+1, \beta-\gamma+1,2-\gamma; z)$. However, when $\alpha = \beta=\frac{1}{2}$ and $\gamma=1$, these two solutions coincide. In order to remedy this, the author considers for the first basis element the function $w_1=F(\frac{1}{2},\frac{1}{2},1;z)$ and for the second
$w_2=F_1(\frac{1}{2},\frac{1}{2},1;z)+F(\frac{1}{2},\frac{1}{2},1;z) \log z$, where $F_1(\frac{1}{2},\frac{1}{2},1;z)=(\frac{\partial F(\alpha, \beta, \gamma;z)}{\partial \alpha}+\frac{\partial F(\alpha, \beta, \gamma;z)}{\partial \beta}+2\frac{\partial F(\alpha, \beta, \gamma;z)}{\partial \gamma})_{\alpha=\frac{1}{2},\beta=\frac{1}{2}, \gamma=1}$. Of course one can check that this is really a solution, but my question is from where, exactly, comes the operator $\frac{\partial}{\partial \alpha}+\frac{\partial}{\partial \beta}+2\frac{\partial}{\partial \gamma}$? How one should get this idea?
Answer: Cannot be submitted as a comment. Your question should be adjusted in view of the output of the Maple 2017.3 command
dsolve(z*(z-1)*((D@@2)(w))(z)+(2*z-1)*(D(w))(z)+2*w(z) = 0);

$$w \left( z \right) ={\it \_C1}\,
{\mbox{$_2$F$_1$}(1/2-i/2\sqrt {7},1/2-i/2\sqrt {7};\,-i\sqrt {7}+1;\,{z}^{-1})}
{z}^{-1/2+i/2\sqrt {7}}+{\it \_C2}\,
{\mbox{$_2$F$_1$}(1/2+i/2\sqrt {7},1/2+i/2\sqrt {7};\,i\sqrt {7}+1;\,{z}^{-1})}
{z}^{-1/2-i/2\sqrt {7}}
 $$
as well as the output of the Mathematica 22.214.171.124 command
DSolve[z*(z - 1)*w''[z] + (2 z - 1)*w'[z] + 2*w[z] == 0, w[z], z]

$$\left\{\left\{w(z)\to c_1 P_{\frac{1}{2} i \left(i+\sqrt{7}\right)}(2 z-1)+c_2 Q_{\frac{1}{2} i \left(i+\sqrt{7}\right)}(2 z-1)\right\}\right\} $$
Comment: @ user64494 : Sorry, but I do not understand what you mean! Could you be more precise? What are $C_1$ and $C_2$?
Comment: @Cyrus: The outputs are not of the form $ F(\frac{1}{2},\frac{1}{2},1;z)$ stated by you. As usualy, $C\,(c)$ stand for constants.
Comment: @ user64494: Yes! you are right, I edited the question, the last coefficeitn should be $\frac{1}{4}$ not $2$!
Comment: @Cyrus: In the case $+\frac 1 4 w(z)$ Maple outputs $$w \left( z \right) ={\it \_C1}\,{\it EllipticK} \left( \sqrt {z}
 \right) +{\it \_C2}\,{\it EllipticCK} \left( \sqrt {z} \right)
 $$. The executed code on demand.
Comment: @Cyrus: Also Mathematica performs $$ \left\{\left\{w(z)\to \frac{2 c_1 K\left(\frac{1}{2} (2-2 z)\right)}{\pi }+c_2 Q_{-\frac{1}{2}}(2 z-1)\right\}\right\}$$ in this case.
Comment: This computation is correct because the solution should be the elliptic integral as indicated in the book. However, my question was something else, by the way what if P and Q in the above?
Comment: @Cyrus: EllipticK and LegendreQ correspondently. What do you mean by " the hypergeometric differential equation "?
Comment: @ user64494: The DE given above in the question.
Comment: @Cyrus: Sorry, still don't understand your statement " In general, a basis for the solution of the hypergeometric differential equation is given by $ F(\alpha, \beta, \gamma;z)$ and  $ z^{1-\gamma}F(\alpha-\gamma+1, \beta-\gamma+1,2-\gamma; z)$ ".
Comment: The general HPG equation is: $z(z-1)w^{\prime \prime}+(z(1+\alpha+\beta)-\gamma )w^{\prime}+\alpha \beta w=0$. The above HPG equation is when $\alpha=\beta=1/2$ and $\gamma=1$.
Comment: It is true that some elliptic integrals and some Legendre functions may be written as hypergeometric functions.  And Maple/Mathematica prefer the elliptic integral or Legendre function forms (if they exist) to the hypergeometric forms.  But of course the hypergeometric forms are still correct solutions of the DE.
Comment: @Gerald Edgar: The conversion of the Maple solution for $ \alpha =  \frac 1 2 ,\, \beta  = \frac 1 2 ,\, \gamma =1 $ to hypergeom is $$ w \left( z \right) =1/2\,{\it \_C1}\,\pi\,
{\mbox{$_2$F$_1$}(1/2,1/2;\,1;\,z)}+1/2\,{\it \_C2}\,\pi\,
{\mbox{$_2$F$_1$}(1/2,1/2;\,1;\,-z+1)}
,$$ not the form in the question.
Comment: @user64494 ... And Maple used a hypergeometric with argument $1-z$ and not $z$ because the other solution is logarithmic at $0$, as shown by the form in the question.
Comment: @Gerald Edgar: Can you kindly base your claim? TIA.


New cat for my other cat

Question: I just lost my male 16 years old cat. I have a 5 years old female, very sweet but lonely. She is declawed in her front feet. I want to get her a new cat, what age, sex and with the claws do you recommend? They are inside cats.
Comment: The most critical thing is how you introduce the new cat. Others can advise better than I, but best practice seems to be to start by keeping the new cat segregated in one room and let them first "meet" by smelling /hearing each other through the door. After some days of that, you can open the door for supervised encounters;  expect a lot of grumbling and posturing, and be prepared to intervene if a fight seems about to start, but otherwise you can mostly let them negotiate for a while. Make sure the established resident gets plenty of attention between visits. Eventually,  leave the door open.
Comment: Agreed, [this is what can happen](http://pets.stackexchange.com/questions/10310/older-cat-doesnt-come-home-since-new-cat-is-here?rq=1) if you do it wrong.
Answer: I'm sorry you lost your male cat. Getting another cat will be good for both you and your female cat.
I would get an adult cat, not a kitten. A mature cat will likely be calmer, and less likely to annoy your cat. Plus, you'll be able to determine the cat's temperament. And you'll be giving a home to an adult cat (they are harder to find homes for than kittens). The sex of the cat isn't really important, assuming it's spayed/neutered.
I suggest that you go to a shelter and explain your situation. They'll know the temperament of the different cats, and will help you pick one that should settle in nicely with your cat. In my experience, shelter staff are very good at matching the right animal to the owner and situation.
Comment: I disagree that the sex isn't important. From what I understand, a dominant female will be much more accepting of another male then another female. Either might have territorial issues (or *maybe* both of these), but the same sex *will* have hierarchy disputes until it becomes established (if you're so lucky that that *ever* happens; I wasn't). However, an excellent answer.
Answer: As I'm sure you know, this is no small undertaking.  First, how long ago was "just"?  What behaviors is your 5 year old exhibiting that make you feel she is "lonely"?  I can tell you from extremely painful experience that you need to be very careful - it is not hard to find yourself in a situation where, though you had the finest intentions, at least two are miserable (and I'm including you).  Once you bring in another cat the die is set and the whole household has to live with the situation.
I strongly urge you to put this off as long as you comfortably can, and make the selection process as long as you can. Your female won't mind that you want to make the best decision possible. Who doesn't fall in love with kittens?  Yet they are so full of energy, so high maintenance, so in-your-face.
I also suggest you set some benchmarks, preferably with a vet's (or some other professional's) help, such as:

how will I work their feeding?
what do I do if a cat wants to eat the other cat's food?
what if they fight?
what would I like to see my house look like after 2nd week, 4th week, 6th week, etc.?

The more prepared you are for situations the better the process will work out.
I wish you - and your 5 year old - the very best!
Answer: I'd suggest trying to find a cat of the opposite sex that's close in age to your five year old. I've had a similar experience in bringing a second feline into the fray after losing one. Another thing to do is to try and spend some time with the cat you're considering adding to the family to make sure that it has a temperament that you feel is compatible with your current cat's. The times I've added on a cat I haven't ever really experienced problems, at least not after the initial hissing and spitting to determine who's the boss.
Something else to keep in mind is that while most of us treat our cats like they're our children, they are cats and the social hierarchy of animals is determined in a different way than that of humans. Try not to force anything. I've read about I don't know how many horror stories of people and their cats not getting along. I've never experienced it with any of the cats I've had and I have always ended up bringing another cat into the mix at some point. None of them have ever done serious damage to each other and I haven't had any that have constantly fought or anything along those lines. I'm sure it'll work out and you'll have a pair of lap heaters.

New cat for my other cat


SQLite Add Space After Commands

Question: Is there a way to automate adding a new line or two after each SQLite command I run in a prompt? I don't like having walls of unorganized commands and I have problems differentiating the actual commands with the end of each output.
Can they be separately colored? I'm using a Windows Batch file, so I doubt it.
Thanks.
Answer: I'm not sure how you're executing your commands, but you should be able to add some 'line breaks' by adding SELECT ''; in between SQL commands. This doesn't really work if you're outputting column headers though!
In Batch, if you're returning to the command line after each command, then use echo. to print a blank line.

SQLite Add Space After Commands


Reference for the Natural Ample Line Bundle on the Affine Grassmannian

Question: Let $G$ be a connected, simply-connected complex semisimple group. Let $$\mathcal{G}r:=G((t))/G[[t]]$$ be its affine Grassmannian. I have read that $\mathcal{G}r$ possesses a natural very ample line bundle/invertible sheaf (see "A Polytope Calculus for Semisimple Groups" by J. Anderson, for instance). This allows one to include $\mathcal{G}r$ in a projective space. I would very much appreciate a reference that explicitly describes this line bundle.
Comment: Might be  it is discussed in Pressly, Segal "Loop groups". Let me just mention informal idea. G - is simple, so there is non-trivial element in H^3(G),  by the trangression for the loops space it is mapped into H^2(LG) - the same cocycle which describes the central extension of LG. It is somehow invariant so we can push it down to G((t))/G[[t]]. So you get element in H^2(Gr). Now standard correspondence between H^2 and Line bundles gives you this line bundle.
Comment: The other way to describe having a cocycle of G((t)) you can construct a line bundle on G((t)) and then check its invariance.
Comment: See section 3.3 (and appendix A) of the recent PhD thesis of Brandon Levin (at his IAS webpage) for any reductive group $G$ (with connected fibers) over a Dedekind domain $A$; this fleshes out details sketched in notes of Gaitsgory and Faltings' paper "Algebraic loop groups...". Your case is $A=k[\![t]\!]$ for a field $k$, for which arguments simplify; when $G$ arises over $k\subset k[\![t]\!]$ then additional simplifications occur. A choice of $G\hookrightarrow {\rm{GL}}(V)$ is used to build the ample line bundle. (NB. You cannot "include" $\mathcal{G}r$ in a projective space; it is too big.)
Comment: Thanks @Alexander Chervov and @user76758! Yes, I was definitely not referring to one of the projective spaces $\mathbb{P}^n$. I was referring to the projective space associated with some infinite-dimensional complex vector space. In this case, the vector space is the dual of the space of global sections of the line bundle in question.
Answer: You may look at Proposition 13.2.19 in S. Kumar's book "Kac-Moody Groups, their Flag Varieties and Representation Theory".


Containers Across Operating systems

Question: Curious how containers are portable across development/testing/cloud environments with no worry needed about the underlying infrastructure. Does the Docker Engine essentially standardize operating systems to the point where the engine is able to launch the same container from the different operating systems? Or does a cloud deployment environment for the container(s) need to be running Linux if the development environment was also running Linux? Thanks!
Answer: No Docker engine alone doesn't do that. The underlying system still has to run the appropriate OS kernel to be able to run a container written for that family of operating system.
There are however, tools built on top of Docker engine, like Docker for Mac, Docker for Windows, and Docker Machine, which automatically creates and runs a virtual machine, so you can, for example, run Linux container on a Mac or Windows almost seamlessly (with a couple caveats with mounted folders). This is possible because the Docker command line clients are build as a remote client that talks to the Docker daemon, so it doesn't really matter whether the daemon and the client are actually running on the same physical machine.
There are also orchestration tools built on top of Docker engine, like Docker Swarm, that can, to some degree, run with mixed cluster of Docker engines running on top different operating system, to create a cluster hybrid engine that can run a mix of Linux and Windows containers.

Containers Across Operating systems


Uilabel effect like in games

Question: Does anyone know how to make a UILabel appear letter by letter like you can see in some games or other.
thanks
Answer: Set up an NSTimer to set the text property of the UILabel.
<code>-(void) revealTimer:(NSTimer *)inTimer {
 if ( ++mIndex < [mFullString length] ) {
  mLabel.text = [mFullString substringToIndex:mIndex];
 } else {
  mLabel.text = mFullString;
  [inTimer invalidate];
 }
}
</code>
start it up with something like this:
<code>-(void) revealString:(NSString *)inString {
 mIndex = 0;
 mLabel.text = "";
 mFullString = [inString retain];
 [NSTimer scheduledTimerWithTimeInterval:0.125 target:self selector:@selector(revealTimer:) userInfo:nil repeats:YES];
}
</code>
be sure not to leak mFullString as the above does, and store the timer if you may need to invalidate it.

Uilabel effect like in games


Chizkiyahu and Messengers from Bavel

Question: I'm looking at Yeshayahu 39 and Melachim 2 20.
What was so bad about Chizkiyahu showing his treasures to the king of Bavel?
If it was so bad, why was he not punished personally?  It seems unfair to punish his descendants for his sin.
I was wondering if G-d was angry that the Babylonians would learn how to duplicate the incense.
Comment: As far as I know, non-Jews are welcome to duplicate the incense whenever they like.
Answer: Rabbi David Fohrman's Aleph Beta series has an entire segment on this here.
Chizkiyahu had the potential to be moshiach. As such, every little "mistake" he made had huge consequences - just like we struggle to understand what was so bad about Moshe hitting the rock that it warranted him being kept out of Eretz Yisrael.

Chizkiyahu and Messengers from Bavel


Can I use a Speedlight 430EX II on my Canon 5D Mark IV?

Question: Can I use a Speedlight 430EX II on my Canon 5D Mark IV (on the camera)? I'm not looking to have it fire other flashes — just want to use it on the camera.
Answer: Yes. This is a Canon-brand flash and it will work on Canon-brand cameras. From Canon's web site for the 430 EX II:

Compatible Cameras:
  All Canon EOS cameras; PowerShot G series cameras

The Canon 5D is an EOS camera.
Answer: Yes, you can use any of the Canon EX speedlite units on the flash hotshoe of a Canon dSLR, and it will be compatible and won't hurt your camera. You just cannot access the 2012 features that were added with the -RT flash units, that your 5DMkIV can do.
That is, you can't use the 430EXII as a shutter remote, or use it in Gr mode as an off-camera optical slave, etc. And, obviously, it doesn't have an RT radio receiver built-in, like the 430EX III-RT.
But it can be controlled via the camera's flash control menu (the 430EX Mk I cannot), and will properly fire, perform eTTL, 2nd curtain, and HSS (high-speed sync).


Is this queen vs. pawn endgame position winnable for black?

Question: Came across a puzzle that stopped at this point. How can black win from this position? White to move.
Answer: Yes, this position can be won by black. Here's how:
These types of positions show the concept of controlling the million-dollar square. Now, what is that square? In this position, it is b6. Why is it called million-dollar square? It is called the million-dollar square because it's the most important square which decides whether black would win this or draw this position.
<code>[FEN "6k1/8/KP6/8/8/8/8/6q1 w - - 0 1"]

 1. b7 Qa1+ 2. Kb6 Qb2+ 3. Ka7 Qd4+ 4. Ka6 Qb4 5. Ka7 Qa5+ 6. Kb8 Kf7 7. Kc8 Qc5+ 8. Kb8 Ke7 9. Ka8 Qa5+ 10. Kb8 Ke8 11. Kc8 Qd8#)
</code>
How does Black win?
The basic idea to win these types of positions is to make the White king go in front of the pawn (on the queening square).

After b7, the black queen starts giving checks.
As soon as the white king is in front of the pawn(on the queening square), bring the black king closer to the pawn by one square.
If the white king starts to run then give checks and force it to move in front of the pawn (on the queening square).
Repeat steps 1,2 and 3 till you checkmate or win the pawn.

Learn more about Queen vs Pawn endgames

This is a lichess study
Youtube video explaining some Queen vs Pawn endgame
Answer: This is a standard Queen vs. Pawn endgame. The queen usually, but not always, wins. The standard idea is to check the enemy king repeatedly until it is forced to move in front of the pawn. This gives you a free move , which lets you advance your own king. If the opponent allows it, moving the queen in front of the pawn (...Qb8 in the diagram position) also wins.
It turns out that this general plan usually works, but fails if the pawn is a bishop's pawn or rook's pawn. In this case the defender can threaten a stalemate defense (e.g. if the pawn is on c2 and the king is on a1, then Qxc2 stalemates the king). There are exceptions and intricacies, though (see the article linked above).
In your case the pawn is a knight's pawn, so Black wins. If you know the general idea you should be able to find a win even against Stockfish, since it's hard to ruin your position. I would suggest trying it.
Answer: Yes, and its pretty simple. Black just plays Qg8 covering the queening square and white has no way to advance the pawn. Black will then advance his king until he captures the pawn and then it's a simple K,Q vs K endgame.
Most of the time that works in these types of endgames however if the pawn is a bishop pawn (c or f file). white can force a draw under certain circumstances ie if white can get to the 7th rank before black can move his king in. The reason is that there are stalemating opportunities. For example, white could move to the corner square (h8) and black can't take the pawn because it would be stalemate.
Comment: Attention: The board is flipped, so the pawn moves downwards, not upwards. Otherwise a correct answer.
Comment: That's fine. The same idea works. Just check and/or prevent white from advancing the pawn until you get to b8. Then move the king in. In most cases, white can't stop it.
Comment: Not quite the same. In most cases of KQ vs KP, yes, the queen can safely reach the promotion square on her own. In this particular position however (with king and pawn close to each other and advanced far enough), White can defend b8 against that idea (so it's necessary to use the strategy outlined by the other answers).
Comment: @Annatar- Not true. The idea is to check and move your king up. Show me how that doesn't work here. Also, I'm teaching the ideas. That's a lot better than memorizing a very specific position and line you will likely never see again in your life. If you understand the ideas you can always play against this type of position. Memorizing specific positions without understanding them isn't going to help you 99% of the time.
Comment: I think we have a misunderstanding here. The point was not about memorization versus understanding. The point was that the "occupy the promotion square with your queen, then approach with your king" idea just doesn't work here (assuming best play from your opponent), so you have to use the "repeatedly force their king to the promotion square to gain moves for your king" one.
Comment: And what I said before was if that's what you think then show me the line. Maybe you misunderstood that.


Do weapon stats include bonuses from skills, class mods, etc?

Question: It seems that weapon bonuses that are on the weapon itself are accounted for in the weapon's stats, but are bonuses for skills, class mods, badass bonuses, etc?  If not, is there any way I can see what my actual stats are?
Comment: I was meaning to test this. I wonder if badass bonuses are counted too
Comment: Easy to test.  Go to the beginning area and shoot a bullywog.  See the damage from a body shot.  Go reset your skill points.  Check the numbers on the gun, then shoot the bullywog again.  See the numbers that pop up.  Do the same by turning off Badass perks and by removing class mods.  Haven't tried this myself, obviously.
Comment: You can just turn off your badass perks and see if the values for your weapons change...
Answer: Weapon stats shown are always the base stats, not including skills, mods or badass bonuses.
To test this I checked out an SMG. With no bonuses, no skills or class mod, it has 54 damage. With a class mod increasing SMG damage 71%, a skill increasing bullet damage 20% and about 3% damage boost from Badass stat bonuses. The gun still showed 54 damage.
Note gun damage also doesn't indicate your level's effect on damage, so guns generally do vastly more real damage than their stats indicate; stats are mostly there to compare guns.


News about CAPM/FF3FM or asset pricing models in general

Question: Is there any interesting news about CAPM/FF3FM or asset pricing models in general lately? Would have been greatly appreciated!
Comment: Google scholar latest entries containing the desired keywords?
Comment: Suggested keywords: fama french 5 factor model
Answer: Regarding asset pricing models, Google scholar will be a good place to search. Begin your search my putting the title of the seminal paper "The Cross-Section of Expected Stock Returns" by E. F. Fama and K. R. French  published in 1992. Go to the citations link of this paper in the results. Finally, sort by date and it will give you latest articles on the topic. The Same idea can be used with other databases (e.g. ScienceDirect). If you mean latest models by "latest news" then there are many models adding different factors. such as the one adding liqudity premium to the fama-french 3-factor model by Weimin Liu.[paper]


Should the article be "the" or "a"?

Question: My nephew who reads in first standard was reading a book on basic introduction to computer. It had a line "The Computer has four basic parts", but to my ear "the computer" sounded weird. I think the article should be "a computer". I think "the" make a computer particular to the discussion which is not true here. A general computer has four basic parts, it is not restrained to any particular computer. So am I correct in this thinking?
Comment: What Matt said, plus: "computer" should not be capitalized. E.g. "The human heart has four valves" not "The Human Heart has four valves".
Answer: The short answer is that the can be used for any object where there is no ambiguity about which object is in question:

You must switch off the computer before you go to bed

And also when talking about the archetypal object (i.e. the object in general).

The triceratops is interesting not only because of its size, but because of its rhinoceros-like horn.

The somewhat longer answer is here.
Answer: A speaker marks a noun phrase as definite when they assume the listener will be able to identify what the noun phrase refers to.
So, can you identify what it refers to?  Yes.  It refers any of the set of computers in general; the particular referent does not matter.  We can say that it represents a prototypical computer, if we like.

Using a definite article for prototypical objects or events is a special case of a more general principle: you can use a definite article for a set of objects or events when the particular referent is irrelevant.  The following examples are from Birner and Ward 1994:

Somebody left their shopping cart outside here where it could roll into a car.  As a good citizen, I'll take it inside.  I'll only be a minute; I'll just leave it up front near the cash register.

There are likely a number of cash registers, and the definite article could refer to any one of them, since the particular referent is irrelevant.  It doesn't assume that the listener can identify any of them uniquely.  (Uniqueness is not part of the definite article's job description, although a rule stated in terms of uniqueness works fairly often.)
Here are a couple more examples of non-unique uses of the definite article, in which the particular referent does not matter, also taken from B&W:

[To spouse, in a room with three equally salient windows] It's hot in here.  Could you please open the window?
[Hotel concierge to guest, in a lobby with four elevators] You're in Room 611.  Take the elevator to the sixth floor and turn left.

But when it matters what the referent is (a particular computer, or a particular window) the definite article no longer works:

[In a room with three equally salient windows] Next week I'm going to start redecorating the room.  #I'll start by replacing the window.

Here, the # symbol means that the definite article is "infelicitous".  It's grammatical, but it's inappropriate in this context because the particular referent does matter, unlike in the earlier example.
(Let me emphasize that "this context" here means the stuff in italics: in a room with three equally salient windows.  It would be fine, for example, in a room with one window, or if it's otherwise obvious from context which window the speaker is talking about.)

The prototypical usage is simply an example of this principle.  Rather than a set of three cash registers, a set of four elevators, or a set of three windows, the computer refers to any of the set of all computers.  Since the particular referent is irrelevant, the definite article can be used to refer non-uniquely to any member of this set.
Comment: I agree with all of this, and this is a really interesting explanation (+1)! I hadn't heard *infelicitous* before, so that was interesting. Since it seems likely that in the OP's example it is indeed the "prototypical" computer that is being referenced (more akin to "The radio changed communication forever" than "Please open the window") would you consider adding a bit more detail on that specific case? (I understand perfectly well what you mean from what you've said, this is just a suggestion :))
Answer: With most of the scientific inventions we use the. No matter whether or not it's specific to one computer or telephone.

The Computer, the telephone, the internet and so on.

You may further read about the same here -The Mayfield Handbook of Technical and Scientific Writing
Comment: But you go out and buy **a** new computer. Your desk probably has **a** telephone, and my company has **an** intranet. The difference is not to do with whether the noun is to do with technology, but whether the object's reference is ambiguous.
Comment: As I stated in my answer, this means either (A) the text is talking about computers in the general sense (called the *prototypical* computer), or (B) the text is talking about a specific actual computer which is obvious from context, or (C) the text is written by a non-English speaker and they have got confused about their articles, and this is just a mistake.
Comment: @Matt. Okay! Then does it mean that OP's nephew was reading a 'general' thing about the machine and that's why there is the definite article 'the'?

Should the article be "the" or "a"?


Debugging failed records from Journey History?

Question: In a recent journey history, I see many records for which processing failed, see image below). However the status is quite vague "Failed - One or more errors occurred." How can I get more information on what failed exactly or debug these failures inside Marketing Cloud?
Answer: You will not have the tools to debug these, this is something only the Salesforce Marketing Cloud support will be able to check.
If you were actually using Marketing Cloud Connect (as you have tagged this question) then you could turn on logging for the Connector to see detailed log for Contact injection process from SF to SFMC. However based on the ID's they are clearly not SF records.
In case you don't want to wait for the support, you can also detail your question with all the relevant information about this Journey, like:

What is the Entry criteria for this Journey
What is the step the failure happens
How is your target DE built (attributes/types)
How are the Contacts injected to the Journey
Answer: This could only be analysed with the help of Salesforce support. It turned out that there was a SocketTimeoutException thrown at Marketing Cloud end (we saw it in the MC logs).
The reason for the SocketTimeout Exception remained unclear, the messages certainly did not reach the target server (we checked firewall logs for TCP sessions established and SYN.ACK on load balancer). We assume it must be a routing problem of some kind that is only triggered on a high volume (>50k of campaign triggers).
As a workaround we switched from on-premise to Heroku for hosting the app and the problem resolved.
P.S.: In the heroku setup, we found duplicate sendings of campaign triggers and cut off message streams in random seldom cases. Both were not shown as failed in above Journey History.


Sharing GRAMPS database between 2 computers

Question: How do I share my database between 2 computers on the same network. One is Windows 10, the other is Ubuntu 20.04. My database resides in the Windows partition but was built using Ubuntu. When I supply the correct path to my Windows version I don't know how to make it use that DB. I've tried New DB but cannot make it point to the existing DB. It wants to create a brand new one.
Answer: There are two ways.
The simpler way is to create a new, empty tree then import your existing database into it.
You should then be able to save the tree and convince Gramps to use the existing file location.
Or, more tricky, you can do this from the command line.
In Windows, instead of opening Gramps in the normal way, open the console mode.
Issue an open command
python gramps.py -O /your-path-to-gramps/.gramps/grampsdb/47320f3d
Note that you need the 8-character hexadecimal database identity, not the name of the tree.
Once opened in this manner, the tree becomes one of your "recent trees" and so is easily accessible next time you wish to open it.
This comes from the Gramps user manual here
Comment: Thank you all for the help. I will try out the options. I appreciate the input
Answer: You can specify the location through the menu sequence Edit | Preferences | Family Tree.


What on-hit effects work on Fiora's ult?

Question: Does crit, Wit's End, Malady, or Madred's Bloodrazor proc with Fiora's ult?
Answer: All on hit effects should proc with the following notes:

Blade Waltz procs on-hit effects.
Blade Waltz will not proc spell vamp or  Rylai's slow similarly with all spells and abilities that proc on-hit effects.
Any on-hit effects that Blade Waltz procs will have their full effect and will not be reduced by hitting the same target.
Tiamat will splash 50% of the damage dealt on each strike.

Source
Comment: So, in essence, you could push out probably 1.5-2k damage to a single person with no problem. Thats a bit OP if you ask me, but then again there are ways to counter it, like going out of her LoS for example, or hourglass it.
Answer: Tiamats work on Fiora's ult, but I'm not too sure about the Wit's End.
Answer: Crits do not work but every on hit works including wits end
Answer: I think that Black Cleaver and Wit's end will stack. Fiora's ultimate is like Warwick's ult, it does multiple hits on a target and should work with on-hit items.


i have create managed packaged and got Organization-level Feature Dependencies on chatter

Question: i have create managed packaged but my controller  got Organization-level Feature Dependencies on chatter. in my controller, i'm querying the user , userRole and profile object.
i noticed that  i'm using SmallPhotoUrl on viusfalforce page may be that's why i got  Feature Dependencies . i want to remove  chatter Feature Dependencies from my packaged . it is possible ?
one more thing im not using chatter or feed fields or object in my controller.
Answer: It looks like the reference to User.SmallPhotoUrl is causing the dependency, based on the answer to this related question:
SmallPhotoUrl in User object is suddenly missing?
The documentation for SmallPhotoUrl in the User SObject confirms this:
http://www.salesforce.com/developer/docs/api/Content/sforce_api_objects_user.htm
"SmallPhotoUrl - The URL for a thumbnail of the user's profile photo if Chatter is enabled."
Comment: Yes im user user.smallPhotoUrl , thanks for api documentation le me check if any other way to get userphoto


What is the free version of Sharepoint and where do I get it?

Question: For (quite literally) playing around at home, I'd like to get a copy of Sharepoint.  I might find a use for it, so I don't want a trial version.  I'm aware that there is a "free" version that doesn't include the MS Office integration etc, and that's fine.  I just might use it for document storage and things.
Answer: Your after Windows Sharepoint Services, WSS for short, as opposed to MOSS which isn't free.  It's available for Windows Server 2003 and 2008. Should come pre-installed with Windows Server 2003 R2, or you can download it here.
Details for downloading/installing on 2008 is here.
Don't think it's possible to run it on a client OS like Windows XP or Windows 7, so if you dont have this running at home, you'll have to get something like Virtual PC or VMWare and something like an MSDN or technet licence.
Comment: For SharePoint 2010, WSS is now SharePoint Foundation.
Answer: Youcan install WSS 3.0 on a Windows 7 box. It does require you to modify the local machine gpo. You can find information regarding that Here.
And as far as sql goes you can use sql server express.