How to draw illustrative 3d physics diagrams like below?

Question:

How to draw 3d illustrative physics pictures as above? Is inkscape capable of doing it (might be possible but afaik it is tedious), or should I use a cad tools like FreeCAD or Blender to achieve the same? Or is there other tools that might help achieve the same?
Comment: Yes Inkscape is capable, but it's 2D software, not 3D. You can fake 3D in 2D though.  Some of the shapes look a little tricky for Inkscape though, although not impossible. See this closely related question, It's not quite a duplicate: [How to draw mathematical diagrams in inkscape](https://graphicdesign.stackexchange.com/q/105220/89608), but the basics would apply to almost any diagram.
Comment: Apart from the 3D cube tool, Inkscape has no 3D capabilities, and even that is not true 3D. However,  it's obviously still possible to manually draw 2D shapes that look like they are in 3D.  I did this in a couple of minutes as [a rough example](https://imgur.com/Gl2snYI).
Comment: @BillyKerr theres no 3d needed in either of the image you can just do all of the 3D needed here with the matrix manipulation of object
Comment: I would agree. Technically no "3D" is necessary.. there's no lighting, no shadows. It's a simple projection that could be created entirely in a  2D app such as Illustrator or Inkscape. Now how easily the projection is created comes down to familiarity with the 2D application.
Answer: As noted in the other answers, you're going to have a 2D result of your 3D source items, but I suspect that is your objective. Any 3D creating software will allow you to generate the images you've provided (or similar, of course) and a screen capture or image export (if available in the software) will give you a raster image. I also expect that your goal is not tied to specifically vector format output, correct me as required.
I'm more capable in OpenSCAD, a text based "scripting" program to generate items of this type, although I'm not experienced enough to generate a sine wave. I'd probably be able to find a library that is capable of doing so. OpenSCAD provides for PNG file output and customization of the background.

A real "old-timer" that may also work is POV-RAY, which is also text based. It is designed specifically to create three dimensional scenes using primitives and modifiers in a manner similar to OpenSCAD.

Each image courtesy of respective linked site.
As noted with the other suggested programs, there's going to be a learning period for both of these programs that may impact your productivity.
Answer: You can have many types of styles. Some are made of vectors, some are drawn by hand some are 3D mechanical projection, some 3D artistic render, etc.
The specific style you are showing is clearly a 2D vector, not a 3D render.
But regardless of the specific technique, you need to plan. Here are not specific steps, because it is not a drawing course, just a proof of concept. Made in Corel Draw.

In this case, you need to make the elements orthogonally.

Then deform them to simulate the change in angle or actually transform the planes. Look for Skew or a similar concept in Inkscape. Also a simple stretch or scale on X.

Repeat and play.

But personally, I would not do this only in 2D, but a composite on Blender.
You need to do some homework.

Turn on import images as planes.

Import the individual planes (already made in Inkscape)

Define the camera as an orthographic camera.

Rotate and Play

But there is much to learn.
There is an alternative tool. Colaboration You could work with an illustrator.
Cheers.
Answer:
Is inkscape capable of doing it (might be possible but afaik it is tedious), or should I use a cad tools like FreeCAD or Blender to achieve the same?

Yes. The image presented as a idea of what to do is is really simple. For you to replicate this the easiest way is to use the tool you already know how to use! So in this special case Inkscape is actually the least tedious one by a wide margin, only because of special circumstances in the mage. But that changes quickly with volume and need. Both FreeCAD and Blender are factories for creating images, but also require some setup time.
Now the real answer to the question you are asking depends on how many images you need to do and what output you need the image to have. See conceptually drawing in FreeCAD or Blender is the same skill needed to draw in Inkscape, or at least roughly. So on a elementary level you still need to learn all the skills needed to do this in Inkscape. Contrary to perceived tedium, its also tedious to learn how to use Blender and FreeCAD for this too. So realistically, the only sane move is to learn Inkscape and one of Blender and FreeCAD at the same time.
So before you begin with this ask yourself:

How long would it take for you to neatly draw the image by hand?
Do you need the image to be vectors, or do raster images suffice?
Do you need to animate?
What kind of prerequisite skills do you possess?
How much time do you have?

If answer to number 1 is more than 10 minutes, then Inkscape starts to look really unfavorable for you. It also makes Blender less than ideal so most likely FreeCAD, but you will be severely limited in coloring options. That said your in a really bad situation and going to have to invest serious amounts of effort to any of the software. Try to find a person who can tutor you.
If answer to number 2 is yes, then blender starts to look slightly unfavorable (though does not drop the ball entirely). And learning both inkscape and freeCAD becomes attractive.
If answer to 3 is yes, and i mean really consider your need for animation (dont do it because of want). Even talking about tediousness in conjunction with inkscape to animation is like comparing a feather to a weightlifters fully laden barbell. But if you need this then realistically you need a Blender, or something similar.
Also consider Latex and PStricks; Mathematica.
PS: I don't generally advice anybody to use FreeCAD. Yeah I have it installed, for one use case where i could also use Catia, but yeah. Anyway I am capable of drawing this in FreeCAD, though not with the coloring freedom. Id page out to a vector editor pretty quickly. I would prefer not to use blender for illustration, but sometimes it is handy. But then i have lots of options.
Comment: i have done engineering drawing course but it was all pencil and paper, i have drawn few diagrams in autocad in my college days but im not an expert, so i thought freecad might be good, a little playing around would get me up to speed, i have some animation experience in blender(mostly keyframes, if that is what it is called). it would be nice to have vectors so i can scale or animate any way i want, 3d means i can take shots of different angles. i hope this clears my background.
Comment: i use mathematica regularly and dont want to use it, i am trying to keep it all under open source tools.
Answer: Pointing out the obvious because the question implies a lack of understanding about illustrations: There is no such thing as a 3D illustration. Unless you're talking about a hologram or other method of display that has an actual depth component. All illustrations on paper, computer screen, billboard, TV or any flat display medium are, by definition, two-dimensional.
You can see, at most, three faces of a cube at one time, whether it's in a 2D drawing program or a 3D one.
Of course there are 3D programs, but they just allow you to draw and move objects as if there were a third dimension on the screen. At any moment in time, you're looking at only a two-dimensional view of the objects.
Long winded answer to say, yes, any vector drawing program can be used to create the illustration examples in the question. You just need the drawing and visualization skills to do it. If you need to be able to rotate an image in 3 dimensions, then yes, you need a 3D program like Inventor or Sketch-up or Blender. But creating a diagram like the examples in 3D originally can be a lot more complicated than creating a flat illustration in a regular vector drawing program. In 3D, you have to create everything as a solid object, so it can be rotated to views you may never use. Unless the viewer is going to be manipulating the drawing in 3D, there is no reason to create the original in 3D.
Comment: I would like to point out that the sentence "In 3D, you have to create everything as a solid object..." Is untrue. No you do not have to. There are plenty of applications that can just draw curves just like in 2d application in 3d space, no need to solid anything.
Comment: Makes sense. But would such a curve be 3D automatically? Or it is 2D and disappears in one of the three dimensions?
Comment: Well dimensionality is a bit of a weird concept. So if its a line yes it would disappear or diminish to a point looked from front or back of the line. But if its a curve then it has ~2.5 dimensions, so it might have a shape regardless where you look at it. Think of it as a bezier with points that are truly 3D. For an example think of a curve that forms a helix. But how the software does this depends on software, most likely its either just stroked like a vector in the 2D view after projection. But some software makes then non shading pipes. Depends on how you want to do it.


PHP find relevance

Question: Say I have a collection of 100,000 articles across 10 different topics. I don't know which articles actually belong to which topic but I have the entire news article (can analyze them for keywords). I would like to group these articles according to their topics. Any idea how I would do that? Any engine (sphinx, lucene) is ok.
Comment: This sounds like something that Google probably employs 300 top-notch people for in the Google News department... Not sure whether freely available solutions to categorize articles exist, especially in the PHP world. But you never know; interested to see what comes up.
Comment: I'm guessing this is the kind of thing that an academic paper is written on :)
Comment: First you need to define a criteria on which you say, that article X belongs to the topic Y. Is that just "words A, B, C, connected to topic Y all exist in the article X"?
Answer: Well an apache project providing maschine learning libraries is Mahout. Its features include the possibility of:

[...] Clustering takes e.g. text documents and groups them into groups of topically related documents. Classification learns from exisiting categorized documents what documents of a specific category look like and is able to assign unlabelled documents to the (hopefully) correct category. [...]

You can find Mahout under http://mahout.apache.org/
Although I have never used Mahout, just considered it ;-), it always seemd to require a decent amount of theoretical knowledge. So if you plan to spend some time on the issue, Mahout would probably be a good starting point, especially since its well documented. But don't expect it to be easy ;-)
Comment: Ui, I totally forgot to mention another alternative. If you seek something like mahout, but being easier to implement try out Bobo-Browse: http://sna-projects.com/bobo/

Actually I believe Bobo-Browse could do an excellent job in your case.
Comment: hi friend i need help in sphinx .I am new to Sphinx .how configure the sphinx in wamp sever in local host.
Answer: In term of machine learning/data mining, we called these kind of problems as the classification problem. The easiest approach is to use past data for future prediction, i.e. statistical oriented:
http://en.wikipedia.org/wiki/Statistical_classification, in which you can start by using the Naive Bayes classifier (commonly used in spam detection)
I would suggest you to read this book (Although written for Python): Programming Collective Intelligence (http://www.amazon.com/Programming-Collective-Intelligence-Building-Applications/dp/0596529325), they have a good example.
Answer: Dirt simple way to create a classifier:
Hand read and bucket N example documents from the 100K into each one of your 10 topics.  Generally, the more example documents the better.
Create a Lucene/Sphinx index with 10 documents corresponding to each topic.  Each document will contain all of the example documents for that topic concatenated together.
To classify a document, submit that document as a query by making every word an OR term.  You'll almost always get all 10 results back.  Lucene/Sphinx will assign a score to each result, which you can interpret as the document's "similarity" to each topic.
Might not be super-accurate, but it's easy if you don't want to go through the trouble of training a real Naive Bayes classifier.  If you want to go that route you can Google for WEKA or MALLET, two good machine learning libraries.
Answer: Excerpt from Chapter 7 of "Algorithms of the Intelligent Web" (Manning 2009):
"In other words, we'll discuss the adoption of our algorithms in the context of a hypothetical
web application. In particular, our example refers to a news portal, which is inspired by the Google News website."
So, the content of Chapter 7 from that book should provide you with code for, and an understanding of, the problem that you are trying to solve.
Answer: you could use sphinix to search for all the articles for all the 10 different topics and then set a threshold as to the number of matches that what make an article linked to a particular topic, and so on
Comment: The thing is, I don't know what topic it's going to be. It's dynamic.
Answer: I recommend the book "Algorithms of the Intelligent Web" by Haralambos Marmanis and Dmitry Babenko. There's a chapter on how to do this.
Answer: I don't it is possible to completely automate this, but you could do most of it. The problem is where would the topics come from?
Extract a list of the most non-common words and phrases from each article and use those as tags.
Then I would make a list of Topics and assign words and phrases which would fall within that topic and then match that to the tags. The problem is that you might get more than one topic per article.
Perhaps the best way would be to use some form of Bayesian classifiers to determine which topic best describes the article. It will require that you train the system initially.
This sort of technique is used on determining if an email is SPAM or not.
This article might be of some help

PHP find relevance


Are files synced from mobile app supposed to download to my PC's Ubuntu One folder?

Question: I just installed Ubuntu One files for Android and it uploaded all my pictures and I can see them in the web interface. Can I get this folder to automatically download all the files to my Ubuntu One folder on my Ubuntu PC?
Comment: I have been having the same problem. I am running ubuntu 10.04 so there is no control panel and therefore no option to sync the cloud "synced folder" to my pc
Answer: Yes. Your pictures are stored in a cloud folder named "Pictures - your phone model". If you run the Ubuntu One control panel (which you can see at https://wiki.ubuntu.com/UbuntuOne/Tutorials/ControlPanel#Cloud_Folders) then your new cloud folder will be listed, and you can tick it to make sure that this cloud folder is also on your computer.
Comment: OK, I am still on 10.10 so I still have the old Control Panel without that option. I will try to install it, but following the advice here http://www.iheartubuntu.com/2011/06/natty-ubuntuone-control-panel-in.html I get 'Couldn't find package ubuntuone-control-panel' when trying 'sudo apt-get install ubuntuone-control-panel' I'll see if I can get it to work.
Comment: doh, I'm on 10.04 can I still do this?
Answer: You should see a new cloud folder called something like "Pictures - Nexus One", which you can specify in the Ubuntu One control panel to sync to your computer.
It doesn't sync down by default, no.


Computing the cumulative distribution of max drawdown of random walk with drift

Question: I am interested in the distribution of the maximum drawdown of a random walk: Let $X_0 = 0, X_{i+1} = X_i + Y_{i+1}$ where $Y_i \sim \mathcal{N}(\mu,1)$. The maximum drawdown after $n$ periods is $\max_{0 \le i \le j \le n} (X_i - X_j)$. A paper by Magdon-Ismail et. al. gives the distribution for maximum drawdown of a Brownian motion with drift. The expression involves an infinite sum which includes some terms defined only implicitly. I am having problems writing an implementation which converges.  Is anyone aware of an alternative expression of the CDF or a reference implementation in code?
Comment: That would require about a million simulated random walks...
Comment: How accurate do you need it? Could you just simulate the walk and avoid fully-functional solutions?
Comment: good point. I don't need atomic-physics level accuracy. in fact, 3 sigfigs is probably just fine....
Answer: This is an alternating sum.  Each successive pair almost cancels; such pair-sums eventually decrease monotonically.
One approach, then, is to compute the sum in pairs where $n$ = {1,2}, {3,4}, {5,6}, etc. (Doing so eliminates a lot of floating point error, too.) Some more tricks can help:
(1) To solve $\tan(t) =  t / \alpha$ for a positive constant $\alpha$, a good starting value to search--and an excellent approximation for the $n^\text{th}$ largest root-- is $t = (n + 1/2)\pi - \frac{\alpha}{(n + 1/2)\pi}$.  I suspect Newton-Raphson should work really well.
(2) After a small number of initial terms, the sums of pairs start decreasing in size very, very consistently.  The logarithms of the absolute values of exponentially-spaced pairs quickly decrease almost linearly.  This means you can interpolate among a very small number of calculated pair-sums to estimate all the pair-sums you did not compute.  For example, by computing the values for only pairs (2,3), (4,5), (8,9), (16,17), ..., (16384, 16385) and constructing the interpolating polynomial for these (thought of as the values of a function at 1, 2, ..., 14) and using the arguments $h = \mu = \sigma = 1$, I was able to achieve six-figure precision for the worst-case errors.  (Even nicer, the errors oscillate in sign, suggesting the precision in the summed interpolated values might be quite a bit better than six figures.)  You could probably estimate the limiting sum to good precision by extrapolating linearly off the end of these values (which translates to a power law) and integrating the extrapolating function out to infinity.  To complete this example calculation you also need the first term.  That gives six-figure precision by means of only 29 computed terms in the summation.
(3) Note that the function really depends on $h/\sigma$ and $\mu/\sigma$, not on all three of these variables independently.  The dependence on $T$ is weak (as it should be); you might be content to fix its value throughout all your calculations.
(4) On top of all this, consider using some series-acceleration methods, like Aitken's method.  A good accounting of this appears in Numerical Recipes.
Added
(5) You can estimate the tail of the sum with an integral.  Upon writing $\theta_n = (n + 1/2)\pi - 1/t_n$, the equation $\tan(\theta_n) =  \theta_n / \alpha$ (with $\alpha = \mu h / \sigma^2$) can be solved for $t_n$, which is small, and then for $\theta_n$ by substituting back.  Expanding the tangent in a Taylor series in $t_n$ gives the approximate solution
$$\theta_n = z - \frac{\alpha}{ z} - \frac{\alpha^2 - \alpha^3/3 }{z^3} + O\left((\frac{\alpha}{n})^5\right)$$
where $z = (n + 1/2)\pi$.
Provided $n$ is sufficiently large, the exponential factors of the form $1 - \exp(\frac{-\sigma^2 \theta_n^2 T}{2 h^2}) \exp(\frac{-\mu^2 T}{2 \sigma^2})$ become extremely close to 1 so you can neglect them.  Typically these terms can be neglected even for small $n$ because $\theta_n^2$ is $\Theta\left(n^2\right)$, making the first exponential go to zero extremely quickly.  (This happens once $n$ substantially exceeds $\alpha / T^{1/2}$.  Do your calculations for large $T$ if you can!)
Using this expression for $\theta_n$ to sum the terms for $n$ and $n+1$ lets us approximate them (once all the smoke clears) as
$$\frac{2}{\pi  n^2}-\frac{4}{\pi  n^3}+\frac{13 \pi ^2+6 (4-3 \alpha ) \alpha }{2 \pi ^3 n^4}+O\left(\frac{1}{n^5}\right) \text{.}$$
Replacing the sum starting at $n = 2N$ by an integral over $N$ starting at $N - 1/4$ approximates the tail.  (The integral has to be multiplied by a common factor of $\exp(-\alpha)$.)  The error in the integral is $O(1/n^4)$.  Thus, to achieve three significant figures you will typically need to compute around eight or so of the terms in the sum and then add this tail approximation.
Comment: this is really great, and should go a long way towards the CDF. Above and Beyond badge material.
Answer: You might start by looking at the drawdown distribution functions in fBasics.  So you could easily simulate the brownian motion with drift and apply these functions as a start.
Comment: +1 That's a pretty direct answer, considering these functions implement the formulas in the paper!
Comment: It seems like this package computes the _expected_ max drawdown based on the paper, but does not compute the CDF. The paper gives 'shortcut' results, IIRC, to compute that expectation.
Comment: @shabbychef Sorry, I missed that nicety.  I see how obtaining the entire CDF can be more useful than just knowing the expectation. (Financial risk is much more than just expected losses...)  But now I feel a little bit better about the work I did to approximate the CDF!


Microsoft Word 2013 -- multiple spaces not recognized by Find/Replace?

Question: I just upgraded to Word 2013, and I'm trying to find/replace all instances of multiple spaces in a document with single spaces (like this). (I'm doing proofreading/typesetting work, where it's critical that there not be extra spaces between words.) In my previous version of Word, typing each instance into Find/Replace and replacing all worked fine, but for some reason Word isn't recognizing that any double spaces exist when they clearly do in the document (ended up catching a lot of them manually.) Is there a workaround for this?
Comment: Turn on formatting marks and inspect what the spaces are really made of. Maybe they are non breaking spaces you are looking at?
Answer: If you are using track changes (whether or not you are displaying the changes), this may cause Word to ignore the extra spaces. To test whether this is the issue, save a copy of the document, accept all the changes, then try to search on "space space" (press the space bar twice) and replace with "space" (press the space bar once). If you don't have any special issues in your document (formatting that involves multiple spaces), you can "replace all." This should address the issue. I noticed this in Word 2010 when I was reviewing a coworker's document. I could manually delete extra spaces when I was editing with his changes hidden, but could NOT get Word to detect the extra spaces in the usual manner. I know it's hopeless to try to fix spacing when viewing track changes, but I did not realize until today that hidden-but-tracked changes will also seemingly disable Word's ability to detect multiple spaces between words or between sentences.
Answer: If you don't come across any non-breaking spaces (per Adam), try using spell check if you haven't already.  That's what I always use to eliminate extra spaces between words.
Answer: Under Options, then Proofreading, Settings, go to Grammar and check the box "Spacing" and Word will catch those extra spaces.


My Husqvarna 45 chainsaw won't start only if the trigger is pulled

Question: I have a Husqvarna 45 chainsaw and it won't start only if the trigger is pulled, and if i release it , the chainsaw stop's. Any suggestions?
Comment: These things are super-sensitive to leaving ethanol-containing fuel in them during storage.  Did you do that?  If so, you likely have a carburetor issue .
Comment: @jwh20 is right, ethanol is not good for small engines. Avoid it altogether if you can. See if any of your local gas stations sell non-oxygenated gas, and if you find one, use that in small engines going forward.
Answer: The carburetor likely just needs cleaning out and re-adjusting.
You can get a build-up of deposits on the jets which can cause issues like this.
I would first try buying a tin of carb cleaner spray and give the intake of the carb a few good soakings to see if that helps.  You will need to take the air filter cover off the tool to get access to the air intake.  Pull the throttle to open the butterfly valve to allow the spray inside.
There are videos on youtube for cleaning chainsaw carbs.
Comment: It might be easier to pull the carb off the chainsaw entirely and then blast it with carb cleaner. If that doesn't work, you can get cheap replacement carbs off ebay for less than $20. They are typically produced by a third party manufacturer in China (maybe shipped from China too), but I've had pretty good luck with them.
Answer: Carburetor cleaning is the way to fix the situation, but the problem will repeat.
It's caused by poor quality gasoline. And by "poor", I mean 99.9% of the gasoline sold, all of the gasoline used by cars for example.
In carbureted engines and engines lacking catalytic converter, you should really be using "small engine gasoline" / "alkylate gasoline". It's almost pure isooctane. If you know how octane rating is defined, isooctane is the "good stuff" and N-heptane is the "bad stuff". A fuel with 98 octane rating for example behaves equally than 98% isooctane and 2% N-heptane mixture would behave.
It costs more, but small engines are used so little that this isn't a problem. Also the exhaust gases are non-carcinogenic, if you use your chainsaw a lot (for example professional forestry worker) you will probably get cancer from the exhaust fumes if you don't use alkylate gasoline. Also the exhaust of alkylate gasoline stinks less.
Normal gasoline has very poor storage properties. You shouldn't store it more than a month. It will gum up your carburetor if you leave it in your equipment. One solution is to drain the fuel completely out, including from the carburetor (may require using the carburetor drain screw if your equipment has it, if not then tough luck). Another solution is to drain as much fuel with a hand siphon as you can and then run the equipment until it dies of fuel starvation.
But with alkylate gasoline, you can leave your equipment with gasoline in it for 5 years and it will still start exactly as well as it would if it was fueled yesterday.
Just remember to mix two-stroke oil if using it in two-stroke engines (like in chainsaws). You may also find premixed alkylate gasoline for sale that has already the two-stroke oil added.
If you cannot find alkylate gasoline, a far poorer solution could be fuel stabilizer. It still won't fix all of the problems of poor quality gasoline, for example ethanol can damage some rubber seals even if you use fuel stabilizer, but could be of some help as a backup solution.


What's the point of DatabaseAttribute within LinqToSQL?

Question: A LinqToSQL Context class is annotated with DatabaseAttribute by default. It is optional however. In any scenario I can think of you would use the connection string to point at a database, so what's the reason for it.
Now, I've obviously read docs. which state, you use it to specify a default database if you wish to omit it from the connection string. But...
why oh why would you want to do that? any suggestions?
Answer: Hmm.... good question. I can't think of a good use for this. If you wanted to span multiple databases (different data-contexts) from a single connection (which is not a good idea in the first place), it would still be pretty useless, as it would be fixed for all instances of the data-context.
In every sensible case I can think of, the connection defines the database, or it is a non-issue (standalone db files, etc). I wonder if it wasn't just put there because it (the knowledge of the database name) existed, and so it would be obtainable (in theory) in the same way...
Answer: Its hard to know what the design team thought at the time.
My guess it is there to allow optional configurations with a default general connection string in an app with multiple databases. This isn't supported built-in so I doubt it. This would allow for something like:
<code><add name="GeneralConnection" ... />
<add name="GeneralConnection.SomeDataContext" ... />
</code>
All the data contexts would be configured to point to the GeneralConnection. Some extra code to retrieve the data context instance, would check if GeneralConnection.ThatDataContext is there, and use the constructor with the connection string in that case.
Its just a guess. I haven't had a similar need, and I don't think I would rely on something like that.


Heteroskedasticity-consistent standard errors

Question: See https://en.wikipedia.org/wiki/Heteroscedasticity-consistent_standard_errors. Assume the model of interest is the linear regression model. If the errors are heteroskedastic, $\hat{\sigma}^2_i = \hat{u}_i^2$ is a consistent estimator of $\sigma^2_i$. If the errors are homoskedastic, $\hat{\sigma}^2 = \frac{1}{N}\sum_{i=1}^{n}\hat{u}_i^2$ is a consistent estimator of $\sigma^2 = \sigma^2_i$. When errors are homoskedastic, why $\hat{\sigma}^2_i = \hat{u}_i^2$ is not an estimator of $\sigma^2 = \sigma^2_i$, and that instead we have to use the estimator $\hat{\sigma}^2 = \frac{1}{N}\sum_{i=1}^{n}\hat{u}_i^2$?
Answer: You cannot have a consistent estimator based on the sample of size 1 -- that is when you have only one residual $\hat u_i$. The expected value of that residual may be converging to $\sigma^2$ in the homoskedastic case, or to $\sigma_i^2$ in the heteroskedastic case, provided the model is correctly specified, but that expected value is an extremely confusing construct -- it surely confused you on this occasion.
Update:
$$
\mathop{\mathbb P}[ \hat u_i/\sigma^2_i > a > 1] \to \mathop{\mathbb P}[ u_i/\sigma^2_i > a] = \mbox{assume normality} = \mathop{\mathbb P}[ \chi^2_1 > a]
$$
does not go to zero. Note that I gave you a huge credit in treating $\hat u_i$ as a consistent estimator of the true residual $u_i$, and frankly I am not even convinced of that.
Comment: Where did I claim that sample size is one? The estimator indicates that there are n observations available.
Comment: See update. $\hat u_i$ is predominantly based on one observation only.
Comment: I do not understand this. That residual is not calculated based on one observation only. Furthermore I no where claimed that the residual is a consistent estimator of the error.
Comment: You need to make your story straight. Your third sentence is, *If the errors are heteroskedastic, $\hat{\sigma}^2_i = \hat{u}_i^2$ is a consistent estimator of $\sigma^2_i$.* That's the claim I was responding to.
Comment: That is already in the Wikipedia article. I do not see the point.


What is "theae folium"?

Question: I wanted to buy black tea at a pharmacy and the pharmacist told me that russian tea is actually black tea so I bought it instead.It's made out of theae folium leaves and for some reason I can't find anything about that plant on the internet and I know that black tea is made out of camelia sinensis leaves, not theae folium.Can anyone tell me what is this plant and is it really russian tea (i found somewhere that russian tea is made from a different plant) and what is this "Russian" tea good for?
Answer: Judging by this image in wikipedia, I would say Theae folium is another name (probably a name in another language) for Camellia sinensis
Comment: It's Latin for "Tea leaf".
Comment: @CactusWoman, the answer is "tea leaf". Camellia sinensis is a flower and here  is just an example of tea. there are others theae folium, not related to this flower.
Comment: _Camellia sinensis_ is the botanical name for the plant whose leaves are used for the beverage commonly known as _tea_ in English (green tea, black tea, etc.).  The plant of course has a flower in the normal course of its growth (as well as leaves, seeds, roots, etc.)
Answer: If the labelling is correct, this should be Camellia sinensis, the plant that produces black tea, green tea, etc. (although not many things that are commonly referred to or marketed as herbal teas).
Thea is the original genus name given by Linnaeus to the species we now call Camellia sinensis.
There's an old pharmacy tradition of specialized latin terminology for plant medicines. These will indicate the plant and also often the plant part. In this tradition, plants are often indicated with different terminology than modern scientific names. Here's a 19th century pharmacy textbook (Parrish and Weigand) explaining why:

And here's the same source discussing the naming of plants parts (as CactusWoman mentions, in this case folium = leaf):

You still see this terminology around in some places (some European texts and occasionally translations of Traditional Chinese Medicine preparations), but it definitely has an 'old-fashioned' feel from the perspective of a botanist.

Parrish and Weigand 1884 A Treatise on Pharmacy
Comment: http://farm2.static.flickr.com/1434/5114191089_e95dd1f1c9.jpg is where I first encountered this form of antiquated nomenclature (in traditional Chinese medicine)

What is "theae folium"?


what is reduced set of risk factors in the context of basel III?

Question: I'm going through the MAR - Calculation of RWA for market risk sections on tps://www.bis.org basel framework page, but not quite understand the reduced set of risk factors. Is it subset of modellable rfs, or non-modellable rf's or is it unrelated and chosen upfront and contains both modellable and non modellable rfs?
Comment: Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
Answer: https://www.bis.org/basel_framework/chapter/MAR/31.htm

31.24
There may, on very rare occasions, be a valid reason why a significant number of modellable risk factors across different banks may become non-modellable due to a widespread reduction in trading activities (for instance, during periods of significant cross-border financial market stress affecting several banks or when financial markets are subjected to a major regime shift). One possible supervisory response in this instance could be to consider as modellable a risk factor that no longer passes the RFET. However, such a response should not facilitate a decrease in capital requirements. Supervisory authorities should only pursue such a response under the most extraordinary, systemic circumstances.

31.26 (6) In cases where banks do not sufficiently justify the use of current market data for products whose characteristics have changed since the stress period, the bank must omit the risk factor for the stressed period and meet the requirement of MAR33.5(2)(b) that the reduced set of risk factors explain 75% of the fully specified ES model. Moreover, if name-specific risk factors are used to calculate the ES in the actual period and these names were not available in the stressed period, there is a presumption that the idiosyncratic part of these risk factors are not in the reduced set of risk factors. Exposures for risk factors that are included in the current set but not in the reduced set need to be mapped to the most suitable risk factor of the reduced set for the purposes of calculating ES measures in the stressed period.

https://www.bis.org/basel_framework/chapter/MAR/33.htm

33.5 (2) This calibration is to be based on an indirect approach using a reduced set of risk factors. Banks must specify a reduced set of risk factors that are relevant for their portfolio and for which there is a sufficiently long history of observations.

(a)    This reduced set of risk factors is subject to supervisory approval and must meet the data quality requirements for a modellable risk factor as outlined in MAR31.12 to MAR31.24.

(b)    The identified reduced set of risk factors must be able to explain a minimum of 75% of the variation of the full ES model (ie the ES of the reduced set of risk factors should be at least equal to 75% of the fully specified ES model on average measured over the preceding 12-week period).

https://www.bis.org/basel_framework/chapter/DIS/50.htm

Table MRB (e) A description of the stress testing applied to the main significant portfolios that are modelled. For example, banks may describe the reduced set of risk factors used to calibrate the period of stress and the full set of risk factors, the share of the variations in the full ES that is explained by the reduced set of risk factors, and the observation horizon used to identify the most stressful 12 months.

So 33.5 (2) (a) says pretty clearly that the reduced set can only contain modelable risk factors. Per 31.24, if it's not possible construct aa reduced that that contains only modelable risk factors and explains 75%, then the regulator has the power to just proclaim some non-modelable risk factors to be modelable, if they want to.
Comment: Funnily, I recently interviewed for a role that was implementing new basel recommendations. We had a VERY lengthy discussion on RRF and them needing to contain 75% of the ES estimation. Despite the guidelines being very clear of the ES metrics, in reality, it's not very clear and/or can be up for interpretation.


Are there any artifacts for filesystem forensics in memory?

Question: I have a memory dump. I know it is infected by a rootkit which uses its own file system installed at the end of the disk. Can there be any artifacts in dmp file to show this?
Comment: Can you define what "this" is at the end of your sentence?
Comment: sorry for my english! I mean is there any way I can follow to know a file in memory comes from a main filesystem and another file has been loaded from sectors out of the filesystem?
Answer: The answer all depends on the rootkit and how it operated. There WILL BE remnants, but whether they are visible, encrypted, mangled, etc., are another story. Since you have a memory image, you can analyze it with Volatility, carve out data from the dmp with psdispscan if you can detect the anomaly from the memory. You could also use scalpel to do this but again, you need something to base your carvings on.
Had I to perform these tasks, I'd use a combination of Volatility, Memoryze, and Redline. I would try to carve out as many processes as possible, any anomalies, and perhaps shove some of them through Virustotal or Anubis. It all depends on my objective(s). So the short answer, yes there will be remnants, the conclusive answer: There are remnants you may not be able to see.
Answer: You can hash/extract each artifact (in a VM) and compare that with a malware database. I assume you have already taken a forensically sound image of the system of course.


Perform checks against XML files, such as Oracle OSB files and Soap-UI test files

Question: Looking for a way we can do checks on XML files, beyond just schema validation.  Have found a few references to Schematron which looks interesting, but struggling to see how we can piece this all toegether:
Problem Background
We're dealing with Oracle OSB which just generates a whole bunch of XML files.  We also produce Soap-UI test suites for integration testing.
We've just started formalising our coding standards and dev guidelines, things that give us a guide when performing code reviews. However a lot of these checks really feel they could be automated.  A lot like how checkstyle can do checks in our java code.
For instance, in our Soap-UI tests, we want to make sure every soap request has assertions for Schema Compliance and Soap Response.  This 'check' could be written as a pretty simple xpath.
Similar checks in our OSB produced XMLs, e.g. making sure variables conform to camelCase naming, that resource paths are not referring to files outside of the project, that top level error handling is present.
Ideal Solution
We've got our builds running in maven, and the soap-ui tests are spitting out surefire formatted reports.  We use jenkins as our CI server, and this is able to pick up these surefire reports so we can easily view test results and see why a build is failing.
We'd like to find something that could perform these checks for us, and have them report cleanly in jenkins.
The best I can figure out so far:

Have maven run ant task which runs schematron checks
Find a way to tranform schematron output into surefire output
Modify jenkins maven-runner to pick up the surefire reports produced

But feels like I'm getting stuck down the rabbit hole here.  If this is the correct way to go about this, I would think someone else has already addressed this, but struggling to find anything useful about integrating schematron with CI tools or maven.
Is schematron worth investigating?
Is there other tools that integrate more closely with our existing setup that would be better suited?
Answer: You might try to use XmlUnit for such purposes.
You would write your checks in form of JUnit tests in that scenario. Simple XPath based checks are easily performed with the help of XmlUnit assertion methods such as assertXpathExists, assertXpathsEqual etc.
More complex checks might be implemented using a custom NodeTester.
Answer: some Python code can help, for a simple working example of Checkstyle with OSB see:
http://www.javamonamour.org/2013/07/lintcheckstyle-for-osb.html
I have used Schematron in the past, it's just not flexible enough.


Gmail freezes on display:none

Question: I have a "div" which i insert in everypage, inside which resides my plugin. In certain pages where i might not need to use the plugin, i do a display:none on the div. This seems to work perfectly fine in all browsers. The only exception to this seems to be the "google.com" pages. Whether it be the search page or the gmail page, it seems to freeze once i do this display:none. By freeze i mean that none of the links are clickable after this. Is there something specific with these pages that i'm missing??
Any help would be appreciated.
Thanks
Answer: if style="display:none" dose not work in gmail. put style="display:none !important;" .

Gmail freezes on display:none


Overpowering a peltier element

Question: I have a peltier element rated at 15.4V, 6A, and 60 watts that I got from China and has no datasheet to be found. When I drive it with a 12 volt power supply, I can get up to about 5.5 amps giving a power output of over 60 watts. Is this an issue? Maybe the specs I have are misleading, but they don't make very much sense to me. is going over the rated power okay if I keep it cool? I have a heatsink on the hot side and it is not even noticeably warm. Is driving it over the rated power going to hurt it? It doesn't make sense to me that the given current and voltage levels would yield so much more power than it is rated for. It makes me think the 60 watts is just a suggestion. It says TEC1-12706 on it, but as far as I can tell, that is not unique to the particular product.
Answer: 15.4V x 6A is over 90W, not 60. So 60W is not the "rated power" but the heat pumping capacity.
This is in line with other Peltier coolers I've seen - they take about 1.5W of electrical power to pump 1W of heat, whereas a compressor-based refrigerator would pump 3-4W of heat for the same 1.5W input power.
So you can use it at 12V, 5.5A (66W in) and it'll probably pump about 40W.
Add these together (106W) and add a safety margin : plan your heatsink/cooling to remove something like 120W from the hot side.
Answer: The current and voltage rating of a Peltier are ususally the maximum cooling point.  You should also consider them the maximum value to not exceed to avoid damage.
While there is probably some margin past the maximum cooling point before damage occurs, it is stupid to go there anyway.  The cooling power of a peltier is proportional to the current thru it, but the internal heat caused is proportional to the square of the current.  Eventually the square wins over linear, and at some point adding more current actually decreases the overall cooling capability.  Put another way, the incremental current causes more internal heating than additional cooling power to get rid of that heat.  This is what the maximum cooling point is, and which is why you don't want to exceed it even if no damage is done.
Answer: You might try looking at a few TEC data sheets, such as this one. http://www.hebeiltd.com.cn/peltier.datasheet/TEC1-12706.pdf  You'll note that, for a given current, the voltage required increases as the hot side temperature rises. Since you don't have a data sheet, I suggest that the ratings you've got are probably based on a somewhat elevated temperature.
As for damaging the TEC by driving too much current through it, apparently the answer is yes. See, for instance, http://assets.newport.com/webDocuments-EN/images/AN14_TEC_Drive_Current_IX.pdf where the subject of thermal runaway is mentioned.
In general, it's true that the more voltage you apply, the more power the TEC will produce. However, that's not what you are interested in: you want to go for cooling effect, and that depends on several factors. Efficiency depends on things like your heat sink capability.

Overpowering a peltier element


Immersion chiller or counter-flow chiller?

Question: Based on your actual experience with each, what are the pros and cons of the two most common types of wort chillers - immersion and counter-flow?  Which do you prefer?
Answer: I can chart a few big leaps in my homebrew quality over the years.  Switching from immersion to counterflow was one of them.  Getting a good cold break makes your beer clear.  CFC use less water.
My next chiller upgrade will be a whirlpool chiller.
Comment: Out of curiosity, what are the other big leaps?
Comment: In chronological order: 1. The move to all-grain. 2. Switching to a counter-flow chiller. 3. Getting fermentation temperature consistent. 4. Reading Designing Great Beers 5. Getting good vorlauf. 6. A nice long sparge
Comment: Where does switching to a CFC fit into that chronology?
Comment: #2. Time to work on reading comprehension skills? ;-)
Comment: Actually, for great beer I'd put #3 and #1.  Temp control can turn even a so so recipe into good beer vs. great recipes and crappy temps.
Comment: Meeee-yowww. ;)
Answer: I started with an immersion chiller and then went to a plate chiller, however I still use the immersion chiller in line with the plate chiller like this:  http://backyardbrewer.blogspot.com/2009/08/post-chiller-chiller.html
which helps a great deal.
mark
Answer: The Immersion Chiller is easiest to clean and the most reliable from a cleanliness standpoint.  The efficiency and speed of chilling can be a bit troubling sometimes depending on the water from the taps temperature.  You also have to dabble a bit in flow rates of the water.  I find that I can run the water fairly fast for the first few minutes, but I really need to slow it down to maximize heat transfer as the wort cools.
A counterflow chiller (and also plate chillers), are often but not always more efficient at chilling.  The are however usually completely sealed up.  So cleaning can be a bit worriesome if you don't know you have a deposit in there.  Also to prevent deposits and clogging with plate chillers, you really need to seperate hop debris from the wort as it exits the kettle.  Depending on the style of counterflow being used sometimes a pump is required for good wort flow.
I too will be upgrading to a whirlpool chiller soon once I get my pump up and running. I guess that means I prefer my immersion chiller.  I use a 50' 1/2" copper coil setup.
Comment: Is a whirlpool chiller a modified immersion chiller, or do you actually pump wort through some tubing with a whirlpool chiller?
Comment: I actually made this a question and answered it [here](http://brewadvice.com/questions/827/what-is-a-whirlpool-chiller/828#828).
Comment: I just made this a question and answered it (here)[http://brewadvice.com/questions/827/what-is-a-whirlpool-chiller/828#828]
Comment: I just made this an question and answered it.
http://homebrew.stackexchange.com/questions/1606/what-is-a-whirlpool-chiller
Comment: Thanks.  I need to be better at realizing, "this would make a good question."


Is it acceptable to ask a professor who is not your supervisor to provide comments on your thesis draft?

Question: I want my thesis to be the best it possibly can be. My supervisor is away for one month right before my thesis submission. Is it inappropriate or poor etiquette to ask another professor in the field who has shown interest in the topic to read the paper and offer any suggestions? This other professor teaches at a different institution, and will not be part of the panel or defence process.
Comment: What about the other members of your committee?
Comment: Did you ask your current supervisor about this?
Comment: At my university they had associate supervisors who could help you if the main supervisor was unavailable.
Comment: I would ask for help from another academic at your institution, but as soon as you circulate your work to anybody external you are at risk of breaking the university's rules on copyright/IP.
Answer: If you have an existing relationship with this professor, you could ask, but be prepared to hear "sorry, I don't have time".
If this professor is a stranger to you, this is probably an unreasonable request.
Comment: In addition to this, I would first consult my supervisor. I would say that having the thesis read by someone else without the supervisor's knowledge is a bad idea.
Answer: I would ask the other professor, but I would phrase it in a way that makes it clear that I'm not expecting them to proofread the entire thesis. Perhaps you could say something like "You expressed an interest in my research, so I wanted to give you a draft of my thesis. Perhaps it might be of interest to you or one of your students. And of course, If you have any comments or suggestions, I'd be glad to hear them." They probably will read it and give you some comments, but they won't feel under pressure to do so.
Comment: If you phrase it like that, the professor will think he's being offered the opportunity to read it and comment, rather than being requested to read it and comment. Something like "I'm sure you must be really busy but if you had time to read this and give me some feedback before I hand it in on date X, I'd be really grateful" makes it clear that you are asking for something, while still giving the professor the chance to say no.
Comment: This strategy might avoid discomfort if the potential reviewer declines, but it also feels vaguely misleading, or at least unnecessarily indirect. Asking for what you want clearly and politely should always be acceptable, and I would suggest the reviewer will be more likely to outright decline as opposed to forgetting or doing a partial job, which is a good thing.
Answer: If the other professor has expressed his interest in reading your thesis and is willing to do it, I don't see why not. It is better to have someone read your work out of interest rather than obligation. But it is also a good idea to let your supervisor know about it.
Answer: I depends what that "lack of knowledge" means:

is it an attempt to hide the fact? Then it is fishy
or just "I will not bother my supervisor with this".

I have been on all the sides of this situation.
As a student I did not tell my supervisor that I was showing my thesis to someone else because I knew he would not care to know and would have encouraged me to do so (to get comments, ideas, ...). He was an excellent supervisor: present and active when I needed him and siding away when I was moving full speed ahead, sometimes against his recommendations. When one of these "without his recommendation" ("against" is maybe too strong a word) turned out to be a good idea he wrote himself off the paper I was publishing (he was second author) because he said he was not convinced at the time and that I should get all the praise. I am glad I met him.
I was also asked several times to have a look at a thesis. To be frank I never thought of asking the student whether his supervisor was OK or not with that  because I did not think about the possibility of being against (and the associated reason).


Can I still use time machine if I encrypt my drive with file vault?

Question: I read somewhere that there are some problems with the time capsule if you encrypt your mac, so I would like to know those before I do that.
Comment: NOTE: having a non-encrypted Time Machine backup, but an encrypted boot drive is an exercise in futility. Somebody who's interested in the data on your Mac will just swipe the backup disk - no need to steal the Mac!
Answer: Yes, you can still use Time Machine backups even if you encrypt the boot drive with FileVault.
Note that when setting up Time Machine backups, you'll have to select that the backup should be encrypted as well, otherwise your data will be stored unencrypted in the Time Machine backup.


How to reverse tether without rooting?

Question: Want to use PC broadband connection on the phone connected via USB [no Bluetooth or wifi] to surf on the phone or install app.
The android device is running 4.0.4 and the PC running Windows 7
I dont want to root the phone. I've the phone driver installed.
Answer: well i hope i am wrong about it but as far as i know there is no way to do so.
i tried searching a method for it and wasted about a good few dozens of hours over it and kept on searching for it until i was sure that it cant be done without rooting the device.
many youtube videos, websites and blog claim they have a method and i tried almost every one i got to know but cudn't find a working method.
hope my answer helps.
Answer: Unfortunately, that's probably not possible, but most of the things you would do on the phone you can do on the computer and then transfer to phone. For example, app apks can be downloaded and moved and then installed.
Answer: Despite what others say, this is in fact possible.
As I could not find any solution myself, I finally created my own app. It supports Android 4.0+ on the client side and all major desktop operating systems on the host side.
You can check the app ReverseTethering NoRoot PRO on Google Play Store

How to reverse tether without rooting?


Short story where a man enters a cave and emerges into a parallel world

Question: Read this short story maybe twenty-plus years ago, the story itself may be older.  A man wanders into a cave, maybe in Mexico, and when he emerges he's in a parallel world.  He's not staying at the hotel where he was and the woman he was married to in his home reality is now merely an ex-girlfriend.  Don't think he was able to return home and had to make a life for himself in the new reality.
Comment: What story format (short story/part of a collection? Novel in its own right?)? What language? Original language or translated?
Comment: For sure a short story.  Maybe from an anthology.  If it were part of a single author collection, I'd probably remember it better because of associated stories.  Heck, maybe even from "the pulps", in which case we may never know the answer.  But English for sure.
Answer: I found it.  The timeframe was right, but I got some of the details wrong.  It was in Mexico, but it didn't involve a cave but, instead, a visit to a pyramid.  He didn't lose a wife, but rather gained one.  There was a girlfriend but in his new reality the girlfriend was merely a friend of him and the "new" wife.  I did get them most important aspect right, which is that he was stuck in the new reality.  The story is "The Changeling" by Robert Silverberg and appeared in his 1984 collection "The Conglomeroid Cocktail Party".


internal AD domain vs. internet domain

Question: By mistake the internal Active Directory domain was named as an Internet domain that the company does not own. Exchange 2010 was installed and runs fine internally. The problem is now they need to send/receive external emails. They want to keep their email accounts using the internal domain, should I rename the forest AD or do I have another options.
Comment: Are you saying that they want email accounts that match the current name you have used for the internal domain (in which case you have choice but to try and buy it) or do they just want their email domain to match what the internal one is, regardless of what it is?
Comment: @Sam, not sure if I understand your question, let's say the domain is PDC of the AD is MyDomain so the email accouns were setup on exchange like email@example.com so they like to keep them in the same, without any change on the email domain.
Comment: so what I am asking is, are they set on having "@mydomain" as the email address they use, or could you change the internal AD domain to "@moyotherdomain" and so long as their email also uses that it will be ok?
Answer: Obvioously you won't be able to receive email from the outside that are addressed from a domain that you don't own, but you should be able to simply setup a real domain, and configure Exchange to accept messages for the new real domain in addition to the domain you have.  If someone else is really using that fake domain, then you will not be able to send email to them.
It will be important to make sure that your accounts use the real address as default so, messages sent to external parties will appear to be valid, and people can reply to you.
See: Configure Microsoft Exchange Server 2010 to accept e-mail for more than one authoritative SMTP domain.
In the long term, you should seriously consider renaming the forest.  It is really not a good idea to be using a domain, that doesn't belong to you.
Comment: @MarkHenderson He can still set up a new forest, create a two-way trust, and migrate mailboxes to the new (properly named) forest. It's a PITA, but it's better than now owning your AD domain.
Comment: We had this issue, but where another company had named their internal domain *the same as our external domain*, and blamed us for the fact that all their emails seemed to bounce. The end users didn't realise that their internal domain was the same (they just used the netbios name for logging in, DOMAIN\user.name). Took weeks and weeks for someone in their IT department to actually notice. Moral of the story: Rename the forest.
Comment: @MarkHenderson: The OP is stuck, though, since he's got Exchange 2010 installed. There's no more domain / forest rename supported after Exchange 2007+ is installed.
Comment: @EvanAnderson - I didn't realise that. Poopies.
Comment: @Mark Henderson, I think so however from what I've read this is not possible: http://serverfault.com/questions/303416/domain-rename-with-exchange-2010
Answer: It sounds like you've got a single Exchange 2010 server computer with all the roles installed there.
To get this going you'll need to configure an additional receive domain for the Customer's Internet domain name (just as @Zoredache says). You'll also need to configure a Receive connector and a Send connector to allow email to be received from the Internet and sent out to the Internet.
Finally, you'll need to modify the firewall configuration to allow inbound and outbound SMTP to/from the Exchange Server computer and, if necessary, create an MX record in the Internet DNS to get the email to route to the public IP address the Exchange Server computer is exposed via.
I agree with @Zoredache in that it's not a good idea to use someone else's domain for your AD forest. Unfortunately, domain rename is not supported after Exchange 2007 or 2010 is installed. You're stuck, now, with a migration to a new forest if you want a new name.
Edit:
It is, apparently, possible to install Exchange into a resource forest, create a cross-forest trust, migrate all your mailboxes to the resource forest, then uninstall Exchange in the source forest, rename the source forest, and reinstall Exchange in the source forest and migrate everything back. That sounds like a horrible ordeal (in a production network-- fun in a lab, though) and I don't think I'd attempt it.

internal AD domain vs. internet domain


Autoburn NFT's after certain amount of time

Question: how to create functionality to make NFT burn automatically when its expiry date is reached ?
while minting i am storing 2 parameters minted date and number of months to expire , so i want it to burn automatically after expiry date is reached
Comment: One way to do it would be to modify the function that returns the address of owner to return nothing if the expiration date is reached.
Answer: To check the time use Chainlink Keepers. Your contract will be able to check if the current date has passed the expiration date. After the condition is met you could call OpenZeppelin's _burn function:
<code>// SPXD-License-Identifier: MIT

pragma solidity ^0.8.8;

import "@chainlink/contracts/src/v0.8/interfaces/KeeperCompatibleInterface.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";

contract NFT is KeeperCompatibleInterface, ERC721 {
    //time is in unix
    //set mintDate and timeTillExpire

    uint256 public currentDate = block.timestamp;
    uint256 public mintDate;
    uint256 public timeTillExpire;
    uint256 public expireDate = mintDate + timeTillExpire;
    uint256 public tokenId = 0;

    //check if it has passed expiration
    function checkUpkeep(bytes memory)
        public
        override
        returns (bool needsUpkeep, bytes memory)
    {
        bool timePassed = (expireDate >= currentDate);
        needsUpkeep = (timePassed);
    }

    //burns token once condition is met
    function performUpkeep(bytes calldata) external override {
        (bool needsUpkeep, ) = checkUpkeep("");
        require(needsUpkeep == true, "Upkeep not needed.");
        _burn(tokenId);
    }

</code>


Magnetic Field in the plane of a circular current carrying loop

Question: If we have a current carrying loop with center at a point o, and i have a point P in this plane where im supposed to calculate magnetic field, if i consider an amperian loop with center at o and passing through P, by symmetry at all points on this amperian loop, the magnetic field should be same
and since current enclosed is zero(no current cuts the amperian surface), shouldnt the magnetic field be zero?
Comment: This might depend on whether you look at the field along the loop trajectory, or perpendicular to it. Check the definitions...
Answer: So your argumentation using Amperes law and rotational symmetry does hold. But as mentioned in the comments you need to take care of the direction you are looking at. Your argumentation tells you, that the magnetic field threw your loop in direction of the loop, if place properly, will be zero at all points of the loop. But that does not mean, the overall magnetic field is zero there, it just means that any nonzero component has to have a direction perpendicular to the loop and therefore not contribute to the integral in Amperes law. Which might be seen relatively easily, if one imagines the kind of dipolish B-field created by your current loop.


Where can I get historical fundamental data for multiple companies in a single CSV file?

Question: Summary
I seek an explicit reference to a source that gives me

a fixed URL, e.g. http://example.com/?isin=US1912161007 or http://example.com/?index=Dow_Jones, which provides
an easily parsed format (e.g. CSV, not HTML),
the fundamental data I need (or at least sufficient data that I can calculate it),
several years in the same file,
search functionality by ISIN (or all stocks of an index in a single file).
The service should not be limited to US stocks but should include at least the stocks of major indices worldwide.
Paying for it is not the issue, but I need to know beforehand if I that data actually does what I need.

Original Post
I'm looking for a service that provides historical fundamental data in CSV format, which might look kind of like this (note how more than one company appears in the same file - alternatively I'd like an usable request interface, e.g. http://example.com/?isin=US1912161007):
stock , ISIN        , year, price       earnings   cash flow  equity     debt     , ...
                            per share , per share, per share, per share, per share, ...
Apple , US0378331005, 2014, 125.32    , 6.49     , 29.78    , 22.3     , 25.1     , ...
Apple , US0378331005, 2013, 125.32    , 5.72     , 26.20    , 24.6     , 32.6     , ...
Boeing, US0970231058, 2014, 152.42    , 7.47     , 123.20   , 12.6     , 120.3    , ...
Boeing, US0970231058, 2013, 152.42    , 6.03     , 112.85   , 21.4     , 101.2    , ...
...

That's the barest minimum of data - more fundamentals are better (and getting it per quarter instead of per year would just be a plus). Some values can also be calculated (e.g. total equity / #shares = equity per share, earnings per share / price per share = PER, equity / debt = leverage etc.), hence having different columns in the file is fine as long as all fundamental data can be calculated.
I do not mind having to pay for long-term historical data - but I want to see a sample of several years and several stocks first so I can decide whether the data actually fits my purpose.
It is important that each CSV file contains multiple stocks (at least all of an index). Because I am very much fed up with having to collect the data for every single stock by hand - or rather by a script that has to crawl three different web pages for every single stock to get all of the fundamentals, regularly throwing up at the weird formatting.
As far as I could see, the sources in "What data sources are available online?" are no better than the scraping script I already have. The main problem being that even though some of them provide CSV they still provide one per stock. One file per index I could work with, but one per stock makes far too many files.
Also, they usually are US stocks only. While having information on US stocks is nice, being restricted to them is not.
Furthermore, a source with a CSV giving a list of the stocks with their current price (or yesterday's - I'm not picky) would be nice, too (and, again, not one file per stock) - though utterly useless without a CSV that gives me the fundamental data.
Comment: Buy a bloomberg terminal. They are awesome.
Comment: @StuartAllan while I have no problem with paying for a service, I do have a problem with paying too much. Bloomberg provides an one-size-fits-all deal with services I do not need. Which means that for the services I actually do need Bloomberg is ten times more expensive than any competitor that specializes on only having the data I do need. My problem is not finding someone with the data, but someone who is willing and able to provide it in an usable format - and I have seen nothing that convinces me that Bloomberg would do so.
Comment: Export options available in popular data providers: http://quant.stackexchange.com/questions/22339/data-exported-from-capital-iq-factset-bloomberg-compustat
Comment: A wiki here answers the question: https://quant.stackexchange.com/questions/141/what-data-sources-are-available-online
Answer: A friend of mine has created a free source for fundamental financial company data of US listed stocks. All of the data is easily available from https://simfin.com/. Feel free to check it out and send him some feedback, so he can improve the service.
Update 30.07.17: So he has just updated the site and now standardized company statements for over 2000 US equities and financial ratios are available. If you are looking for a bulk data download feel free to reach out to him.
Update 27.05.20: a new version of the bulk download is now available here: https://simfin.com/data/bulk
or via the SimFin python API on github: https://github.com/SimFin/simfin
Comment: SimFin looks great, but I can only find current period data.
Comment: Hey Decent, you are completely right currently you can't see the history of the standardized ratios. The team is just updating the platform to include this feature. Also if you go to: https://simfin.com/data/find/companies  you can create views to see the history of the ratios, but for now its not perfectly user-friendly (as the purpose is filtering according to specific criteria). I'll send an update here as soon as the feature is ready and online.
Comment: Cool thanks for the tip. If they have a XBRL+ML tool and it's on GitHub I might give back to the project.
Comment: Hey Decent, here the link to GitHub, but for now they are only working on the data extractor from the SimFin bulk download. In addition, the team is considering adding more opportunities to make the project more open sourced. Thomas the founder is always looking to engage with the community, so if you consider contributing just send an email via firstname.lastname@example.com.
Comment: https://simfin.com/data/bulk
Answer: You can find dataset you need on QUANDL (although some data service is for paying, it is a good data source and not expensive); there are a lot of fundamentals data, surely all you need and you download them in CSV format too. I also know that they provide different frequencies and so even the quarterly frequency.
The only problem is that you have to download data separately in csv files and after put them together since I think they do not provide a full and complete dataset. If you need that kind of service the only sources available are Bloomberg/ Reuters.
Comment: I looked at QUANDL before. It seems to be limited to US stocks (I think I hadn't yet mentioned that's a problem when you posted), and the site is so bad I can't even find the data I need on those. Bloomberg/Reuters don't seem to be particularly interested in non-institutionalized users - e.g. Bloomberg provides only one-size-fits-all with services I don't need.
Answer: I'd just like to share that I work at Quandl and noticed this thread. We now have global fundamentals data that can be downloaded in various formats including CSV. Our Global Select Stock Fundamentals database can be found here: https://www.quandl.com/data/RB1 The database covers 75 harmonized financials, ratios and forecasts for 4500+ most liquid global stocks. There's a special focus on Asian and European companies. The database also covers 6 years history and is updated daily. Another source of global fundamentals that we offer is Global Fundamentals data from Mergent here: https://www.quandl.com/databases/MF1 Key features: Fundamentals data providing 50+ fundamental indicators, including derived margins and ratios, for 10,000+ companies across 67 countries as covered by the Russell Global Index. Also includes auditor status for each company. History goes back to 2005. Updated daily.
We'd also like to comment that we're very conscious of our search feature's shortcomings and we're working very hard to improve our search so that users can find the exact data they need more easily.
Answer: You can get that data from Intrinio in an API call that outputs a CSV download or you can use the Excel add-in to build EXACTLY what you are looking for and save it to CSV- it will update with the latest data each time you open the work book:
You can see from that picture that an Excel add-in is designed to let you put a list of tickers in column A, a list of "tags" across the top row, and then to drag formulas down with relative references to pull in the data. You can add more tickers or tags to get any fundamentals you want (revenue, EPS, debt, etc).
The CSV download looks like this- you just paste it into your browser and you will download the information:
http://api.intrinio.com/prices.csv?ticker=AAPL

That syntax will download Apple's price history, or you can download Apple's total revenue to CSV:
https://api.intrinio.com/historical_data?identifier=AAPL&item=totalrevenue&start_date=2014-01-01&end_date=2015-01-01

The problem with a CSV download for what you are looking for is that you are putting 3 dimensional data (ticker, tag, date) into a 2 dimensional format (rows, columns). It's better to put group different time periods in different spreadsheets or tabs in a single spreadsheet if you want to work in a 2D medium like Excel. For example:

As you can see in this example, I can use the add-in to adjust the time period- in this case I'm pulling daily marketcap, but I could also get yearly, quarterly, ttm, etc. Getting this in 3D, so I'm pulling marketcap AND other metrics for multiple tickers and multiple time periods is not a thing with CSV downloads.
You can use this Excel add-in for free depending on how much data you need in a day and you can use the CSV download functionality to get the data you want, just not in a single CSV. Let me know if I missed any of your requirements- you can definitely get unique identifiers for the stocks as well if you don't want to use the ticker symbols.
Answer: All the other answers are either paid services or don't provide the data in a very user-friendly way.
I would use graphfundamentals.com, it's free and provides all the quarterly fundamentals of a stock sourced directly from the SEC filings.
To get the information into an Excel, you can just search the company you are looking for, select the fields you want, and then copy and past the data table that it displays.
Answer: If paying for it is not an issue you should get CRSP dataset which is available on Wharton Research Data Services. I think the only thing you can't do is search by ISIN. However, you do can get all stocks of an index in a single file.
Also you can search by ticker, permno, permco, secid, etc.
Answer: I've spent a fair amount of time with the type of fundamentals data you are looking for, and I am not aware of any site or provider that meets all of your criteria. Specifically, I am not aware of a provider that provides multi-company fundamentals data, in CSV format, retrievable at an ISIN-addressed URL.
Given the above, if you are willing to build the URL interface you desire, you can acquire all of the raw fundamentals data you are looking for by using S&P CapitalIQ's Xpressfeed product with the appropriate data packages. They provide fundamentals on global companies, indexable by the ISIN of an issued security, and there is a package that provides information on index constituents. Some of the data is delivered in CSV format, but other portions are delivered in a custom text format. All of the data can easily be loaded into a database, assuming your familiar with relational databases. If you were willing to go this route, you might find that after loading all of the data in a database, you don't really need the URL interface you described.
Be warned, given it's price, these are not products targeted at individuals (I don't know what you mean by "non-institutionalized"), and you're not going to find all the details you want at the above link; you're going to have to talk to a sales representative.
Answer: Sage Data Service - www.sagedataservice.com can provide the raw fundamental data you are looking for.
All U.S. stocks are covered with 7 years of quarterly history and an additional 5 years of yearly history. The price of this offering is substantially below that offered by the big vendors. They don't offer ISIN codes. These codes are available at www.isin.org for a reasonable price.
API's and FTP are offered for downloading at Sage Data Service.
Comment: Please disclose your affiliation.
Answer: I used Intrinio in the past and it is a very solid source although I think it is only via API and doesn't provide CSV downloads.
For CSV downloads you could try financialDatadb.
You should always request a sample before purchasing as the quality for this type of data varies enormously. As a quick test, I always check the quarterly cash flow statements as these usually need to be calculated by the provider and are the most unreliable of the three accounts (Bal Sheet, Income Statement and CashFlow Statement).
Answer: I work at Leeway, and we offer API access to global stock data (quotes and fundamentals). You can find the documentation here: https://leeway.tech/data-api. We cannot offer the data for free, but it is certainly cheaper than typical alternatives like Bloomberg.


Is there is a simple way to tell if a graph is 3-connected

Question: Is there is a simple way to tell if a graph is 3-connected? In lecture, we use the definition that a graph is k connected iff it contains no proper separations of order < k $\therefore$ by this definition, a graph is 3-connected iff it contains no proper separations of order < 3. However using only this definition makes the process of determining if graphs are 3-connected rather arduous - and there is always the risk of missing a separation - so I was wondering if there were any other theorems/lemmas/corollaries/definitions which might make the process a bit quicker.
Answer: Whitney's theorem is useful for vertex connectivity computations:
A graph $G$ is $k$-connected if and
only if for every pair of distinct vertices $a$, $b$ of $G$ there is a family of
$k$ disjoint $a$, $b$-paths in $G$.
See Theorem 3.3.5. (Global Version of Menger's Theorem)  in Reinhard Diestel's book Graph Theory.
Answer: An excellent description of a number of algorithms is given here. All of these are far more efficient than Whitney's algorithm.


Ancheer 250watt Motor Hall Sensors?

Question: I need to replace  the 3 hall sensors in this 36v 26" hub motor for ancheer bike.
I purchased the 41F/0H41/SH41/SS41F/S41 Bipolar Hall Element Sensor TO-92UA
but it is bigger and does not fit. i squeezed them in to make them fit but they dont work. motor does not respond to these they are the wrong model. anyone can suggest which hall sensors might work. the originals are lableled 4010 1724
and nothing like this exists online. ancheer also doesnt know.
Comment: Have you tried electronics.stackexchange?
Comment: It's going to be hard to determine which hall sensor you need if you have no idea what the characteristics of the ones you're replacing are (also, how do you know that the sensors need replacing?)
Comment: Have you tried Ancheer ?   Why do all three sensors need replacing ?
Answer: You most likely need digital hall sensors (instead of analog versions). Most bldc motors use digital hall sensors. You should check your controller specs to see what type of hall sensors it supports but most likely you will need digital.
have you tried testing the hall sensors with either a multimeter or controller tester to see if they  switch on and off when rotating the wheel? Are you sure your hall sensor leads are correctly connected to the controller? Is there voltage on to the GND and +5V wires going to the hall sensors? (Measure voltage across these two wires when the controller is turned on, the motor doesn't have to be moving for this.
Are you sure you didn't damage your hall sensors during installation?
Is there any other text/marking(brand perhaps) on the original hall sensors? Could you attach a/some photo(s) of the original hall sensors for reference?

Ancheer 250watt Motor Hall Sensors?


How to track the index of variables in an interpreter

Question: I'm creating an interpreter (a bytecode interpreter, so also a compiler) and I've found a problem I just can't solve. I need to store variables somewhere. Storing them in a dictionary and looking them up at runtime would be way to slow, so I'd like to store them in registers and use their indexes instead of their name.
So at compile time I give every variable an index, and create an array of registers. That's fine for monolithic scoped languages. But the language I'm creating the interpreter for has nested scopes (and function calls). So another approach could be that I have a set of global registers, and a stack of register lists for function calls. So my virtual machine would have something like:
Register globalRegisters[NUMBER_OF_GLOBALS];
Stack<Register[]> callstack;

But there's another thing. My language allows functions inside functions. Example:
var x = 1;
function foo() {
    y = 2;
    function bar() {
        z = 3;
        y = y - 1;
    }
}

Function bar() refers to a variable that belongs to foo(). So that means that the virtual machine would have to look at the register list under the top one on the stack. But what if bar() is recursive? What if the number of recursions are defined by user input? Then the virtual machine just wouldn't know how many stack elements does it have to go under to find the set of registers containing the value of y.
What could be an effective solution for this problem? This is the first time I'm dealing with registers, calculations happen on a value stack.
Answer: The usual way to represent closures is to create a struct that contains both the function pointer itself as well as its environment. The simplest way to represent the environment would be as a pointer to the stack frame of the outer function. The inner function could then simply dereference that pointer (with the offset of the given variable of course) when accessing variables of the outer function.
However there's another problem you have to consider: What if foo returns bar and then bar is called after foo already returned? In this case a pointer to foo's stack frame would be invalid as that stack frame would no longer exist at that point. So if you want to allow that scenario (instead of simply making it illegal to return functions), you need another solution.
One common solution would be to represent all local variables as pointers to heap-allocated values and storing copies of all those pointers in the function's struct.
Another solution would be to restrict closures, so that variables of the outer function can only be accessed by the inner function if they're never re-assigned. That's what closures in Java 8 do. Then the struct could simply contain copies of the variables instead of pointers.
Comment: So one solution would be that the inner function's stack frame has a pointer to it's outer function's stack frame?
Comment: @PeterLenkefi Yes, if you disallow returning functions (and keeping in mind that you need to save the stack pointer along with the function at the time of function creation as you may otherwise not have access to it at the time of the function call - thus the struct).
Comment: My language can only return lambdas, so that's not gonna be a problem. This is a neat answer, thank you!
Answer: I think the underlying question here is very different from the one you have written, so I've written an explanation to why I think the question is malformed and an answer to what I think the underlying question is. If I am mistaken I apologize, but bear with me a bit :-)
The problem with the question

I'm creating an interpreter (a bytecode interpreter, so also a compiler)

An interpreter is not a compiler, even if it's for a low-level language - unless you meant that your program both compiles some language to some bytecode interpretation, and then interprets it. In any case, unless you're jitting code, the program that is actually running is the interpreter.

Storing them in a dictionary and looking them up at runtime would be way to slow, so I'd like to store them in registers and use their indexes instead of their name.

In an interpreter, forcing target language variables into registers doesn't smell right to me. For instance, say you have a method for interpreting a specific statement which uses variables. You can pull the variables quickly since you force them into registers, but then you have too few registers for running the operations in your own method efficiently. Also, saying "yea, I'll just store those in registers" makes me suspect you great overestimate the number of registers available to you.
I'm guessing "registers" here is a misnomar and you just care about some efficient way of storing and accessing locals, in the presence of nested scopes and recursion. So I think your question can really be phrased as "I want some data structure storing locals, how do I do that in the presence of nested scopes and recursive functions?" If I'm wrong I'm sorry, but if not:
My Answer
To answer "I want some data structure storing locals, how do I do that in the presence of nested scopes and recursive functions?", I think it's best to first clarify the distinction between scopes and frames, in the context of locals.
A scope is some mapping of identifiers to local variables. Inside a scope, you know all the instances of the x identifier refer to the same thing (roughly). A scope is something you care about when you're parsing the input language - it's what you use to understand the semantic of the code ("oh, the x the coder is incrementing is the same x from 2 lines ago").
A frame is the memory allocated (typically on the stack) when calling a function. Each local usually gets a reserved place on the frame to store its value.
When you parse the code, dealing with scopes, you don't care about recursion (since you're not running anything, just parsing). You do care about nested scopes, but those are never unbound - since the code itself (not its execution, just the code) is always finite. The standard way to deal with locals in scopes when parsing is to keep of stack of dictionaries. Create and push a new dictionary when a scope is opened, pop it when it's closed. Whenever x is accessed, look for it in the dictionary at the topmost dictionary in the stack - if not there, continue to the next one, and so on.
The code you generate (or straightforward perform, in an interpreter) will then know exactly to what location each instance of x is referring to. And those memory locations will be allocated when creating a frame. That way you also don't care about recursion - you have mapped variables to locations in the current frame, and that is valid regardless of where that frame was called from.
Finally, a word about closures
In all the languages I can recall right now, closures work by capturing enclosing variables at definition time. In Java, for example, every local accessed in an inner class that belongs to an outer class will, in practice, be passed to the inner class at the moment of its creation - think of it as just another argument to the construction of the inner class. C++ is more explicit about which variables it captures, but otherwise it works the same - the lambda object just gets those variables (by value or by reference, depending on the directive) passed to it on creation. In any case the captured object is distinct from the original object after it was captured (they may be both pointers to the same place, but that does not make them the same object), so it shouldn't be hard to parse.
Comment: To help in understanding the point @Oak makes about closures and how they capture variables: I blogged about the same topic here: http://orangejuiceliberationfront.com/what-a-block-really-is/ (I call them "blocks" and "lambdas" there, as that is what Objective-C resp. C++ call them).


Issue with scaling width of background-image (CSS)

Question: I'm havig troubles with an image that, by using "contain" in CSS adds a huge spacing between the top image and the next paragraph. When i use "cover" there is no spacing issue but the pictures width is too high.
I'm using this in CSS
.headerLine{
position: relative;
width: 100%;
overflow: hidden;
height: auto;
background-repeat: no-repeat;
background-position: center top;
background-image: url(../images/bgTop.jpg);
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: contain;

I upoaded pictures for 100% Desktop, using Cover, using contain and one for the wished results here: Description
Answer: Have you considered including the image as an  instead of as a background image? This will cause the headerLine div to dynamically change height to match the child image.
HTML:

CSS:
.headerLine img {
    display: block;
    width: 100%;
    height: auto;
}

Concerning background size from W3 Schools:
Background Cover:

Scale the background image to be as large as possible so that the
  background area is completely covered by the background image. Some
  parts of the background image may not be in view within the background
  positioning area Background cover will scale the image

Background Contain:

Scale the image to the largest size such that both its width and its
  height can fit inside the content area


How to choose a yeshiva for an adult?

Question: Usually a parent would have the job of deciding during their youth where to go and as a result will have a better idea of where he wants to go for adult learning. What do the sources have to say about how to go about finding and choosing the right yeshiva for someone who didn't have the benefit of growing up with a Jewish education?
Comment: I don't think it's true that someone who was brought up with a Jewish education, when it comes time for him to go to _y'shiva_ as an adult (postsecondary _y'shiva_, a/k/a _y'shiva g'dola_), his parent has the job of deciding. Naturally, his parents should advise him to the best of their ability (and his receptiveness), but it's his decision (modulo any financial or other constraints).
Comment: @msh210 edited to make my point more clear. thanks
Comment: two suggestions. 1. a yeshiva which is committed to following halacha. a yeshiva which does not follow halacha is pasul. 2. a yeshiva with people like you studying there. important not to try to jump the ladder.
Comment: Related: https://judaism.stackexchange.com/questions/120794/prerequisites-for-attending-yeshiva-as-a-middle-aged-baal-teshuva/120867#120867
Answer: The main sentence is that "אין אדם למד, אלא ממקום שלבו חפץ" (A person can not study Torah, unless from a place that his heart wants) [Avoda Zara 19 page 1).
So as long as it is a yeshiva that coinsides with the Halacha it is good! Also if you tried it a out a little bit and liked it than better!
Of course there are pros with every type of Yeshiva that are pretty objective. If you ask about Israeli "Dati Leumi" Yeshivas I can give you some main ideas of each one (in the comments).

How to choose a yeshiva for an adult?


I need to restrict the copying and printing of my artwork

Question: I need to restrict the copying and printing of my image files. Please tell me what is the best file format for restricting copying and printing of files?
Comment: Yes its a paper known as a contract or license.  You also need to be able to back it up with legal action
Answer: None.
What you want is not possible.
If someone has the file, they can copy & print it; even if they have to do a screen capture or physical scan to achieve it.
That's why people put watermarks on their images, until paid for.
Answer: Well, if you export PDF's from Photoshop, Illustrator or InDesign, you get the 'Security' tab in the export dialog window, where you can set up a password to protect printing and editing the file. Basicly, without the password, a person can only look at the file, but will not be able to print, make edits or extract data from the file.
Aside from this, a person can always copy the file, email it, make screenshots and so on.
Comment: this will not prevent saving / printing a screengrab of the .pdf while it is viewed.
Comment: Yes, and i did say that in the last line of the answer before the picture.
Comment: my bad, didn't notice that...
Comment: Actually if the user can view the pdf then you can use non adobe versions of PDF tools to strip the encryption. So it does not actually help at all.
Comment: Probably, but this assumes 'normal' people will not go as far as to decrypt passworded files. This is just a first hand protection against printing and editing and I have used passworded PDFs on some occasions, especially with new clients or one off jobs before a certain level or mutual trust was reached and then moved on to unlocked files.
Answer: You can not, it is a logical fallacy. But i would point out that your solving the wrong problem. Quoting myself

You should not be so concerned with others swiping your designs. What you should be concerned is how to find clients and getting paid. Don't fall into the trap of thinking you're going to lose money at this stage from copying, because even if it happens there's no real way for you to turn it into money.
Only care about money you can actually make. You can look at all the virtual money you've lost, but all that gets you is a bad feeling and is nonconstructive. You're not going to be very efficient in converting that effort into more money. So it's waste of your resources.

The thing is if you allow the computer I am using to read the file then I can copy the file because the file I am viewing is a copy. The media industry has spend hundreds of million or billions to collude with hardware manufacturers to make copy protection possible. Yet the fail each and every time.
They fail because it is in fact impossible to do this with the current technological systems. Now to be honest a technique that might make this feasible has been invented a few years back, in theory, its just that it would require a order of magnitude faster computers because it would slow you down considerable*.  So perhaps if you wait 10-20 years.
also don't believe people when they say they can do copy protection. They are either lying, or dont know what they are talking about. Lets take a example:
Even if PDF has a checkbox to do this, it does not actually work. See for it to work it requires that all PDF viewers in the world will respect this flag. This is not possible since there are open source viewers. So stripping the protection of a view only PDF is relatively straight forward.
Now then the only thing that really protects you is the Law, so hone your contracts.
* Given that computers aren't getting orders of magnitudes faster...
Answer: There is no such file format.
Include a human readable copyright notice in your image files and on your website or wherever you publish them for a broad audience.

In case of Photographs keep the original camera raw files and never publish them.
Cut at least app. 10-20 pixel wide rows and columns from the image edges for publication so that you can with ease prove with your camera, the raw files and the additional image information that you're the originator.
Publish for viewing lower resolutions in .jpg or other compressed formats.

If you sell or license the images, there will be contracts involved between you and your customers / licensees covering legal uses.
You may embed invisible watermarking into your images to trace them back to where they were copied or printed from.


Is it possible to reach outer space with this method?

Question: Could we use a hot air balloon to carry a rocket and send it into orbit at a higher altitude? That is, do I need to reach a specific speed to be completely free of Earth's gravity, or can I just ascend to some height?
Comment: I can't really tell what you mean to ask here - if you are asking whether one can build rockets with multiple stages, then yes.
Comment: It's worth referring you to [xkcd-what-if Orbital Speed](https://what-if.xkcd.com/58/).
Comment: Related: http://physics.stackexchange.com/q/29889/ http://physics.stackexchange.com/q/45454/
Comment: hmm ok sorry i will edit my question :)
Answer: What you're describing is called an air launch.See also the Wikipedia article on air launch to orbit. As far as I know balloons are not used because they can't lift heavy enough loads. The launch is generally done using a large airliner.
There is some related discussion in the question Why do spacecrafts take off with rockets instead of just ascending like an aircraft until they reach space?.
At the moment air launches can't handle big payloads, and there are some concerns about safety when launching very powerful rockets. However, as the Wikipedia article mentions, there are studies being done into launching rockets capable of lifting payloads of up to six tonnes. I suspect there is a reluctance to invest lots of money in researching air launches when ground launched rockets are a mature technology and work very well.
Answer: If I am reading your question correctly, I believe you are asking whether or not you can reach outer space by simply ascending to a certain distance rather than reaching a specific velocity--that is, if by climbing in a hot air balloon you can reach a point where the gravitational potential energy is zero.
If this is what you're asking, then there is a speed (known as the escape velocity) you need to achieve to escape the Earth's pull: it is given as
$$
v_e=\sqrt{\frac{2GM}{r}}
$$
where $M$ is the mass of the Earth, $r$ is the radius, and $G$ is the gravitational constant. If you are leaving from the Earth's surface, then it is around $11.2$ kilometers per second. However, if you fly your balloon to a certain altitude and then attempt to fly into space there, you will see a decrease in the escape velocity. You can read more about it on the wikipedia article for escape velocity.
Comment: wow your answer just awesome!, that's exactly what I want, thanks allot :D