In tumblr, show only posts with a certain tag in the home page

Question: In tumblr, is it possible to show only posts with a certain tag in the home page?
If so, how is it done?
Comment: This is a programming question, i'm looking to modify the theme's html.
Comment: Are you looking to make an extension, or is this not a programming question?
Answer: I just wrote up the solution to the opposite problem here:

How to hide the posts with a given tag from the homepage.

You can take inspiration from there and implement the opposite. Alternatively, you can simply add a "hidden" tag to each one of the things that you don't want displayed on the homepage.
Answer: I know that this topic is quite old, but I figured I'd share what I did for anyone who is still looking for an answer to this problem.
First, paste the following code after the "</title>" in your theme HTML.
<meta name="text:Default Tag" content="" />

Next, right after the "" in your theme's HTML, paste the following:
{block:IndexPage}{/block:IndexPage}

In your theme settings, you should see a box labeled "Default Tag".  Put the tag you'd like posts to appear for in that box (without a hashtag) and click save.
Now, if someone visits your blog, it will forward them to the page that shows posts with your specified tag.  Of course, this probably isn't the best way of doing it, but it's the best way I could come up with that wouldn't mess up themes.
Another thing I like about this way of doing this, is that you can send someone your blog URL with a "/?" appended to it (e.g. "myblog.tumblr.com/?") and it will show all of your posts.
Answer: Using mircealungu's suggestion worked perfectly for me! Here's how I did it:
1. Find the article tag, and add the classname:
class="notfeatured {TagsAsClasses}"
If it already has a classname, add the part in bold above inside the classname quotes. Mine ended up looking like this:

2. Find the div tag that precedes the article tag, and add the classname:
class="{block:TagPage} tag_page {/block:TagPage}{block:PermalinkPage}perma_page{/block:PermalinkPage}"
Again, if a class already exists, just add the part in bold above inside the classname quotes. Mine ended up like this:

3. Finally, add this to your CSS:
article.notfeatured {display: none;}
article.featured, .tag_page article.notfeatured, .perma_page article.notfeatured {display: block;}

Now any post tagged as "featured" will display on your home page, but nothing else. So far no issues for me, it works great! You can see it here.
You can also use javascript to reorder the display so you can make the featured posts appear first in a list. The script is very simple:
$('article.featured').prependTo('#posts');

And here is a demo. Just place that inside javascript tags and put it right before the /body tag in your theme. In this case don't use the CSS above, because you don't want to hide the posts. I implemented a .top class for the script and kept the .featured class for the CSS, and I use both the CSS and the script.
Answer: Tumblr's Custom Themes don't provide such a functionality.
You could use JS or CSS to (visually) hide all posts without a specific tag on the index page, but that way you won't have the full 10 (or whatever you configured) posts per page anymore.
You could probably use Tumblr's API to create a list of matching posts (with Javascript) and display that content instead of the default posts (so your custom theme would only contain the script for the index page content). You would have to make sure that the pager still works, though.
Answer: Actually, it is possible, but it might not work how you want.
1st. Identify the id of your individual posts (usually something like #post or #entry, lets call yours #entry)
2nd. Replace your opening post div with this:
2nd. Add this bit of css
{block:IndexPage}
#entry (or whatever name it is) {display:none}
.featured {display:inline !important}
{/block:IndexPAge}

3rd. Tag all the posts you want to show on your homepage without quotes as "featured"
This should work, but it will most likely hide all the non "featured" posts on your search page and tag page as well, which you may not want.
If you want your users to be directed to a specific 'splashpage' when they visit your blog, you could always use a jquery redirect script. Hope some of this helped!
Answer: Im sorry to say, with their existing theme options as of today, you cannot achieve this without horribly ruining your seo reputation.
Answer: I have tried many ways to do this, using tumblr php api and other,
This worked for me: I am using a page outside tumblr and loading the tagged posts via curl php calls.
It can be done via ajax but for SEO reasons I wanted to use php.
Here is the code:
$oath = 'xxx';
$blogName = 'yyy.tumblr.com';
$tag='tagname';
$apiLink = "http://api.tumblr.com/v2/blog/$blogName/posts/?api_key=$oath&tag=$tag";

// Initializing curl
$ch = curl_init( $apiLink );

// Configuring curl options
$options = array(
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => array('Content-type: application/json') ,
);

// Setting curl options
curl_setopt_array( $ch, $options );

// Getting results
$result =  curl_exec($ch); // Getting JSON result string

$data = json_decode($result);

$posts = $data->response->posts;

Answer: I realise this is old, but I've just had to do it, so here is my solution. At the end of the theme, in the script tags add:
{block:IndexPage}
        $( ".the-posts" ).load( "tagged/home .the-posts article" );
{/block:IndexPage}

Where home is the tag you have given the posts you wish to see on the index page. This will basically load the correct articles into the posts div, replacing what it there. See the jquery man page: http://api.jquery.com/load/ for more info.


can automatic update work when app is not installed from android marketplace?

Question: or how can i auto update an app that is not installed via
android marketplace. it is useful in scenario where many of our customer uses custom built of android device ( which not yet registered to android ) , and we want to make sure that changes to our app propogate to device ?
Answer: This sounds like it might be better asked on stackoverflow.
The autoupdate is a feature of the market. If users haven't installed the app with the market you'll have to implement your own update feature. In Android 2.2 you could potentially take advantage of the push notification system for updates.
Comment: As an example, the dxTop homescreen uses an internal update feature. The software checks regularly (internally, NOT via market) and if there's an update, asks, downloads and installs it.
Answer: You would have to create your own process of having the application notifying the user of updates (and providing a link to the new apk. You could do this with a background service that pops up a message in the notification bar). The user has to install the application from the market to receive updates via the Android market.
Answer: To notify an Android phone that an application have a new version (without programming all the process) you have 2 options:
1.- Use the market feature, but for your comments I think this one is out of your list.
2.- Use the notification system available on Android 2.2 and 2.3.
To use this push notification service the device needs to be logged on a Google account in order to receive the notification, so maybe this isn't suitable for your process.
If no one of this options is what you're looking for, you will be forced to develop your own push notification system and install that system in every Android phone you need update.
Comment: @Doliveras- I'm curious re: the push notification system is there a way to push a notification that then auto-triggers an update, or are you suggesting you push the notification and then programmatically kick off the install?
Comment: @Simon, I'm suggesting to push a notification to a device and then use the application he mentions it's installed on that device to take the appropiate action.


My radio says ERRE only. How do I get the word CODE to show?

Question: I need to reset my 2004 Honda radio. I have the code and the serial number. I can't get the screen to show the word CODE. It shows ERRE only and won't change to CODE. What do I do?
Answer: ErrE is displayed when the code is entered wrong 10 times or when the radio is faulty.
If it is due to the wrong code then you have to disconnect the battery for over 30seconds although go for 5 minutes to be sure.
Power up the radio and then Code should appear again.
Make sure you are entering the security code and not the serial number


Null token URI for ERC721 metadata on OpenSea TestNets

Question: I am relatively new to deploying ERC721 tokens for NFT collections and I have a quick question about why my token metadata isn't properly refreshing and showing the images, description, name and traits.
I am getting the following response from the OpenSea testnet API:

It's showing that my token_uri is null, but I've followed the steps of Alchemy's docs and implemented my ipfs://<cid> into the uri section of my safeMint function in Etherscan:

The CID points to a metadata folder with 100 JSON files in it that include the name, id, description, traits and the image link pointing to IPFS.
I have refreshed the metadata like 100 times and nothing has changed. I've gone through and forced the refresh via the testnet opensea api, and still nothing.
Here is the Testnet OpenSea collection -> https://testnets.opensea.io/collection/beaver-believers
What am I doing wrong here?
Answer: Are you following this tutorial?
It seems like you never provide the NFT metadata. It is included in the later section of this tutorial.
I love Beavers, Happy coding!


How to setup custom 404 page that will ignore the path?

Question: I have the pathauto setting up URLs as /Country/Dept/node-name  (i.e. - /US/Training/How-To-Create-Node).  If I enter a non-existent path at the root, it goes to my default 404 page I created.  However, if the path is /Country/Dept/ anything, it just goes to the parent folder.  How can I get it to go to the 404 page, regardless of the path?
Answer: In my case, the main problem was that there were blank landing pages for the parts of the URL.  For instance, there was a blank US page for /US/Training/page-title.  So, Drupal was finding /US and just redirected the visitor to that page.  Because of this, no 404 was being registered, therefore never redirecting to the 404 page.  None of the 404 modules helped for this.
Because I have a Taxonomy term for the Country that is used to set the URL, I simply removed the blank landing pages.  Now, it will properly register a 404 and will go to my custom 404 node.
Answer: The module 404 Navigation provides a 404 path for a solution for Drupal 7. It doesn't provide any path in the 404 page. You'll just get a message:

The requested page could not be found.

which is without any path.
Or for more control you can check my answer here.


iFrame in UIWebView loads the content of iframe inside the container UIWebView

Question: Opening a page like this in UIWebView causes the WebView to load the URL that shoudl be loaded inside the iframe.... can this be changed? ie, can the WebView "stay" on the main page, and load the other page inside the iFrame?
MAIN.HTML:
(shortened for simplicity)
<code><html>
   Hello, see the content of the iframe below
   <iframe scr=iframe.html />
</html>
</code>
PROBLEM - UIWebView will load iframe.html, rathern than Main.Html with the iframe inside it.
Answer: Maybe you could download page and then feed UIWebView with string?


Where do OSX applications typically store user configuration data?

Question: I've noticed on OSX, installation is frequently a drag and drop one file kinda deal.  I assume that file is an archive of all the applications necessary bits and that the application runs directly from it.  Where does the application store configuration data, particularly per user settings when there are multiple users?  On Windows, this type of stuff might go in the registry under HKLU or HKLM, or in the Application Data folder for the user or for all users.
Answer: In /Users/username/Library/Preferences.
You also see some stuff being placed in /Users/username/Library/Application Support.
Both of these folders have corresponding global locations outside /Users, namely under /Library. These however seem to be used very little by applications as such, for obvious reasons.
The format of the preferences for OSX-native applications are usually .plist (property-list) files with a name given in reverse-domain name syntax. There is a standalone application called Property List Editor which allows you to view and edit such files. (I think it's part of the XCode/developer-tools download.) Of course there's nothing to prevent you from using your own preference storage system, and naturally applications that are mostly cross-platform will tend to do this, but the preferences should nevertheless be placed in the /Users/username/Library/Preferences directory.
Edit: If you're writing software for the Mac and you're using the Cocoa framework, then Apple has this document for the part of the Cocoa API that deals with storing and retrieving preference settings: User Defaults Programming
Comment: It doesn't matter whether you're using Cocoa or Carbon, there are APIs (NSUserDefaults and CFPreferences) for storing and retrieving preference data that you should use instead of manipulating files. That lets your app interact with e.g. policy management, parental controls, etc. transparently.
Comment: The link provided has moved. The new location is [here](https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/UserDefaults/Introduction/Introduction.html)
Answer: Also
/Users/username/Library/Containers and /Users/username/Library/Group Containers
are places to look for.
Comment: To add, the containers are often named by their "Bundle identifier" (e.g. `com.docker.docker`). You can find this identifier by right clicking on the app icon in application folder -> "show package contents" -> and looking for `Info.plist` file where the bundle identifier is.
Comment: Also try: `/Users/username/Library/Saved Application State`
Answer: As an addendum to harms' answer, I would note that, like the windows registry, OS X preferences are deliberately not deleted when the app is removed but, unlike the windows registry, preferences can migrate from machine to machine as you upgrade your Mac and use the "user migration" facility.
This can lead to surprising results such as installing "NeatoApp 2008" and discovering that it knows all the settings you chose for "NeatoApp 2003" even though the 2003 version was never installed on your current machine.


Spherical Coordinates 2

Question: Fundementals of applied electromagnetics
i am wondering where does that formula come from? (that i signed in pic.)
Answer: These are well-known properties of vectors, so if you are having trouble recognizing them, I really suggest a review. But here are the essentials:
At any point on a surface where the surface is smooth, there will be a plane tangent to the surface, and a line that normal to that plane (and therefore, to the surface).
So if you are given a vector $\mathbf E$ at that point, you can project $\mathbf E$ on to the normal line, to get the "normal component" $\mathbf E_n$, and you can also project it onto the tangent plane to get the "tangent component" $\mathbf E_t$. And because the normal line and tangent plane are orthogonal to each other,
$$\mathbf E = \mathbf E_t + \mathbf E_n$$
Now, if the direction of the normal line is given by the unit vector $\mathbf{\hat n}$, then the signed length of the projection of $\mathbf E$ is given by the inner product $\bf E\cdot \hat n$. And since lines are one dimensional, every vector on the line is a multiple of $\mathbf{\hat n}$. So it must be that $$\mathbf E_n = (\mathbf E\cdot \mathbf{\hat n})\mathbf{\hat n}$$
And therefore, the tangential component is given by
$$\mathbf E_t = \mathbf E - \mathbf E_n = \mathbf E - (\mathbf E\cdot \mathbf{\hat n})\mathbf{\hat n}$$
For a cylinder, the unit normal vector to the surface is the radial vector $\mathbf{\hat r}$, because the tangent to a circle is perpendicular to the radius.
For a sphere, the unit normal vector to the surface is the radial vector $\hat {\boldsymbol\rho}$, for exactly the same reason.

Spherical Coordinates 2


TV show/episode about a man in a cabinet containing snow which starts swirling around him

Question: I saw a show once where this man steps into a cabinet and snow starts swirling around him. Later in the show someone wipes circles on the glass and finds him. The only other thing I remember is that a woman was upset by all this.
Comment: I remember a tv movie in the seventies where a man was brought back from cryogenic suspension, and it turned out that he had no soul as a consequence, and wreaked all kinds of havoc...does that ring any bells?
Comment: The part with the cabinet and the snow sounds like *Narnia*. The "woman" might be the evil witch, whose name escapes me at the moment.
Comment: @ChrisB.Behrens, the movie you remember is [Chiller](http://www.imdb.com/title/tt0088912/), from 1985.
Comment: I don't find this deserving of down votes. Sounds like a challenge. Also sounds like a [snow globe](http://en.wikipedia.org/wiki/Snow_globe).
Comment: @tlp - The evil witch was Jadis, but I doubt it's narnia; no glass to wipe, and it was a little girl, then her sister and two brothers.
Answer: You don't say when you saw it, but I'm wondering if it's the "Silent Snow, Secret Snow" episode of Night Gallery, released in 1971.
From IMDb:

Psychiatrist Joel Winter investigates the claims of his asylum patient, hippie Gideon, that a pretty girl from a nearby farm is killing his patients./The Haslemans worry when their son becomes obsessed with snow that's talking to him.
Comment: Unfortunately, that's not it.
Answer: Perhaps you are thinking of an episode of Castle (ABC)? In season 4 episode 3 "Head Case", the main characters find a room with bodies preserved by cryogenics, and Castle wipes circles on the glass window on one of the containers and finds a frozen guy. Several women are upset by this.
Comment: Unfortunately, not old.
Answer: Chronicles of Narnia: The Lion, the Witch, and the Wardrobe
But this is a book (multiple movie versions, though). The man(faun) is in the wardrobe-world, and the children go inside. Jadis, the White Witch gets pretty upset.
Comment: It wasn't a book.
Comment: @ScottMetz :I've seen two movies and a tv series made from it. Maybe more.
Comment: It sounds like something from The Box of Delights. 1980s BBC fantasy series. I was just reminded of it by an article on the SFX/GamesRadar website. Haven't seen it since I was a kid so can't say if there is a specific scene like this but I do remember a lot of snow and people disappearing into cabinets or wardrobes. Could it be this one?


What is Quantum Convolutional Neural Network?

Question: I just came through the TensorFlow Quantum library they introduced Quantum Convolutional Neural Network.

What is Quantum Convolutional Neural Network?
What is the difference between CNN vs QCNN?
Answer: This answer might not make a lot of sense without a little background on quantum computing
A QCNN (https://arxiv.org/abs/1810.03787) is a type of quantum model that the authors in this paper use to model quantum data. At the core it is just a quantum circuit acting on a set of qubits in order to model quantum data that is on those qubits. The authors use it to predict a particular property of their quantum data. Here is a piece from the paper where they explain the architecture at a high level:

The circuit's input is an unknown quantum state $\rho_{\text{in}}$. A convolution layer applies a single quasi-local unitary ($U_i$) in a translationally-invariant manner for finite depth. For pooling, a fraction
  of qubits are measured, and their outcomes determine unitary rotations ($V_j$) applied to nearby qubits. Hence, nonlinearities in QCNN arise from reducing the number of degrees of freedom. Convolution and pooling layers are performed until the system size is sufficiently small; then, a fully connected layer is applied as a unitary $F$ on the remaining qubits. Finally, the outcome of the circuit is obtained by measuring a fixed number of output qubits. As in the classical case, circuit structures (i.e. QCNN hyperparameters) such as the number of convolution and pooling layers are fixed, and the unitaries themselves are learned.

To contrast this a little bit with the classical CNN: The QCNN is best used when dealing with quantum data that you wouldn't normally be able to deal with (easily) classically. The authors made a very smart choice here in choosing to model data that could be prepared on a quantum computer, data which might be harder for a classical computer to prepare. If you have classical data (like MNIST or CIFAR) then the CNN is still your best bet over the QCNN for performance. If you have quantum data on a quantum computer the QCNN has a much stronger case.
If you've been using TensorFlow Quantum, one of the tutorials shows this exact performance comparison where a quantum computer modelling classical data has a really hard time keeping up with the scaling of the classical computer (https://www.tensorflow.org/quantum/tutorials/mnist).
We are hoping to use TensorFlow Quantum to better understand quantum data and it's not too likely any QCNNs are going to pop up in serious classical ML pipelines for NLP or Image classification at scale that are going to drastically improve performance..... yet :P


Does Tor now keep history?

Question: The latest update seems to have changed settings to keeping history. Is it also broadcasting our social security #'s?
Answer: Just checked, Tor Browser doesn't keeps the history by default. You probably changed the settings.
Also, I'm not aware of any browser broadcasting social security numbers. So, yeah. Tor doesn't do it either.
If in doubt you can also check the source code: https://gitweb.torproject.org/
Comment: Also make sure that you are really using the real Tor Browser. If it doesn't come from here, then it might be fake: https://www.torproject.org/download/

Does Tor now keep history?


Can I safely cancel in the middle of a system install?

Question: I'm trying to reinstall Ubuntu 15.04 but I am stuck on bug 946663. What do I need to do to safely cancel the installation process in the middle of it? If I just hold the power button down, will that screw with any of my data?
Answer: No, it will not, if you have data in another drive or u haven't format your system drive.
But use another ISO to reinstall system.
Answer:
If I just hold the power button down, will that screw with any of my data?

No, unless the data was screwed to begin with (for instance due to you telling the system to format the data) all a reboot/shutdown will do is stop the installation. You then can restart the installation. Again though: formatting/repartitioning will be a permanent change to the system during the installation.
WARNING: The above is only true for this particular case. Holding down the power button on an already installed system is dangerous and will render Ubuntu inoperable.


Ofdm and subcarrier modulation

Question: I was learning about OFDM systems and the different subcarriers. My understanding is thay each subcarrier carries one symbol. One question come to mind, can these different subcarriers be modulated differently for example one subcarrier with BPSK and another with QPSK?
What about SCFDMA?
Thank you.
Answer: Yes, it's totally possible to have different modulation alphabets per subcarrier. You can do that, e.g. when different subcarriers experience different SNRs.

Ofdm and subcarrier modulation


Why does carbon nanotubes look "furry" in scanning electron microscopy?

Question: In scanning electron microscopy images, carbon nanotubes looks quite different from the schematic hexagonal structured tubes which usually describes them. How come they are all bent and "furry"?
Comment: The given scale of this image confuse me, 2 micrometers is a lot in this context. So maybe the "fur" itself is the nanotubes? The source of the image: https://medienportal.univie.ac.at/presse/aktuelle-pressemeldungen/detailansicht/artikel/nanotechnology-for-water-filter/
Answer: It might be a bit too late, but I noticed there is no answer to this question, so I thought I'd give one.
In the scanning electron microscope (SEM) image above, the carbon nanotubes (CNTs) are the thin hair-like entities; so you might as well say the "fur" is the nanotubes. But first, maybe some context.
CNTs can be thought as folded sheets of graphene, therefore they share many similar characteristics and properties. They can be single-walled or multi-walled (nested nanotubes, equivalent to folded multi-layer graphene), with diameters typically 1-2 nm and 5-15 nm, respectively. CNTs are grown with a variety of ways, with chemical vapour deposition (CVD) probably being the most popular one, especially in research. Nanotube growth with CVD  is a bit random in the sense that there is no direct control of the growth length or direction, but the growth density can be controlled. In the SEM image above, you can say the growth density is quite high since the CNTs are all over the place.
But if nanotubes are typically a few nm in diameter, why do they appear so much wider in the SEM image? This relates to how the SEM works and how electrons interact with materials of different conductivity. When imaged properly, CNTs on insulating surfaces have apparent diameters that are about 50 times larger than their true diameter. Moreover, nanotubes on the background appear darker than those at the "front". This again depends on how the electrons from the SEM interact with the material they are imaging and how many of those electrons make it back to the SEM detector. This paper goes into it in more details.
In general, it is very unlikely for the hexagonal structure to be visible with an SEM. However, a scanning tunneling microscope (STM) could do the job: you can see a CNT image taken with an STM here, where the hexagonal structure is visible.
Comment: It is possible that those larger bodies were on the substrate in advance, especially if the substrate surface was not polished. However, they could also be remnants from the nanotube growth. Usually when nanotubes are to be grown on a substrate, the latter undergoes some treatment (e.g. some metallic nanoparticle catalysts are added for CVD). Depending on the growth procedure, the substrate can be left with "dirt" or treatment remnants, in addition to nanotubes.
Comment: Thanks, great answer! So I guess the larger bodies (1-2 micrometer width) is just the structure of the subtrate, and had the same shape before the CNTs were grown?
Answer: Because diagrams lie. They have to, in some cases, to make their point clear.
I presume you mean something like this?

(Courtesy "Simetrical", cc-by-sa 3.0. Wikimedia Commons. Retrieved from: 1)
Yes, the tube shown in the picture is artificially straight. It's no different from showing a diagram of, say, an electric wire that shows it as straight. It's meant to illustrate the structure, not the physical properties of it as an object, such as its deformability. Just as a piece of cable can bend, so too a nanotube can bend. They're flexible. The flexibility is because the bonds are not perfectly rigid, but can strain (deviate from their customary angles).
Also, you cannot see the hexagonal structure because it is too small. The width of a nanotube (not illustrated in the picture I give) is like maybe only 2 nm or so; and the length of a single carbonic bond is something like 0.14 nm. Note that the scale bar on your picture translates to 2000 nm, so the nanotube "hairs" are probably on the order of 1000 nm long. The bonds and atoms are thus just far too small to see in the picture. Equivalently, it's like you're "zoomed way out" compared to the level of detail in a diagram like the one above.


Covering challas by 3rd meal on Shabbos

Question: We cover the challas by the shabbos meals for a number of reasons. One however is because the mann was covered (with dew) on top and on the bottom (See Tosfos Pesachim 100b) and the challas that we are eating are a rememberance of the mann. For this reason then seemingly we should cover the challas also by the third seudah. Are there people that do cover the challas then? If there isn't a minhag like this, why not?
Comment: The Rambam held such a view I believe.
Comment: Everywhere I've been (that I can think of) for the third meal has covered them. In large settings not every single one has always been covered, necessarily, but when people have taken them on their plates they've typically covered them (again, not every instance, but I always assume that is because they just didn't think of it or because there's no wine so they don't bother). Anyway, point is, it's very commonly done.
Comment: Aruch Hashulchan says there is no minhag
Comment: @sam No. He says that the people in his time and place didn't have that minhag. He doesn't say there is no such minhag.
Comment: Well if you see answer I said that
Answer: Rivevos Ephraim 8:117:14 addresses this and says since there is no kiddush we don't cover the challahs.However,the Rambam(reasoning of the Tur )holds one does make kiddush.
The Aruch Hashulchan 291:10.we are noheg not to cover them.
The Ben Ish Chai Shana Beit Chayei Sarah 12 holds one has to cover the bread just like the night and day meal even though there is no kiddush by this meal since there are two other reasons which have nothing to do with kiddish(like the questioner mentioned)
Comment: The Rambam doesn't hold there's kidush, just that you drink wine during the meal--the Aruch hashulchan says this as well.
Comment: @wfb ,not so pashut see the Tur who holds such an opinion in 291:4 also see Bach.but it is debatable.

Covering challas by 3rd meal on Shabbos


Using dollar-store picture glass for print bed on top of original heated aluminum bed?

Question: I'm having a really hard time printing on my aluminum heated bed... Cleaning it just results in it being scratched (trying to scrape dried hairspray/glue/etc off) and I don't think it is particularly flat either.
I was thinking of stopping by the dollar store on my way home and getting several picture frames and using the glass from them as interchangeable glass beds - this would also make it easier to take them off the printer to clean without needing to re-level the bed every time as the aluminum base would stay-put.
Do you guys think the quality of it would be okay to print on? (withstand the heat, be flat enough, etc) I'm planning to coat it in purple-glue-stick as I have heard that works well for adhesion purposes.
For reference: Printing PLA, Prusia i3 printer.
Answer: Picture frame glass (generally float glass) will work well enough, but count on it eventually cracking/getting chipped. It's always very flat (due to the way the production process works).
Taking it up to 100-110C for printing ABS should not be a problem, but you'll want to avoid sharp changes in temperature, and should be careful that your prints don't adhere too well: I've had PLA/PETG prints take out pieces of glass with them due to the force required to remove them from the build plate. You might want to try without any (or very little) adhesive first, and make sure your nozzle isn't too close to the build plate.
Comment: I'd be happy for any adhesion at this point :) and if it messes the glass up.. well its a good thing I have a dollar-store near my work ;)

By any chance do you have any good ideas for how to clip the glass to the aluminum bed securely without big paper-clamps getting in the way?
Comment: There are clamps you can print on Thingiverse. You'd have to browse for the right ones for your printer and the thickness of your glass.
Comment: Comments are not for asking follow-up questions. @JohnSensebe has a good suggestion; some people also use silicone thermal pads which stick the glass to the metal by means of suction/vacuum and don't get in the way at all.
Answer: I've done it. Yes it will print just fine. Treat it like any other bed surface BUT... A few points to keep in mind and to consider.
Normal glass

It will break fast. Had mine last a few weeks.
It is not strong. If your Z endstop fails then it will crack
Higher thermal expansion than other options. So parts pop off bed when it cools

While we are talking about beds. Lets talk about the other options.
A popular plate is Borosilicate. Here are a few points about that as a bed.

Borosilicate is a lot stronger.
Borosilicate in my experience can chip / flake. I had it happen to
one of mine, never found the missing glass..
It also has other properties such as high temp resistance and low
thermal expansion.

Another option, my favorite is Tempered glass. I have never had it flake apart as I try to remove from the bed. Also it is stronger, doesn't shatter into razers.

You can get more comparisons at Here
So go for it! But I would let it cool then remove parts. Be EXTRA careful removing the part from the bed. Oyster shuckers and the like are likely to break the bad while you handle it (Bad!) I will say in the long run a tempered plate will save you money. I have had some plate of tempered for over a thousand hours of printing on some of my printers. Including my Mendlemax and Dozens of HARD head crashes. Same plate from 2013!
Also check the local hardware store. That is where I got my glass.
Answer: I am using a glass plate from a decommissioned flatbed scanner I got from the electronics trash. I cut it to size with a glass cutter and it is doing a swell job at 68°C for my PLA. The print sticks superbly during printing and almost pops off the buildplate when cooled down to less than 40°C.
I am very happy with the glass as a buildplate for PLA, especially because it came for free.
Answer: I use normal glass plates on top of my heated borosilicate glass bed all the time.
Advantages:

very cheap (about €3 where the borosilicate glass bed of my printer costs about €80 to replace)
no need to wait till the bed cools down to start a new print. Just put on an other sheet of glass and start over. (I use 3dlac to make my prints stick better so trying to remove a print from a hot borosilicate glass bed often results in a chipped glass)
Answer: I was driving down the street the other day and saw a very nice OLD and LARGE mirror on a lawn at a garage sale.  It was about 36" x 28".
Sale price?  $5.00
I'm going to be using it for my MPCNC machine to allow me to print large prints on glass.  The reason I like the OLD mirrors is that they are much thicker than the new ones and therefore more durable and solid.
If you're trying to stay economical, you can probably find an old mirror at a garage sale somewhere.
That being said, I currently print on glass with a heated bed and spray it with Aquanet Hair Spray.  I have discovered that with PLA, if I heat the bed to 60 Celsius before printing and then allow it to cool down to room temperature before removing the print job, I am able to very easily remove items from the glass.  Very little effort.
So, in summary, I'd recommend using Glass or a Mirror as your surface, heating it to 60 celsius before you print, spray it with aquanet hair spray, and you'll be glad you did.
Good luck.


Connotation of "appease"

Question: Is "Bob did what he could in his capability to appease them" a positive or negative comment about Bob?
Comment: That sentence doesn't make much sense, so neither. "Bob did what he could to appease them" is all you need, and I would say it probably generally reflects more positively than negatively on Bob, though it's really a fairly neutral statement. In the right context, it could easily reflect badly on Bob.
Comment: Either "Bob did what he could", or "Bob did everything in his power", but not a combination of the two with *power* inexplicably replaced with *capability*.
Comment: @Seenu The statement itself is quite neutral—none of the words are inherently positive or negative. But to me at least, doing what you can to appease someone is more likely to be a positive characteristic in a person than a negative one—except you can always use it in a context where _them_ is someone you don't want appeased, and then it suddenly becomes negative.
Comment: @JanusBahsJacquet even more confused after reading your comment, you said it is all (positive, neutral & negative )
Answer: The term appease itself is fairly neutral:

appease - verb
pacify or placate (someone) by acceding to their demands.
assuage or satisfy (a demand or a feeling).

It's not defined as being disparaging, and you can use it fairly neutrally.

I appeased my growling stomach by eating a sandwich.
We appeased the opposing parties, by throwing some concessions in.

However, it does have some negative connotations, going back to pre-World War II, where Britain's policy toward Hitler under Neville Chamberlain was one of appeasement.
This has been heavily criticised as allowing Hitler to gain momentum and power, and World War II happening.
See the Wikipedia article on Appeasement for more details.
See also this question:
What is the polite word describing a person who unreasonably says and does things to make a person happy?
Comment: I'd say that the noun 'appeasement' (being largely confined to the political arena) has more of this negative connotation, and for the reason you give. A tweaked quote of Sir Winston Churchill: "Appeasement is like feeding the crocodile in the hope that it will eat you last."
Answer: Appeasement as a national policy got negative connotation during WWII:
"The term is most often applied to the foreign policy of the British Prime Minister Neville Chamberlain towards Nazi Germany between 1937 and 1939. His policies of avoiding war with Germany have been the subject of intense debate for seventy years among academics, politicians and diplomats. The historians' assessments have ranged from condemnation for allowing Adolf Hitler's Germany to grow too strong, to the judgment that he had no alternative and acted in Britain's best interests. At the time, these concessions were widely seen as positive, and the Munich Pact concluded on 30 September 1938 among Germany, Britain, France, and Italy prompted Chamberlain to announce that he had secured "peace for our time." (http://en.wikipedia.org/wiki/Appeasement)
Regarding actions of a single human, I'd say the connotations are fairly neutral.
Answer:
Bob did what he could to appease them.

I would consider them to be the insulted party here. Appease is being used in the sense of soothing or pacifying. Adults don't need to be soothed or pacified.
Comment: appease has 3 different meanings, when used of a person it means to soothe or pacify. You can soothe or pacify a frightened or cranky child without it being insulting, but I'd consider it to be very insulting to a rational adult to treat them that way.
Comment: How do you get the concept of an insulted party in that sentence?
Answer: One person seeks to appease another if the latter has some need and the power to satisfy that need at the former's expense. By appeasing the latter, i.e. satisfying their need, the former can avoid the latter's self-serving behavior and the expense it levies against the former.
Appeasement is often considered the "easy way out" as it's typically quicker, cheaper, and less risky than more aggressive solutions to conflict. This depicts the appeaser as weak, lazy, and/or fearful. Furthermore, when an oppressor dominates a group, a member of the group who appeases the oppressor might even be considered traitorous, as appeasement facilitates (or at least does nothing to resist) the oppressor's actions against the group as a whole and can even be construed as declaration of alliance with the oppressor.
There is nothing positive about appeasement in any scenario, as its very nature implies submission to a destructively dominant and self-interested power. The given phrase, "Bob did what he could ... to appease them," implies (doubly) that Bob is unable to overcome an oppressive force. It suggests Bob is weak, and that he is in a poor position. The situation might not be "serious" (e.g. if "them" refers to his grumpy children), but this phrase certainly does not paint Bob in a positive light.
Edit: I'm referring to literal positivity and negativity. If you're asking whether or not Bob should be insulted to be spoken of in this way... I'd say not. "You're such an appeaser" is a pretty weak insult, IMO.
Answer: I would interpret "Bob did what he could to appease them." to imply that he did not agree with their position, but he attempted to placate them anyway.
Comment: I'm not sure there's enough context from just that sentence to infer anything about a disagreement between Bob and "them." In any case, this doesn't really answer the question of whether there's a positive or a negative connotation.
Comment: I can see that.  However, it is clear that the other party is displeased about something.  Is there a difference between appeasing someone and satisfying them?  It seems that the first is more about their attitude; the second is about the issue.
Comment: Neither of those statements tells anyone anything about the speaker's attitude, though, which is what this question is about.
Answer: It's "kind of a negative" word.
You know how during a war, when country X is invaded, some people "go along" with the invaders, so as to cause less death, etc? That's "collaborating."  So, "even worse" than appeasing, is collaborating - let's say.
I would say that usually -- not always -- appease has a somewhat negative connotation.
It's a bit like speaking about things like ... bureaucracy, government departments, red tape, wishy-washy, flim-flam, dithering.
It is usually but not always, somewhat negative.

Connotation of "appease"


In Isothermal expansion of Carnot Cycle, Energy of the system should be constant, Since Temperature is constant. How does the system absorb energy?

Question: In Carnot cycle's Isothermal phase, Heat is said to be absorbed.
Energy of the Carnot Engine in Isothermal phase as per Ideal Gas equation should be:
$$E=\frac32nRT$$
Since the amount of Gas($n$) and the temperature ($T$) does not change, The energy of the system should be constant. Keeping that in mind, How does the Carnot engine absorb energy in the isothermal phase without any change in the gas temperature?
Comment: For an isothermal system, the $\textit{internal}$ energy is meant to be constant. If heat is supplied to a system, it can still do work or work can still be done on the system.
Answer:
Keeping that in mind, How does the Carnot engine absorb energy in the
isothermal phase without any change in the gas temperature?

It does so by performing an amount of expansion work exactly equal to the heat added, so that the internal energy remains constant throughout the process. Per the first law,
$$\Delta U=Q-W$$
Then, since $Q=W$, $\Delta U=0$.
Since the internal energy of an ideal gas depends only on temperature, the temperature remains constant.
In a reversible isothermal process the temperature difference between the system and surroundings is kept infinitesimal so that in the limit they are considered the same, i.e., the system can be considered to always be in thermal equilibrium with the surroundings while the system does work.
To see how this is possible, imagine a reversible isothermal expansion where the hot reservoir and the system are initially at the same temperature, $T_H$. The external pressure is then infinitesimally reduced by an amount $dP$ (imaging a bag of sand on top of the piston and we remove one grain). The gas undergoes an infinitesimal expansion of $dV$ (thereby doing work $dW$) which lowers the temperature of the gas by an infinitesimal amount $dT$ below the hot reservoir. The hot reservoir now transfers an infinitesimal amount of heat $dQ$ which raises the temperature of the system by an amount $dT$ back to that of the hot reservoir. Repeat this process over and over again and the system temperature will remain the same as the surroundings while the gas slowly expands doing work.
Hope this helps.
Comment: thanks for the explanation. It is possible to conceive infinitesimal increase of energy, But at the end of the isothermal cycle there is a significant energy gained. Since the energy is not stored in the ideal gas (internal energy being constant), In what form is the energy stored ?
Comment: @physicsEnquiry All the energy added in the form of heat is used to perform expansion work, so that no energy is stored.  That's the whole point of the reversible isothermal process (its not a isothermal cycle).
Answer: As was mentioned in a comment, the system absorbs heat and does work on the surroundings such that internal energy does not change:
$$dU=dQ-PdV=0$$


Unexpected output for multiple assignment with arrays

Question: Consider
int b = 2;

int[] a = new int[4];

a[a[b]] = a[b] = b = 2;

for (int i = 0; i <= 3; i++)
{
    System.out.println(a[i]);
}

The output is
2
0
2
0

I was expecting a[0] to be zero.
Comment: Why would you ever have such code? Any statement with three assignments in is a bad idea...
Comment: @Pshemo: Great spot and the accepted answer on the duplicate is excellent.
Comment: @Bathsheba All credits to TheEnd. He found it and posted link in his answer. I just flagged it as duplicate.
Answer: Excerpt from JLS 15.26.1. Simple Assignment Operator =

If the left-hand operand is an array access expression (§15.13),
  possibly enclosed in one or more pairs of parentheses, then:
First, the array reference subexpression of the left-hand operand
  array access expression is evaluated. If this evaluation completes
  abruptly, then the assignment expression completes abruptly for the
  same reason; the index subexpression (of the left-hand operand array
  access expression) and the right-hand operand are not evaluated and no
  assignment occurs.

This means that a[a[b]] evaluates to a[0] as it's evaluated first. Then we proceed simply as a[0] = a[b] = b = 2, with the assignment taking place from right to left.
See http://docs.oracle.com/javase/specs/jls/se7/html/jls-15.html#jls-15.26.1
Answer: Because a[a[b]] is same as a[0] and you are assigning value 2 for that..
b = 2, a[b] = 0 so a[a[b]] = 2

Answer: a[a[b]] = a[b]=b=2 , This executes from left hand side
First
a[a[b]] i.e, a[a[2]] -> a[0] //initially the value of a[2] will be 0

now,
a[0]=a[2]=b=2;

so the output is,
2 0 2 0

Answer: I guess this thread might help you to understand the evaluation order in java:
What are the rules for evaluation order in Java?
The most important part of this problem is that the first = is the actual assignment. In java the index is always evaluated befor the asignment, therefor a[a[b]] is the fist one in the evaluation order. And at this point a[b] is 0.
Answer: Let's see what a[a[b]] = a[b]=b=2; does in detail:
a[a[b]] : b is 2, a[2] is 0, a[a[2]] is a[0].
so a[a[b]] = a[b]=b=2; is evaluated to a[0] = a[b]=b=2;
that is evaluated to a[0] = a[2] =2;, so a[2] is 2 and a[0] is equal to a[2]
Answer: I think you are reading
a[a[b]] = a[b]=b=2;
from right to left and expecting the array and b to be reevaluated at each step, when in fact it seems like a and b are frozen at the time of the assignment. Consider the equivalent code:
1) int b = 2;

//array initialized to 0
2) int[] a= new int[4]; // 0 0 0 0

// at this point a[b] is a[2] = 0, therefore  below a[a[b]]=2 is equivalent to  a[0]=2
3) a[a[b]] = 2          // 2 0 0 0

// the same: a[b] = 2 is equivalent to a[2] = 2  -note that the arrays are zero based
4) a[b]= 2              // 2 0 2 0

5) b=2;


Geany fails to load the files in my base directory

Question: I just moved from Mac OS X Leopard to Ubuntu 12.04. I downloaded Geany and I want to continue coding there. However, when I create a new project, Geany does not import my files, it only shows the "untitled" file. The base directory is correct. I tried moving the files to another directory (changing the base directory), changing the permissions to 777, reinstalling Geany, downloading all the plugins, but to no avail. Anyone knows what might be happening? It is probably a noob mistake, but I cant find it!
Comment: your question is unclear to me.  Which files do you want Geany to import?  Congrats on using linux :)
Answer: If you set the correct project base directory (as it sounds like you did), Geany will default to that directory when opening files. Unlike more complicated/advanced IDEs, Geany's project support is quite simple, it just points to a directory where you open files from and saves which files you had open at last shutdown/close. There is no "import" feature, if you have supported source files in the project base directory, Geany will allow you to edit them without doing anything special.
For some more info on Geany projects, check out the manual. You might also like to check out some of the more advanced project plugins like GProject if you want something more advanced than Geany's built-in simple projects.


MySQL : limit the number of clients served concurrently

Question:
I am experiencing a problem where the server runs out of memory in specific scenarios.
one solution I am thinking about is to limit the number of clients served concurrently, but have the extra clients wait for a free slot instead of having them get a "too many connections error".
is this possible?
how do I calculate maximum memory usage per open mysql connection?
Answer: take a look in my.cnf (should be somewhere in /etc or /etc/mysql, depending on your distro); there you have several options for fine tuning, like

max_connections
max_connect_errors
max_delayed_threads
max_user_connections

and some query cache options
Comment: this does not really answer my question.
limiting max_connections results in an error if the number of connections is reached (instead of the desired 'wait for a free slot' behavior).
Comment: I don't think you can setup a waiting queue; all connections coming after the "slots" have been filled up are discarded
Answer: How much memory is the database using?  How much is installed?  What OS are you running MySQL on?
Comment: Debian lenny, and the machine has 4GB of RAM and is also doing other things.
lets assume mysql cannot handle the peak usage (with the required max_allowed_packet - there are big inserts).
is there a way to achieve what I specified by tweaking mysql?
Comment: key_buffer              = 512M
max_allowed_packet      = 64M
thread_stack            = 128K
thread_cache_size       = 32K
max_connections         = 350
table_cache            = 256
thread_concurrency     = 8

sort_buffer_size        = 64M
wait_timeout            = 20

query_cache_limit       = 64M
query_cache_size        = 512M
query_alloc_block_size  = 4M
query_prealloc_size     = 128M

[mysqldump]
quick
quote-names
max_allowed_packet      = 16M

[mysql]

[isamchk]
key_buffer              = 16M
##########
try those or modify the left values to your needs
Comment: If changing those settings doesn't correct the issue, you may need to increase the amount of RAM in the server.  4 Gigs for a busy server isn't a whole lot.


Finding power series with radius of convergence $r$

Question: I'm working on this problem in real analysis:
Problem: Find for every $r \in \mathbb{R}^+ \setminus \left\{0 \right\}$ a power series $ \sum_{n \to \infty} c_n z_n $ whose radius of convergence is $r$.
Attempt: In general, if we have a power series $$ \sum_{n \to \infty} c_n (z - a)^n $$ centered around $a$, the radius of convergence equals $$ \lim_{n \to \infty} \frac{ | c_n |}{ | c_{n+1} | } $$ provided that this limit exists. So I was looking for coefficients so that the limit of the ratio would give me $r$. But I couldn't find any, and I'm not sure if this is the correct method to approach this.
Answer: Assuming $r>0$. One may just take
$$
\sum_{n\geq0}^\infty\frac{z^n}{r^n}, \quad |z|<r.
$$


What's the purpose of the hash added to filenames in custom folder?

Question: I have a ton of image files to add to Civi (far too many to do manually) and have figured out what tables to update & make it all work.  But I notice that files uploaded via the Civi UI have a hash string added to the filename that's stored.  So xyz.pdf becomes xyz$$$.pdf where $$$ is the hash. What's the purpose of this hash string?  Is it to make a unique URI?  Should I do this as well for my files? It all works without this.  (I don't want to use the API by the way, and we're on 4.6.8)
Answer: Two reasons I can think of:

what happens if you upload twice a file with the same name for different contacts? the hash allow to avoid overwriting
probably increase a bit the protection and privacy too, eg. by guessing and trying to download warren_buffet.jpg or bill_gates.jpg, we could know if you have some wealthy donors in your db

This being said, it's been there since forever and I never quite questioned it.
If it's for mass uploading contact images, you can probably just set the field into civicrm_contact and put the image at the right place, I remember having done something like that a while ago, it probably still works
as andy detailled, you need to touch a few more tables if you want to upload the file in a custom field

add a row to civicrm_file with the file name
add a row to civicrm_entity_file to link to the contact id, civicrm_file table & your custom table
update your custom table with the numeric id from the civicrm_file
upload the file into the right folder
Comment: Thanks, Xavier, I will add a unique hash key.  For others to know, you have to 1) add a row to civicrm_file with the file name 2) add a row to civicrm_entity_file to link to the contact id, civicrm_file table & your custom table 3) update your custom table with the numeric id from the civicrm_file 4) upload the file.  QED!
Comment: ah, i replied about the contact thumbnail, but indeed, slightly more complicated if custom field. i'm updating my answer with your extra info
Answer: If you are spending time trying to manually reproduce how Civi handles files in your own custom code, consider using the Attachment api, which will do it all for you:


What is the electrical potential of a quadrupole ion trap?

Question: I learned from Wikipedia that the quadrupolar potential $\phi$ of a quadrupole ion trap is
\begin{equation}
 \phi = \frac{\phi_0}{r_0^2}(\lambda x^2 + \sigma y^2 + \gamma z^2)
 \end{equation}
where $r_0$ is a size parameter constant and $\lambda, \sigma, \gamma$ are weighting factors for the three coordinates, it also says that $\phi_0$ is the applied electrical potential which is a combination of AC and DC
\begin{equation}
 \phi_0 = U + V\cos(\Omega t)
 \end{equation}
so my question is that what is the difference between $\phi$ and $\phi_0$? Which is the actual potential field that the ion feels? And how to derive the first equation(the expression of $\phi$)?
Answer:
so my question is that what is the difference between $\phi$ and $\phi_0$?

May be part of your confusion is caused by omitting the dependency on
position and time in your equations.
The potential $\phi(x,y,z,t)$ depends on position ($x,y,z$) and time ($t$).
It can be decomposed into two factors: One factor depending only on time ($t$),
and another factor depending only on position ($x,y,z$).
$$\phi(x,y,z,t)=\frac{\phi_0(t)}{r_0^2}(\lambda x^2+\sigma y^2+\gamma z^2) \tag{1}$$
where
$$\phi_0(t)=U+V\cos(\Omega t) \tag{2}$$
is the electric potential applied by the external voltage supply.

And how to derive the first equation (the expression of $\phi$)?

Equation (1) can be derived from Laplace's equation
for the potential field $\phi(x,y,z,t)$
$$\Delta\phi= 0 \tag{3a}$$
which short-hand notation for
$$\frac{\partial^2\phi}{\partial x^2}+
  \frac{\partial^2\phi}{\partial y^2}+
  \frac{\partial^2\phi}{\partial z^2}=0. \tag{3b}$$
Laplace's equation (3) in turn can be derived from Gauss's law
$$\vec{\nabla}\cdot\vec{E}=\frac{\rho}{\epsilon_0}  \tag{4a}$$
which is short-hand notation for
$$\frac{\partial E_x}{\partial x}+
  \frac{\partial E_y}{\partial y}+
  \frac{\partial E_z}{\partial z}
 =\frac{\rho}{\epsilon_0}  \tag{4b}$$
and the definition of the electric potential $\phi$
$$\vec{E}=-\vec\nabla\phi \tag{5}$$
where $\vec{E}(x,y,z,t)$ is the electric field strength
and $\rho(x,y,z,t)$ is the charge density.
The electric charges of the trapped ions are much smaller than
the charges on the external metal electrodes.
And therefore, in the space between the electrodes,
$\rho(x,y,z,t)$ can be neglected and replaced by $0$ in equation (4).
So you need to solve Laplace's equation (3) with the boundary conditions
(given by the position-independent potential on your metal electrodes).
But at the end you only want to know the potential near the center
(small $x$, $y$, $z$) because that's where your ions are located.
Therefore you can neglect any higher-order terms,
like octupole terms ($\propto x^3,x^2y,xy^2,...$) which are much smaller
than the quadrupole terms.
And because of the geometric form of the electrodes you don't have
any dipole terms ($\propto x,y,z$) in the first place.
Comment: So $\phi_0$ is actually the external voltage supply and it has nothing to do with the quadrupole trap itself. And the form of $\phi$(the position depending part) is determined by the structure of this quadrupole trap?
Comment: @Hou Yes, $\phi_0$ is given by the external voltage supply.
And the constants in the position-dependent part ($\lambda, \sigma, \gamma$)
are determined by the geometric shape of the metal electrodes.
Comment: Thanks. But can you offer more details about how to determine equation(1)? I know the Laplace's equation of the potential, but the structure of a quadrupole trap is complex, I want to totally understand the form of the potential $\phi$.
Comment: @Hou I have added a paragraph at the end of my answer.
Comment: Thanks. So anyway it is a computing problem, and the potential field that the ion feels is $\phi$, which is a function of time and position.


How should I include libraries that I want to statically link against in my repository?

Question: I know how to actually do the linking, but I'm not sure what the best practice is for actually getting those libraries downloaded and into my repository. Should I just straight-out include them using Git? Should I use git submodules (but what if the library in question doesn't use git)? Or should I provide a shell script to download them before building? How is this handled in most projects?
Comment: There is no best practice
Answer: Your goal should be that a new developer can get all the sources needed to build your product as easily as possible, and that you can easily get lets say a nine month old version of all sources from git and build it.
There are two ways to do this: Either you make it a part of your build process that external sources are automatically downloaded and built as needed, so if I check out nine month old sources and press the "Build" button, nine month old versions of these external sources are automatically downloaded and built as well. Or you check in those sources into your git project. Which is the easiest and most reliable method.
Answer: There is no unique answer, and it is also a matter of opinion and habits and conventions (which are probably different in various communities and for various operating systems or computers).
At the very least, document the required dependencies, what version you expect (even for build tools, e.g. your C++ compiler), and where to download them. Try to avoid, or to help against, any dependency hell.
(I am implicitly thinking of some free software for GNU/Linux; adapt my hints to your system & communities)
If your program is some free software running on Linux, and if the dependencies are common free software (e.g. libcurl and zlib are probably packaged in every Linux distribution), you could just mention them.
You may also want to package your software for some common Linux distributions. You could even provide for downloading a .deb and/or .rpm package file of your software. You may hope that distribution contributors might package your free software.
BTW, I recommend against static linking and strongly suggest to dynamically link (at least against common libraries).
If the dependencies are some uncommon libraries (not often packaged) you could use a git submodule
Some software projects provide a script to download and/or build dependencies. For example, GCC provides a contrib/download_prerequisites script.
If possible, explain what to do when dependencies are updated (e.g. when the libcurl dependency goes from version 7.50 to 7.52) and how to rebuild your stuff. Try to facilitate the case when a dependency is installed in some non-standard way (e.g. a newer version in /usr/local/lib/ with the older system version in /usr/lib/). Perhaps tools like autoconf or cmake or pkg-config might be relevant to deal with this. At least, have readable and easily improvable build procedures (for example, have a nicely commented and well written Makefile and use appropriate variables there)
BTW, I believe that practices are wildly different on Linux, on MacOSX, on Android, on Windows or even between different communities (e.g. web server administrators vs nuclear physicists or bioinformatists).


How are useless states created NFA to DFA

Question: So I understand how to convert an NFA to a DFA, however my question is, on a conceptual level, how and why are useless states created, and how can you (if there is a way) convert an NFA to a DFA without creating any useless states?
Answer: Below a nondeterministic automaton for the language of all strings where the one-but-last letter is an $a$. If we make it determinsitic using the standard construction half of the states will be unreachable.
You ask, why does this happen? Look at the initial state $0$ of the original automaton. It has a loop for both $a$ and $b$. That means that in the powerset construction all next states will always contain state $0$ because the deterministic automaton collects the states of all paths from the original automaton. As a consequence all states without $0$ are uneachable.

It is possible "by hand" to avoid those unreachable states, by a step by step construction. Only consider staes that are reached and continue form those to the next possible states. A kind of depth-first construction will work.
Answer: If the construction method supports "negative" regular expression operators, such as set intersection or set difference, it's likely that the method will produce useless states. For example, Brzozowski's method, when given the expression $\left(a \cup b\right)^* \setminus \left( a \left( a \cup b\right)^* \right)$, will likely produce something like this:

The branch $q_2$ corresponds to the "removed" subexpression $a \left( a \cup b\right)^*$. (Note that this is a DFA.)
The typical way to eliminate useless states in real-world DFA generators is to use DFA minimisation. In the minimal DFA, all useless states map to a single state, so there's only one state to remove.


Why use the parry skill?

Question: Since defenders are able to oppose with both dodge and opposed weapon skill in combat, what is really the use of the parry skill?
Answer: There are several factors:

Parry isn't just for defense, and because the Parry skill can be used with any one handed weapon with the Defensive quality, which basically means Shields.
Weapons in the Parry class have special features which make them appealing (eg. Defensive, Trap-Blade - see p.298).
Parry is based upon WS stat, Dodge is Agility stat. The difference in stat and advanced in Parry might make the character's parry higher.
many Talents have special actions allowed when defending which are not valid if dodging. Sometime you can't dodge. e.g. very tight areas (although this is an assumption, not RAW).
Shields grant a bonus to defense, as do weapons with the defensive quality. However the character must have a minimum of one advance in the skill to gain the bonus, as without the advance they must ignore all the weapon qualities and accept all the flaws.
Answer: I don't have the book readily available, but what I can say is:

Not every class has the dodge skill, mainly the non-fighting ones have it. So your knight is awful at dodging. Moreover, some fighting class cannot improve their Agility, but most can improve their WS. So dodging is that much worse in the long run for them.
If you do not have the parry skill, using a shield in your off hand suffers a -20 for all your combat checks, like parrying. If you have the parry skill, all weapons with the defensive trait can be used off hand to parry without the malus, and without the need for the dual wielding feats.
It is added to your WS for parry checks, like other skills.

If you are not planning on using a shield or a main gauche, you would be better off using the melee skills for your weapons.
But I think that you at least need one point in parry to be able to use it. Since it falls under the category melee (any), it is not that hard to get.
Comment: In 4th edition all classes can learn all basic skills(and advanced with teachers) but for double the exp cost. The use of shield would be a valid point, but if I am not mistaken the parry skill is a basic skill therefore all classes start with at least their WS in parry.
Answer: After checking the rulebook I've found this...

Parry
Any one-handed weapon with the Defensive Quality can be used
with Melee (Parry). When using Melee (Parry), a weapon can be
used to Oppose an incoming attack without the normal –20 offhand
penalty

And..

Defensive
Defensive weapons are designed to parry incoming attacks. If you
are wielding such a weapon, gain a bonus of +1 SL to any Melee
Test when you oppose an incoming attack.

So the real answer to my question would be "Because that is the weapon skill you use for weapons under the parry category, it is not used for a third defense option.".

Why use the parry skill?


How quickly does the bonus pool refill?

Question: In SC2, how fast do my bonus pool points refill?  I have finally worn my pool down to 0.  Does anybody know if it is just time that refills them or something else?
Comment: I had 13 points in my bonus pool (2v2 if that matters) when my last played was 19 hours ago, so 1 point every 2 seems like it may be a bit off.
Comment: Deleting my answer.  It does not help you.  I did find this Team Liquid link: http://www.teamliquid.net/forum/viewmessage.php?topic_id=118212 which was made in April so during the beta.  There is a section on the bonus pool there.  "1 point every 2" hours caught my eye.
Answer: According to original research by our friends at teamliquid:

The Bonus Pool accrues at a rate of 1 point per 2 hours, whether the player or team is active or not. The Bonus Pool also begins building based on when the ladder season began. That is, if Player A was placed into a division and started with a Bonus Pool of 100, then 24 hours later Player B placed into a new division, Player B's Bonus Pool would be 112.

This means it does not matter when you join the ladder your bonus pool will be as if you joined at the start of the season.
You'll notice this was last updated August 11th
Answer: The bonus pool for 1v1 matches and the random team leagues grows by one point per two hours, as tzenes points out in his answer.
The non-random team leagues (where you play with a fixed team) have a slower growing bonus pool, at least in the current (the second) season. The bonus pool for 2v2 teams grows only by one point every three hours, and the bonus pool for 3v3 and 4v4 teams only increases by one point every six hours.
The reason for these lower increases is probably that fixed teams usually don't play as often. A single player can always start a game whenever he feels like it, but for a team all members have to be online. If teams would get the same bonus pool as single players, most of the teams probably wouldn't be able to deplete the pool.
Answer:
Q: At what rate does the Bonus Pool grows?
A: For Grandmaster and Master league player, the bonus pool increase at the rate of 56 minutes per 1 bonus pool, equivalent to 180 bonus pool per week.
For Bronze to Diamond league player, the bonus pool increase at the rate of 96 minutes 3 seconds per 1 bonus pool, equivalent to 104.4 bonus pool per week.

Source

How quickly does the bonus pool refill?


1 piece to 3 piece crank conversion

Question: I wish to convert my 1 piece crank to a 3 piece crank. I have a conversion kit that presses into the bb shell and accepts a cartridge style bb. I went to order one and realized I have no idea what spindle/axle length to get and wouldn't have a clue how to get this measurement from the one piece crank. I have an idea how to get it using the original chain line measurement which falls in at around 45mm but would like to know if there's a more accurate or formal way of determining the bb I should get for this job. I have a couple of options for crank arms in 170 & 175mm length and either square taper or Octa-link and whatever truvative/Sram calls their similar interface.
Comment: So i asked the guys at the local shop i use and besides trying to get me to bring it in so they could take a look at it and try to charge me an arm, leg, and my first born to do it for me, they suggested a method using the distance between the pedal mounting surfaces of the crank arms which means i basivallu pick any 68mm cartridge and look up crank arm specs to find as match or by trial and error? That doesn't seem very senseful so i started looking around for more information and found a different setup entirely. Instead of converting to a cartridge it's a complete set including a spindle.
Comment: But I still don't know nor can i find how to determine the length of the spindle/axle. What am i missing here? This can't be something that nobody has info on. I couldn't  even find anything on Sheldon Brown's site. All the bike guys on YouTube, nothing. What's the deal with this?
Answer: If going with the adapter which interfaces an American BB shell with a sealed cartridge BB, 68x113 works with most standard mtb crank arms.
You'll also need to stick with mtb chain ring setup.
The other conversion kits which are specifically made for BMX conversions may or may not be a complete kit with crank arms ans a sprocket however spindle length isn't a factor when choosing one, they are all a standard size. I don't know what that is specifically because I went with what I already have which was the adapter and mtb parts mentioned above. However since it's not a factor when shopping for one I guess that doesn't matter.
What you have to know when shopping for one of these kits is whether it's for an American, mid, or European (French, Italian, etc) BB shell, spindle diameter (19, 22, or 24mm. 19 is most standard duty, 22 for heavy duty, 24 for race/competition. I also read that there are 2 different specs for 24mm, one being actually 23.xx and one being true 24mm for race only) crank arm length, and sprocket tooth count (last 2 for a kit that's complete with arms and sprocket.).

1 piece to 3 piece crank conversion


What happens when a multirotor runs out of battery mid-air?

Question: If I am flying a multirotor drone and it runs out of battery mid-air, what will happen to it? Will it just fall down from the sky or will it give me a low-battery warning?
Answer: Assuming that you ignore all of the warning signs that your battery is low, while also assuming that you can completely deplete the voltage in your battery, the drone will ultimately reach a point where it is still providing power for the motors to spin the props, but the props won't provide enough lift to keep the drone in the air.
The drone will start to descend slowly and will increase descent the longer time goes on.  If you are a few feet off the ground, it might look like a soft landing.  If you are a few hundred feet off the ground, it might be a hard crash.  There will also be a point where the voltage cannot provide enough power for the flight controller and receiver and other electronics on the drone, which will shut them down and at that point, if the drone is still able to fly, it will drop since motors will not be spinning at this point.
The last scenario is not likely to happen since the main electronics tend to run at very low voltages, so they will have power for a while after the motors stop spinning fast enough to provide lift to the drone.
The drone won't just give you a warning when the battery is low.  You, or the maker of the drone, need to set that up.  If it's already set up, then you should have all you need to avoid a low voltage scenario.
Answer: It really depends on the drone.
Photography quads like those build by DJI will try to return to home. If you cancel RTH, they will try to softly land themselves.
FPV quads will try to warn you through a beeper, telemetry and OSD, but if you don't have any GPS set up they will just land (fairly hard) wherever they are. It also depends on voltage sag. If you're just cruising, it won't sag too much and will land more softly, Because there's just not enough power left in the battery to keep or gain the altitude but enough to keep the motors spinning. If you're catching yourself after a power loop, there'll be a large voltage sag and you'll land harder (crash).
You grade quads tend to have their lights start to flash, and then will slowly fall down.
Answer: This depends on the drone. Most drones have a low voltage cutoff, meaning it will notify you of low battery and you can start descending or do a forced landing. You will have no power but you will still have control of the drone. Only badly built drones will just fall to the ground with no indication what-so-ever.
Answer: There are a range of possibilities, depending on the make and type of drone. You should check your drones manual for details.
Most of the multirotors I have flown have been DJI aircraft, and these give an audible, visual and haptic alarm to the pilot when the battery passes set 'low' and 'critical' levels.
If the battery reaches the point where the aircraft can only just return home, the aircraft will automatically begin it's RTH procedure; this can be overridden manually but may not be a good idea.
If the battery reaches the point where it cannot continue flight for much longer (this varies, depending on factors like current altitude), the aircraft will descend where it is in a controlled manner and land.
I also have a small "Micro Drone" which I can fly indoors. On this drone, the LEDs flash on low battery but also as the charge decreases so does the thrust. While the motors keep spinning, eventually it just can't generate enough lift to maintain altitude and will slowly descend to the ground. (I tested this one with a low hover, to see what would happen.)
On the fixed wing aircraft I fly, the reducing battery results in reduced thrust. This results in the aircraft naturally starting to descend and as the motor needs more power than the servos you can typically retain control of the aircraft while it glides back to the surface. Landing without the motor is a slightly different experience, so fixed-wing pilots will regularly practice power-off landings.


Which Stack Exchange site is for suggestions on improving one's study of mathematics?

Question: Someone kindly direct me to a Stack Exchange where I could properly pose questions about improving my study and reading of mathematics.  I may be suffering from limitations of talent, but I notice often I am stumped by exercises because I do not read them with sufficient care.   When I have spent an inordinate amount of time going down the wrong paths, I frequently see that I have been careless, not having taken the time to understand: I have passed over something too quickly in my haste to solve the problem. It may be an incurable fault, I know, but perhaps discussing it would help me.
Comment: Questions about personal help aren't really a good fit for our network.
Comment: It looks like you've found the solution to your problem already.
Comment: At least, I did not lose much time at Meta.
Comment: Q&A is not for discussion.
Answer: Mathematics Stack Exchange has a [learning] tag for

Questions about the process of learning mathematics, both inside and outside a formal environment, including learning strategies, recommendations for learning particular subjects, and studying habits.

But I fear it's going to be hard to state your question in a way that's 1) objective 2) detailed enough and 3) useful to future visitors. Perhaps the users on Mathematics' own Meta can help?
Answer: To the extent your request involves learning on your own, note that Mathematics Educators Stack Exchange's [self-learning] tag is for

Questions about how someone learns on their his or her own, outside of traditional classroom environments.

I suggest you go through at least some of the questions listed there (currently 126 of them). You may find at least one or two which help you with your current situation. Also, if you wish to ask a question there, doing a check of a few of these questions first will give you a better idea of how suitable your question would be. Nonetheless, I recommend before posting that you also first carefully read at least the What types of questions should I avoid asking? and What topics can I ask about here? pages linked from their Help Center page.


Trying to unzip a locked folder

Question: I recently downloaded a .zip archive, and i want to unzip it, so that I can run the application inside, but when I try to, it asks for a password. I am the root on my laptop, so I put in my own password, but it said that the password was wrong. Also, that is the only password that exists on my laptop (no other accounts). What should I do?
Comment: Is the zip folder encrypted with a password?
Answer: ZIP archives can be encrypted. You will need either to know a decription password specific to the archive you downloaded or you'll need a password-guessing software fcrackzip that will simply try every possible password. The software is in Ubuntu repositories.
Answer: the zip file is password protected by his creator, so if you don't know it, you can't open the archive
Answer: If you downloaded the .Zip File from a external source like maybe a You Tuber Gave you a link they might have put a lock on the ZIP file itself.
So you need the password to the zip file and not your computer password.

Trying to unzip a locked folder


What is 'diffusion' in a stator/diffuser?

Question: I understand what diffusion of mass or diffusion of heat means. I know that the conversion of the dynamic head of the flow into static pressure in a stator or diffuser is called 'diffusion'. But in the case of diffuser what is being 'diffused'? What is 'diffusion' in a stator/diffuser?
Answer: A Diffusor in this context is the opposite of a nozzle. While a nozzle speeds up a fluid/air flow by diminishing flow diameter, diffusion does the opposite by giving it more room, thus slowing it down and increasing pressure.
This is often done to slow down air speed below mach in order to protect a rotor/stator from damage.
Comment: Opposite of compression is expansion isn't it. Compression doesn't speed up the flow it increases its pressure and maybe also density.
Comment: Compression via tightening the flow. Maybe the wrong word, as it speeds up the flow, but  actually lowers pressure. I'll have to look up the real term, English isn't my native language and I'm not used to writing about physics in English.
Answer: "Diffusion" in this context means taking a flow of high-velocity gas and converting its kinetic energy into compression work, to compress that gas. In the specific case of a centrifugal compressor, as used for example in car engine turbos, an impeller forcefully slings air up to high speed and shoots it into a diffuser, which is a confined space where it the incoming air "piles up" , slows down, and gets squeezed up to higher pressure.


Retrieving deleted text within a note on my iPhone

Question: In my iPhone notes, I had created a "note" and had lots of text typed in there. By mistake, I deleted most of the text I had typed inside of the "note". Is there a way I can retrieve that text? I did not delete the whole note, only text inside the note was deleted, so what I want to know is if I can recover that text or not.
Answer: iPhones have an Undo function. By default, to trigger the undo option you need to give your phone a quick shake. In your case it may be too late to use it.
To find out, go into your note and then give the phone a quick shake. If it works you will get an option such as the one below:

Obviously, then you would tap on Undo to undo the last typing action.


Filter geojson or shapefiles

Question: I'm trying to create a geojson file with a few shapes of roads from OSM. Now, I've been able to get shapefiles of the greater region (province) these roads are in from http://download.geofabrik.de/ . I've also been able to convert a shape file to geojson using ogr2ogr. My problem is that it contains way too much data. Is there a way to filter a shapefile or geojson file by name, type or ID?
Comment: The usual approach is to import source OSM data into postgis, or to do a simple extract using the overpass API. Otherwise, which of your 4 questions is the one that should be answered?
Comment: Thanks. You're right. I've cleaned up the post a bit. The main issue is filtering. Thanks for your answer, that's very helpful.
Answer: ogr2ogr supports filtering, by using the where clause.
http://www.gdal.org/ogr2ogr.html

Filter geojson or shapefiles


How would I install psensor-server as a service on Ubuntu 16.04 LTS

Question: I am looking for the ability to create a service to run psensor-server on startup and be able to restart it using systemctl if possible?
Answer: I have tried to find a place to actually post a tutorial on this, wiki wouldn't load for me to add a page, and I really don't know where it goes. But I wrote a tutorial for this and I'm by no means an expert but this was how I managed to get this working on my server without having to open a terminal and execute the start command every time.
If anyone can think of a better place to put this, or knows where it should be please do let me know...
I'm aware some have said that ppa isn't needed, you can skip this step if you wish as it is already in the universe repository, however adding the PPA will guarantee that you receive the latest stable updates when pushed by the psensor team.
This guide will show you how to install Psensor-Server on ubuntu 16.04 Server, and then create a service to launch it on a given port at system start
The first thing we need to do is be sure the system is up to date package wise, not sure this matters, but it's always good practice.
sudo apt update
sudo apt upgrade

The next thing is to install the prerequisites for Psensor
sudo apt install lm-sensors

Start the detection of your hardware sensors
sudo sensors-detect

It will ask a series of questions, answer yes to everything unless you know what you need.
Verify it works by running the following:
sensors

Output should look something like this, however please note yours will vary based on how many sensors you have in your PC so your reading will not be exact.
coretemp-isa-0000
Adapter: ISA adapter
Core 0:      +46.0C  (high = +76.0C, crit = +100.0C)
coretemp-isa-0001
Adapter: ISA adapter
Core 1:      +44.0C  (high = +76.0C, crit = +100.0C)
After this we will install psensor and psensor-server We will use the repository to be sure we have the latest stable version. Install the prerequisites for add-apt if their not already present on your machine.
sudo apt install software-properties-common python-software-properties

Next step is adding the repositories
sudo add-apt-repository ppa:jfi/psensor

Update the Repositories
    sudo apt update
Install Psensor and Psensor-Server
sudo apt update && sudo apt install psensor psensor-server

Now that we have Psensor-server installed we have to write a couple scripts to start and stop the service.
Warning, the stop script just simply uses pkill which I've been made aware that probably isn't the best option, but for my purposes this wasn't an issue, you may need to adapt the script to your needs accordingly.
the first script is created as follows
I use nano, you may use whatever editor you prefer. If you do not have nano you can obtain it by the following.
sudo apt install nano

then
sudo nano /home/someuser/startps.sh

replace someuser with your username
when it opens type the following
#!/bin/bash
sudo psensor-server --port=8085

You may use whatever port you wish, just ensure it doesn't conflict with ports already open on the system.
CTRL + X and answer yes to save
then issue
sudo nano /home/someuser/stopps.sh

Again replace someuser with your user account.
enter the following
#!/bin/bash
sudo pkill psensor-server

CTRL + X and answer yes to save.
To create the service issue the following command
sudo nano /etc/systemd/system/startps.service

Enter the Following
[Unit]

Description=psensor service

[Service]

ExecStart=/home/someuser/startps.sh
ExecStop=/home/someuser/stopps.sh

[Install]

WantedBy=multi-user.target

Replace someuser in the paths to the same username you used when creating the .sh scripts.
CTRL + X and yes to save.
Then enter the following at your terminal
sudo chmod u+x /home/someuser/startps.sh && sudo chmod u+x /home/someuser/stopps.sh

Again remember to replace someuser with your username.
Now to start our service we type
sudo systemctl start startps

it should start and take you back to the terminal prompt, at which time we enter
sudo systemctl status startps

The output should be as follows
● startps.service - psensor service
   Loaded: loaded (/etc/systemd/system/startps.service; disabled; vendor preset: enabled)
   Active: active (running) since Fri 2018-08-10 16:42:43 CDT; 2s ago
  Process: 15300 ExecStop=/home/someuser/stopps.sh (code=exited, status=203/EXEC)
 Main PID: 15385 (startpf.sh)
    Tasks: 4
   Memory: 1.9M
      CPU: 21ms
   CGroup: /system.slice/startps.service
           ├─15385 /bin/bash /home/someuser/startpf.sh
           ├─15387 sudo psensor-server --port=8085
           └─15388 psensor-server --port=8085

Aug 10 16:42:43 [hostname] systemd[1]: Started psensor service.
Aug 10 16:42:43 [hostname] sudo[15387]:     root : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/bin/psensor-server --port=8085
Aug 10 16:42:43 [hostname] sudo[15387]: pam_unix(sudo:session): session opened for user root by (uid=0)

Please note where it says disabled, it should also tell you the process is running.
Now to enable your service type
sudo systemctl enable startps

if it returns to the terminal you may issue
sudo systemctl status startps

You should now see this response.
● startps.service - psensor service
   Loaded: loaded (/etc/systemd/system/startps.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2018-08-10 16:42:43 CDT; 45min ago

 Main PID: 15385 (startpf.sh)
   CGroup: /system.slice/startps.service
           ├─15385 /bin/bash /home/someuser/startps/startps.sh
           ├─15387 sudo psensor-server --port=8085
           └─15388 psensor-server --port=8085

Aug 10 16:42:43 [hostname] systemd[1]: Started psensor service.
Aug 10 16:42:43 [hostname] sudo[15387]:     root : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/bin/psensor-server --port=8085
Aug 10 16:42:43 [hostname] sudo[15387]: pam_unix(sudo:session): session opened for user root by (uid=0)

The main thing you're looking for here is that it says enabled in the second line.
If you see these outputs, then lets move onto the next step which is opening the firewall to allow access from the client machine within our network.
I feel you should know that psensor-server with it's built in HTTP server has no security measures what so ever. So essentially if you open it to the outside world you do so at your own risk, and I assume no responsibility should a hacker frag your computer
That is why I specifically included the next part of this guide to show you how to open the port in iptables to one client machine, you may adapt this as many times as you like.
so to open the port to a client machine you would use the following
sudo iptables -I INPUT -p tcp -s x.x.x.x --dport 8085 -j ACCEPT

Keep in mind x.x.x.x would be the IP of your client machine you want to access the psensor-server http page.
Also if you set a different port after the -dport flag you would need to adapt 8085 to the port you chose in the creation of the startps.sh in the steps above.
Now you should be able to go to the client machine and type http://x.x.x.x:8085 wherein x.x.x.x is your server's IP and 8085 is the port you set in the creation of startps.sh in the steps above.
The following guides were used in creating this guide. The commands were adapted to remove apt-get as apt is now the default way to install software in ubuntu 16.04
https://wpitchoune.net/psensor/
https://wpitchoune.net/psensor/README.html
http://lifeonubuntu.com/ubuntu-missing-add-apt-repository-command/
https://www.digitalocean.com/community/tutorials/understanding-systemd-units-and-unit-files
How do I run a single command at startup using systemd?
https://www.garron.me/en/bits/iptables-open-port-for-specific-ip.html
As well as the #ubuntu-server irc channel. I hope this helps someone who wants to do what I did but doesn't have the know how. Please note this guide was obviously meant for users like myself who really don't know much about Ubuntu and/or the terminal window. If anyone has an easier way feel free to note it as an answer and I'll update as I get time.


Specific integral of modified Bessel function of first kind

Question: While doing some calculations for a random matrix model I arrived at the following formula
$$ \int_0^x\int_x^∞ e^{−t−s} I_0(2\sqrt{ts}) \mathrm{d}t\mathrm{d}s
= xe^{−2x} (I_0(2x) + I_1(2x)) $$
where $I_ν$ denotes the modified Bessel function of first kind, i.e.
$$I_ν(x) = \sum_{n=0}^{\infty} \frac{1}{n!Γ(n+ν+1)}\left(\frac{z}{2}\right)^{2n+ν}.$$
I am now looking for some (short) analytic proof for it? I tried a bit around but could not find any.
Answer: A few thoughts that may propel you onto a full proof.
Consider taking the following integral over the rectangle $0 \leq u \leq x, 0 \leq t \leq y$
$$I(x, y) = \int_0^x \int_0^ye^{-u-t}I_0(2 \sqrt{ut})\,\mathrm{du}\, \mathrm{dt}$$
I aim to show that
$$I(x, y) = x-\frac{1}{2}e^{-x-y}[(x+y)I_0(\xi)+\xi I_1(\xi)]+(y-x)F(x, y) \tag{1}$$
Where
$$F(x, y) = \frac{1}{2}\kappa\int_\xi^\infty e^{- \sigma t}f(t)\, \mathrm{dt}$$
and
\begin{align}
f(t) &= e^{-t}I_0(t)\\
\xi  &=2\sqrt{xy} \\
\sigma &= \frac{(\sqrt{y}-\sqrt{x})^2}{\xi}\\
\kappa &= \frac{y-x}{\xi}
\end{align}
So, write
\begin{align}
I(x, y)&=x+(y-x)K(x, y)-e^{-x-y}[\frac{1}{2}\xi I_1(\xi)+xI_0(\xi)] \tag{2}\\
K(x, y) &=\int_0^xe^{-(t+y)}I_0(2 \sqrt{ty})\,\mathrm{dt} \tag{3}
\end{align}
This relation comes straight from Lassey On the computation of certain integrals containing the modified Bessel function $I_0(\xi)$.
The second relation here can be verified by applying $\partial^2 / \partial x \partial y$ to the first relation and using the fact that
\begin{align}
\frac{\partial K}{\partial y} &= -e^{-x-y}\sqrt{x/y}I_1(\xi)\\
\frac{\partial}{\partial x}\sqrt{x/y}I_1(\xi)&=I_0(\xi)
\end{align}
Now, proceeding with $(3)$ and replacing the Bessel function with
$$I_0(2\sqrt{ty}) = \frac{1}{2 \pi i}\int_L e^{t/s + ys}\,\frac{\mathrm{ds}}{s}\tag{4}$$
Where $L$ is the unit circle around $s=0$. Inserting $(4)$ into $(2)$ yields
$$K(x, y) = \frac{e^{-x-y}}{2 \pi i}\int_L \frac{e^{ys}(e^{x/s}-e^x)}{1-s}\, \mathrm{ds}$$
Integrating this along $|s| = \rho = \sqrt{x/y}$ (assuming that $\rho < 1$ then
$$K(x,y)=- \frac{e^{-x-y}}{2 \pi}\int_0^\pi e^{\xi \cos \theta}\frac{2 \rho (\rho-\cos \theta)}{\rho^2 - 2\rho \cos \theta +1}\, \mathrm{d \theta} $$
Writing $2 \rho (\rho - \cos \theta) = \rho^2 - 2 \rho \cos \theta + 1 + \rho^2-1$ gives
$$K(x, y) = F(x, y)-\frac{1}{2}e^{-x-y}I_0(\xi)\tag{5}$$
In the above we have integrated $(4)$ along the circle $|s|=\sqrt{t/y}$ to obtain
$$I_0(\xi) = \frac{1}{\pi}\int_0^\pi e^{\xi \cos \theta}\, \mathrm{d \theta}$$
Returning to $(5)$ we define
$$F(x, y) = \frac{(1-\rho^2)e^{-x-y}}{2 \pi} \int_0^\pi \frac{e^{\xi \cos \theta}}{\rho^2-2\rho\cos \theta +1}\, \mathrm{d \theta}$$
Combining $(5)$ and $(2)$ you should get to $(1)$. I hope that this gives some help, please comment and critique as you see fit!
Comment: Thank's a lot. Actually, already (2) solves my question by using $x=y$. Notice that in (2) there is a small typo: the first term should be $\frac{1}{2}\xi I_1(\xi)$.
Comment: Do you have any hints on how you guessed/knew formula (2)? Even with your hint of taking the derivatives it is straight forward but far from obvious to me.

Also I do not completely get the advantage of (1) compared to (2). They both seem to me of same difficulty. Do you have any comments on this as well?
Comment: Hello Marcel. Thanks for the feedback. I will address the typos and your other question later today. Sorry for delay. Best, Kevin
Comment: Hi Kevin, could you please explain me quickly how you came up with equation (2)? Until now, this seems to be kind of magic guessing.
Comment: @Marcel Hello! Apologies for the lateness, I had to do my job over the last few days! The result in (2) comes from a result in the paper of Lassey - I should have been more careful to express this at the outset. I have looked online for a copy of the paper but cannot source a pdf, only a reference to the AMS journal entry. I will re-write the section above to inlcude this as a reference. Please check it out, the apper itself is teriffic and considers lots of other cool relation involving $I_0(\xi)$.


Unable to open sleep image due to permission issues

Question: I upgraded my Mac to High Sierra and I wanted to open the sleep image which is situated in <code>/private/var/vm</code> But when I opened it it showed 'you have no acces to open this file please contact your administrator or network administrator' message like that.I am not sure whether this is a problem with me or has Apple restricted access to sleep image on high sierra
Comment: Why do you want to do this?
Answer: Find these keys on your keyboard command+I this will open the get info window
After the windows opens scroll down and click on the sharing & permission
Now if you don't see your username in the filed which appears after clicking on sharing & permissions then add your username (Admin) by clicking on the plus sign
Now if this doesn't works then again click on the plus sign and add Administrator (First check is Administrator is visible in the filed or not after clicking sharing and permission)
After pressing command+i you will get to see a window like this after which you will have to click on the lock icon!

Then enter your password

Now a second overlaying window will appear on your mac screen
Now, You will have to select either your username or administrators and add it to the sharing and permissions field
After that there wouldn't be any permission issues!
Comment: doesn't work. I don't have necessary permissions to add my name or my group. Sorry. Furthermore this sleepimage is corrupted and the answer seems to delete this file but impossible. Very irritating because my mac book pro restart in the middle of the night every night even though it's closed
Comment: Try deleting it by entering `sudo rm -r /private/var/vm` this will erase it no matter what


SuperDraco Dragon V2 vs Merlin 1D Falcon

Question: I figured out that ten SuperDraco engines have about the same thrust as a Merlin 1D. So if we replace Falcon 9's second stage with a Dragon V2 with 2 additional SuperDracos ( and replace some seats with fuel tanks,) can it plus a Falcon first stage propel itself into orbit?(or, at least, sub-orbit.)
Plus, Dragon V2 is reusable, while a Falcon second stage is not. So I think replace a Falcon 9 second stage with a Dragon is pretty cost-saving, huh?
Answer: The thrust of the engines (for any launcher or spacecraft, really) is nowhere near as important as the amount of fuel feeding them.
It takes about 9400-10000m/s of ∆v, depending on trajectory, to reach stable orbit from Earth's surface.
The second stage of a Falcon 9 1.1, depending on payload, is responsible for the majority of that speed: 6200-6700 m/s. That gets 10-13 tons into LEO. It achieves this by carrying 92 tons of propellants.
According to the numbers filed with the EPA, Dragon V2 carries 450 gallons of hydrazine and NTO propellants, roughly 2 tons. With the dry mass of 4.2 tons, that's about 900 m/s delta-V assuming zero payload. With 3 tons of payload you've got about 565 m/s.
On the up side, losing the second stage means the first stage is carrying much less weight, so it gets you going a lot faster, yielding an extra 3200m/s of ∆v, but that leaves you 2000 m/s short of orbit.
Replacing the Dragon payload with fuel tankage could get the total system ∆v to 8800m/s, still 1000m/s short of orbit with no useful payload.
Answer: The critical number for rocket engines is their specific impulse (Isp, a measure of how efficient the engine is).

The Merlin has an Isp of 311 s.
The SuperDraco Isp is estimated to be around 225 s (which is in line with other hydrazine engines).

This means an upper stage that uses SuperDracos would need to be much heavier than a Merlin-powered upper stage, because it'd need more fuel to achieve the same $\Delta V$. So you'd end up replacing the second stage with a Dragon that's larger and heavier than the second stage (and as a consequence, will be harder to land intact).
Comment: The thing is that, the SuperDracos only need to lift the Dragon, while the Merlin Vacuum need to lift the Dragon AND the second stage
Comment: No, the SuperDracos need to lift the Dragon PLUS all of the fuel. It turns out, to carry all that fuel, you need a structure the size of the second stage. The Dragon carries enough fuel to fire the SuperDracos for a few seconds. You need to run them for ~8 minutes to get to orbit.