In 2 point charge system, the work done in bringing the first charge to desired configuration shouldn't be zero?

Question: In the derivation of potential energy of two-point charge system, we define the potential energy of the system as the work done in giving both charges to their present configuration, and while doing the derivation, we assume the work done in bringing the first charge to its desired configuration to be zero, but I think it shouldn't be like that. Why is the force = qE acting on the first charge due to the second charge being ignored while calculating the work done in bringing the first charge to the desired configuration?
Comment: If both charges are initially at infinity, and far from each other, there is negligible E-field on charge 1 as it is brought to the desired location.
Comment: That's one way to do it. Both charges could also be at $+\infty$ and still be infinitely far apart. Note also that space has 3 dimensions so there is a lot of room "at infinity".
Comment: Sir I think I am wrong in the basic definition, the definition that I mentioned is correct?
Comment: Your definition is fine. The point is while you are bringing in charge 1, there is no force against which you must do work, because charge 2 is so far away as this is happening and its force on charge 1 is negligible.
Comment: Sir does that mean I have to place first charge at - ∞ and second charge at + ∞, and thank you so much for helping me with so much patience.
Answer: An important idea is that it does not matter how the charges arrived at their final positions after travelling from being an infinite distance apart, the final electric potential energy of the system of two charges will be the same.
It is much easier to do the sums by assuming that one charge is put into position with no external work being done, as there is no force due to an electric field being present on the charge, and then evaluate the external work done in bringing the other charge in from infinity.
One could sum the work done by external forces when both charges move together from their initial positions at infinity to find that it is the same as starting with one charge already moved to its final position.
Put another way, suppose there was an isolated charge in a region where there was no electric field present then there would be no force acting on it and so no work could be done by/on the charge and so no work would be needed to move the charge to infinity.


Why my Infrared data acquired in transmission mode looks like it was acquired in absorbance mode?

Question: I'm analyzing some carbon nanotubes with DRIFTS. I mix the CNT with KBr powder and proceed to measure the spectrum of the powder. After acquiring the KBr background (in %T, peaks facing down) I proceed and acquire the sample spectrum and it comes back with the peaks in the opposite direction . Once you apply  Kubelka-Munk correction you get the spectrum as in transmission again but sometimes the KBr background is not completely removed. Why is this?.
Comment: Please clarify your question and show the spectra. The question heading is different but you are also talking about background correction. Whenever you do something new, always run a simple sample (just a simple polystyrene powder), whose results are known. This gives confidence in the results. Carbon FTIRs are horrible anyway.
Comment: Eons ago, I used direct transmission mode by employing a small amount of carbon in KBr rather this complicated Kubelka-Munk correction. Use a large number of scans, say 64.
Comment: KM theory, is more valid for weakly absorbing materials. Carbon absorbs everything...recall a black body is a good absorber.
Comment: @AChem I mixed the CNT with KBr and ran 64 scans. I also acquired a spectrum of Polystyrene and it was fine. The issue I describe seems to be sample related; also the KM correction is done by the software in like a second, I don't understand your comment.
Comment: Is the sample and KBr bone-dry?
Comment: @AChem yes. The issue is if I acquire transmission spectra of any other sample, the peaks come facing down as expected. Once I analyze the CNT samples, the opposite happens as you can see from the image I uploaded
Comment: How do you account for negative KM units?
Comment: May I suggest getting a 1bounce or 3 bounce diamond atr cell
Comment: I will take your guys' suggestions, any insights into the actual question?
Answer: First of all I would suggest you to read the reference Validity limits of Kubelka–Munk theory for DRIFT spectra of photodegraded solid wood. Wood Sci Technol 45, 135–146 (2011). https://doi.org/10.1007/s00226-010-0314-x. The introduction highlights the how many spurious (or more crudely bogus) DRIFT results are out there just because researchers did not carefully think about the validity limits of KM.
The authors highlight the facts that KM is useful for weak absorbers. Certainly carbon nanotubes are not weak absorbers and one would expect problems (non-ideal behavior).
Although your question has been appreciated but it is missing a lot of information about the sample, its pre-treatment and many other critical instrumental settings. FTIR is a Fourier transform technique, and you have to choose (perhaps in advanced settings), the correct apodization function. Using an improper setting may cause final spectrum's artifacts. Check the manual which one is the right apodization for DRIFT. Make sure all the settings are correct from the manual.
Alternatively, a short-cut is that you repeat a well-behaving organic compound and reproduce a correct absorption spectrum which matches very well with a standard database and does not generate negative scales on the y-axis. You are also using 64 scans, which is fine.
The red-flag in that carbon spectrum is the negative y-axis. When the instrument generates an output which has no physical meaning...there is a problem somewhere. Even with simple double-beam UV-Vis spectrophotometers, some time the sample shows negative absorbance. It does not physically mean anything.
To troubleshoot one can re-visit the problem from the beginning.
(i) KBr is bone dry, FTIR grade and freshly dried.
(ii) The carbon nanotubes have been thoroughly washed with suitable high quality solvents and thoroughly dried > 24 hours. This will ensure the sample is clean and the background is not coming from random junk sticking to carbons. Carbon is an excellent non-selective adsorbent.
(iii) Mix the KBr and carbon nanotubes throughly (all IRs used to have mortar and pestle) so that the mixture is as uniform as possible.
(iv) After collecting background, use KBr as a sample and see how the baseline looks, and if this is reproducible or not. If it is reproducible, one could subtract this baseline from the final spectrum.
(v) Do a sample concentration study: Use different amounts of carbons in KBr (do it semi-quantitatively) and see how the spectrum changes. Overlay the spectra and see which regions of the spectrum change and when do they start to behave well. Carefully, use the same amount of the sample for DRIFT measurements.
(vi) In the worst case, if nothing works in DRIFT mode, use a simple KBr pellet method and use the transmission mode. A low sample concentration is required. Making a good pellet under high-pressure was an art in itself.
This is a little bit of work, but the end-results will be satisfying and you will be confident about the results.


Representation of dilations

Question: I am having some trouble getting some signs right on the representation of the dilation operator on a field. Let us follow the conventions of Joshua D. Qualls https://arxiv.org/abs/1511.04074. According to equation (2.36), we have
$$e^{ix\cdot P}De^{-ix\cdot P}=D+x\cdot P.\tag{2.36}$$
Recall that
$$P_\mu=-i\partial_\mu.\tag{2.34}$$
We then have for a field of scaling dimension $\Delta$, i.e. $$D\phi(0)=-i\Delta\phi(0),\tag{1}$$
$$D\phi(x)=De^{ix\cdot P}\phi(0)=e^{ix\cdot P}e^{-ix\cdot P}De^{ix\cdot P}\phi(0)=e^{ix\cdot P}(D-x\cdot P)\phi(0)=e^{ix\cdot P}(-i\Delta-x\cdot P)\phi(0)=(-i\Delta-x\cdot P)\phi(x).\tag{2}$$
We conclude that
$$D=-i\Delta-x\cdot P=-i\Delta+ix\cdot\partial.\tag{3}$$
However, according (2.37), I go the sign of the momentum part wrong. Can somebody help me understand where my mistake is?
Answer: The problem is in the first equality of eq. (2): How is the momentum (2.34) supposed to act on the missing $x$-dependence in $\phi(0)$? Instead use eq. (2.36) to deduce that
$$ [D,P_{\mu}] ~=~i P_{\mu}. \tag{2.27}$$
Conclude from eq. (2.27) that $$D~=~x^{\mu}P_{\mu}~\stackrel{(2.34)}{=}~-i x^{\mu}\partial_{\mu}$$ up to a central element.
Answer: As explained in Sign error in representation of angular momentum on fields, the problem is actually that the commutations relations should be $$e^{ix\cdot P}De^{-ix\cdot P}=D-x\cdot P,$$
because, the generators on the transformation on fields satisfy the opposite commutators than those acting on spacetime.

Representation of dilations


Gutenberg blocks not full width

Question: I am having an issue where an image block in Gutenberg editor is not the full with of the page even though I have selected "Full Width" in the back-end. Is there a way to fix this?
Image for reference:
Comment: Setting an image as full width doesn't mean the CSS needed to implement that will be on the frontend, you'll need to add CSS to your theme to support full width images, otherwise you shouldn't add the theme support. Similar to how if you declare that your theme supports a header, WP will add the UI to select it, but you still have to implement support in your theme
Answer: <code>.wp-block {
 max-width: unset;
}
</code>
If it is your custom block add to editor_style .
If not include css file with hook enqueue_block_editor_assets
Answer: You can use this CSS to allow an element to be full width even if it's in a parent element with a max-width.
<code>.is-fullwidth {
  left: 50%;
  position: relative;
  transform: translateX(-50%);
  width: 100vw;
}
</code>
Note: This only works if the element is centered. You would need to alter it if there's a sidebar.

Gutenberg blocks not full width


How is zero conditional mean assumption "stronger" than uncorrelated assumption?

Question: I am trying to understand what the zero conditional mean assumption ($\mathbb{E}[u\vert X]=0 $) encompasses in addition to a zero-correlation assumption ($\text{Corr}(X,u)=0$). I assume it must be "stronger" (by stronger I mean covers more cases) assumption, as otherwise we could replace it with a zero-correlation assumption. So what would be the cases where the zero-correlation assumption is not sufficient?
Comment: $E[u\mid X]$ is a *function of possible values of $X$* whereas $\operatorname{Cor}(X,u)$ is a *single number.*  When $X$ is non-constant, perforce the restriction on the former is stronger than any restriction on the latter.
Answer: One simple contrived example:
Consider 2 discrete random variables $X \in \{-1,0,1\},Y \in \{-1,1\}$ with the following joint distribution:
\begin{array}{c|ccc|c}
Y,X & -1 & 0 & 1 \\
\hline
1 & 1/12 & 4/12 & 1/12 &1/2\\
-1 & 3/12 & 0 & 3/12 & 1/2 \\
\hline
&1/3&1/3&1/3
\end{array}
Then by symmetry $\mathbb{E}(X) = \mathbb{E}(Y) = 0$ and so
$$\text{cor}(X,Y) = \mathbb{E}(XY) = 1 \times 1/3 -1 \times 1/3 = 0$$
Yet
$\mathbb{E}(Y|X=-1) = - 1/2 \neq 0$
This is the minimal example I could think of; you should get some intuition from the construction, but might seem a bit cheeky/unmotivated. Perhaps better intuition is that correlation 0 is a single scalar constraint therefore very weak; however having zero conditional expectation gives a scalar constraint for every value of $X$ and so is a lot stronger. Another perspective might be that correlation is only a linear property, whereas conditional expectation can tell you more about non-linear relationships between random variables (like in this example).
Comment: I think that expected value is -1/2, not -1/12?
Comment: agreed, edited - thanks!
Answer: The result follows from the law of iterated expectations,
$$
E[X^T \epsilon]=E[X^TE[\epsilon | X ]]=E[X^T0]=E[0]=0.
$$
For examples where the stronger condition is not satisfied but the weaker may be, consider Proving OLS unbiasedness without conditional zero error expectation? or Non Linear Endogeneity.


true of application.xml not working in Wildfly 8.2.0

Question: I am migrating my application from JBoss 6 AS to Wildfly 8.2.0 AS. It is an EAR application containing MBeans and EJBs. It is a multi-maven module project and MBeans are scattered across different sub modules and packaging is of type EJB and JAR for those modules. I cannot convert sub-modules containing MBeans as SAR deployment as they are tightly linked and packed as JAR.
I am using jboss-service.xml in META-INF folder of EAR to deploy and register MBeans. MBeans are dependent on EJBs and hence, EJBs need to be deployed first before JAR containing MBeans gets deployed.
I tried <initialize-in-order>true</initialize-in-order> in application.xml to have an order in deployment of EAR contents but it is not following the modules sequence present in application.xml but it is not working. Order of deployment as defined in application.xml is not followed. FYI that I am unpacking the EAR and deploying using auto-deploy-exploded="true" in deployment scanner in standalone-full-ha.xml. I believe packed or unpacked EAR deployment format does not contribute this problem.
I also saw the xsd file of jboss-app.xml but I could not find any example supporting the order of EAR deployment.
Could anyone please help to implement the order of deployment for EAR in Wildfly 8.2.0 AS.
Answer: There was this bug when defining the loading order in that certain module which depends on persistence unit declared in another module.
Removing the <initialize-in-order>true</initialize-in-order> worked for me on JBOSS EAP 6.4.


Variable declaration not resolving as expected

Question: Using CodeDom in C#, I am trying to generate the following for loop:
for (int i = 0; i < ds.Tables[0].Rows.Count; i = (i + 1))

Except that my code is generating this:
for (int i; (i < ds.Tables[0].Rows.Count); i = (i + 1))

Note that this does not initialize i to zero, which does not compile in C#.  (VB does accept this).
So I have to go in later after the code is generated and fix it manually, which is mostly just annoying, but I'd like to fix it.  The code to generate the entire statement is as follows:
CodeVariableDeclarationStatement idx = new CodeVariableDeclarationStatement(new CodeTypeReference("System.Int32"), "i", new CodePrimitiveExpression(0));
        CodeIndexerExpression dsIndex = new CodeIndexerExpression(new CodeVariableReferenceExpression("ds.Tables"), new CodeExpression[] { new CodePrimitiveExpression(0) });
        CodeBinaryOperatorExpression comp = new CodeBinaryOperatorExpression(new CodeVariableReferenceExpression("i"), CodeBinaryOperatorType.LessThan, new CodePropertyReferenceExpression(dsIndex, "Rows.Count"));
        CodeAssignStatement incr = new CodeAssignStatement(new CodeVariableReferenceExpression("i"), new CodeBinaryOperatorExpression(new CodeVariableReferenceExpression("i"), CodeBinaryOperatorType.Add, new CodePrimitiveExpression(1)));
        CodeIterationStatement iterator = new CodeIterationStatement(idx, comp, incr);

According to MSDN this is the way to initialize a value, unless there's something subtle I'm missing.  Can anybody help?
Edit: The code is correct.  It turns out another project in the solution was referencing a Redgate-SQL library that had an expired license, and it was somehow preventing my updates from getting deployed correctly.  Thanks for your help and time.
Answer: It seems to work well on my machine.
Returns:
for (int i = 0; (i < ds.Tables[0].Rows.Count); i = (i + 1)) {
}

What version of the framework are you using?


Do Russian speakers in the former USSR countries use patronymics?

Question: Can the general calling conventions in Russian (for example - Dimitri Ivanovich Petrov will be formally referred to as Dimitri Ivanovich) be extended to the countries of the former Soviet Union  (particularly Ukraine and Armenia) ?
Comment: This stackexchange is about the Russian language, not about countries.
Comment: In Ukraine, the patronimic is officially written in everybody's passport and all the other documents, too. However, in Ukraine in formal situations only the Ukrainian language is to be used, and in Ukrainian there are other traditional formal ways of address beside name+patronimic. But that's a story for [a different SE](https://ukrainian.stackexchange.com/), not this one.
Comment: Hi and welcome to Russian.SE! Could you please clarify what exactly do you mean by "extended to the countries"? Are you asking if it is OK to use patronymics in Ukraine and Armenia, or is the usage pattern the same, or what? Thanks!
Comment: I ask if the usage pattern is same or not in the former Soviet Union (Armenia, Ukraine, Georgia etc.) as it is in Russia.
Comment: Oh, I was asking in general for former USSR countries in general. Thought that should correspond to the common tying thread that is Russia in this case instead of three or four different forums for Ukraine, Armenia etc.
Answer: Russian-speaking Ukrainians and Armenians, when communicating in Russian, do expect patronymics used towards them in the same way Russians do, and mostly they do have a preference about rendition of their patronymic in Russian.
For instance, Armenian prime minister Nikol Pashinyan insists that his patronymic is rendered Воваевич in Russian, because his father's given name is rendered in Russian as Вова.
Etymologically, Вова is a hypocorism (pet form) of Russian name Владимир, that's why some Russian speakers call him Никол Владимирович, which he deems wrong.
Forming the patronymic following the usual Russian pattern for names in -а, -я (Фома > Фомич, Илья > Ильич etc.) would give Вович, but he does not prefer this form either.


Strange file structure on surveillance DVR

Question: I have a 2TB HDD (WD Purple) from a client's surveillance DVR (Night Owl) with a puzzling file structure. The drive has 7,451 256MB files all dated 1/10/2098 23:02. The files are named 0001-7451 with no extension. That adds up to exactly the number of 256MB files that will fit on 2TB with 39MB left over. Looking at them in a hex editor, they have a line or two of seemingly random data and then nothing but 00.
These don't appear to be video files, which the manufacturer confirms should be H264 or AVI, but I'm wondering if the file structure suggests anything else such as a drive wipe? Thought I would throw this out there and see if anyone has come across it before.
Comment: I own a similar product:
usually the file format is converted to something usable by a tool provided with the dvr. The package should be avallaible from the html interface of the dvr or from the productor's site.
Give a try with vlc but difficult to have success in that way.
Answer: Mine has the option to stream via rtsp which I believe will work with QuickTime player and vlc. it may have something to do with that function. I'm not currently close to the dvr so cannot access the menu. But the firmware shows the url constructor starting with rtsp:// it includes the username, pass, stream and channel and a few other parameters.


Windows Form application run on Windows hosting service

Question: I've created a Windows Forms application that basically contains an HttpListener which launch a Form for each request. I have to show forms server side because I have to take a snapshot of what it's shown on the screen to send it to the client.
I've also made a asp.net web application in which I show those images sent from the HttpListener who act as a server.
Everything works fine on my machine but now that I must deploy it on my company's website I dont know how to do it, anyone has a solution? I haven't remote control on server, I can just upload files inside using FTP.
What if I create a page inside my web application to launch the exe file? Any suggestion is really welcome!
Comment: It really sounds like you need to rethink your architecture - what you're describing sounds like a nightmare.  What is it that you are rendering on a form that needs to be snapshot?
Comment: Something that use OpenGL, so I can take snapshot once it appears on the screen. So one clear thinig is that I must show winForm, and it's not the only cause I have also to capture commands from web request to do something to refresh the screen, that's why I used an HttpListener! It's a nightmare anyway :)
If you have any idea to redesign this please share it with me!
Comment: Why do you need to take a snapshot to begin with?  No hosted provider with a brain will allow you to launch EXE files on their web server, so just what are you doing that cannot be done on the client side?
Comment: I know it's gonna difficult to have the right permission to operate but with all these requirements I didnt find another solution, as i said Im really open to any suggestion to improve or redesign my application.
Answer: I'm definitely no OpenGL expert but I believe that its possible to use OpenGL to render a scene without displaying it to a screen.  Some preliminary research indicates that "pbuffers" allow you to render an image to a texture (which would presumably then allow for programatic access).
Can i save an OpenGL scene as an image without showing it?
Note that using OpenGL probably depends on the server machine having a suitable graphics card.  As most servers don't come with very capable graphics card (some servers don't come with any graphics card) this is definitely something that you should check beforehand.


Software for submitting and testing programming assignments

Question: Can anyone recommend an open source system for students to submit programming assignments? Ideally it would be something that would run on the web, do some level of testing on the server side, and provide feedback to the students based on testing.
Comment: This question appears to be off-topic because we don't do shopping questions here. This could be on-topic for [softwarerecs.se], if it was brought up to the standard required there (see their meta for details)
Comment: @EnergyNumbers: Perhaps the way it is phrased, it sounds like a shopping question, but the general idea of the question is relevant, I feel. Many academics need to deal with electronically submitted assignments. Some of these are software and software needs to be/can be run automatically.
Comment: Since I'm interested in this topic as well, let me turn this into a more constructive direction: What would be needed to make this question on-topic? How about asking for practical experiences with automated assessment tools (specific tools or in general), or about specific features which turned out to be useful (or not so useful) in classes?
Comment: @EnergyNumbers There [are several similar questions](http://academia.stackexchange.com/questions/tagged/tools) that have been accepted. I agree, though, that [softwarerecs.SE] would be appropriate, too.
Comment: @DaveClarke the general idea may be relevant, but we don't do list questions here. There is a Stack explicitly for this site of question - and that's [softwarerecs.se]. And this sort of question is explicitly off-topic here: not because of its general idea, but because of its nature as a list (aka shopping) question. Software recommendations are really difficult to ask for, which is why Software Recs has detailed instructions on its meta.
Answer: I've never done this myself, but I think the following system could work using GitHub and Travis CI:

Create a repository for the homework where students can submit pull requests to.
Make scripts to run and test the solution and put them on the repo.
Students would then fork the repo, add their submission, and make a pull request.
Setup Travis CI to run the test scripts on the solutions. This will require some form of standardization for the commands to compile and run the solutions.

The nice thing about this system is that the pull request page on GitHub reports the status of the Travis CI run. You can then leave comments for the students and they can iterate until Travis gives them the green light.
Comment: They could but that would cause a merge conflict that would show up on the pull request. Rewriting history changes the commit hashes and they would need a forced push for that.
Comment: That is a very neat idea (as long as you check they are not touching the tests).
Comment: @Davidmh that's the beauty of version control! Just check with a quick  "git diff".
Comment: or in the Github's files tab. Just thought it was worth mentioning they may try to trick you!
Comment: Can't one rewrite history in the forked clone so that the modifications to the tests don't show up with "git diff" nor in Github's files tab?
Answer: The open-source web program CMS (Contest Management System) was created by people at my university (CS institute, university of Pisa). Screenshots here.
It has been used also in the international informatics Olympiad and several other international programming contests, so it is mature and well tested.
It is in use since a few years in the undergraduate course on Algorithms in our CS degree. It allows students to submit their source code online, where it is executed in a sandboxed environment and scored automatically on the basis of some test cases. It supports out of the box C, C++, Java, Python, Pascal, PHP, and other languages can be added (although I don't know how easy it is).
Answer: Github classroom provides a free place to make and submit assignments and you can set up autograding.  One thing is that in github with github actions you can also build tests right into the push process.  However, I have seen some people on the forums for teachers say that they run out of free processing time during busy parts of the semester.
Comment: +1 for GitHub classroom. I've used it extensively for database, Java, and C++ classes. My class sizes are relatively small, so I haven't run into the processing time issue much and, when I did, I decided the extra expense was worth it (again, for my class size it was maybe $10).
Answer: I can strongly recommend PASS (Programming Assignment Submission System), which was written by Mrs Marsupial to support my teaching on first and second year programming modules (Java and C++).  It formats the code into a .pdf document using LaTeX, but it also compiles and executes the program and adds the compiler messages and output to the .pdf file (and any output files that the program is supposed to produce).  The .pdf file includes an embedded .zip file containing the code in a standardised format in case further inspection/testing is required.  The requirements for each assessment are provided in an XML file for each module that specified expected files, input datafiles etc.  We have done some experimentation with automated testing, the simplest approach would be to include a Makefile and test harness in the metadata and PASS can add the output of the test harness.  However, for the modules I teach I am mostly interested in the structural side of the program design and whether the program is maintainable, so I tend just to have output specifications that show the program basically works and then mark by annotating the .pdf file on my ipad.
We have been using PASS for quite a while at my institution and it has saved a lot of unnecessary admin and hassle.  The major benefit is that there is a well-defined target environment (eliminating the "well it works on my computer" complaint) and the students get to see exactly the output of the program as I see it when it is marked.  Unfortunately students have to formally submit the .pdf file via BlackBoard at my institution, but another useful feature of PASS is that it provides a reliable independent time-stamp that can be used to determine whether an academic advantage has been gained by a late/failed BlackBoard submission.


Why throw candy on the ground?

Question: What is the point of throwing candy on the ground using the "Throw 10 candies on the ground"? All that seems to happen is that the text under it becomes more and more disappointed in me. ಠ_ಠ
Comment: @JohnDoeSanta - That's in Candy Box 1.
Comment: i have thrown 700 and still nothing
Comment: Eat the Candy and a merchant will appear. From that point the game is self explanatory. Also, Duplicate:http://gaming.stackexchange.com/questions/116113/do-the-starting-abilities-actually-do-anything
Answer: Throw enough candies (1630) on the ground and the guy (._.) will dig a hole (because he gets annoyed by your candy wasting). He falls into a room that contains something.

 a chocolate bar

Around 2000 Candies (1770), he digs into another room. In this room, there are giant candies.
He stays in the room and keeps eating them.
He doesn't do anything else after that, just eating those giant candies.
Comment: I can confirm (from looking at the source code) that he doesn't do anything else after that.
Comment: I've thrown 22,000 and still nothing
Comment: How many is 'enough'?
Comment: I've thrown 150,000, I wish I read this earlier
Answer: As you continue to throw candy it starts adding punctuation. Then it adds some smiley sad faces. Then it adds this little guy: (o_o)
He yells at you for throwing candy and says stop stop stop. But if you keep throwing he says whatever and attempted to run away but hits a wall and says whatever and tries digging into the ground and falls through a hole and finds a chest. You get a chocolate bar. Then he tries digging again and finds a large room full of candy. So far at 3,600 candy thrown, that's all i've found. It seems as if that's it.
Basically throw enough candy to get 1 chocolate bar.
Answer: the more candy you throw on the ground the better it will get-his face will change he'll say a quote and once you reach enough you will get a chocolate bar!
After that he will dig even more, and he'll find a ton of giant candy (you dont get any) and then from there on out when you throw candy on the ground he will just eat it.
Answer: This may not be correct information, throwing candy on the ground does not open the hole, only changes the little symbols at the ed of the sentence
Comment: Wrong. Spoiler: https://dl.dropboxusercontent.com/u/10221029/spoilercandy.PNG

Why throw candy on the ground?


Visiting Neuschwanstein without booking a ticket?

Question: I would like to visit Neuschwanstein Castle. However, I don't know when I will be there, so that I am unable to book a ticket earlier. Is there any daily visitor limit there? If so, after reaching this limit, Is it possible to get there and see it from outside (from its court, like in Vienna's Schönbrunn) without buying a ticket?
Answer: If you travel during summer holiday season I would say forget it. All the tours are reserved, I was there in March (the off-off season) and they were doing a steady business. The outer parts are not ticketed, and the other castle (Hohenschwangau) is less busy.
It is definitely worth the trip, I would say plan your travels around the ticket date, there are not all that many other attractions in the area so those destinations can be flexible.
Answer: Just in case you don't get tickets for Neuschwanstein: There is another castle nearby in which King Ludwig II (who built Neuschwanstein) grew up - Castle Hohenschwangau (http://en.wikipedia.org/wiki/Hohenschwangau_Castle).
It might be a good alternative if Neuschwanstein is too crowded - many locals recommend it as the better alternative (better guided tours, the rooms are closer to their original states than in Neuschwanstein, etc.).


Realtime Nationwide (or as many states possible) Auto Crash/Incident data

Question: I'm looking to create a database that will pull Realtime Nationwide (or as many states possible) Auto Crash/Incident information with the inclusion of the people that were involved in the incident(s) first, last name, age and the incident type [auto_accident_personal_injury].
An example that has some of the information I need is here https://data.vbgov.com/Public-Safety/Police-Incident-Reports/iqkq-gr5p/data- but it does not include the first, last name, age which is public information. Wondering if there is a way to also grab this in Open Data Network?
I've looked for weeks now and cannot figure this out. Any help would be awesome! I'm willing to hire someone to help me.
Answer: I'm not sure how realtime this is, but LexisNexis® Community Crime Map (which appears not to be paywalled) lists traffic incidents.


Not receiving droid texts on iphone

Question: I gave my granddaughter my samsung android phone when her iphone got broken. I now have an iphone. I have to send her texts using SMS (turned it on in settings) but when she answers I do not receive her replies on my iphone 5.   I've noticed my messages to other iphone users are not always iMessages anymore.  Frustrated with not being able to communicate with granddaughter.  Does it have anything to do with the droid was my phone before and used same number?
Answer: It doesn't have to do with your Number, it's a known Bug which happens to all iPhone Android switchers.
It has to do with the way Apple has made its iMessage service.
Thanks to an ongoing issue with the way Apple built its iMessage platform, users who switch away from an iPhone to an Android phone or any other cell phone are faced with a huge problem: once they bail on the iPhone, they often can't receive text messages from contacts who are still using iPhones. This is because Apple's system still sees them as iMessage users, and it tries to deliver messages sent using Apple's Messages app as iMessages. To make matters even worse, the iPhone users who send those messages see their status as "delivered" even though they are not being received.
source http://bgr.com/2014/05/19/fix-imessage-iphone-bug-android-sms/.
i hope this will help you.
Comment: I believe this issue has been fixed(at least apple page suggests it has).  https://selfsolve.apple.com/deregister-imessage/

Not receiving droid texts on iphone


Beginner Hardware development guides

Question: I'm looking to get started with Arduino and I wanted to know any good books out there. Any help would be appreciated
Answer: What is your experience level? What types of hardware?
I would probably put "Making Things Talk" close to the top of
the list.
Depending on your experience some general electronics books
like "The Art of Electronics" and "CMOS Cookbook". An
excellent free resource is http://www.allaboutcircuits.com
Comment: I can second allaboutcircuits.com. It's very easy to understand!
Answer: "Getting Started with Arduino" by Massimo Banzi, then
"Practical Arduino" by Jon Oxer and Hugh Blemings
Answer: Make: Arduino Bots and Gadgets

Arduino: A Quick-Start Guide by Maik Schmidt
Answer: This is a very good book for complete beginners:
Joe sent me a copy to see what I thought of it.
It's also available with a hardware kit.
Comment: This link appears to be dead if you can remember the name of the book.
Answer: The question of how best to get started with Arduino is an important topic. Before recommending books, let me suggest a three step approach:
1) Talk with the community. Since you posted here, you are already doing this step.
2) Get your hands dirty as soon as possible, and keep them dirty. Build kits - they allow you to make something cool without understanding all the parts, so you can focus on learning a particular aspect. As you get better, modify kits.
3) Read books and blogs. There is a lot out there for free, and you will soon be spending more than you intended on your new hobby :)
Books to start with is a very active topic on the Arduino News forum. (arduino.cc)
That discussion suggests http://earthshinedesign.co.uk, (go to bottom left, External Links, top link, "The complete Beginners Guide ...") which is a free download. I would suggest trying that.
I tried Getting started with Arduino, and found it OK, but "meh". There is better stuff nowadays. Making Things Talk is well worth the money and pretty basic, but not for complete beginners.
Comment: This link appears to be dead if you can remember the name of the book.
Comment: Agreed on get dirty.  Translation: build things.  Make mistakes, and learn from them.  The rate at which you build things and make mistakes determines the rate at which you learn electronics.  The best noise we'd like to hear from someone in electronics is; "hmm, that's odd!".
Answer: Forrest Mims' books on electronics are great for understanding the basics. For the digital stuff, I find the internet (Google, AVR Freaks, this site, Arduino forums) and the datasheet for your microcontroller to be the best guides.

Beginner Hardware development guides


Where is the Line?

Question: A comment posted on one of my questions the other day raised a question in my head. I know that many site admins appreciate users reporting bugs and security holes, and as a user I appreciate people who do this. I often try to find and report them in sites and apps to which I use frequently or hand sensitive data. I am reasonably certain these sites would be fine with me testing really harmless stuff like reflected XSS and the like but where is the line? How much is it ethical to test without permission? Is it ethical to test the site for sql injection vulnerabilities if I do not actually extract data? Is there a difference between what the law permits and what site administrators will thank you for? What is the best way to ask a site admin what their opinion on this is without scaring them?
Comment: I should clarify that I never test more than I am absolutely sure would be ok with the admin of any given site.
Answer: In a web app pentesting course I took recently, the instructor opined that anything you can do passively - looking at the raw source the server and client is exchanging, without changing anything - is on the ethical side of the line.  As soon as you insert 'malicious' strings (like SQL injection tests, even those that won't extract any data) or alter things (bypassing client-side validation, for example) you're on the other side of the line, and should have permission before doing so.
(And if you're smart or professional, permission should be documented)
(There's a 13-to-47 mapping between what the law permits and what system administrators approve of, and the mapping shifts regularly)
Comment: Important note: passively looking at the exchange between the client and the server is only ethical if you're the client in question.
Answer: I agree with gowenfawr. The unfortunate truth is that penetration testing and bug testing do more harm than good in many cases even when you're doing them accidentally. The laws haven't caught up yet, so you could go to jail for just trying to help. Maybe in a couple decades when there are more lawmakers and fortune 500 execs who have learned how to turn on a computer than those who haven't, you won't have to ask this question (even if you're still alive by that time :)).
Comment: I'm serious about the "not knowing how to turn on a computer". My uncle certainly doesn't, or he claims he doesn't. Now, he's neither a Fortune 500 person nor lawmaker, but this illustrates the point that there are still people like that.

Where is the Line?


Can we average the data first before updating its gradient while doing mini-batch gradient descent?

Question: Say we are doing mini-batch gradient descent, the common way of doing so is by calculating the overall gradient of several samples and then update the parameter. Can we average the samples passed in first and then conducting the gradient update on this "averaged data"?
Answer: In general, no.
Consider a function $f[x]$ applied to some data $x_1,x_2,\ldots,x_n$, where $n$ is the size of the mini-batch.
Let $g[x]=f'[x]$ be the derivative of $f$. Then the average derivative over the data is $\langle{g}\rangle=\frac{1}{n}\sum_ig[x_i]$, while the derivative evaluated at the average data is $g[\langle{x}\rangle]$, where $\langle{x}\rangle=\frac{1}{n}\sum_ix_i$.
The two expressions are equal only if $g[x]=f'[x]$ is a linear map
$$g[a_1x_1+a_2x_2]=a_1g[x_1]+a_2g[x_2]$$
This will only be true in the special case where $f[x]$ is a quadratic form
$$f[x]=\tfrac{1}{2}x^TAx \implies \frac{\partial{f}}{\partial{x}}=Ax$$
for some matrix $A$ that does not depend on $x$.


Ember best practices for loading javascript/app only after authentication

Question: Starting a new Ember app and was prepared to follow token authentication type structure for authentication in the restricted API routes but was then told we need to not show any of the javascript (or as absolute little as possible) before authentication. This has me a little puzzled given single page javascript apps.
I'm using the, very helpful, ember-app-kit which has great tools that compile everything down to a minified and obfuscated single javascript file, which I thought was good enough for security, but apparently its not.
Having the entire app loaded once, and even in a single compiled/minified js file, what is best practice for "hiding" some of the javascript and only loading after authentication?
I had one thought of my own and have found another potential:
A ) coming from rails, I thought I could just build a very thin rails app that handles authentication in a server side view that doesnt load any of the app js. Then on successful authentication, transition the user to a view that loads all of the JS for the app and go from there.
B ) I found some talk of new functionality in ember-data that allows you to async load javascript files in the models. This seems like it could work but also seems very complex and I'm not sure if It'll totally work cause they want to hide not only models but things like app routes (basically everything but login)
Answer: I have done option A in rails: authenticate the user on the server and then forward them to a page containing the actual client Ember application. It will be far simpler than trying to dynamically load the app on the client side. Simple is usually best.


Is there a way to get the description of an Affliction in-game?

Question: Most of the UI in Darkest Dungeon is intuitive, but I can't seem to figure out how to get descriptions of my characters Afflictions. When hovering a Trait, a tooltip describes the Trait, but hovering Afflictions and/or clicking them doesn't seem to do anything. What have I missed?
Comment: As far as I am aware, there is no way but keeping open a wiki tab in the background and checking manually. Same goes for most of the traits. They might have a description, but most of these are so vague that I am left puzzling even after that.
Answer: While the game does not contain any explicit descriptions of afflictions per se, you'll have to use external resources for that, there is a limited set of things that an affliction can do.
A: Cause additional stress, in response to:

Start of the turn to everybody else.
When another hero is hurt by an enemy to that hero.
When they are hurt by an enemy to everybody else.
When another hero attacks an enemy to that hero. only skills that deal damage are affected

B: Deal damage to friendly targets, at the start of their turn (does not consume their turn).

Deal percentage damage to self. ~10%, round up
Deal percentage damage to another character.
Deal weapon damage, plus bleed/blight if applicable, to another character.

C: Act on their own

Pass their turn.
Move forward one. Does not consume their turn.
Move backward one. Does not consume their turn.
Use a random ability. If no ability is available, will pass instead.

D: Refuse help Help counts as:

Heals or buffs cast in combat. Targeted abilities will allow you to cast another ability. AoE abilities will waste their use on the afflicted hero, but still get cast. If a targeted spell fails in this way, the hero becomes unable to be targeted this round.
Camping skills used outside of combat on the hero. The camping skill is wasted, and the points are lost.
Eating food or using consumables. This does not disable you from trying again, so it's only a cosmetic effect (as you can simply try to feed, bandage, antivenom, etc. them a second, third, etc. time.
Switching places with the hero. Characters can't stop another character from moving past them, so if your hero that wants to move past has 2 movement, you can move two steps instead. Also, this does not stop heroes that use skills to move to switch positions, such as the graverobber's Lunge attack.

E: Reduce statistics
Generally, each affliction will affect statistics in various ways. Most will for example lower resistances by 25%, Health by 10%. When your character is afflicted, you can view their status screen to check what stat changes have been applied.
Some afflictions may also increase statistics (most notably the Flagellants' Rapturous state.
Not every affliction can have all the effects. In general, the name of the affliction is a big clue as to which effects are enabled for that affliction. For example, a paranoid induvidual is likely to refuse help, and act on their own, but won't hurt themselves or others.
Most affliction effects seem to have about a 25% chance of occurring whenever they can occur. To catalogue the exact effects, you'll have to look into the game files.
One event per hero
A hero can only react to something once, even if their affliction has two separate possiblities in response to an event. It is however possible for two different afflicted heroes to react to an event. For example, if a masochistic character is crit by an enemy, they may comment how much they liked it (upsetting everyone else), and then the fearful hero could complain about how hopeless the situation is, causing a triple load of stress on the two remaining heroes.
Answer: In addition to aphid's post (can't comment) you can find the stat changes either by searching on the wiki or hovering over the stats. There will be a percentage change called +-xx% affliction.
They also cause random stress upon curios interaction and sometimes misses by teammates.


What could be causing cracks in the drywall of a newly renovated home?

Question: We bought an older home and completely renovated it about 18 months ago. Now I am starting to see small cracks in the drywall in the ceiling and walls. What could be causing this?
Comment: Are the cracks running along a seam in a flat surface or at corners?
Comment: Does your house have a whole home humidifier? Lack of humidity can cause this. Also check to make sure it is working and maintained.
Comment: Were the cracks smaller during the summer?  Is it related to seasonal changes in humidity?  Or are the cracks growing and growing?
Answer: I am not a structural engineer.  I'm just a homeowner/remodeler.  This kind of diagnosis requires a site by a structural engineer.  If you are really concerned about your house, I'd recommend hiring one for an hour or two to visit your home and provide their opinion.  Cost is likely $125-$250.  Don't get talked into making complicated drawings for lots of money unless they see that there is a problem.  You may already have some drawings if you had a permitted remodel.
However, I can talk about what might generically cause issues like this in a house.
There is, as BrownRedHawk suggestions, the benign explanation.  These crack could be normal signs of age, material expansion, or harmless settling.  If these cracks are primarily at corners or in lines at seams in the drywall, then they may simply be a bad mud job on the drywall.  Even how you hang the pieces around doors and windows can significantly affect cracking.  If it is the benign problem, you could probably just have a drywaller redo the cracking joints, possible with fiber tape if that wasn't used last time or corner beard, and see if it cracks again.  I wouldn't do that until you eliminate the more serious problems.
However, you could have more serious problems.
Some possibilities:

if you have an especially wet year, especially in areas with clay or
a high water table, expansion of clay soils could cause some lift and
settle of the house or the water table could cause a new range of
settling.  If either problem is chronic, it should be addressed with
floating basement walls and/or basement slab drainage.  Neither are
cheap solutions.  You probably know best whether you live in a high
water table, a clay soil area, or had a very wet or very dry year.
If door and window operation is affected or if enlarged or added any windows, the structural elements around the window or door may
have been compromised or installed incorrectly.  During an old
remodel, I found two previously remodeled windows where the header
was unsupported (improperly installed).  This could cause some
movement in the wall or ceiling around the window, cracking the
drywall.
If you removed any walls during the remodel, even if you didn't think they were structural, they may have been accommodating some
other structural weakness in the house.  If you did this kind of work
and that is the area that is cracking, you'll definitely need to talk
to a structural engineer.
Did you convert any flooring from carpet to tile?  Tile, especially if properly installed on concrete board, is quite heavy.  If some
element of your structure was at its load, the tile load could have
caused some settling into the new load.  I might expect some cracking
tile in this situation.
Were any roofs lor gutters or drainage systems altered or compromised during your remodel?  Is it possible you now have
drainage water running next to your foundation etc that was
previously safely directed away?
If there was heavy equipment or digging on your site during the remodel, a french drain system outside the house could have been crushed or destroyed by the digging or heavy equipment.  If you know
where water goes into your french drain system and where it goes to
daylight again, you could have it camera snaked by a professional
sewer cleaning company.  You could also try a poor mans trick of
filling it with the garden hose.  If it doesn't come out the other
end, you probably have a problem.
Is your water usage excessively?  If you have a leaking water main or sprinkler system, which would probably be indicated by heavy water
usage, the water could be running underground near the foundation and
causing settling or expansion.
Last you could have an actual foundation problem.  A crack in a slab or a really old foundation (think stone not concrete) could be
failing and causing some cracking.  If your foundation is visible
around the outside of the house (most older homes have some
'freeboard' concrete showing), you might be able to see a problem.
Or if you have a crawl space you could examine the foundation in the
crawl space.  I don't think this is especially likely unless you have
a stone rubble foundation.

So those are some very general things that could cause this problem.  I'd strongly suggest investing in an hour or two of a structural engineer's time if for no other reason than to sleep better at night.  If something really foolish has been done structurally, hopefully they would notice and you could correct it before the problem becomes more serious (structure or life threatening).  I'd also consider having a drainage guy out to look at your gutter and drainage systems if they aren't in great shape.
Hope that helps.
Answer: The short answer is, 'your house is like a living creature'.
The long answer is with changes in temperature, humidity, barometric pressure and similar, all have an effect on the overall dimensions of different building materials. Generally things shrink when they get colder and/or more dry, expand when they get warmer and/or more moisture rich; however they do this at different rates. The lumber in your walls may expand or contract in greater amount than your drywall does under the exact same conditions.
All this shifting means that gaps, cracks and sometimes even buckling of surfaces (drywall, trim, hardwood floors, etc.) may occur through changes in weather. This can be especially true in places where there is a large difference in temperature between the outside of the home and the inside.
Don't expect ANYTHING to ever remain 100% stable and unchanging through the seasons.
See Here For Specific Rates of Expansion
Inspectapedia.com - Table of Table of Coefficient of Expansion of Building Materials
Comment: This is all true, but on the other hand there are many other reasons that cracks might form: water, movement/deflection/settling of the structure, inadequate fasteners, etc. I don't think there's enough info in the question to say for sure.
Comment: Good point Henry. I do think 18 months is a sizable amount of time for anything major in the installation to have shown up. It would be good to get more information regarding what might have changed in the house (ice dams, extreme temperatures, changes in roof, etc.)
Answer: Houses are like living creatures, but I doubt this is the case where "breathing" caused problems. Your problem is to put it in one word poor craftsmanship. Most likely contractor "forgot" to put the flange and on the places where boards are joined crack appears. If that is the case, and from my experience usually it is you should scrape the paint put flange where ever necessary, also apply specialized products for this type of work (knauf's  fugenfuller etc.) and pain it all over again. Scraping is so flange would get a better grip on the board, but it is not necessary.
Comment: From your use of the word, "flange" sounds like what we would call "tape" and joint compound in the US.
Comment: I think they mean the *bevels* at the top and bottom of a sheet. Butt-joints are more likely to crack unless done correctly (make a ~2' wide bulge all the way along it).
Comment: Sorry,a bit of language bariere.Flange is kind of tape; here is the link there you can see:http://www.dragovic.biz/modules/imager.php?w=600⌖=aℑ=../catalog/images/233


Book with woman with supernatural powers forced into slavery

Question: A female character with supernatural powers starts off working for a criminal gang with other powers. She is captured and sent to work for supernatural creatures who have blackmailed the government to give them human slaves. Her master is involved in a power struggle between the supernatural beings. There are some other supernatural things that everyone is scared of. I think it's a series.
Comment: date or year would be helpful. some names of characters or palces. And i didnt downvote.
Comment: I'm assuming that this is a book?
Comment: @Sean Duggan Question's original title was "book identification" so I presume it is.
Answer: One possible answer is The Bone Season, by Samantha Shannon.
It's set a couple of hundred years in the future, and the UK (at least; possibly the world) has been conquered by powerful beings called Rephaim. Psychic powers are common and tightly controlled - the protagonist is Paige, who is a clairvoyant, working with and protected by an organised crime ring.
Unfortunately for her, she's captured and sent to the Rephaim headquarters; there she learns some truths about her world, including that the Rephaim claim to be there to protect humans from another species, called the Emim. There are also innumerable power struggles among the Rephaim.
It's the first book of a projected seven book series.
Comment: Yes, that is definitely it. Thank you.


CredentialsError: Missing credentials in config. While using S3 SDK in EC2

Question: Architecture of my application have one elastic load-balancer and auto scaling group, In Auto Scaling Group I have created Launch configuration to instantiate EC2 instances with UserData to run nodejs server on each instance.
AWS_ACCESS_ID and AWS_SECRET_ACCESS_KEY has been added in EC2 environment variables using User Data. So, in my server-side(Node) code I am not giving these credentials.
It is giving error when I use S3 SDK.
Error says: "CredentialsError: Missing credentials in config".

But, if I use the same User Data to create individual EC2 Instance without any load-balancer and Auto Scaling Group, It works fine.
And also, if I stop the node server manually (when I have the load-balancer and auto scaling group) on EC2 instance and run it again, it starts working fine.
Following is the user data I have for EC2 Launch Configuration.
I am using Amazon-Linux on EC2.
<code>#!/bin/bash
set -e -x
echo AWS_ACCESS_KEY_ID=********** >> /etc/environment
echo AWS_SECRET_ACCESS_KEY=****************************** >> /etc/environment
curl --silent --location https://rpm.nodesource.com/setup_9.x | bash -
sudo yum install -y git nodejs
git clone https://github.com/Vaaceph/BackEndCloud.git && cd BackEndCloud
sudo npm install
DEBUG=express:* node server.js
</code>
Answer: Best practice for EC2 is to assign an instance profile as per: https://docs.aws.amazon.com/autoscaling/ec2/userguide/us-iam-role.html
This has benefit that the credentials used by EC2 are short lived, automatically rotated and don't require ongoing management of the user access key/secret key.


Order to watch the Danganronpa series? Is there a "Danganronpa 2"?

Question: This season there are 2 simultaneous Danganronpa shows, both of which are prefaced with "Danganronpa 3".  The first series in the franchise is "Danganronpa: Kibou no Gakuen to Zetsubou no Koukousei".
I'm not clear on if there is a second series anywhere, or if the number 3 was just added to the names of both the new series.
Wikipedia says

A second anime series, titled Danganronpa 3: The End of Hope's Peak High School, began airing in July 2016. The series is split into two simultaneously airing parts; Side: Future, which serves as a conclusion to the "Hope's Peak Academy" storyline, and Side: Despair, which serves as a prequel to Danganronpa 2

which is clear as mud.  I am unable to find information on "Danganronpa 2", though I would expect one to be a prequel to the first series, and the other to maybe be a side story or a post story.

What order should I watch Danganronpa in?
For the current series, does it matter which episode I watch first from each of the simultaneous ones (the "Future Arc" started airing before the "Despair Arc")?
Does the Wiki page confuse "Danganronpa 2" with the manga/LN material?
Comment: When it says it'll serves as a prequel to Danganronpa 2 I assume it's talking about the PSVita game Danganronpa 2: Goodbye Dispair. the first Danganronpa anime was an adaptation of the first game and I'm not sure what adaptations the Danganronpa 2 stuff are to the second game having not read/seen any of the anime/manga/light novels
Answer: I think what is being missed here is the second game in the series, Danganronpa 2: Goodbye Despair.
From the Wikipedia article:

It is the second installment in the Danganronpa series, and a direct sequel to the 2010 game Danganronpa: Trigger Happy Havoc.

It's the sequel to Danganronpa 1, adding to the DGR universe beyond the events of Trigger Happy Havoc, complete with a whole new set of characters, scenery, and more.
Danganronpa: The Animation is an anime adaptation of DGR1, AKA Trigger Happy Havoc, AKA THH. THH is the basis of the entire DGR story/franchise; it is the first game, but not the first event of DGR chronologically. Essentially all other canon media in the DGR universe builds upon the events of THH, so you'll want to start here. Either the show or the game will suffice, though I recommend the game.
DGR2's story is critical to both sides of the DGR3 animes. As per the wiki article, Despair

tells the backstory of Hope's Peak Academy's 77th Class

which is the same class featured in DGR2. Even though 3/Despair happens chronologically before DGR2, I recommend playing DGR2 before watching 3/Despair. DGR2 tells the story of the 77th class, which is then given more context/backstory in 3/Despair. DGR2 does not have an anime adaptation, but it apparently has a manga.
The Future and Despair arcs aired simultaneously in an alternating fashion, starting with Future. Chronologically, Despair happens entirely before Future, but the intended watching order is actually the order in which the episodes are released; so, also in an alternating fashion starting with Future (source: wiki.) In other words, Future ep. 1, then Despair ep. 1, then Future ep. 2, then Despair ep. 2, so on and so forth.

So, to hopefully answer your questions:

All Series Watch Order:

DGR1/THH/Danganronpa: The Animation
DGR2: Goodbye Despair (game or manga)
DGR Ultra Despair Girls (game)

 A few characters from UDG appear in Future, so it may benefit you to play this first, but it's not a dealbreaker like not playing DGR2 is.

Alternate watching DGR3/Future and DGR3/Despair episodes, i.e. F1 -> D1 -> F2 -> D2... etc.
DGR3/Hope
Danganronpa V3: Killing Harmony (game)

 IMO, V3's only strict prerequisite is DGR1 to get the full picture, but I recommend experiencing the whole series to be safe, if you can.

The DGR subreddit also has a good FAQ/writeup on this topic, including Supplementary Material.

DGR3 (Anime) Series Watch Order:

Alternate watching Future and Despair episodes, starting with Future.

A Note Regarding DGRv3:

The branding can be slightly confusing between Danganronpa 3 and Danganronpa V3. Danganronpa V3: Killing Harmony is the third installment of the game series (and features a brand new cast separate from DGR1/2), and Danganronpa 3, as discussed above, is the anime split into two parts (Despair/Hope) and the last episode, Hope.
Answer: Okay, so this actually gets a little complicated.
Instead of watching the anime for the first game, I would watch a let's play or pick it up on Steam when it's on sale (it's worth it, trust me).  As far as an actual order to get the most out of the story the order I would go is:

Danganronpa: Trigger Happy Havoc
Danganronpa 2: Goodbye Despair
Danganronpa Another Episode: Ultra Despair Girls (this has spoilers for SDR2)

All of this is pretty standard so far.  But here is where things get complicated.  After 2 comes Danganronpa 3: The End of Hope's Peak Academy which is set during 2 different timelines that are two different complementary series.  The idea is that you alternate between the two of them starting with Side Future, then Side Despair so your order would be F1, D1, F2, D2, etc...
After that you'll be all caught up for the release of Danganronpa V3: Killing Harmony this summer.
Answer: I'm pretty sure it's like this:
Danganronpa 3: Despair Arc first.
Then the remnants of despair (students in Danganronpa 3) ruin world while Danganronpa: The Animation/Trigger Happy Havoc is going on.
Niegi and others escape and successfully capture the remnants. While they are, the events in New Despair Girsls are taking place.
As Danganronpa 3: Future Arc starts, the remnants are currently in Danganronpa 2: Goodbye Despair.
When Danganronpa 3 ends, Niegi, Kirigiri, and Byakuya head into Danganronpa 2 to help the former remnants. This isn't the order to watch or anything, but it is the chronology.
Answer: To be honest, the correct order of watching it is: (From top to bottom)

Future Arc
Despair Arc
Hope

By watching alternately, it makes more sense but the proper way to watch is: (From top to bottom)

Future
Despair
Hope
Answer: The anime are actually pretty much a secondary product to the DR games.

In order to watch the Danganronpa series, you should play the games before watching the Danganronpa 1 and Danganronpa 2 anime. The games are called:

Danganronpa 1

and

Danganronpa 2

After that watch Danganronpa 3 anime and then play the Danganronpa 3 game.

No matter how you look at it, the story doesn't really make sense unless you play the games, as the anime was made for the people who have already played the games.(At least the Danganronpa 3 anime was, the Danganronpa 1 anime is just an adaptation of the first game.)
Answer:
Danganronpa 1/trigger happy havoc (danganronpa: the animation?)
danganronpa 2: goodbye despair
Danganronpa: ultra despair girls
danganronpa 3: future , despair , hope. (< in order)
danganronpa: the end of hope's peak academy(?)
Danganronpa V3: killing harmony
danganronpa anime(?)
Comment: Welcome to A&M, could you elaborate a bit on this order?
Is this the chronological order? The order of release?


$K$-convex Banach spaces

Question: Let $X$ be a Banach space. We say that $X$ contains $\ell_1^n$'s uniformly iff for all $n\in\mathbb N$ there exist subspaces $X_n\subseteq X$ with $d(X_n,\ell_1^n)\leq \lambda$ for some $\lambda\geq 1$. A famous theorem of Pisier's asserts that an infinite dimensional Banach space is $K$-convex iff it does not contain $\ell_1^n$'s uniformly. For the notion of $K$-convexity look at https://bookstore.ams.org/cbms-60. I want to know the following suppose an infinite dimensional Banach space $X$ is not $K$-convex. Now assume that $X$ is an inductive limit of Banach spaces $Y_1\subseteq Y_2\subseteq\dots\subseteq Y_n\subseteq\dots$ where $\text{dim}Y_n=n.$ Let $X$ not $K$-convex. Clearly without loss of generality we may assume that there exists an increasing sequence $(k_n)$ such that $Y_n$ contains a subspace of dimension $k_n$ which is $\lambda$-isomorphic to $\ell_1^{k_n}$ for all $n\geq 1$ and $\lambda\geq 1$ fixed positive constant. My question is if there are any known estimates on the norm of projection from $Y_n$ to  the subspace which is $\lambda$-isomorphic to $\ell_1^{k_n}$?
Answer: $Y_n$ can be $\ell_\infty^n$, in which case the best projection onto any $\ell_1^k$ is of order at least $\sqrt{k}$.
Comment: If the $Y_n$ are uniformly isomorphic to $\ell_n^p$, with $1<p<\infty$, then $X$ is $K$-convex. My answer implies that in general you do not have bounds better than of order $\sqrt{n}$ if, e.g., $X$ is a $C(K)$ space.
Comment: I am starting with the Banach spaces $Y_n$'s and now I want to know a bound on the projection constant. For example $Y_n=\ell_p^n$ and $X=\ell_p.$ Or do you want to say that if X is not K-convex then X contains $Y_n$'s isomorphic to $\ell_\infty^n$'s for which you have what you are saying? If so can you also find the bounds on norms of the isomorphism depending on $n$?
Comment: Also please note that I have the restriction that X is not K convex. So there might be something special happening.

$K$-convex Banach spaces


How does a stored image or video appear in binary on the hard drive?

Question: In attempting to understand the concept of binary, my question is "How does a stored image or video look in binary on the hard drive?"
Answer: As for how it is physically stored, it depends on the technology of your storage device. For a hard disk drive you can read about it on Wikipedia.
The next layer is how the controller on the storage device sends the data to the motherboard.
Then how the motherboard sends the data to the operating system.
Then how the operating system stores the data on the disk (what file system it uses; NTFS is common in modern Windows installations.)
Finally, what you'll see when reading the data is groups of 8 bits (bytes) which are basically 8 on/off flags, which together form 256 possible combinations. Which is why most image formats are stored with colors varying from 0-255 for each channel (red, green, blue.) Most raw formats are stored linearly, so you can actually try reading them yourself. A raw image where the first pixel is red (assuming it stores the pixels left-to-right, top-to-bottom) would look like this in bits:
<code>11111111 00000000 00000000
red      green    blue
</code>
For more information, you'll have to be more specific.
Answer: Check out the link: Binary File Format
The images are sequential flow of colored dots... But it's not hardware dependent i.e. your hard-disk will store any thing in any format which your OS provide it to... However the OS maintain standards of saving file formats other wise a JPG image will not be valid one across different platforms...
Simillarly the videos are flows of images and voice data multiplexed into a sequential flow.
Answer: Every file on disk is basically a number of bits in a row.
The difference between "binary" and "something else" (often called ASCII, or text, or...) is that non-binary is basically human readable when opened in a text editor. In other words: the bytes in the file map to human readable letter (and other) characters in some way a generic text editor knows how to handle.
So called binary files can only be interpreted back to that data that they actually contain when you know the format which was used to map the content (image, sound, movie, whatever) to a stream of zeros and ones. This mapping is called the file format and is usually part of the file name in the form of an extension. You need a piece of software that knows the mapping and can interpret the row of bits back into the original content.
Mind you: this is usually only a hint. Renaming a JPEG image file to have a .mp3 extension doesn't change it into an audio file; it is still just an image file, containing the image (=dimensions of the image in pixels + the color values for each pixel, basically) encoded into a stream of zeros and ones in the way described in the JPEG file format encoding description.
Comment: re renaming: As a kid, I renamed a .bmp file to an .exe file, tried to run it, and was confused why it didn't display the picture...
Answer: All data on commercial computer systems are stored in binary format (we'll ignore scientific studies into quantum and optical computing).
At the lowest level all files and processing by a computer are performed in binary. This is because our computing systems are powered by the flow of electrons. They either flow or don't. Electric current is on or off. 1 and 0.
The data stored on a hard disk is there due to pulsing of the hard disk write head coil which magnetises spots of hard disk material. These magnetised spots cause a current pulse in the read coil (in actual fact the read and write coils are the same) as the hard disk head passes over them. Hence the data is read as a stream of current pulses, 1s and 0s.
Now processors are built to accept process a finite number of binary "pulses" or data bits simultaneously (it can be anything from 4 bits upwards). Hence a modern 64bit PC can process 64 binary data bits i.e. 64 1s and 0s, at any one time.
Now at a higher level, although all files are stored as binary and can be read in binary format we help the processing of them by telling the processor what format to read them in. This is so that it process the file data as small chunks e.g. 8 bits or 1 byte for ASCII text.
The operating system provides the processor with a template for any given file. This is set up in an extension relation table. And according to what the file extension is the operating system will expect that data to be in a particular format and link it to code that can be used by the processor to interpret it. Hence changing a file name extension will confuse the processor as it won't interpret the data correctly. That's why changing the filename from *.jpg to *.exe won't show the image, as the processor has been told to expect executable code, which the data within the file clearly isn't.
So back to your original question the image within the jpeg file has been encoded as series of 1s and 0s in a specific order.
I'm not sure how exactly they are arranged, but as an example:
A picture was captured and stored as a bitmap at a resoultion of 800 x 600 in 24bit colour. The first pixel is stored as 3 bytes (8 bit binary) representing a red, green and blue value. The value of each byte dictates the intensity of that colour. 0 - 255, with 0 being none at all to 255 being the highest value. Unsigned 255 in binary is 11111111, I won't confuse you with 2's complement for signed values. So the full picture will require a file of minimum 1,440,000 bytes or about 1,406 kilobytes (a kilobyte being 1024 bytes).
Answer: The binary as follows: 000010101011010101101010101 would be stored on a hard drive actual microscopic bumps and troughs by changing the polarity of the metalic grains on the disk in specific regions.Binary is actually read from right to left, obviously the opposite way of how most people read text.
Comment: I think you're confusing a harddisk with an optical medium like a CD? As far as I know there are no bump on harddisk platters, just alignments of magnetic particles. But then again, I hardly know anything about harddisk hardware myself.
Comment: Come to think of it I think your absolutely right, should seem obvious because disks are read with lasers and a hard drive is read/written by a copper head actuator coil according to Wikipedia. I feel dumb now...
Answer: If your question is really "how does it look": See Figure 4 on this page; it shows high resolution measurements of a hard drive.
Although googletorp's answer does not look very helpful, it's not totally untrue. To store binary data, the only thing you need is the possibility to have two different states for each storage unit (be it an on/off switch, hole or no hole in a punchcard, or, as in the case of hard drives, the direction of ferromagnetic particles).
Answer: The Wikipedia page for the BMP File Format contains an example(Including all hex values) of a 2x2 pixel bitmap image, it should be very good at explaining the basis of the binary representation of an image.
In general if you're really curious how the binary looks for a file you could always use a Hex Viewer and take a look yourself :) I normally use od on Linux to dump the binary information of a file. I'm sure you can google a good Hex Editor for Windows (or maybe someone can suggest one.)
Answer: Headers ? Every file created contains header information, that are also stored as binary bits along with the data. The header bits of a files holds the information of header length, file type, file location and length. Now each application is designed to read certain file types. If the application tries to open a file on hard disk which has a header with a different file format, that is not supported by the application, it fails to read the file. Thus a text file cannot be opened using a media player. Because a media player expects a file that contains a header with audio file format binary pattern. Similarly, same in case of picture files.


Can the original "Age of Empires 2" be played in two-player mode, so I can play against a friend (and a few computer-driven societies)?

Question: Recently, I downloaded the game "Age of Empires II" (the original version of 20 years ago) on my PC. I would like to play that against a friend, both in the same room against each other (and if possible against computer-driven societies). Is it possible to use a multiplayer mode for that? Does it work via the same Wifi network? Do I need to use a LAN cable or insert the IP address?
Comment: Given the age of the original game, you might have a few technical wrangles such as the original game using IPX. But then again, you're going to have technical wrangles just getting it running on modern Windows. Without knowing how you plan to so much as run the game, and on what OS, whether you plan to use DOSBox/WINE, etc, we can't give you any more details.
Answer: According to the website, Age of Empires II: Age of Kings supports multiplayer through both wireless and LAN. There is a place in the main menu called Lobbies, and from there you can either create a lobby or join your friend's lobby, and add as many computer players as you want from the game.
You can also join online wireless lobbies through this website.
Comment: bear in mind, they are talking about *the original* release, not the re-release that is patched to work on modern OSes.


Need some sources on radiotelescope sensitivity

Question: Could anyone direct me to papers with info on minimal flux that can be registered with radiotelescopes?
Comment: Have a look at the answer I've posted. If it is not what you are expecting or you have further questions, please feel free to add a comment. I'm not an expert, but I'll do my best.
Comment: The links I've provided may not direct you to the best papers on the topic, I think probably others more familliar with the literature will add answers as well.
Answer: I'll try a quick estimate.
The strength of a radio source $S$ is often measured in Jansky's and 1 Jy is $1 \times 10^{-26}$ W/m^2/Hz. That means every square meter of collection area is exposed to $1 \times 10^{-26}$ per Hz of bandwidth.
Total power received would then be
$$P_S = S A \Delta \nu$$
where $A$ is the receiving area of the dish and $\Delta \nu$ is the bandwidth in Hz.
The noise limit of an RF receiving system is often expressed as an equivalent temperature. A typical number might be 50 Kelvin, which includes a receiver temperature, sky temperature, spillover (thermal radio emission radiated from the ground) etc. Though it seems counterintuitive, we can add temperatures as a proxy for adding powers because we are in the Rayleigh-Jeans regime where $\nu << k_B T/h$ as explained in this answer
You convert the noise temperature to a power in Watts:
$$P_N = k_B T \Delta \nu$$
where $k_B$ is the Boltzmann constant which is about $1.381 \times 10^{-23}$ Joules/K, and $\Delta \nu$ is again bandwidth in Hz.
Let's set the minimum strength easily detected to be equal to the noise, and equate the two powers:
$$P_S = P_T $$
$$S A \Delta \nu = k_B T \Delta \nu$$
$$S A = k_B T$$
$$S = k_B T / A$$
Note that the bandwidth drops out since both the thermal noise and most radio sources are fairly broadband. Even if the original line is fairly narrow, you'll tend set your minimum bandwidth of a specific measurement to cover the spectral region of interest.
Ballpark Estimate
The Arecibo dish has a radius of about 150 meters, so the area $A$ is about 70,700 square meters. A typical radio astronomy system temperature is 50 Kelvin (it can be significantly higher or lower depending on many factors, NASA deep space 70 meter dish liquid helium cooled front-end is 20K (see here and here), so plugging that into the equation above, we get $ = 9.8 \times 10^{-27}$ watts, which is (probably not coincidentally) almost exactly 1 Jansky!
Confirm that
According to Joeri van Leeuwen's Radio Astronomy lecture 5, The Radio Telescope at the bottom of page 79, the System equivalent Flux Density or SEFD of Arecibo is 3 Jansky, so a basic back of the envelope calculation gets us quite close!
Other radio telescopes will very roughly scale based on area, a smaller area dish will have a higher SEFD or signal level equivalent to the system noise.
Another example, VLA
A VLA dish is 25 meters in diameter, which is about 150 times less area. My back-of-the-envelope calculation would then be 150 Jansky.
According to Table 3.2.1 on the NRAO page Performance of the VLA during the Next Semester; Sensitivity at its lowest, a VLA dish's best SEFD is 250 Jansky. I've plotted the table below. Still checks out.


Python title() with apostrophes

Question: Is there a way to use .title() to get the correct output from a title with apostrophes? For example:
"john's school".title() --> "John'S School"

How would I get the correct title here, "John's School" ?
Answer: If your titles do not contain several whitespace characters in a row (which would be collapsed), you can use string.capwords() instead:
>>> import string
>>> string.capwords("john's school")
"John's School"

EDIT: As Chris Morgan rightfully says below, you can alleviate the whitespace collapsing issue by specifying " " in the sep argument:
>>> string.capwords("john's    school", " ")
"John's    School"

Comment: And that is exactly equivalent to `' '.join(x.capitalize() for x in s.split())`.
Comment: And if you care about not collapsing multiple spaces, you can specify the `sep` argument: `string.capwords("john's school", ' ')`.
Comment: @Chris, very good point, I'll edit my answer accordingly. Thanks :)
Answer: This is difficult in the general case, because some single apostrophes are legitimately followed by an uppercase character, such as Irish names starting with "O'".  string.capwords() will work in many cases, but ignores anything in quotes.  string.capwords("john's principal says,'no'") will not return the result you may be expecting.
>>> capwords("John's School")
"John's School"
>>> capwords("john's principal says,'no'")
"John's Principal Says,'no'"
>>> capwords("John O'brien's School")
"John O'brien's School"

A more annoying issue is that title itself does not produce the proper results.  For example, in American usage English, articles and prepositions are generally not capitalized in titles or headlines. (Chicago Manual of Style).
>>> capwords("John clears school of spiders")
'John Clears School Of Spiders'
>>> "John clears school of spiders".title()
'John Clears School Of Spiders'

You can easy_install the titlecase module that will be much more useful to you, and does what you like, without capwords's issues.  There are still many edge cases, of course, but you'll get much further without worrying too much about a personally-written version.
>>> titlecase("John clears school of spiders")
'John Clears School of Spiders'

Answer: I think that can be tricky with title()
Lets try out something different :
def titlize(s):
    b = []
    for temp in s.split(' '): b.append(temp.capitalize())
    return ' '.join(b)

titlize("john's school")

// You get : John's School

Hope that helps.. !!
Comment: @FrédéricHamidi Thats not fair. Yugal code doesnt take spaces away that is a problem with string.capwords
Comment: It's *not* better. It's much less efficient (appending to a list item by item rather than using a generator expression). And `string.capwords` accepts a `sep` argument, which, if set to `' '` would do precisely this.
Comment: You don't need any extra library here !
Comment: @joaquin, you're right, I didn't see the argument to `split()` at first. Yugal's implementation is therefore better than `capwords()`, apologies for implying otherwise.
Comment: Its worth.. if this is the use case.
Answer: Although the other answers are helpful, and more concise, you may run into some problems with them. For example, if there are new lines or tabs in your string. Also, hyphenated words (whether with regular or non-breaking hyphens) may be a problem in some instances, as well as words that begin with apostrophes. However, using regular expressions (using a function for the regular expression replacement argument) you can solve these problems:
import re

def title_capitalize(match):
    text=match.group()
    i=0
    new_text=""
    capitalized=False
    while i<len(text):
        if text[i] not in {"'", "'"} and capitalized==False:
            new_text+=text[i].upper()
            capitalized=True
        else:
            new_text+=text[i].lower()
        i+=1
    return new_text

def title(the_string):
    return re.sub(r"[\w''‑-]+", title_capitalize, the_string)

s="here's an apostrophe es. this string has multiple         spaces\nnew\n\nlines\nhyphenated words: and non-breaking   spaces, and a non‑breaking hyphen, as well as 'ords that begin with 'strophies; it\teven\thas\t\ttabs."
print(title(s))

Anyway, you can edit this to compensate for any further problems, such as backticks and what-have-you, if needed.
If you're of the opinion that title casing should keep such as prepositions, conjunctions and articles lowercase unless they're at the beginning or ending of the title, you can try such as this code (but there are a few ambiguous words that you'll have to figure out by context, such as when):
import re

lowers={'this', 'upon', 'altogether', 'whereunto', 'across', 'between', 'and', 'if', 'as', 'over', 'above', 'afore', 'inside', 'like', 'besides', 'on', 'atop', 'about', 'toward', 'by', 'these', 'for', 'into', 'beforehand', 'unlike', 'until', 'in', 'aft', 'onto', 'to', 'vs', 'amid', 'towards', 'afterwards', 'notwithstanding', 'unto', 'while', 'next', 'including', 'thru', 'a', 'down', 'after', 'with', 'afterward', 'or', 'those', 'but', 'whereas', 'versus', 'without', 'off', 'among', 'because', 'some', 'against', 'before', 'around', 'of', 'under', 'that', 'except', 'at', 'beneath', 'out', 'amongst', 'the', 'from', 'per', 'mid', 'behind', 'along', 'outside', 'beyond', 'up', 'past', 'through', 'beside', 'below', 'during'}

def title_capitalize(match, use_lowers=True):
    text=match.group()
    lower=text.lower()
    if lower in lowers and use_lowers==True:
        return lower
    else:
        i=0
        new_text=""
        capitalized=False
        while i<len(text):
            if text[i] not in {"'", "'"} and capitalized==False:
                new_text+=text[i].upper()
                capitalized=True
            else:
                new_text+=text[i].lower()
            i+=1
        return new_text

def title(the_string):
    first=re.sub(r"[\w''‑-]+", title_capitalize, the_string)
    return re.sub(r"(^[\w''‑-]+)|([\w''‑-]+$)", lambda match : title_capitalize(match, use_lowers=False), first)

Answer: IMHO, best answer is @Frédéric's one. But if you already have your string separated to words, and you know how string.capwords is implemeted, then you can avoid unneeded joining step:
def capwords(s, sep=None):
    return (sep or ' ').join(
        x.capitalize() for x in s.split(sep)
    )

As a result, you can just do this:
# here my_words == ['word1', 'word2', ...]
s = ' '.join(word.capitalize() for word in my_words)

Answer: If you have to cater for dashes then use:
import string
" ".join(
    string.capwords(word, sep="-")
    for word in string.capwords(
        "john's school at bel-red"
    ).split()
)
# "John's School At Bel-Red"

Python title() with apostrophes


What is the correct date format for x-stream-offset for the RabbitMQ Streaming Plugin?

Question: Bunny keeps giving me an error that I believe is being sent back from RabbitMQ that the following strings are invalid date formats:
invalid:

ISO8601 timestamp string
milliseconds Integer
YYYY-MM-DD string
Unix Time or Epoch Time integer Time.now.to_i

valid:

Integer (gets back the requested message and everything after)
first (string) (gets back all messages starting from first)
last (string)
next (string)

iso8601 = '2021-08-28T13:40:31-07:00'

opts = {
  exclusive: false,
  manual_ack: true,
  block: true,
  arguments: {
    'x-stream-offset': iso8601
  }
}

queue.subscribe(opts) do |delivery_info, _properties, payload|
  msg = JSON.parse(payload)
  puts msg

  ch.ack(delivery_info.delivery_tag, false)
end

i get an error back that says its an invalid stream offset argument
below is the error message from the rake task that I am running it in
Bunny::PreconditionFailed: PRECONDITION_FAILED - invalid arg 'x-stream-offset' for queue 'stream_test' in vhost '/': {invalid_stream_offset_arg,{longstr,<<"2021-08-28T13:40:31-07:00">>}}
/Users/aronlilland/.rvm/gems/ruby-2.4.1/gems/bunny-2.18.0/lib/bunny/channel.rb:2014:in `raise_if_channel_close!'
/Users/aronlilland/.rvm/gems/ruby-2.4.1/gems/bunny-2.18.0/lib/bunny/channel.rb:944:in `basic_consume_with'
/Users/aronlilland/.rvm/gems/ruby-2.4.1/gems/bunny-2.18.0/lib/bunny/queue.rb:191:in `subscribe'
/Users/aronlilland/Documents/dev/bin/random/rabbit_mq_stream/lib/stream/lib/read.rb:39:in `read'
/Users/aronlilland/Documents/dev/bin/random/rabbit_mq_stream/tasks/read.rake:9:in `block in <top (required)>'
/Users/aronlilland/.rvm/gems/ruby-2.4.1/gems/rake-12.3.3/exe/rake:27:in `<top (required)>'
/Users/aronlilland/.rvm/gems/ruby-2.4.1/bin/ruby_executable_hooks:22:in `eval'
/Users/aronlilland/.rvm/gems/ruby-2.4.1/bin/ruby_executable_hooks:22:in `'

--
below is a working example connecting to rabbitMQ as a stream (without the binary protocol) - the streaming plugin is required
# frozen_string_literal: true

require 'bunny'
require 'json'
require 'pp'

rabbit_user = 'guest'
rabbit_pass = 'guest'
rabbit_host = 'localhost:5672'

conn = Bunny.new(
  "amqp://#{rabbit_user}:#{rabbit_pass}@#{rabbit_host}",
  client_properties: { connection_name: :stream }
)

conn.start

ch = conn.create_channel(nil, 16)

queue = ch.queue(
  'stream_test',
  durable: true,
  auto_delete: false,
  exclusive: false,
  arguments: {
    'x-queue-type': 'stream',
    'x-max-length-bytes': 500_000_000
  }
)

50000.times do |i|
  queue.publish(JSON.dump({ hello: "world #{i + 1}" }), routing_key: 'stream_test')
  puts "published #{i + 1}"
end

ch.basic_qos(25)

opts = {
  exclusive: false,
  manual_ack: true,
  ## block will make it consume the main IO instead of being a seperate thread
  ## it is not recommended in production
  block: true,
  arguments: {
    'x-stream-offset': 'first'
  }
}

queue.subscribe(opts) do |delivery_info, _properties, payload|
  msg = JSON.parse(payload)
  puts msg

  ch.ack(delivery_info.delivery_tag, false)
end

puts 'done'
sleep 1
conn.close

the Java client examples show that it should be able to accept a timestamp, but it doesnt appear that I am able to send one, is there an accepted date format?
the Java client Docs for the streaming feature say

Timestamp - a timestamp value specifying the point in time to attach to the log at. It will clamp to the closest offset, if the timestamp is out of range for the stream it will clamp either the start or end of the log respectively. With AMQP 0.9.1, the timestamp used is POSIX time with an accuracy of one second, that is the number of seconds since 00:00:00 UTC, 1970-01-01.

I can find no examples of what a POSIX timestamp looks like
Answer: I wondered the same for the RabbitMQ .NET client. It turns out that there is a AmqpTimestamp type.
On the wire it ends up being something like 'T'{(ulong bytes)timestamp}.
So this worked:
var streamOffset = new AmqpTimestamp((long)Math.Floor((DateTime.Parse("2023-02-17T08:11:00Z", CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal) - DateTime.UnixEpoch).TotalSeconds));

channel.BasicQos(0, 10, false);
channel.BasicConsume(
    queue: stream,
    autoAck: false,
    consumer: consumer,
    arguments: new Dictionary<string, object> { { "x-stream-offset", streamOffset } });

Answer: After looking at the Erlang RabbitMQ source code here, which is not shown in any of the developer docs, it appears that you can get time series data by passing in {number_of_seconds}s to get the number of seconds or {number_of_minutes}m to get the number of minutes
So, time series data can be formatted as a string - it looks like it does indeed accept some format of time, but again it isnt clear how to get it to work, for the sake of my needs a string value is acceptable
%% Erlang Source Code for RabbitMQ
source_filters_to_consumer_args(#'v1_0.source'{filter = {map, KVList}}) ->
    Key = {symbol, <<"rabbitmq:stream-offset-spec">>},
    case lists:keyfind(Key, 1, KVList) of
        {_, {timestamp, Ts}} ->
            [{<<"x-stream-offset">>, timestamp, Ts div 1000}]; %% 0.9.1 uses second based timestamps
        {_, {utf8, Spec}} ->
            [{<<"x-stream-offset">>, longstr, Spec}]; %% next, last, first and "10m" etc
        {_, {_, Offset}} when is_integer(Offset) ->
            [{<<"x-stream-offset">>, long, Offset}]; %% integer offset
        _ ->
            []
    end;
source_filters_to_consumer_args(_Source) ->
    [].

The answer in Ruby would be to do the following:
## float/decimal values are rejected, only accepts whole numbers,
## so you have to round seconds to the nearest whole number
offset = "10s"

opts = {
  exclusive: false,
  manual_ack: true,
  ## block will make it consume the main IO instead of being a seperate thread
  ## it is not recommended in production
  block: true,
  arguments: {
    'x-stream-offset': offset
  }
}

queue.subscribe(opts) do |delivery_info, _properties, payload|
  msg = JSON.parse(payload)
  puts msg

  ch.ack(delivery_info.delivery_tag, false)
end


How to get Visual Studio quick comments to add a space after the double slash to avoid SA1005?

Question: In Visual Studio, I have a block of code. I highlight it and use Ctrl+k+c to comment out the block. That adds "//" at the start of every line I highlighted. I then try to submit my code... and I run into StyleCop rule "SA1005" that requires all // to be followed by a space or be changed to ////. I would really like to modify Visual Studio so that ctrl+k+c adds "// ". I have not found any extensions or options that make that happen. Does anyone know of a way to do that change (short of writing my own new VS extension)?
Answer: My coworker tells me that you can also just hit Ctrl+K+C Ctrl+K+C (that is, apply commenting twice), and it will do ////code. That will pass StyleCop. Do the uncomment shortcut key twice to undo. Apparently, StyleCop doesn't care if there's a space after four slashes, only after two.
It seems some people really like this rule behavior. People will comment out code with a single set of // if they are playing around with stuff but do not want to forget and check it in that way.  SA will fail and the code will not go in.  Once you really mean to comment out of the code and check it in, then you comment it out again and you are good to go.  This, they claim, has saved many from a bad check-in.
Answer: You don't need to write your own VS extension, there is already plugin GhostDoc that we are offering - you are welcome to use the free version - and it will generate StyleCop compliant XML Comment templates (which you can tweak too). GhostDoc also generate the comments on triple-slash (///) just like the VS does.
Comment: Nice plug.  GhostDoc is excellent. However, this doesn't solve the OP's issue of inserting a space after `//` and I also note, that whilst GhostDoc makes attractive `///  ` comments, when writing a multi-line `` inside a GhostDoc generated comment block, adding a new line default Visual Studio to default to `///` with no space, making very unattractive output.
Comment: I agree that GhostDoc is a great tool. However this question is not related to XML Documentation comments.
Comment: This does not answer the OP question, but rather advertise your tool.


Rigify problem with floating bones

Question: just wanted to ask, I'm learning Rigify and why are those green circles just standing in the air like that? I see that in this tutorial they are also standing like this. Is this normal? Should something be done to fix them? Example:
Answer: In Rigify Rigs every limb has two animation systems: IK and FK. When you select a bone of a limb, in the N properties panel you will see an IK/FK slider that lets you choose which control bones chain to use.
In your example you're using IK, if you switch the slider to FK the limbs will go to the floating bones.
We generally turn off the visibility of the unused bone chains using bone layers (3.6 and older versions) or bone collections (4.0 and above).

Rigify problem with floating bones


I signed a lease with on site manager then the following day the owner of the property wanted to void the lease

Question: I was approved to move into a lot,, so i paid a $100 deposit on a space rent and the onsite management made an  agreement with me to pay the remaining 435 by the 15th of the month. 24 hours later the owner wanted to void the lease until the 435 was paid. Instead of making me leave he refused me unit utilities and gave me intell 5pm on the 14th on the month to pay the 435. My lease states the agreement made with on-site manager?
Comment: What exactly is your legal question?  It's not quite clear.
Answer: It depends on where this is and what kind of rental you're talking about, but generally, the owner has to live with the consequences of his agent's agreements. However, if you signed a lease that supports the owner's position over your understanding with the agent, the written document generally take precedence. On the third hand, your description makes it sound like the manager explicitly overrode the implications of the written lease (so on the fourth hand, it somewhat depends on whether he decides to support your position in court, or not – that is, can he maintain that you misinterpreted his statement? This is why the written document counts the most).
Your description in terms of "moving into a lot" doesn't match the tag "residential lease", which matters because a landlord can't cut off the utilities on a residential lease (apartment) under state law (if this is in the US), but the matter is not so clear for other kinds of leases, e.g. mobile homes.


Is it "policy(ies)" or policy(s)" for an optional, parenthetical plural suffix?

Question: When writing a noun that shows a parenthetical plural suffix option, which is acceptable, "policy(ies)" or policy(s)"?
Answer: Since the difference between the words is not a simple addition of characters, using parenthesis to show the optional form is not clear.
Instead, it would be clearer to write:

policy (or policies).


borderlands 2 badass rank lost?? Can i mod a xbox 360 game save on xbox one?

Question: So if i play borderlands 2 xbox 360 version on my xbox one, can i still mod the game save or would i have to play it on the 360 to do so. Disclaimer not looking to break the game just looking to get my original bad ass rank and stats back. I have tried finding a save editor to do so, but to no avail.
Answer: You could try:

Modding your Xbox 360 Save
Load that save into your Xbox 360
Upload the character to the cloud
Load up BL2 on Xbox One
Retrieve cloud save

You can only have one cloud character saved at a time, so if you have multiple characters you have to switch back and forth after each upload.


Can I not fast certain days of Ramadan month but make up for it after it ends?

Question: Can I not fast certain days of Ramadan month but make up for it after Ramadan ends?
It's because of school and stuff.
Comment: Nope, you have to fast.
Answer: Assalm o Alaikum...
Ramadan fasts are obligated like Prayers...
As you can not skip or delay prayers without a genuine reason... Similarly delaying fasts of Ramadan without a genuine reason is not allowed...
So please try to make your fasts in this holy month...
Although it is a little bit difficult but the reward after it is much greater..
Jzk