zeroes of holomorphic function

Question: I know that zeroes of holomorphic functions are isolated,and I know that if a holomorphic function has zero set whic has a limit point then it is identically zero function,i know a holomorphic function can have countable zero set, does there exixt a holomorphic function which is not identically zero, and has uncountable number of zeroes?
Answer: As others have said, it comes down to the nonexistence of an uncountable discrete subset $Z$ of an open subset $U$ of the complex plane $\mathbb{C}$.  The point of this answer is to record a proof of this that I find simplest.  Namely, the space $\mathbb{C}$ is second countable: there is a countable base for the topology (take, e.g., open balls with rational radii centered at points $x+yi$ with $x,y \in \mathbb{Q})$).  But every subspace of a second countable space is second countable: just restrict a countable base to the subspace.  In particular $U$ is second countable and so is the putative uncountable discrete subset $Z$ of $U$.  But this is absurd: since the only base of a discrete space consists of all the singleton sets, an uncountable discrete space is not second-countable!
Answer: Existence of such a function would imply that its zero locus were an uncountable closed discrete subset of the complex plane, contradicting that the complex plane is separable and normal.
EDIT in response to question: (For simplicity's sake $f$ is assumed to be defined on all of $\mathbb{C}$ — this isn't really a problem because $\mathbb{C}$ is hereditarily normal, so if $f$ is defined on an open set $U$ we also have that $U$ is separable and normal)
The zero locus of $f$ means $f^{-1}(\{0\})$ (i.e. the set of points where $f$ is $0$ — call it $Z$) and it's the pre-image of a closed set under a continuous function so it's closed. Assume that $Z$ is uncountable and discrete. Then every function from $Z$ to $\mathbb{R}$ is continuous and thus there are $2^{2^{\aleph_0}}$ many continuous functions from $Z$ to $\mathbb{R}$. Since $\mathbb{Q}(i)$ is a countable dense subset of $\mathbb{C}$ any continuous real-valued function on $\mathbb{C}$ is determined by its values on $\mathbb{Q}(i)$, i.e. there are $2^{\aleph_0}$ many continuous real-valued functions on $\mathbb{C}$. Hence there is some continuous real-valued function on $Z$ that cannot be extended to the whole space, but $\mathbb{C}$ is normal so any continuous function on a closed subspace is extendable to a continuous function on the whole space by the Tietze extension theorem; contradicting our assumption of $Z$ being uncountable and discrete.
This is essentially the same argument as why the Moore plane isn't normal.
Comment: @kahen---> could you explain a little more?why if zero locus(I dont know what is zero locus means exactly) were uncountable then C would not be normal and seperable?
Comment: +1: I like this.  However, when you say $2^{2^\aleph_0}$, aren't you assuming that the zero set has cardinality $2^{\aleph_0}$ rather than just being uncountable?  It is apparently consistent that $2^{\aleph_1}=2^{\aleph_0}$, so there seems to be something else needed. http://mathoverflow.net/questions/17152/when-2a-2b-implies-ab-a-b-cardinals  (An uncountable closed subset of $\mathbb{C}$ must have cardinality $2^{\aleph_0}$, so there isn't really a problem, but I didn't know whether you meant to skip that step.)
Comment: @ Kahen,nice I got it, thank you very much to all.
Comment: @Jonas: True. If one wants to avoid that, one could go by the alternate route of using $\sigma$-compactness, $Z$ having infinitely many points in one of the compact sets, and that any infinite subset of a compact metric space has a limit point
Answer: A holomorphic function on a connected open set that is not identically zero cannot have uncountably many zeros.  Open subsets of $\mathbb{C}$ are $\sigma$-compact, so if $G$ is the domain, then there is a sequence $K_1,K_2,\ldots$ of compact subsets of $G$ such that $G=K_1\cup K_2\cup\cdots$.  (It is not hard to construct $K_n$; e.g., if $G$ is the whole plane, you can take $K_n=\{z:|z|\leq n\}$.  Otherwise you can take $\{z\in G:|z|\leq n\text{ and }d(z,\partial G)\geq \frac{1}{n}\}$.) An uncountable subset of $G$ must have uncountable intersection with one of the $K_n$s, because a countable union of countable sets is countable.  An infinite subset of $K_n$ has a limit point in $K_n$ by compactness.  The rest follows from the result you mentioned that a holomorphic function that is not identically zero cannot have a limit point of its zero set in the connected open set on which it is defined.
Comment: thank you,so I can say that any uncountable subset of C has a limit point because if not then for a point in it will have a ball with no other point from the set and I will put a complex number with rational co ordinate in that ball and then i can construct an injection from this uncountable set to rational points of plane.am I correct?
Comment: @elinor: That's not quite right, because from what you have described there is no guarantee that the balls will be disjoint, and therefore no guarantee that the chosen rationals are distinct.
Comment: @jonas--ok!! I got
Answer: Your question needs some clarification, as it is not internally consistent. If I understand correctly, you're asking if all holomorphic functions have uncountably many zeros? In that case, the answer is definitely no, for example $f(z) = 1$.
Comment: @ alex-nope, I am saying that is it true--> whether a non constant holomorphic function can have uncountable number of zeroes.
Comment: @elinor: Alex was responding to your original version which was later fixed by William.

zeroes of holomorphic function


How to get all the rice out of the pan?

Question: Often when cooking rice a lot of it ends up sticking to the bottom of the pan and gets wasted. Is there a way to get all the rice out of the pan easily?
Answer: It sounds like you're most likely boiling your rice. If that is the case, here is a quick explanation of what could be happening.
1.) The rice is burning in the pan, and becomes fixed to the bottom.
This seems most likely, as you mentioned that the rice was only getting stuck to the bottom of the pan, not the sides. This means it is likely related to heat.
To counter this, you'll need to either lower the heat, or keep the rice from sitting on the bottom of the pan long enough to burn. This can be accomplished by stirring frequently. This is also one of the reasons why steaming is often an easier way of preparing rice, as there is no direct heat source to burn the rice.
2.) The rice is too starchy and it's getting extra sticky.
Rice is very starchy, which is why most people wash their rice at least once before cooking. Rinsing the grains can remove some of the starch on the outside of the rice, and soaking for a between a few minutes and an hour will begin to release some starch from within the grain itself. '
As a general rule, rinse your rice until the water is mostly clear, then soak it for 5-10 minutes, rinse again until the water is clear, then cook. This will make sure that a large portion of the starch is removed, and the rice will not clump together when cooked. Adding a teaspoon of oil to the boiling water will also help prevent this clumping by minimizing sticking between grains and pot.
3.) If all these suggestions fail, you may consider another option for cooking your rice.
Rice Cookers are their own world of appliances, and you can find one on practically any budget these days. Multipurpose steamers and pressure cookers are also widely available, and can not only cook rice, but a wide range of dishes. Microwave cooking has also become increasingly popular in recent years, and a cursory google search yielded me several results regarding how to prepare rice in a microwave.
If none of this equipment is attainable, you can also create a simple steamer by placing a heat-safe bowl inside of a large pot. You simply need a bowl that is small enough to fit into the pot without touching the sides. Place a heat safe rack, another small bowl, or balled up foil under the bowl to prevent it from touching the bottom of the pot. Place the water in the outer pot, and your rinsed rice in the inner bowl with a little water. Once you cover the pot, the steam will build up inside and cook your rice. Be careful when opening the pot, as the steam is hot, and try to keep the lid closed so that you keep as much steam inside as possible. Be aware that rice made with this method sometimes has a tendency to clump, but this can be solved with occasional stirrings and the addition of oil.
Comment: Great answer, thanks! I am indeed talking about boiling the rice.
Answer: Here's my cooking "hack" for rice, which is basically avoiding to overheat the rice and remove excess starch too:

wash the rice before cooking until the water is clear
add the amount of water according your personal taste (more is sticky vs. less water is grainy rice in the end)
boil the rice and the water for a shortly time only, then drastically reduce temperature
5 minutes before your rice would be ready turn off the heat completely to just let it sit until it is done (no stiring!)

Alternatively - this is how my grandmother prepared rice - you could also immediately after the water boiled put the rice from the oven to put the pot into an insulated box or wrap it in a blanket. Let it stay for 30-60 minutes, again according to your personal taste of graininess. This gives you the advantage of not only saving a lot of energy but you also have one cooktop plate freed for preparing the rest of the meal.
Answer: I used to have this problem all the time - I'm a great chef, but was somehow notorious for screwing up rice. Now, my hack is to always add a bit of fat in the beginning. As the rice cooks, it's coating the pan and the rice grains and makes for very easy removal, and prevents sticking to the bottom during cooking.
I HIGHLY recommend this! You need just very little. My rice cooking has improved ten-fold and works with any rice. Use whatever fat makes sense for whatever you're cooking:
Example: Ghee for indian /
Coconut oil for thai /
Sesame oil for korean /
Olive oil for mediterrean /
Avocado oil for anything /
etc etc etc
Answer: Rice sticks when overheated. Cook slowly and stir frequently to prevent sticking. You might also add a drop or two of oil when boiling.
Answer: This may also be caused by pouring the rice into the pan too quickly (which cools the water and causes the rice to clump together). Try to pour slowly enough that the water keeps boiling.
Answer: You can cook your rice in more water for a shorter time, my book says 8 minutes but it can be different with other kinds of rice, drain the extra water (by pouring it through a sieve or strainer) and put it back in the warm pan.
Close the pan with a good fitting lid and keep the pan warm but not on the fire. In an oven at max 50 C or even wrapped in newspaper under the blankets of a bed. (If you live in a warm country you may just let it sit on the worktop.)
Ready to eat after about 15 minutes, depending on the time you cooked it and no sticking or burned bits, washing and soaking not needed.
I have used this method with several different kinds of rice and it always works, but some rice may need a bit longer cooking or standing.
(Source of the recipe a book, 'Op Kamers' by Huub Verstegen, in Dutch.)

How to get all the rice out of the pan?


QGIS changing map options distance units

Question: I want to change the map distance units option in QGIS from metres to centimetres.  I am currently using projection British National Grid EPSG 27700.  I would like the print composer to print a map out on the scale 1cm:5000cm.  Also how accurate is this projection relating to actual distance measured on the ground?  To the nearest metre (as EPSG 27700 projection is in metres?)?  Would there always be some margin of error in QGIS as it is open source software?
Comment: The error-margin stems from the projection or most likely the data, not the software. Also, 1:5k is always 1:5k - regardless of the units.
Answer: The distance-distortion in the map projection will be independent of the software (ignoring blunders); it is instead dependent on the projection used, and is also spatially variable.
Ordnance Survey National Grid is a Transverse Mercator projection chosen that the distances on the ground are identical to distances in the grid along two meridians: two lines of true
scale about 180 km to the east and west of the central meridian (2°W).  Away from these lines distance distortion is spatially variable.  For example:

In London, UK, the OSNG distance distortion is ~200PPM (or 20cm
distortion per km)
In Birmingham, UK, the OSNG distance distortion is
~400PPM (or 40cm distortion per km)

Note that this does not take into the height effect - the distance between two points on the ground increases the higher the elevation (about 1PPM per 6.4m height change).
For general mapping purposes this distortion between ground and grid may be considered entirely negligible; for precise engineering however this distortion is very significant and must be dealt with in some manner (for example, use of alternate projections: Snake Projection or Highways England Grids).
Answer: If you are using EPSG:27700 and all you want to do is measure distances any errors will depend on the accuracy of the data. If this is OS data the errors will be very small.
Comment: Thanks for this, I notice MapInfo has a BNG EPSG projection of 1mm accuracy- does QGIS have this projection?  I'm using QGIS for CAD purposes at the moment, to produce digitise objects and prepare maps at 1:1250 for planning applications, the distances have to be accurate.
Comment: The distances will be as accurate as your data. If, for example, you have four coordinates that define the corners of a rectangular land parcel the accuracy will depend on the accuracy of the coordinates. The BNG is just a simple rectangular grid, think of it as a piece of squared graph paper.


How make raspberry pi web controls?

Question: I want to develop web based control software for the Pi in PHP. I have some experience in PHP , but i have experience in using PHP, but no experience in running it on a Raspberry Pi.
Comment: @Goma01Tera20 you did not ask anything that is specific to RPi ... your question could easily apply to Linux, MacOS or Windows ... that makes it a general programming question ... you are "shooting yourself in the foot", if all you look for are RPi tutorials and RPi info on the web
Comment: your question appears to have nothing to do with the Raspberry Pi ... look for general programming tutorials and linux tutorials
Comment: @jsotola what you mean?
Comment: @jsotola I guess the actual question is "How to install a web server on the pi" and possibly something like "Can I control my Pi (e.g. GPIO) from PHP". This isn't really clear and maybe Goma01 Tera20 can add more details to the question.
Answer: You can start off by setting up a simple apache server you can then use PHP for something like creating a dashboard that displays data from the sensors you connect to your Pi. I made a similar project for a high school hackathon last year.
Some tutorials to help you get started:

https://www.raspberrypi.org/documentation/remote-access/web-server/apache.md
https://www.w3schools.com/php/php_intro.asp
Answer: welcome.
I assume you mean to ask: what do I need to make gpios and other pi-specific stuff usable in PHP?
I would encourage in using some other tech, but if that's your choice my gut feeling would be to just have some system calls, see this example.
The performance won't be exciting but it's acceptable for watering the pots or turning on a lamp.
A quick google of PHP libraries for GPIOs resulted in multiple matches, I wouldn't feel like using any but you can take the chance to experiment with them.

How make raspberry pi web controls?


proper wrist extension movement

Question: When doing wrist curls or reverse one should dumbbell should move in plane perpendicular to ground or should it follow normal curved path as ulnar is shorter so weight moves toward  ulnar side naturally. Which form is perfect?
Answer: You would be correct, as the ulna is shorter you do tend to naturally deviate toward that side.

However a major stabilizing structure called the Triangular Fibrocartilage Complex (TFCC) basically helps cushion and minimize any ulnar deviation seen at rest.

Honestly whatever's comfortable.  Wrist Flexion / Extension is essential a pure sagittal plane movement.  Try a straight or ez-curl bar, use whatever feels best -- risk of injury is low as this is a distal joint (so it's a much more isolated movement).
Other Exercise Options:
Use a variety of exercises to help to maximize the strength and contours of your hand, wrist, and forearm. This increase in the overall strength of your upper extremities will also help to improve your hand and wrist dexterity, which in turn can improve competitive performance in athletics, gaming, and even in day-to-day tasks.
Seated Wrist Hammer Curls
In a seated position with your back straight, place your forearm on your thighs with your thumbs pointed upward. Use a 5-, 10-, or 20lb weight in a hammer position and lift it back and forth slowly for 3 sets of 20 repetitions. This will develop your brachioradialis muscle, which inserts at the distal aspect of the forearm at the wrist. Greater hypertrophy of this muscle will give more definition and balance of the forearm.
Seated Reverse Wrist Curls
This is to develop your extensor muscles and is also done in a seated position with your forearms on your thigh, palms facing downward, with the wrist three to four inches away from the knees. Grasp the weight and extend the wrist fully. Do this for 3 sets of 20 and be sure to not lift the elbows from the thighs when extending the wrists. Keep the palms down.
Answer: There is never "one perfect form" in any exercise. One of the keys to progress is variety.
If you find one motion, and do it over and over and over, the benefits will suffer diminishing returns very quickly. You need to overload the muscles, both in terms of volume (sets x reps), intensity (weight), and variety.
And just to nitpick a bit; there are two planes perpendicular to the floor. The sagittal and the frontal planes. Only the transverse plane is parallel to the floor.
Comment: "The sagittal and the frontal planes. Only the transverse plane is parallel to the floor." -- Yep this is true.

proper wrist extension movement


Is there a Bukkit Plugin that allows giving new users books?

Question: I was thinking, with the books Minecraft has come out with, it's time to replace those 500 blocks worth of signs with a simple book. Is there a Bukkit Plugin that will automatically give new users a rulebook?
Comment: They do it in MineZ so there's gotta be something which makes it possible.
Comment: @shanodin Assuming they use bukkit and not e.g. a custom server. But anyway, yes, [it is possible](http://gaming.stackexchange.com/a/123079/88)
Comment: @Zommuter true indeed
Comment: Are you willing to use command blocks instead, because you could do it that way?
Answer: The BookRules plugin might be exactly what you are looking for:

Automatically give players written books containing rules, getting started guides, etc when they join your server.

It's pretty simple to use:

in the config file set Seconds-Delay to a value you deem appropriate. (It's the time in seconds between a new player login and the book being given to the player)
In game, write a book with all the rules
use /rulebook add to add the book as a rule book.
enjoy

A plugin that would be nice would be a book read plugin keeping all new player in prison as long as they haven't finished reading the rule book.
Comment: +1, but re your last paragraph, that's just like EULA: everyone will click "read & understood", but once you're forced to do so you won't...
Answer: You can use the tools referred to in the answer to my question Is there a bukkit plugin to run small scripts when players (re)spawn?, namely Autorun command's
/addfirstjoincommand <identifier>.


How can I read ISO 9660 in Windows 10?

Question: ZTE Valet smart phone on USB looks like CDFS file system (read only, write once). Windows Explorer only shows the USB driver which is installed on first use.
Comment: If the driver were successfully installed then the device would almost certainly appear "properly". That it doesn't suggests that it isn't installed, perhaps it only works on a 32-bit version of Windows?
Comment: Not sure if I understand the title. "CDFS" _is_ ISO 9660.
Answer: The ZTE phone file system has multiple partitions. You have to manually select an access mode by clicking a button in Settings/Connect to PC. The four modes are: Charge only; Media device (MTP); Camera (PTP); Install driver. I was in the Install mode (default for first time connecting to USB port), so Windows Explorer showed only the Install partition. After selecting the Media mode, Windows Explorer shows the Phone and SDcard partitions. The ZTE "USB driver" is a program installed in C:/Program Files (x86). The two ZTE "Assistant apps" are a web link to http://joinme.ztedevice.com and an uninstall program.
Comment: Here's a picture of the "Connect to PC" screen.
Comment: http://rhmccullough.net/Pictures/Connect_to_PC.jpg

How can I read ISO 9660 in Windows 10?


How to re-create a JPEG file compressed by Android within a Java server

Question: What I am attempting to do is to convert a JPEG image from an Android app, send it across to a Java app (e.g. a server) and then convert it back to a JPEG file.
I know how to do these parts individually; i.e.
 - JPEG to byte[] conversion in Android using BitmapFactory and BitMap classes
 - conversion from a byte[] created in Java side (using ImageIO) back into a JPEG class.
My question is how to re-create the JPEG in the Java side if the byte[] created by the Android app contains compressed data (e.g. created using BitMap#compress method). The only knowledge shared between Android and Java side is that the content will be a JPEG file
(and can pass in info about a common compression algorithm if both libraries/APIs support it).
Any help is much appreciated!
Comment: Why would you want to recreate a jpg if you already have it ? BTW it doesnt matter where the file came from as this not the important part of the q...
Answer: I would avoid the compress() step if possible. JPEGs are already compressed. Otherwise you are going to need a BitMapFactory implementation on the Java side.


Beef jerky to Israel

Question: For the purposes of customs, is beef jerky considered a raw meat product?
In other words, can I bring beef jerky from the US to Israel?
Comment: "Smuggle" with or without quotes is never a good idea but into *Israel* ? That is a spectacularly bad idea, my friend.
Comment: Are you planning on taking several hundred dollars worth?
Comment: @CGCampbell possibly --I want to have for my own personal use, but don't really want to just "smuggle" it in through the green line if it's not allowed..
Comment: @chx I said I *don't * want to because it's the law. (even though I suspect no one would notice anything due to the "green line")
Comment: When I entered Israel a few days ago (via TLV) they were randomly X-raying peoples bags from the "Green Line"
Answer: As I indicated in the other question, import of non-Kosher meat is prohibited [Israeli government website, in English]. I see no exception for quantities brought in with you. Kosher beef jerky is available in the USA, but the coals-to-Newcastle aspect is noticeable.
Comment: FYI the link doesn't work anymore. There is a version up on the Internet Archive, but I wouldn't know if that's up to date or not.
Comment: I didn't know that! I wonder which other countries use "public morals" as a reason to deny import.
Comment: Working link - [The relevant law in Hebrew](https://www.nevo.co.il/law_html/Law01/165_002.htm) - prohibits the import of non-Kosher meat, with no mention of quantity. I'm sure it's not enforced on individuals with small amounts (but of course - don't blame me if I'm wrong).
Answer: Food is always iffy on the border but as far as I am aware beef jerky is raw meat and you can't import raw meat into Israel without a license.

Beef jerky to Israel


Python Mechanize module, selecting all input fields within a form

Question: I need Mechanize to put a certain string into every edittable input field within a selected from. Here is some HTML code as an example:
<form action = "http://localhost/whatever.php" method = "post">
<input type = "hidden" name = "dummy" value = "12345">
<input type = "text" name = "msg">

<input type = "text" name = "name">

<input type = "submit" value = "Send">
</form>

Since my Python script would be very tedious to re-write on every website, and would become very website dependent, I want it to select all edittable input fields (while not editting hidden or disabled fields) within a selected form and set the value of each input field to a certain string. However, I will not know the names of each input element. So is there a way in which I can select an input element by its index number? My code looks something like this so far:
import mechanize
browser = mechanize.Browser()
url = raw_input("Enter web address: ")
browser.open(url)
browser.select_form(nr=0)
# I know the index number of the form or my Python code will find out which it is
# but I do not know the names of the input elements within this form

And at that point, I would want to do something like this: figure out how many editable input elements exist, and select each one by its index number setting it to a value. So can
this be done? I just need an automated way of selecting input fields and setting them to a value without knowing their name or id. Is it possible to select it by its index number, like something like this:
browser.input_elements[1] = "whatever"

In which case is there a list or sequence in Mechanize containing the input elements and values, so I can edit them?
Answer: Found something that might be of use here:
http://stockrt.github.com/p/emulating-a-browser-in-python-with-mechanize/
# Select the first (index zero) form
br.select_form(nr=0)


What to do when a deal breaker is played against a complete set with more property in it...?

Question: I have a red color property complete set(3 cards) then I put rent and my opponent gives me another red. Then my moves ended. My opponent put a deal breaker now I have to give him a set (3 cards) or all of it(4 cards) .
Comment: What does the deal breaker card say? Providing that information will help get answers as people won't have to research what you are asking as much.
Answer: You would have put the new red card in another place -- it doesn't go in the set that's already full (you're starting a new set of red).
When they play Deal Breaker, they only get the full set (3 cards in this case)


pytorch: Instance norm implemented by basic operations has different result comparing to torch.nn.InstanceNorm2d

Question: I implement instance norm by pytorch basic operations from scratch. But the result is different from torch.nn.InstanceNorm2d. Can anyone help me out? Below is my code:
import torch
import numpy as np
x = torch.rand((8, 16, 32, 32))
a = torch.nn.InstanceNorm2d(256)
a.eval()
with torch.no_grad():
    b = a(x)
x_mean = torch.mean(x, axis=(2,3), keepdims=True)
x_var = torch.var(x, axis=(2,3), keepdims=True)
x_norm = (x - x_mean) / torch.sqrt(x_var + 1e-5)
b_numpy = b.numpy()
x_norm_numpy = x_norm.numpy()
\# check if b_numpy and x_norm_numpy close to the torlerance of 1e-3
print(np.allclose(b_numpy, x_norm_numpy, atol=1e-3))
\# check if b_numpy and x_norm_numpy close to the torlerance of 1e-3
print(np.allclose(b_numpy, x_norm_numpy, atol=1e-4))

Result:
True
False

So, the result shows that when precision comes to 1e-4, they are different. I don't know why. Can anyone help me to get a more close result to torch.nn.InstanceNorm2d?
BTW, the reason why I do not use formula gamma * x_normalized_numpy + beta in the paper is I find that when the first initialization of torch.nn.InstanceNorm2d, all gamma is initialized to [1.0, 1.0, 1.0, …] and all beta is initialized to [0.0, 0.0, 0.0, …]. So, under this condition, x_normalized_numpy = gamma * x_normalized_numpy + beta
Answer: PyTorch's implementation of Instance Norm uses the biased variance estimate.
Try using torch.var(x, axis=(2,3), keepdims=True, unbiased=False).


Painting over cracks in ceiling

Question: Our kitchen ceiling has several cracks in the plaster. We need to repaint the ceilings and didn't know what our best option was for the cracks. We don't want to do some sort of plaster because we figure we won't be able to get the matching texture of the ceiling and it would be very obvious. We were thinking using good ceiling paint that the cracks would be concealed. Is this a correct assumption or no?
Comment: Paint may or may not seal the crack. You could try spackle, finger painted to the crack only. The crack will probably always be noticable one way or another.
Answer: I encountered this in my first property, which due to the age of the building would have cracks in many walls and ceilings.
In my experience paint does not do the job.  Perhaps if you slapped a lot of thick, gloss on top of them you could "fill" them, but I don't believe standard interior matte paint will reduce visibility of the crack.
In an ideal world, you would tape over them and use some sort of jointing/finishing compound to cover the area approx 5cm either side of the crack along it's length.  A bit of sanding and paint and you're sorted.
However, with your ceiling this is either going to be impossible, or look very obvious after the fact.
Advice you don't want, but will definitely fix it: re-plaster the whole ceiling
Cheaper, but might not work: run some caulk (with the smallest nozzle possible) down the crack and smooth in with your finger.  Wipe away the excess and let it dry.  Paint over.  It may not be perfect, but it has the potential to work in the long-term as the caulking is more flexible and will allow for a little movement.
Comment: Rather than "smoothing" it, rub it off with a rag, so that just the crack is filled and the natural texture of the ceiling isn't obscured.
Answer: So lucky for you this is very common and easy to fix :)

Do you live in a cool or warm climate area? The answer will be slightly different depending on the climate you are located in.

If: you are located in a warm climate then you can start fixing right away.
If: you are located in a cool climate area wait until spring passes to let the cracks get worse or new ones to appear because of the temperature change.
This will just save you a bit of work for future.

Buy a metal scraper from the dollar store scrape of the paint/texture LIGHTLY.
Using fine sandpaper smooth out the area.
Don't scrape everything off just 2-3 inches away from the crack in all directions.
Get CGC20 and if the crack is bigger than 1/8 get some drywall mesh tape as well.
Stick the mesh tape on the crack, and put a coat of CGC on it.. smooth it out like you would doing any other taping.
Wait 24 hours, take a drywall sponge/sander and smooth out the compound.
Depending on severity you may have to repeat the process again.
If it looks ok and you want to smooth out more, use cgc20 for finishing coat.
To duplicate the current paint texture, go to your local paint store and get a textured brush and some thick paint, show them the picture you posted they will give you the right type.
Duplicate the pattern with the paint, it should be pretty easy, make sure to get a small roller to do it with.. it will save your shoulders.

P.S if anything is unclear let me know i will put some more info. I've had to do worse in the past lol..
Product List:

1. CGC20

2. CGC45

3. Drywall Sanding Sponge
4. Small Drywall knife
P.S get the smaller pre mixed packages of compound. And you don't NEED to re-plaster you whole ceiling it is probably fine, that would just be a waste of money and time.
Comment: Thanks for the suggestions. The cracks are very small. I wasn't able to slide a piece of paper into any of them. It seems like using compound may be an overkill, especially if the cracks are going to reappear. With ceiling paint being thicker, I would think that the cracks would become less noticeable with the ceiling being repainted. Is this bad logic?
Answer: you don't need to slide paper into the cracks, the mesh tape goes on top and then when you are sanding you really gotta sand hard to basically make it flush with the ceiling.
The mesh tape will just stop gravity from pulling the compound out of the crack while its drying.
If you think compound is an overkill use CGC 20 i think its in the green bag its a very light mixture that's easy to sand.
If you want to try an interesting way, you can buy Alex Plus caulking and cut the nozzle on a 30 degree angle so that you have a 1/8 hole. When you are applying the caulking hold the gun on the same angle the nozzle is cut and apply a VERY thin layer of caulking. Smooth it out with your finger and then apply the paint over it. The caulking is more elastic so if your ceiling moves an 1/8 here or there it should be able to expand better than compound. And then apply the paint over top. :)
Last time i posted as guest "Mike"
https://www.homedepot.ca/en/home/p.300ml-white-alex-plus-acrylic-latex-caulk-with-silicone---35-yr.1000158964.html
Answer: With just painting the crack will reappear sooner or later. Scrape the texture around the crack apply drywall tape, mud it, re-texture and paint is the most common thing to do, also clean cracks just a bit and apply a bit of a latex caulk wipe with wet sponge and paint.
Answer: We have plaster ceilings, and walls. For us the cracks turned into bubbles, the bubbles grew and grew, peeled, cracked.  We had professional painters come in. They scraped, and scraped, then fixed and sealed before painting.  We have this happen every 4-5 years.  We like live in extreme hot and cold weather. I think that's the nature of the beast (plaster)

Painting over cracks in ceiling


PCA on the stocks

Question: I have N stocks, and a covariance matrix that indicates the covariance of these N random variables. Now, if I run PCA on the covariance matrix, what can you tell about the principle component?
Comment: If you have a covariance matrix of the returns, the first principle component is comparable to the CAPM or the Single Index Model, ie, there is one common factor that explains a good part of the individual returns
Answer: PCA is nothing more than a special change of basis, such that most of the variance in the data is concentrated in the first eigendirections. So the first eigendirection will explain more variance than any other eigendirection. The princal components are then the original data transformed into this new basis.
If $N$ is large, then the first eigendirection or pc is the main factor that moves these assets. So one might say that this "common single factor among all stocks" is the general market risk of the market portfolio ($\beta$ in CAPM), i.e. a factor not attributed to individual stocks, rather global macro aspects.
While the first factor is generally considered the market risk/systemic risk, the other factors are more fuzzy. To my knowledge, there is no clear interpretation of these, as it also depends on what your stock universe consists of. Potential interpreration for these other factors could be equity sectors (healthcare, financial, industrial), equity stock fundamentals (revenue, balance sheets), etc...
Answer: Your first PC will be the "true" beta of the stock, compared to the other stocks in your sample. As opposed to the beta to the usual market index that people choose to measure this against.
If it isn't, then you have a very strange sample of stocks ;-)

PCA on the stocks


What does the d do in "nmcli d wifi list ifname wlan0"

Question: nmcli d wifi list ifname wlan0 - I understand that this command returns a list of avaible networks for wlan0, but what exactly does the "d" do in the command? Because "nmcli wifi list ifname wlan0" doesn't work. If someone could break this down I would greatly appreciate it.
Answer: It means device as per --help:
  d[evice]        devices managed by NetworkManager

Answer: If you use man nmcli you'll get the man page for the tool.
I'll break it down a little for you:
nmcli d wifi list ifname wlan0

SYNOPSIS
       nmcli [OPTIONS...]
       {help | general | networking | radio | connection | device | agent | monitor}
       [COMMAND]
       [ARGUMENTS...]

DESCRIPTION
      nmcli is a command-line tool for controlling NetworkManager and reporting network
      status...

[OPTIONS...] will start with a - or --.  In your case your d does not start with that, so the d is short for one of the {...} keywords.  In this case, the only option is device.  If we look at the device section of the man page, we see:

DEVICE MANAGEMENT COMMANDS
      nmcli device
      {status | show | set | connect | reapply | modify | disconnect | delete | monitor | wifi | lldp}
      [ARGUMENTS...]

       Show and manage network interfaces.

wifi in your command matches the next keyword.  There are a few entries on wifi including wifi hotspot, wifi rescan, wifi connect, but your command uses wifi list.  The entry on wifi list looks like this:

       wifi [list [--rescan | auto | no | yes] [ifname ifname] [bssid BSSID]]
           List available Wi-Fi access points. The ifname and bssid options can
           be used to list APs for a particular interface or with a specific
           BSSID, respectively.

So we can conclude that the command you wrote says:

nmcli - I want to control NetworkManager or report network status
d - I'm interested showing or managing a specific network interface (device)
wifi list ifname wlan0 - I want to list wifi access points visible to wlan0


Forget Gate in Long Short-Term Memory

Question: What value does actually LSTM forget in a training phase?
for example, I do have a surface temperature data for 10 years. Then I made them as a training data for building my neural network using lSTM algorithm. Then what value or which time step in my data that LSTM forget?
Answer: The way LSTMs are capable of learning long term dependencies is by keeping a cell state which serves as a memory of sorts.
This cell state is updated based on the values of different gates within the cell, forget gate being one of them.
The forget gate looks at the previous hidden state and the current input and outputs a number between 0 and 1 for each value in the cell state - deciding which values should be discarded and which saved.
During training, the cell learns which values in the cell state it should keep at different time steps in order to yield better results for the task at hand.
Now, saying exactly what are those values are is hard since it changes between samples and time steps. For example, let's assume that your objective is to predict the temperature for tomorrow based on the previous 10 days. If you had an outlier on the 3rd day of the previous 10 days, that might hinder the prediction, and the cell could decide to forget that value. In other cases, it might decide to keep the value of the 3rd day since it helps prediction.
If you want to understand LSTMs better I suggest this great post by Chris Olah.

Forget Gate in Long Short-Term Memory


Solving recurrence equation for lossy duplication

Question: Suppose we have a word of length $L$ from a two-letter alphabet (say, $\mathcal{A} = \{A,B\}$), and we duplicate it. However, our duplication is fallible: each element of the result is incorrect ($A$ changed to $B$, or vice versa) with probability $\mu$. Now we have a set of two words: the original, and the lossy copy. We duplicate both of these words by the same procedure, and repeat for $n$ rounds so that we have a set of $2^N$ (not necessarily unique) words.
I'm interested in what the final set of words looks like after $N$ rounds. Ultimately, I'd like to find the joint probability distribution for the number of copies we have of each possible word in $\mathcal{A}^L$. But I decided to start with something easier by finding the expectation of this distribution.
Let $f_n(x)$ be the expected number of copies of word $x \in \mathcal{A}^L$ after the $n$th round of duplication, and let the distance $d(x,y)$ between two words $x, y \in \mathcal{A}^L$ be the number of letters at which they differ. Then we have the following recurrence relation:
$$f_{n+1}(x) = f_n(x) + \sum_{y \in \mathcal{A}^L} f_n(y) \mu^{d(x,y)} (1-\mu)^{L-d(x,y)}$$
I'd like to be able to turn this into an explicit formula for $f_n(x)$ in terms of $n$, $x$, and $L$. Unfortunately, if I ever learned how to solve problems of this sort I've long since forgotten, and I don't even know what field of mathematics I'm looking for. As such, and since I'm hoping to build on this solution to solve more complicated versions of this and related problems, I would be very grateful for answers which offer thorough explanation of the methods and/or references to where I could learn more.
Answer: This is a comment, not an answer.
These types of sums
can be made less complicated
like this:
$\begin{array}\\
f_{n+1}(x)
&= f_n(x) + \sum_{y \in \mathcal{A}^L} f_n(y) \mu^{d(x,y)} (1-\mu)^{L-d(x,y)}\\
&= f_n(x) + \sum_{y \in \mathcal{A}^L} f_n(y) \mu^{d(x,y)} (1-\mu)^{L}(1-\mu)^{-d(x,y)}\\
&= f_n(x) + (1-\mu)^{L}\sum_{y \in \mathcal{A}^L} f_n(y) (\frac{\mu}{1-\mu})^{d(x,y)} \\
&= f_n(x) + (1-\mu)^{L}\sum_{y \in \mathcal{A}^L} f_n(y) z^{d(x,y)}
\quad\text{where } z = (\frac{\mu}{1-\mu})\\
\end{array}
$
To actually work on the sum,
you might convert it
to a sum over
the number of
positions in the string.


Any simple, cryptographically secure AES-based DRNG?

Question: I am looking for a DRNG/DRBG (cryptographically secure) algorithm/function (which I can program into js). I am looking to use a DRNG as a seed generator for generating multiple, identical AES keys on separate client devices, sharing the seed for the DRNG securely between users. Basically, I trying to see if there are any simple mathematical ways to achieve this. Any suggestions are greatly appreciated!
Answer: With access to AES-256, and if the seed is a 256-bit secret about uniformly random value, a simple method that fits is to use that 256-bit secret as AES-256 key, and encipher a 128-bit counter (initially zero, incremented after use) until sufficient output has been produced; that is $n$ (resp. $\lceil 3n/2\rceil$, $2n$) times to produce $n$ AES-128 (resp. AES-192; AES-256) keys.
That's the method used internally by AES-CTR to generate it's keystream, except that here we set the IV at zero. That change introduces the theoretical possibility of a multi-target attack, but it does not matter because a 256-bit key is so large. Further, in the use case, having many client devices with keys derived from the same secret seed does not make multi-target attack easier (having many different seeds would be necessary for that).
Importantly in a JS context, there's no arithmetic on secret data (outside AES, assumed secure). There's some arithmetic for the counter, but it's value is public.
Note: With access to AES-256-CTR, we can even remove the counter arithmetic by using AES-256-CTR decryption of all-zero data, with an all-zero IV.
Perhaps importantly in the context, it's easy to generate the key for one particular user without the cost (time and space) of generating the keys for the other ones; that is, we have an addressable PRNG/DRNG.

If the seeding material was low-entropy, that's another matter. We must use key stretching, preferably memory-hard, and improvising that from AES is not trivial.
Comment: With this method, is there any possibility for attacks because each key is derived from the counter? Since the attacker knows the counter value, does this reduce the time to brute force using known plaintext attacks (assuming sufficient entropy of the seed)? Also, I read that AES-CTR uses nonce + counter, is this necessary?
Comment: @Randusr: For a seed taken among $n$, whatever the method, brute force is going to take an expected $n/2$ steps, and that's infeasible for $n=2^{256}$ as in this scheme, so there's no worry to have. What I call IV in the answer is the nonce you read about (or perhaps the nonce with some zero bytes added on the right). It needs to have some value, and I propose all-zeroes when we want to compute all the user keys at once.
Comment: Is this method perfectly secret (perfect forward secrecy) if the message space >= key space? My understanding is that perfect secrecy requires no information to be revealed about the plaintext from the ciphertext, so the message length has to be >= key length. Does it make sense to add some kind of padding to messages of shorter length? Does this make the system perfectly secret for all messages?
Comment: @Randusr: this method is not information-theoretically secure (a.k.a. perfectly secure, secure against arbitrary powerful adversaries); but AES (or almost anything actually used) is not, as soon at more message is encrypted than the key size. Since there is no notion of session or key change over time, I don't see how we can define (perfect) [forward secrecy](https://en.wikipedia.org/wiki/Forward_secrecy) (which is disconnected from perfect secrecy).


Can an android phone harm windows network?

Question: Is it a security issue if someone is able to login into windows domain through an android phone with admin credentials through something like ES file explorer? I read that usually androids cant run exe files so I feel like not much harm can be done without tools like cmd.exe
Comment: If anything, ```cmd``` would be the last tool I would use if I could. If I had to be on windows, I would try to use cygwin or some other bash simulator.
Answer: Yes, any device that allows you access to a Windows network can be used to compromise that network. It doesn't matter that an android phone can't run exe files. I can grab tokens, attack files, databases...etc
And similar to @iismathwizard, I wouldn't expect to ever use cmd.exe on any device I was using to attack a Windows network. I may run the cmd.exe on a compromised Windows box, but to do that I'd have already connected to that box, and I can do that from any device I like with RDP/SSH/telnet/whatever


Field calculations and existing domains

Question: I have feature layer which needs to be updated with new attribute information. The text field I need to populate already has an established coded domain. I need to update hundreds of records and don't want to manually update. If I field calculate the selected values aren't I adding a new value not associated with my domain? What is the correct workflow for this type of mass edit?
Comment: If the domain already contains the value you want to apply to your records, in an Editor session use the Attribute window (right click in the map with the Editor arrow and choose "Attributes").  After selecting the records that must all change to one of the domain values, in the Attribute window select the layer name at the top of the selected feature list, then in the field list choose the domain value you want from the normal drop down.  All of the records will be updated to the domain value you picked.  If you need new domain values use the methods described by Alex first.
Comment: Thanks Richard! I completely forgot about that in the attributes window when editing
Answer: The field calculator will ignore the domain that you have set up for the field. It will be possible to calculate the coded values that are not present in the domain. Calculating those values won't add them to the domain.
If you want to add multiple values to the domain, you should use the GP tool Add Coded Value To Domain which adds a value to a domain's coded value list. Alternatively, use the Table To Domain tool which creates or updates a coded value domain with values from a table.
I suggest using Python for automating the workflow. You should have a valid domain with valid coded values before you will edit the values. I'd consider editing an attribute with values that are not present in the domain associated with a field a bad practice.
Comment: I don't want to add a new value to the domain. I just want to populate new features in bulk with an established value
Comment: I see. Then you can use the field calculator with Python code, such as here for having multiple if-else statements - look here `Calculate fields using logic with Python` at http://resources.arcgis.com/en/help/main/10.2/index.html#/Calculate_Field_examples/00170000004s000000/. You could also select rows you want to update in the attribute table and run field calculator. It respects the selection.

Field calculations and existing domains


For the purpose of Canadian tax reporting, can buying a business be deducted against personal taxable income?

Question: In Canada, can buying a business be deducted against personal taxable income as other business related expenses would, if one is running it as a sole proprietorship?
Comment: Buying a business is not a business expense.
Comment: not even if one has existing business, and buys an another existing business to add to their own?
Comment: of course not. That is called *investment* and is not tax deductible.
Answer: Yes, you will be able to claim it as an expense on your taxes, but not all in the current year. It is split into three categories:

Current Expenses - Assets purchased such as inventory would be able to be claimed in the current year.
Assets - Vehicles, Buildings, and equipment can be depreciated over time based on the value you purchased them for and the CCA class.
Goodwill - In tax terms this is the value of the business purchase that is not eligible in 1 or 2 and is called Eligible Capital Property. This can be expensed over time.

From info at CRA website: http://www.cra-arc.gc.ca/tx/bsnss/tpcs/lf-vnts/byng/menu-eng.html


Access mounted volumes via the command line

Question: I've plugged an external hdd into my usb port, and it shows up on the desktop and in nautilus. How can i access this mounted hdd via the command line?
Answer: automounted drives usually sit on /media/{label of your partition}. You can browse into it  by cd command in terminal
say if my pendrive is labeled SAGAR
cd /media/SAGAR

You can view the path in nautilus with ctrl+l and cd from terminal copying the path as well
EDIT: In Newer version, the username is used for directory: /media/${USER}/{SOME_HASH}
Answer: Every mounted devices have a "mount point" where they are mounted to. You can try to guess them (most removable stuffs are mounted into directories inside /media), but a nicer way to use the mount command within a shell, so you can see the mounted file systems. Then it's easy to check the directories you need to look ("something on somewhere" at every lines, look at "somewhere"). Also you can install a nautilus extension, in packages nautilus-terminal and nautilus-open-terminal, as far as I remember, one of these can open a terminal for you at the location where you are in nautilus, so you don't even need to use a single cd command to get there :) But anyway, if you're using nautilus you can navigate to the device's directory you are interested in, and the location bar will show you (or you may need to press CTRL-L then ...)
Comment: command is "mount" not mound ...
Comment: well of course, it was only a typo! Thanks for noticing!
Answer: It may be useful to do a 'disk free' check df -h - this should show where the main partition is mounted. The device will probably appear as dev/sda, dev/sda dev/sdb or similar e.g.
Filesystem      Size  Used Avail Use% Mounted on
...
/dev/sdb1       100G  0G   100   0%   /media/...


PCB footprint design of the ADMP401

Question: I am creating a PCB in KiCad and I am trying to create a footprint for my mic, the ADMP401. When creating the footprint and running the design rules checker, it says I have a clearance issue with the pads on the footprint I created for the ADMP401 and it needs to be at least .2 mm. Im, not sure how to fix this. I have attached the datasheet.
https://www.sparkfun.com/datasheets/Components/General/ADMP401.pdf
Comment: I inserted a picture of the ADMP401 I am using. As you can see, this ADMP401 does not have the middle or two corner pins, only the 3 on the end. I am unsure how to figure out what size I need to make the holes and the pads on the footprint to not violate these rules.
Comment: Can you also post a picture of the footprint as displayed in the footprint editor?
IIRC there are also clearance settings in the pad menu (select pad, press E, one or two tabs to the right)
Comment: yep, just checked. there are clearance settings for pad-to-pad clearance, solder mask clearance and paste mask clearance. Your problem is likely the pad-to-pad clearance. The DRC error should mention the layer where the problem is...
Comment: Be careful you are not mixing measurements in inches (in) and millimeters (mm). Also, are you actually using the 0.5500 in x 0.400 in module (PCB) as you show, or do you want to use the much smaller component as described in the datasheet you have linked to?
Comment: Im not sure at this point, what I am using is pictured above, the ADMP401.
Comment: OK, so what you show in the last two pictures is the module, (that contains the smaller ADMP401 and other components). Very often vendors will name the module after the chip P/N. A few of the comments and answers give you the correct advice to just set up the 3-pin module as a 3-pin inline (or SIP) connector with 0.100 in (2.54 mm) pin spacing. Note that if you replace the 3-pin straight header with a right-angle type you could mount the module vertically and save space. Be sure to include an easy way to determine the module's orientation in your PCB, mark pin 1 or add silkscreen markings.
Answer: The footprint as shown in the datasheet does not require clearances closer than 0.3mm (0.306 and 0.300 are the tightest) so I think you've got something wrong elsewhere. Maybe try recreating it from scratch.

Your updated post shows a module, not the chip in the datasheet. You only have to make pads for a 2.5mm pitch 3-pin connector and leave room for the PCB clearances your fab wants to see.
Use 0.9mm holes (1.0mm is a bit loose I think) and make the pads big enough to get enough spacing. Since it has some mechanical purpose you can go with something like 2.0mm or even 2.2mm for the pads. You can even make them non-round to get more copper, but that's more important when you have a board without plated-through holes.
Comment: Please see updated post.
Comment: @user23342283 Show the footprint you created with critical dimensions. Figure 4 in the data sheet shows the recommended footprint.
Comment: The body of the chip is 4.72mmx3.76mm so the holes would be too big wouldn't they?
Comment: @user23342283:  The 4.72 x 3.76 mm is the size of the microphone device itself.  The SparkFun module is 0.4. x 0.55 inch (10.16 x 13.97 mm).  From the SparkFun picture, it appears the holes are 0.05 inch from the edge of the board - you seem to have them 0.1 inch from the edge.  Your pads look very small to me.  Please verify if you are working with the bare microphone IC or with the SparkFun module.  That makes a BIG difference when discussing the required footprint.
Comment: The sparkfun module.
Answer: It appears that you are using a module using the ADMP401 and some supporting circuitry, not a bare ADMP401.  That module just needs a 3 pin 0.1 inch header, not the fancy footprint shown on the ADMP401 datasheet.
You should be able to find a suitable footprint in KiCad's connector library.
If I had to make the footprint, I would use three .060 pads with .040 hole, spaced 0.1 inch apart.
Comment: How can I make them 1 inch apart if the entire board is 4.72mm long and 3.76mm wide?
Comment: The pin spacing is 0.1" (2.54 mm).
Comment: The pin spacing is the same as for GPIO headers on an Arduino, Raspberry Pi, or similar boards
Comment: So the first and third pin should be .1 in apart?
Comment: No - there is 0.1 inch between first and second pin, and 0.1 inch between the second and third pin.  When you get the actual module, the pin spacing should be obvious.
Comment: I have submitted a picture of my created footprint, however, it does not look like the board. Please let me know what I need to change.
Comment: @user23342283: your footprint looks fine to me. A footprint will normally just show the pad/holes for connections and an outline of the part.  For a module like this, it won't show any of the components mounted on the module.  The person making the footprint got fancy and drew some of the parts that are mounted on the module - that is not necessary for KiCad to use the footprint.
Comment: I know that it wont look like the physical part, but even the outline looks wrong. The holes look far away from eachother and the outline of the board.
Comment: @user23342283: do you have the actual Sparkfun module?  If so, you can measure the hole positions on the module and adjust your footprint to suit.  I notice that there is a fourth hole required under the microphone IC to allow sound to pass to the mic.  This is shown on the SparkFun footprint drawing.

PCB footprint design of the ADMP401


How to transfer random selection of directories from external hd to laptop and specify limit of total data

Question: My laptop HD is a 120GB SSD. I also have a TB external HD which I used to store my music, photos and videos. I like having some music on my laptop in case I want to listen to something and I don't have Internet access (I don't usually carry around my external HD). But if I had my entire music collection on my laptop it would take up a huge chunk of my free space. I wanted a tool that got a random selection of albums from my external HD and transfered them to my music collection on my laptop. For the transfer I would like to specify only the maximum amount of data I want to transfer. For example, I would like to be able to specify, get me 10GB worth of random albums from the music collection in my external HD and put them in my laptop's music directory while eliminating what had previously been available on my laptop's music directory. Is there a tool that can help me achieve this? This would also be useful for transferring music to my smart-phone. P.S. I'm an Ubuntu user.
Answer: Use the tool Random Copy.
Random Copy has three Modes:

A file-based mode: the normal Mode for create a Music collection out of different Source Folders.
A directory-based Mode: to create a Music collection, also based on different source directories, but in different to the file-based Mode the complete Content of a directory is copied.
A CD-based Mode: A mode special to fit the size of a CD or DVD with songs, so there is less space left. Destination files could be the source files or wave files after internal conversion.

Alternative Linux
One option would be for Linux Mix2Stix.
Steps for installation and how to use, it described on page.

Note: Mix2Stix requires Java which has to be installed on the system. The source is included in the distribution.

Using the find/cp command
find -L ~ -type f -name "*.mp3" | sort -R | tail -n50 | while read file; do cp "$file" /media/<yourdisk>; done

The find command will search for mp3 files in your user folder ~. -n50 represents how many files are going to be copied.
Comment: That looks great, do you know of a Linux alternative?
Comment: @climatewarrior: Updated my answer. I will try to create a script that does it.
Answer: As long as you don't need exactly 10GB of data, just approximately 10GB but no more, you can write a bash function that does this. Add these lines to your $HOME/.bashrc file:
function random_copy(){
    size=0;
    tries=0;
    dirs=();
  ## The maximum size, change this to whatever you want
    limit=10000000
  ## The maximum number of times we will try to get
  ## another dir if the current one is too big.
    maxtries=20
  ## While we have not reached the size limit
    while [[ $size -lt $limit ]] ; do
  ## Find a random, non-empty directory from the source.
  ## sort -R does a  random sort and head -n 1 prints the first line.
    dir="$(find $1/*/  -not -empty -type d | sort -R | head -n 1)"
  ## Get this dir's size
    dsize=$(du -s "$dir" | cut -f 1)
  ## If this dir does not make us pass the limit
    if [[  $((size + $dsize)) -le $limit ]]; then
        echo "Copying $dir" 1>&2
    ## Copy it to target
        cp -r "$dir" $2
    ## Add its size to $size
        let size+=$dsize
  ## If this dir makes us pass the limit
  ## try $maxtries times to find another that does not
    else
        let tries++;
        if [[ $tries -gt $maxtries ]]; then
        echo "" 1>&2;
        echo "Final size =  $size"
        break;
        fi
    fi
    done;
}

You can then call the function by running
random_copy /path/to/source /path/to/destination

For example
random_copy ~/Music /tmp/music

NOTES

The function will look for folders that are under the source directory. I am assuming that each of your albums is in its own folder.
The actual size you end up with will be different every time you run the function. If a particular directory makes it pass the size limit, it will try again until $maxtries is reached. You can control this by changing maxtries=20 to whatever you want.
Comment: Thank you! I figured I would probably just end up doing a Bash script. This is a pretty nice head start, thanks.


thread get 100% CPU very fast

Question: I am implementing a very basic thread in C#:
private Thread listenThread;

public void startParser()
{
    this.listenThread = new Thread(new ThreadStart(checkingData));
    this.listenThread.IsBackground = true;
    this.listenThread.Start();
}

private void checkingData()
{
    while (true)
    {

    }
}

Then I immediately get 100% CPU. I want to check if sensor data is read inside the while(true) loop. Why it is like this?
Thanks in advance.
Comment: Getting 100% CPU is correct according to this code. Is there any interval you want to check sensor data? Probably you may have to sleep the thread accordingly.
Comment: Can we assume there is actually some implementation in the `while` loop, and that it has some ability to terminate?
Answer: while (true) is what killing your CPU.
You can add Thread.Sleep(X) to you while to give CPU some rest before checking again.
Also, seems like you actually need a Timer.
Look at one of the Timer classes here http://msdn.microsoft.com/en-us/library/system.threading.timer.aspx.
Use Timer with as high pulling interval as you can afford, 1 sec, half a sec.
You need to tradeoff between CPU usage and the maximum delay you can afford between checks.
Comment: How often do you need to be checking realistically? Even letting it sleep for 10ms will make a huge difference.
Comment: Hi. thanks. But then how can I wait for data coming? I would like to continuously checking the data coming.
Comment: @JoesyXHN - where are your data coming from?
Answer: Let your loop sleep. It's running around and around and getting tired. At the very least, let it take a break eventually.
Comment: should I use: timer.tick per 1 millisecond instead of using thread with while loop and sleep for 1 millisecond?
Comment: BAHAHAHAHAHAHAHA! 1 millisecond! try 100-500 milliseconds.
Answer: Because your function isn't doing anything inside the while block, it grabs the CPU, and, for all practical purposes, never lets go of it, so other threads can do their work
private void checkingData()
{
    while (true)
    {
        // executes, immediately
    }
}

If you change it to the following, you should see more reasonable CPU consumption:
private void checkingData()
{
    while (true)
    {
        // read your sensor data

        Thread.Sleep(1000);
    }
}

Answer: you can use blocking queue. take a item from blocking queue will block the thread until there is a item put into the queue. that doesn't cost any cpu.
with .net4, you can use BlockingCollection http://msdn.microsoft.com/en-us/library/dd267312.aspx
under version 4, there is not blocking queue int .net framework.
you can find many implements of blocking queue if you google it.
here is a implementation
http://www.codeproject.com/KB/recipes/boundedblockingqueue.aspx
by the way. where does the data you wait come from?
EDIT
if you want to check file. you can use FileSystemWatcher to check it with thread block.
if your data comes from external API and the api doesn't block the thread, there is no way to block the thread except use Thread.Sleep
Comment: how blocking collection will help if JoesyXHN needs to check a file or external API or something else?
Comment: you are right. if he want to watch a file or the data comes from external API. blocking collection is useless.
Comment: so i asked him where the data comes from.
Answer: If you're polling for a condition, definitely do as others suggested and put in a sleep. I'd also add that if you need maximum performance, you can use a statistical trick to avoid sleeping when sensor data has been read. When you detect sensor data is idle, say, 10 times in a row, then start to sleep on each iteration again.

thread get 100% CPU very fast


Naming for image sequence?

Question: I am working in compositor and VSE and find that Blender does not seem to understand image-sequences named like 120311_115058__001.jpg?
What are the rules for naming img-sequences?
Thanks
Answer: There should be no issue with such naming. As long as the end of the file name is that of the sequence, for exqample: xxxx_xxx_#### in which # stands for the frame number.
If you are importing into the VSE make sure you select all of the frames that are part of the sequence (press A).

As for the compositor use an Image Sequence node you just need to select the first image in the sequence. Then enable Match movie length and Auto_Refresh.
Comment: Thanks, but still not working. Filename starting with 100105_115616_0001.jpg, and when I open the first one in the compositor the node is set to image sequence. But "Frames" is set to 1 and if I increase it, the thumbnail disappears.. "Match movie length" does not seem to do anything.
Comment: Also have a cyclic button..? Using 77a
Comment: Renamed the files to 0001.jpg and now work as expected.

Naming for image sequence?


Analyse disk requires admin, but why?

Question: To analyse for fragmentation in Windows you are required to be an administrator.
What dangers could a disk analysis pose?
Answer: Taking a look at the Defrag Documentation of Microsoft Technet:

Locates and consolidates fragmented files on local volumes to improve system performance.

Now, imagine that you have an operating system with 3 users, only one of them being Administrator. How could and algorithm running unprivileged manage to access files that can't be read? Would not happen. Access to those files would be denied, and the defrag process will be suboptimal, since i cant calculate how spread is a file that is not owned by my unprivileged user inside a volume. And why an unprivileged user should have raw disk access to disk? There is no reason why, and it will allow users to circunvent all protection to disk devices that the OS create and ignore the access rights implemented by the filesystem.
Situation two: Imagine that the analyze tool has some "automatic administrator" configured(like runas /user:.\Administrator /savecred defrag C: /U /V). If this software has the ability to read information about files, and it had Administrator credentials saved, it could be a feasable attack vector to extract information from other users, using your unprivileged user that is running this software. It's just a matter of time to have some bug explored on functions used to open files called by your defrag binary.
That's why you cant give disk manipulation or raw disk access to non-admin users.
Related Stuff:

Is it possible to defrag the hard disk without admin rights? - answer
Technet - Allow non-admin users to run Disk Defragmenter
Symantec - Top 5 Reasons Why Users Need Administrator Rights
Comment: By the way, OS that are SSD aware, will NOT perform defrag.
Comment: Thats right. All moderns OSs knows that defrag is not needed on SSD hardware.
Answer: Defragmentation or coherence control exists for almost any file system (think of fsck in Unix world). But by definition, it cannot use normal file system access functions which would hide the detailed implementations.
This is normally implemented by using direct low level disk sector accesses (on the disk partition). So that access along with the file system structure allows to read data from any file actually bypassing all file system access control. For that reason, it is normally reserved for administrator accounts.
Answer: First of all: Research whether Defragmentation really has any positive effect. I'd argue it's mostly snakeoil on modern Windowses, since their NTFS implementation is self-fragmentation-avoiding.
Then: For operating on a intrinsics-of-file-system layer, you need the same level of access as the file system – that is, full access to the raw disk.
Now, Operating Systems don't categorize for "good" and "potentially bad" programs, they simply characterize after "can only do the things this user is allowed" (which does not include direct disk access) and "things this user is not allowed to do".
Answer:
What dangers could a disk analysis pose?

Might allow you to list all files (and their fragments) regardless of file owner, thus circumventing NTFS permissions.
Answer: Windows has no suid facilities like Unix, so there's no way to mark a vetted program to run as administrator. To achieve a similar effect, programs would need to install a service/driver to expose system operations to unprivileged users.
Microsoft probably decided it's not worth the trouble creating a disk defragment service, but many third-party defragmenter indeed support this.
As an alternative, an administrator can create an interactive scheduled task that runs the defagmenter as admin and grant normal users the permission to start it. When triggered, the Task Scheduler service will start it with appropriate permissions.

Analyse disk requires admin, but why?


Dense subgroup in a profinite completion

Question: Let $G$ be finitely generated  residually finite group and $\hat{G}$ its profinite completion. Let $H \leq \hat{G}$ be a dense subgroup. Does it follow that $\hat{H}$ is isomorphic to $\hat{G}$?
Comment: I think for non-finitely generated groups, the profinite completion of the profinite completion can grow. You might be able to take H = G-hat for a counterexample.  Maybe none of the examples are residually finite, but I kind of thought that was a different sort of finiteness condition.
Comment: I forgot to add  finitely generated condition. Thanks for pointing out.
Answer: This is actually false.
Theorem. Let $G$ be a finitely generated subgroup of $GL(n, {\mathbb R})$ which is not virtually solvable. Then $G$ contains a subgroup $H$ which is dense in $\hat{G}$ but $\hat{H}$ is not isomorphic to $\hat{G}$.
Proof. According to a theorem of Margulis and Soifer, each finitely generated non-virtually solvable subgroup $G< GL(n, {\mathbb R})$ contains a maximal subgroup $H$, i.e. a subgroup such that if $H\le G_1\le G$, then either $G_1=H$ or $G_1=G$.
G. Margulis, G. Soifer, Maximal subgroups of infinite index in finitely generated linear groups, Journal of Algebra, Volume 69, 1981, p. 1-23.
Examination of their proof shows more, namely, that if $G$ is torsion free then there exists profinitely dense subgroup $H< G$ which is free of countably infinite rank. (They denote this subgroup by $S$, see pages 19 and 20 of their paper.)
Remark. If you do not want to rely upon such examination, simply consider the following example: $G=F_2$, free group of rank 2. Then each maximal subgroup of $G$ will be free of infinite rank. Since $H$ is maximal, $H$ is dense in $\hat{G}$.
Since $H$ is free of infinite rank, it admits an epimorphism to any finite group. But, since $G$ is finitely generated, it cannot have epimorphisms to arbitrary finite groups (for instance, if $G$ is $k$ generated, every quotient of $G$ is also $k$ generated, but the finite group $Z_2^{k+1}$ cannot be $k$ generated). Thus, $\hat{G}$ also does not admit epimorphisms to some finite groups. Therefore, $\hat{G}$ cannot be isomorphic to $\hat{H}$. qed
Now, use the fact that all finitely generated subgroups of $GL(n, {\mathbb R})$ are residually finite.
Answer: I believe this is correct.
If $\hat{G}$ is finitely generated (as a topological group) and if $\hat{H}$ is another profinite group with the same isomorphism classes of finite groups as continuous finite images then $\hat{G}\cong\hat{H}$.
In the case above, it remains to show that $\hat{G}$ and the dense subgroup $H$ have the same finite images. This can be achieved using the second isomorphism theorem.
Answer: Let me write down another class of groups where this fails.
By a result of Abert, the closure of a finitely generated weakly branch group (in the profinite topology of the relative automorphism group) contains a dense free subgroup.
There are similar results by Epstein for Lie groups, but I don't know the exact reference. This is relevant, at least in spirit, to the answer by Moishe Cohen.


What was the primary method the Jews used to make a fire at the time of Jesus?

Question: In 0BC or AD depending on your approach to history I suppose, what was the primary method of ignition to start a fire, used by the Jewish People.  I am sure flint and steel were available at that time but was it common and cheap enough to be available to the average household?  Did the Jew's use friction fire, flint and steel?  Please cite sources for your answer.  I have been unable to find definitive source on how fires were made at the time of Christ.
Comment: I would guess, the primary method is to keep a fire burning. And when the fire is extinguished, then you ask your neighbour if you can light your fire on his fire.
Comment: There was no year 0. The first year was 1, and 1 BCE = 1 CE. (Thus, the length of time between 1.5 BCE and 1.5 CE is one year, not three.)
Comment: Useful links and opinions at http://historum.com/ancient-history/68744-how-did-romans-greeks-start-fire.html . Yes, it was easier to keep the fire burning, and the community often organized this. Oil-soaked material, metal and flint or other hard rocks are suggested.
Comment: Great question, and +1. See [this](https://en.m.wikipedia.org/wiki/Firelighting). The answer is, with flint and kindling. I'll try to provide some textual references for this in the next few days. It is discussed in early rabbinic aources because of the prohibition of doing it on the sabbath.
Comment: @ShimonbM What is your source for "1 BCE = 1 CE"? Wikipedia (and every other source I've ever read) says that the year 1 BC was followed by the year 1 AD. (I'm assuming here that CE is the same as AD, and BCE the same as BC; please correct me if there's some distinction I'm not aware of.) Also, I'm not sure I understand your fractional years. Just when is 2017.5 CE? Is 2017.0 the beginning, middle, or end of the year 2017?
Comment: @ShimonbM. In the usage of astronomers the BC 1 is called 0, BC 2 is -1, etc. This makes the mathematics a lot easier.
Answer: Ancient Israelis, (first half of the 8th millennium BP),  reportedly used clay matches.  Israeli archeology sites yield among the world's oldest known fire starters.  The clay figures would be spun on a board with a mechanical bow and would have worked similarly to wooden drills, fireboards, and bows as presented in the paper "The Earliest Matches" by Name Goren-Inbar.

As for Roman times, Jews may not work on the Sabbath, and not working includes starting, extinguishing, or tending a fire.  Scriptures give us a clue here.

"Ye shall kindle no fire in your dwelling-places on the sabbath
  day."  On the sabbath day itself you may not kindle a fire,
  but you may on Friday kindle a fire for the Sabbath.
  Exodus 35:3

The first line gives us our first clue.  The best way to make fire, is from existing fire.  So no fire in your "dwelling-place" says to me there was a communal source of fire.  Back to the scriptures:

"Fire shall be kept burning upon the altar continually" (Lev. 6:6)

So like Rome's Temple of Vestal (goddess of the hearth) who's priestesses tended fire of which anyone was permitted to share.
Jews had available flames at their temples.
Barring the communal fire, given the second line in Exodus above, Jews of Roman times it seems stored the fire on Friday for use on Saturday.  We know also from scriptures they used oil lamps, and candles; but this could also mean storing embers of fire in such a way to preserve them over hours or 24 hours without need for tending, as is seen in other Mediterranean cultures like the Egyptians.
If your fire went out at home, and no communal fire could be obtained, flint and steel was probable the most portable common method to fall back on.  We know this was the Roman's go too.  And one would think it was available to the Roman Jews also. Yes flint and steel is a pain, but it's significantly better than the alternatives in Roman times.  Assuming here ancient Israeli match technology was lost to the ages.  Lighting fire with two sticks or a stick and bow is significantly more effort than flint and steel.
It's also possible again given Roman technology that lenses could be used to start fire from sunlight.  However I'm guessing this technology would not be considered "primary" way as your question details.
Comment: Just a note: they didn't use candles. Candle-making technology was not unknown, but the proliferation of olive oil throughout the region meant that it didn't make inroads until significantly later. When it did, the word "ner" (lamp) was relexified and came to mean candle instead.
Answer:
"The method used in early Old Testament times to produce a fire was to
  make  sparks by the striking of stone and flint, or by the friction of
  pieces of wood,  afterwards igniting a blaze. There are indications
  that Israel in later times  produced fire by striking steel against
  flint. In Isaiah 50:11, where it speaks of  kindling a fire, the
  Hebrew word translated "kindle" means "to strike," and  evidently
  refers to the striking of flint on steel."

Tang, Nicholas. Manners and Customs of Bible Lands: Manners and Customs of Bible Lands (p. 37). Kindle Edition.


UK Tier 2 visa - Naric certificate didn't scanned by VFS but they signed checklist

Question: I am a nurse applying for a UK Tier 2 visa and I have all of the necessary supporting documents. I chose to upload the documents myself through the VFS portal, but due to the large file size, I decided to scan the Naric certificate at their office. During the process, they did not ask for the Naric certificate, but instead signed the checklist to state that all documents had been received. I asked them if I needed to submit anything else and they said no, after completing the Biometric assessment.
Now I am worried about my visa process. If they require any additional documents, will they email me?
Answer: If UKVI requires any additional documents regarding your application they would definitely email you.


Compute an integral containing a product of powers of logarithms.

Question: Let $q \ge 1$ and $p \ge 0$ be integers. Consider a following integral:
\begin{equation}
{\mathcal I}^{(q,p)} := \int\limits_0^1 [\log(1-\eta)]^q [\log(\eta)]^p \frac{1}{\eta} d \eta
\end{equation}
Clearly that integral is proportional to the Nielsen generalized polylogarithm at unity.
Now by using Euler's beta function integral it is easy to see that :
\begin{equation}
{\mathcal I}^{(q,p)} =
\frac{\partial^p}{\partial \theta_1^p}
\frac{\partial^q}{\partial \theta_2^q}
\left.
\left[
\frac{(\theta_1-1)! \theta_2!}{(\theta_1+\theta_2)!}
\right]
\right|_{\theta_1=\theta_2=0}
\end{equation}
We have computed the derivative with respect to $\theta_2$ using the Faa di Bruno's formula then we have set $\theta_2=0$ then we differentiated the result $p$ times using Mathematica and finally set $\theta_1=0$. As a result we discovered the following relations:
\begin{eqnarray}
&&1!\cdot{\mathcal I}^{(q,0)} = - \Psi^{(q)}(1) \\
&&2! \cdot{\mathcal I}^{(q,1)} = - \Psi^{(q+1)}(1) + \sum\limits_{j=1}^{q-1} \binom{q}{j} \Psi^{(j)}(1) \Psi^{(q-j)}(1) \\
&&3! \cdot {\mathcal I}^{(q,2)} = -2 \Psi^{(q+2)}(1) + 3 \cdot 1_{q\ge 2}\cdot\sum\limits_{j=1}^{q-1} \binom{q}{j}\cdot\left[
 \Psi^{(j+1)}(1) \Psi^{(q-j)}(1)+\Psi^{(j)}(1) \Psi^{(q+1-j)}(1) \right]+ \\
&&-2 \cdot 1_{q \ge 3}\cdot\sum\limits_{1 \le j < j_1 \le q-1} \binom{q}{j,j_1-j,q-j_1} \Psi^{(j)}(1) \Psi^{(j_1-j)}(1) \Psi^{(q-j_1)}(1)\\
&&4! \cdot {\mathcal I}^{(q,3)} = -6 \Psi^{(q+3)}(1)+\\
&&12 \cdot\sum\limits_{j=1}^{q-1} \binom{q}{j} \left[ \Psi^{(j)}(1) \Psi^{(q-j+2)}(1) + \frac{3}{2} \Psi^{(j+1)}(1) \Psi^{(q-j+1)}(1)+\Psi^{(j+2)}(1) \Psi^{(q-j+0)}(1)\right]+\\
&&-12 \cdot \sum\limits_{1 \le j < j_1 \le q-1} \binom{q}{j,j_1-j,q-j_1} \left[\Psi^{(j)}(1) \Psi^{(j_1-j)}(1) \Psi^{(q-j_1+1)}(1)+\Psi^{(j)}(1) \Psi^{(j_1-j+1)}(1) \Psi^{(q-j_1)}(1)+\Psi^{(j+1)}(1) \Psi^{(j_1-j)}(1) \Psi^{(q-j_1)}(1)\right]+\\
&&6\cdot \sum\limits_{1\le j < j_1 < j_2 \le q-1} \binom{q}{j,j_1-j,j_2-j_1,q-j_2} \Psi^{(j)}(1) \Psi^{(j_1-j)}(1) \Psi^{(j_2-j_1)}(1) \Psi^{(q-j_2)}(1)
\end{eqnarray}
where $\Psi^{(j)}(1)$ is the polygamma function at unity.
Now the question would be how do we find the result for $p \ge 3$? The multitude of terms that appear in the Faa di Bruno formula is difficult to deal with. Is there a more elegant way of arriving at the result?
Comment: 1) First of all, do we agree that it is $(\log(1-\eta))^q$, or using classical notations $(ln(1-\eta))^q$ ? 2) Besides, you use factorial notation where people usually work with $\Gamma$ notation ($x!=\Gamma(x+1)$)... Don't you think that it is maybe the key to a quicker way to your answer ?
Comment: Well, I got accustomed to using factorials rather than the Gamma function simply because it looks nicer for me. Besides I do not see how using a different notation might help me to find the answer. Please try to use the chain rule to write out the derivatives and then take the appropriate limits. There is no way to get insight into the huge number of terms that appear and in addition the expression is singular.
Comment: @JeanMarie: I see no issue in the logarithms above and I agree with the OP that $n!$ is more efficient, as a notation, than $\Gamma(n+1)$. It is Legendre's fault that $n!=\Gamma(n+1)$ instead of $n!=\Gamma(n)$, but we do not have to carry this burden at all costs.
Answer: We have
$$ \log^q(1-\eta) = q!\sum_{n\geq q}(-1)^q{\,n\, \brack q}\frac{\eta^n}{n!}\tag{1} $$
hence
$$ \mathcal{I}^{(q,p)}=p!q!\sum_{n\geq q}\frac{(-1)^{p+q}}{n!\,n^{p+1}}{\,n\,\brack q}\tag{2} $$
and the problem boils down to computing some Euler sums, once the Stirling numbers of the first kind are converted into combinations of generalized harmonic numbers. In this context values of $p$ or $q$ greater than $3$ lead to intractable problems by hand: that is a good moment for invoking the help of a CAS, without shame.
Comment: +1. I use CAS everyday without shame. Even for $\sqrt{0}$.
Comment: @Jack D'Aurizio: Thanks for that. I have to admit I am very interested in finding closed form solutions for various sums, in particular for Euler sums. I do admit I am learning a lot from your website about how to calculate such things.
Answer: Since understanding of this problem is essential for calculating a whole family of Euler sums I will write down a detailed solution to the problem. We start from rewriting our quantities as follows:
\begin{eqnarray}
{\mathcal I}^{(q,p)} &=& \left.\frac{\partial^p}{\partial \theta_1^p}  e^{\log(\Gamma(\theta_1)} \frac{\partial^q}{\partial \theta_2^q}e^{\log(\Gamma(\theta_2+1)) - \log(\Gamma(\theta_2+\theta_1+1))} \right|_{\theta_1=\theta_2=0}\\
&=& \left.\sum\limits_{1 \cdot m_1+ \cdots + q \cdot m_q = q} \left(\frac{q!}{\prod\limits_{\xi=1}^q m_\xi! (\xi!)^{m_\xi}}\right) \cdot \frac{\partial^p}{\partial \theta_1^p} \left( \frac{\prod\limits_{j=1}^q [\Psi^{(j-1)}(1) - \Psi^{(j-1)}(1+\theta_1)]^{m_j}}{\theta_1} \right) \right|_{\theta_1=0}
\end{eqnarray}
In here we have computed the higher order derivative with respect to $\theta_2$ by using the Faa di Bruno formula. The sum in the right hand side in the equation above runs over all non-negative integers $\left\{ m_j \right\}_{j=1}^q$ such that $\sum\limits_{j=1}^q j m_j = q$.
Now in the fraction in parentheses under the derivative operator the numerator behaves as $\theta_1^{m_1+m_2+\cdots+m_q}$ as $\theta_1 \rightarrow 0$. This allows us to conclude that only those terms in the sum contribute where $0 \le m_1+m_2+\cdots+m_q \le p+1$.
Bearing this in mind it is not hard to realize that that gigantic sum can be re-written as follows:
\begin{eqnarray}
{\mathcal I}^{(q,p)} = \left.\sum\limits_{l=0}^{p+1} \frac{1}{(l+1)!} \sum\limits_{\begin{array}{r}j_0+j_1+\cdots+j_l=q\\j_0\ge1,\cdots,j_l\ge 1\end{array}} \binom{q}{j_0,\cdots,j_l} \cdot \frac{\partial^p}{\partial \theta^p} \left(\frac{\prod\limits_{\xi=0}^l [ \Psi^{(j_\xi-1)}(1) - \Psi^{(j_\xi-1)}(1+\theta)]}{\theta}\right) \right|_{\theta=0}
\end{eqnarray}
At this stage the only thing we need to do is to evaluate the derivative at zero. It is clear that it is not a hard thing to do. The easiest way to do it is to expand the numerator in parentheses into a Taylor series in $\theta$ and to extract the coefficient at $\theta^{p+1}$. That coefficient multiplied by $p!$ (which comes from differentiating the power function at zero) gives the result. For extreme (i.e. both the smallest and biggest values of $l$ the result has a neat closed form yet for intermediate values of $l$ the number of possible terms that contribute to a given power of $\theta$ increases very rapidly and as such it is difficult to write down the expression in a neat closed form. Bearing all this in mind we actually write down the derivative in question below:
\begin{eqnarray}
&&\left.\frac{\partial^p}{\partial \theta^p} \left( \right) \right|_{\theta=0}=\left\{
\begin{array}{rr}
(-1)^1\frac{1}{(p+1)} \Psi^{(q+p)}(1) & \mbox{if $l=0$}\\
(-1)^2\sum\limits_{l_0+l_1=p+1}\frac{p!}{l_0! l_1!} \prod\limits_{\xi=0}^1 \Psi^{(j_\xi+l_\xi-1)}(1)  & \mbox{if $l=1$}\\
(-1)^3\sum\limits_{l_0+l_1+l_2=p+1}\frac{p!}{l_0! l_1! l_2!} \prod\limits_{\xi=0}^2 \Psi^{(j_\xi+l_\xi-1)}(1)  & \mbox{if $l=2$}\\
\vdots \\
(-1)^{p+1} p! \prod\limits_{\xi=0}^p \Psi^{(j_\xi)}(1) & \mbox{if $l=p$} \\
0 & \mbox{if $l=p+1$}
\end{array}
\right.
\end{eqnarray}
In here the $l$-indices are strictly positive.
This concludes the proof.
Corollary: Consider a slightly more general integral:
\begin{equation}
{\mathcal I}^{(q,p)}_r := \int\limits_0^1 \log(1-\eta)^q \cdot \log(\eta)^p\frac{1}{\eta^{1-r}} d\eta
\end{equation}
where $r\ge 0$. Then by redoing the calculations above we conclude that:
\begin{eqnarray}
{\mathcal I}^{(q,p)}_r= \left.\sum\limits_{1\cdot m_1+\cdots q \cdot m_q = q} \left(\frac{q!}{\prod\limits_{\xi=1}^q m_\xi! (\xi!)^{m_\xi}}\right) \cdot
\frac{\partial^p}{\partial \theta_1^p} \left( \frac{\prod\limits_{j=1}^q (\Psi^{(j-1)}(1) - \Psi^{(j-1)}(1+\theta_1+r))}{\theta_1+r}\right)\right|_{\theta_1=0}
\end{eqnarray}
The expression on the right hand side is not singular anymore (as it was in the previous case ) and it can be further evaluated by using the chain rule.


Feeling stressed and incapable at the beginning of my MSc, how can I handle that?

Question: I just admitted and enrolled in a thesis-based master of applied science program in electrical engineering a month ago.
My supervisor sends me different papers sometime to read and I also schedule some meetings with him to talk about my research interests bi-weekly.
The thing is that I am so stressed about the situation going, sometimes I don't understand different terminologies in a paper or even cannot grasp the main idea of the papers that my professor sends me.
I cannot even come up with new research ideas at all. During the meetings sometime I ask some basic questions and my supervisor explain it to me but I can feel that these questions are dumb! One time I asked him a basic question and he explained 2-3 times, at the end he said "Is it something hard to understand?"
Overall, I am really stressful that I may cannot satisfy his expectations and disappoint him. Although this is my first semester and he acknowledged that my main focus should be on coursework, but I ask him personally to do some warm-up for research. I even talked to him about the terminologies that I don't understand and he said that it's Ok and I should just grasp the main idea of the paper, but how can I get the main ideas of the paper when I've never seen the basic terminologies used in a paper before?
At this point, I just try to keep my contact with my supervisor, scheduling bi-weekly meetings to ask him my questions, but I feel that the more we talk to each other, he becomes more disappointed of me because of dump questions that I ask.
My supervisor research group has three other MSc students who submitted one conference paper in the late of their first year of study, and I think that I should do that as well to keep my supervisor satisfied, but I really can not see the potential inside me to write a conference paper at the end of my first year in MSc, I roughly have 6 months time left to the submission deadline in the next upcoming conferences that my supervisor usually submits to them.
It seems he has not disappointed yet, or at least doesn't express it, but I need to catch up with his other students as soon as possible I think.
So I wanted to ask that how can I control this situation and do something before things get worse than this.
Comment: What is your question?
Comment: @user438383 I wanted to ask that how can I control this situation and do something before things get worse than this. It seems he has not disappointed yet, or at least doesn't express it, but I need to catch up with his other students as soon as possible I think.
Answer: I think that your expectations of self are (far) too high. What you describe in the first paragraphs are entirely normal. You aren't yet a trained professional. In particular your statement that "I cannot even come up with new research ideas at all" worries me. That is actually one of the harder things for researchers to do, even for your professor.
You can't predict, after a month, what will be the case after a year, much less later.
OTOH, your interactions with your professor seem correct and their advice also seems correct. Relax a bit. Take it as it comes. The technical stuff that you don't yet understand will almost certainly become clearer as you read and think more. And also as you discuss the ideas with the professor and others.
It reads to me like a panic attack, not incompetence. Take a deep breath. Have culturally appropriate beverage. And, yes, focus on the course work and ask a lot of questions.


Creating restfull service web with visual studio 2010

Question: I need to create a restfull service web using visual studio 2010. Can anyone tell me how to do?
Answer: Personally, I would start by creating a new ASP.NET MVC Project and creating an MVC application that had only JSON returned by the controllers.
I did hear that the WCF team recently added some new stuff around REST that you might want to check out as well...but the MVC Project would still be my choice. You can check out the WCF HTTP Project at Codeplex to see if it interests you:
WCF Community Site - WCF HTTP


Show ignored questions on hover

Question: I think that it is a good idea to grey out questions with ignored tags, as currently happens:
 However, I think that these questions should go back to full colour as you hover on them, as happens with answers of -3 or less. (See here for an answer of <-3)
This would be a useful feature for me, because it would allow me to view them easily if I wanted to. I realise that the purpose of 'Ignored Tags' is tags that you want to ignore, but I frequently use them to remove from my notice questions I won't be able to answer, even if they may be helpful to me for solving my own problems.
Unless there is some reason that people would find this annoying or in anyway negative, please could we implement this?
Answer: I would personally find this very irritating.
Even though I seldom look at question tags these days, when I do, having those questions which are ignored appear lesser is a huge plus for me since I'm not as tempted to click any link-looking thing about it.
If it highlighted into view, that would indicate that I should give it more attention than I want to, since I was the one who made the determination to ignore them in the first place.
Comment: Fair enough, I do not think I would feel this but there we go. I was trying to find the question that discussed the introduction of full cover on hover for <-2 answers, but failed. I think it discussed extra attention being drawn by the change in colour aswell.

Show ignored questions on hover


How is the work done by Carnot Engine obtained or converted to usable form?

Question: I read about the Carnot Cycle and Carnot engine where it was said that the work done by this engine is equal to the area enclosed in the PV diagram. I understood the proof and everything but I am not able to get an intuitive idea of how the system is doing work in a complete cycle? Clearly the gravitational potential energy of system does not increase because P and V after a complete cycle remains same so no mass changes its height after complete cycle. Can I connect a dynamo somewhere in some way and get electrical energy? How exactly does this engine do work and how can I obtain energy from it?
Comment: This image gives an example: http://www.physics.louisville.edu/cldavis/phys298/notes/therm_carnot_fig1.jpg
Comment: In a sense the question should be in the subjective (i.e. How *would* the work done by ... ) because—as far as I know—there simply aren't any practical designs that actually attempt to implement the Carnot cycle. All the changing of which reservoir the system is in contact with that appears in @Pieter's figure as moving the cylinder around is hard to arrange in a practical device.
Answer: I agree with dmckee's comment on Pieter's figure, which is a typical depiction of the Carnot cycle operating on an ideal gas with a piston/cylinder being the "engine". Not only is it hard to arrange the piston/cylinder moving around between thermal reservoirs, there is also the issue of adding and removing thermal insulation in going between the adiabatic and isothermal processes.
A theoretical application not involving the aforementioned limitations is in the application of the Carnot cycle as a two-phase steam power cycle alternative to the Rankine cycle.  See the T-S diagram below. Here at least the output of the Carnot cycle is steam turbine work, which can be clearly visualized to generate electrical power.
However even in this application the Carnot cycle is not practical.  To name a few, there are practical issues in designing an isentropic compressor to compress saturated steam into saturated liquid (process d-a) (in the Rankine cycle the pump simply raises the pressure of saturated liquid to the boiler pressure).  There is also the problem of the output of the turbine involving steam that may be too wet causing blade corrosion (process b-c) (the Rankine cycle can use superheat steam that exits the turbine with dryer steam).
But probably the biggest limitation of all potential Carnot cycle applications is that in order for the cycle to be reversible, it must be carried out extremely slowly. So while the cycle may be the most efficient in terms of work out per heat in, the rate of work output (power) would be very low.
As I recall someone said you might get better gas economy if you put a Carnot engine in your car, but pedestrians would be passing you by!
Hope this helps.
Answer: The Carnot Process is an ideal process to gain Energy from a temperature difference. I'll describe a slightly simpler process, though the general idea should stay the same.
Say you have a gas filled cylinder with a piston. If the pressure rises, the piston moves, unless it's held in place by breaks.
This cylinder is now heated and cooled.

First, heating it while holding the piston, the pressure rises.
Before switching to cooling, the piston is released and the gas allowed to expand. Here is the point, where we could extract energy.
While cooling, the piston is held in place again and the pressure drops.
Before heating it again, we allow the piston to contract. (I.e. the ambient air pressure pushes the piston back in) Again, we could extract energy here.

The differences to the Carnot process are threefold:

the piston wouldn't be fixed,but expand and contract "cleverly" while heated and cooled.
it turns out if you invest back a bit of energy to compress the gas more than it wants to before heating up and expand it a bit further before cooling down, the efficiency increases.
the Carnot cycle works as defined only if you have infinite time for expansion and contraction. In real engines, truncated Carnot cycles are used.


Can a store take my bag when it contains both my and their property?

Question: I've had my bag snatched from me before I've even got anywhere near till point (cash register). They told me to leave because I'm barred. They won't let me in to get my bag, and they still have it. How can I get my property back?
Comment: I frequently take a shopping bag into a store to hold items I have selected, before I reach the point of payment. Doing so is not theft, if there is no attempt to conceal them or pretend that thy are mine. Indeed many stores sell or provide bags for this purpose. The question does not presently make the circumstances clear. In any case, the store cannot lawfully retain the property of an accused thief, nor even of a convicted one.
Comment: Could the store employees  have reasonably believed that this was an attempt at shoplifting? Did they say it was?  Did you ask for the return of your property? Did you notify law enforcement?
Answer: Go to the police
Taking someone's property with the intention of permanently depriving them of it is stealing.
Ask a nice police officer to accompany you to the store to help you sort it out.