Which scale to use to solo when capo'd

Question: I'm trying to write a song using the key of C with capo on 2nd fret (my understanding is that this changes the key to Bb) my question is which scale do I use to solo over this with/without capo? As an experiment if I play on garageband (with capo) and try simple chords on say the piano it sounds terrible even if I change the key to Bb. What am I missing, some logic method is escaping me
Comment: Hi. Putting a capo on the second fret doesn't change the key to Bb - it raises *the key the song would be in with no capo* by two semitones. Are you saying that your song played without a capo is in C? if so, a capo on the second fret would make it D. Or is that not what you mean?
Comment: Maybe you're just bad at the garage band piano...?? I don't think it will make a difference if you transpose ("capo", which is not possible on an actual piano).
Answer: Trying to understand the question! If the guitar is tuned standard, and you play an open C chord, it'll produce a concert C chord. Put a capo on 2nd fret, and play that same shape as if the capo is the nut, it'll produce a D chord.
If that's the case, and the chord is the same as the song's key, you're now playing in D. Thus any solo on any instrument needs to be in concert D also.
With a remote chance that you capo 2nd fret, and play a 'Bb chord', then you're actually playing a C chord. Can't think of any reason why you'd do this, but you're back to square one - concert C, thus any solo will be in C.
As said in comments, a capo will take the pitch/key up by the same number of semitones as number of frets. Thus 2nd fret, plus two semitones (or one tone, e.g. C>D, F>G, Bb>C).
Most use of capo is to keep open shape chords, or change key easily and quickly.
Answer: Even without capo you can play on guitar in any key. Capo is just to make some chords easier to grab and to change the key of whole piece easily.
Determine in which key you are playing without capo and then add X number of semitones where X is the fret on which you put capo. This way you will get the new key :-).

Which scale to use to solo when capo’d


Visual Studio Failing to Create C++ Console Project

Question: I have a problem where Visual Studio will not create a new C++ Console Application project. I can input the project name and location, but when I hit the create button it simply closes the project creator window and reopens it without creating anything. It will do this with both types of the standard C++ Win32 project templates. Everything else works and will load without this error, but for whatever reason Visual Studio will not create Win32 C++ project types. I have previously been able to create such projects in the past; the problem I am encountering is recent.
My version of Windows 10 has recently been updated to the most recent version, but I do not think this will have effected the program. I have tried to run the repair tool included with Visual Studio and running it as an administrator, but nothing has helped. Can you please tell me why Visual Studio might be refusing to create Win32 Projects and how to fix it?
Comment: Try restarting the computer (not shutdown)
Answer: Fixed it. I completely uninstalled Visual Studio and it worked fine after that. Rebooting didn't help; the reinstall did the trick.


How to let site:example.com show results?

Question: I set up a website example.com several months ago but it does not show up in site:example.com, so I submitted it in Google search console. After several days, I saw there were some pages indexed in Google search console, but site:example.com still shows nothing. I want to know under what conditions are the indexed pages shown by site:example.com, or the site: instruction is useless nowadays like the link: instruction?
Answer: You should get at least one result: the homepage.
Check two things:

if the usage is correct, just site: and just the domain name without http/s or www
in Google Search Console type your homepage url at the top, where it says "inspect any URL in..".

If it's indexed (and you say it is), but Google doesn't show it, it may be because it's too new or the domain has some past penalties. Ultimately, turn off the safe search in case it's an adult type of result.
The site: operator is still used, here is the official documentation: https://developers.google.com/search/docs/monitor-debug/search-operators/all-search-site
Comment: site: is not an accurate tool. Use the reports in Google Search Console to know what is indexed. And even that can be delayed from reality.
Comment: The usage is correct, but site:example.com does not show any web page, even the homepage. Inspecting url in google search console shows homepage is not indexed but other pages are indexed. I don't see any sign of penalty in google search console.
Comment: @William See the Limitations section at the bottom of this Google help document on the [site: search operator](https://developers.google.com/search/docs/monitor-debug/search-operators/all-search-site): `The site: operator doesn't necessarily return all the URLs that are indexed under the prefix specified in the query.`
Comment: @dan Yes, I know that. But I'm surprised by the fact that it does not return any url.
Answer: Google is always slow at indexing a new site.  It can take weeks to months before it is trusted enough to be indexed fully.  You need to use the Search Console to find out why.

Try the site:domain command  on other search engines?
Submit to Bing and Yandex.  They both provide better feedback if there are issues with your page, especially Yandex.
Use a site checking tool, I use Ahrefs, it is free for small sites and will provide you with some feedback.


Linux file Recovery

Question: Can anyone help me out in getting back a deleted file in linux.
Instead of giving this command " rm -rvf *~ ", I gave " rm -rvf * ".
Is there any way to get all files back ??
Answer: First think to do is power off the computer to avoid writing in the disk you delete your data.
After that, you can use one of several tools existing to recover. I like http://www.cgsecurity.org/wiki/PhotoRec, but it recover several file types an not only photos :)
You can also do an image of the disc you have deleted the files, and them, with your system up and running recover the files from the image (this works with photorec).
Some time ago I've similar problem and I find several tools to try recover the data. Each tools have some pros and cons. You can check this http://www.h-online.com/security/features/Digital-autopsy-747165.html and you will get an overview how data forensics works and in the last page you have listed some tools.
Comment: PhotoRec is the tool I recommend, so +1 to this.
Answer: I have successfully recovered deleted files from my ext3 partition using ext3grep.

Linux file Recovery


What do you call the crunching sound from bone joints?

Question: When I wake up and do stretching I hear some sounds from my joints. What do you call this crunching sound from bone joints?
Comment: I call it worrying....
Answer: There are different words for it. Chiropractors often call it 'cracking the joints' when they adjust your back or neck. Other words used for this sound are snapping and popping. It is more or less up to you what word you want to use.
"My back often snap during Yoga", "Did you hear how my knee popped?" "You should not crack your neck." Etc. etc.
Comment: Yep, "snap, crackle, pop".
Answer: This answer explains and organizes some of the terms sketchily presented in previous answers, and adds a term or two.
Wikipedia's cracking-joints article says

Cracking joints is the action of moving joints to produce a sharp cracking or popping sound. This commonly occurs during deliberate knuckle-cracking. It is possible to crack many joints, such as...

Besides referring to this noise as cracking and popping, wikipedia mentions the terms clicking
and snapping.
Cavitation, more precisely discharge cavitation, "in joint fluid is thought to cause the popping sound produced by bone joint cracking, for example by deliberately cracking one's knuckles."  Cavitation is "formation and implosion of cavities in a liquid" – that is, bubbles form and collapse, releasing energy and possibly making noise.
Another source of bone joint noise is crepitus, "the grating, crackling or popping sounds and sensations experienced under the skin and joints".  Wikipedia mentions that cavitation, respiratory diseases, and rough surfaces in contact due to fractures or arithritis are some of the causes of crepitus.
Answer: Perhaps you would call it crepitus.
Comment: Oh...be careful with *crepitus*. In *Dorland's Medical Dictionary*, the first definition is "1. the discharge of flatus from the bowels." (I'll let you do the translation into layman's terms.) You could use *joint crepitus* (which is "the grating sensation caused by the rubbing together of the dry synovial surfaces of joints") or *crepitation* ("2. the noise made by rubbing together the ends of a fractured bone.").
Answer: Wikipedia offers Cavitation rather than Crepitus which seems to be more of a grinding noise from worn down joints.


Downloaded theme not functional

Question: I have downloaded a theme. The folder contains app, js, media and skin folders.
I have disabled and flushed all the caches. Then I have copied the theme's folders to Magento root (located in local virtual host 'magento.local') overwriting the existing folders. That caused the site to stop working.
Later, I started to manually copy the files from the theme folders to the corresponding Magento locations so as not to delete any of the existing files and I have put down my theme's name in all of the the 'System -> Configuration -> Design -> Themes' inputs. However the site still has the default look.
I would say, that I should delete some of the default folders in the app, js, media or skin folders but I'm not sure which ones.
Is there any way some of you could help my having these information, please?
Thank you very much!
Answer: You should be able to find corresponding folders in Magento's root for app, skin, js and media.
Theme layout files (app) go in app/design/frontend/THEME_NAME
Skin files (skin) go in skin/frontend/THEME_NAME
The js and media files have their own folders in Magento's root.
Once you have your theme files in place, you should be able to select the theme (THEME_NAME) from admin.
Do NOT delete the base and default theme folders, as these are what Magento falls back on if you have a missing file in your custom theme.
Answer: Where have you put the theme and assets. The theme should be app/design/frontend/ and assets (JS) in skin/frontend/package
Then you can set the design package via the admin.
Comment: You should put your comments in the comments and not the answers section since you technically asked them a followup question.

Downloaded theme not functional


Add border and shadow to the buttons

Question: I want to add medium thick black border and shadow to the buttons that I have added in my iPad application. I have taken those buttons as custom as I have applied images on them. How can I add border and shadow to ht
Answer: To add shadows and border is simple.
1) Add the QuartzCore framework to your target.
2) Import the framework header in the class where you want to add borders and shadows. (Or if you have custom class for the button then you can simple import this framework in that class.)
3) To add the border to the button use this code (where button is an IBOutlet connected with the button in interface):
[self.button.layer setBorderWidth:3.0];
[self.button.layer setBorderColor:[[UIColor blackColor] CGColor]];

4) To add the shadow to the button use the following code:
[self.button.layer setShadowOffset:CGSizeMake(5, 5)];
[self.button.layer setShadowColor:[[UIColor blackColor] CGColor]];
[self.button.layer setShadowOpacity:0.5];

You can play around with the values and see how it will affect the behaviour.
Comment: @PrateekChaubey
Well good to know that it helped you :) ... And yes you can set the corner of the borders to be round rect with the following code

`[self.button.layer setCornerRadius:5.0];`
Comment: Hey arslan, thanks buddy, your code worked. I just had to make some minor changes. I want to know one more thing. Initially my buttons had rounded corners and after applying border using your code, the corners are no more rounded. So how can I make them rounded as they were initially.
regards PC
Comment: I use a custom UIButton class 'UIDictButton'.and use the code to custom my button but there is no shadow.only border. @Arsian if you to set cornerRadius may be you should set maskbouds to YES.
Comment: @frank. Can you share the code you are using to add shadow to your button. You have to play around with the shadowOffSet values in order to get desired result.
Comment: Hello Arslan, do you have idea how to do it with NSButton in Mac app ?
Answer: If you were in Cocoa, you could use NSView's setShadow. (NSView is an ancestor of NSButton.) I don't see the equivalent method for UIView, so I don't think there is any simple way of doing that in iOS. Come to think of it, I don't think I've seen that effect in iOS apps, period.
But since you're using custom button images anyway, why not prepare images that include shadow and border?
Comment: well my designer has not provided me images included with border. I asked him to give me new images but now my manager says that he won't give me new images. I have to apply border and shadow myself.

Add border and shadow to the buttons


Comparing different hashes to confirm they came from the same string

Question: Is there any safe hashing algorithm that returns a different hash each time (like bcrypt) but has the possibility to compare 2 different hashes and determine that they were hashed from the same password/string without knowing this password/string?
Comment: If the "determine" step is efficient, it seems to undo the benefit of the different (salted?) hash output.  Given the hashed password, I could check if it was compatible with the hash of "qwerty", i.e. use my pre-computed hash dictionary.
Comment: Why would you want such a thing?
Comment: I guess one may want such a thing to hash passwords, prevent password reuse and defeat rainbow tables.
Comment: indeed, those are viable options. But I don't have an implementation, just want to know if such technology exists.
Answer: Here's a thought; we work in a pairing-friendly elliptic curve where the discrete log problem is hard, and we generate a 'hash' of a value $p$ [1] by selecting a random value $r$, and outputting the two points $(rG, rpG)$.
Then, given two such hashes $(rG, rpG)$ and $(r'G, r'p'G)$, we can check if they are hashes of the same password by computing the two pairing operations $e(rG, r'p'G)$ and $e(r'G, rpG)$.  If $p = p'$, then both values will be the same, namely the value $e(G, G)^{rr'p}$.
Reversing the hash, that is, given $(rG, rpG)$, recover $p$, is a discrete log problem, this is assumed to be hard.
And, given a long list of hash passwords $(rG, rpG), (r'G, r'p'G), (r''G, r''p''G), ...$, there doesn't appear to be any obvious way to compare all of then against an attacker chosen password with less than $O(n)$ pairing operations or point multiplications.
The attacker can test a single hash $(rG, rpG)$ against a test password $p'$ by checking if $p'(rG) = rpG$; however with any such primitive where there is a primitive to compare hashes, the attacker could perform this test by hashing the password $p'$ and using the comparison primitive to see if that hash matches the one under test, and so this is not a vulnerability.

[1] The value $p$ might be a conventional hash of the actual password; that detail isn't important for this idea.
Answer: Noting that I would not call such a hash function safe, if you knew that the strings you wanted to check were less than $2^b$ in number, you could use a strong (pseudo)random permutation $$\pi:\{0,1\}^b \rightarrow \{0,1\}^b $$
(so you could hide the string or the index to the string) and a hash function $H$ with $n$ bit output (with $2^{n/2}$ bit security against collisions) and output the $n+b$-bit vector:
$$
(H(X) \mathbin\Vert \pi(X))
$$
where $\pi$ should be chosen to hide things such as weight of the vector (a plain bit permutation wouldn't do).
Comment: How does this prevent an adversary from performing offline guessing attacks by evaluating $\pi$ when they compromise the password database?


How do i shutdown my heroku app?

Question: I've slowly battled through to the point where I have a working Grails app on Heroku. I'm going to bed now so I want to shut it down so I don't continue to use up my 750 free hours of my Dyno. It is probably obvious but I can't find how to shutdown my Heroku web server and restart it again in the morning.
Answer: To shut down your Heroku app scale the web processes to 0:

heroku ps:scale web=0

See the Usage & Billing dev centre article: "A web dyno that is idled continues to accrue usage". I believe maintenance mode will continue to accrue time; it simply serves a static page to visitors instead of serving your app.
Keep in mind each app receives 750 free billing hours per month. Depending on your intended usage, this may mean you don't need to shut down (i.e. if you only plan to run a single dyno for the whole month).
Answer: From web:
Personal => Your App Name => Overview => Configure Dynos => Click on edit against web => Flip the switch => Confirm
Comment: Thank you @Sunny, I can't believe they made this so hard to find! It also took more Googling than I care to admit!
Answer: To stop a DYNO you can use:
heroku ps:stop "appname"

To get list of running appnames you can use:
heroku apps

Comment: Looks like the syntax has changed to `heroku ps:stop --app "myapp"`.  Also my web dynos kept magically restarting themselves for some reason, so I went with culix's answer (scaling web dynos down to 0).
Comment: Will this also stop the charges on my database?
Answer: Just read the documentation:
https://devcenter.heroku.com/articles/one-off-dynos#one-off-dynos
Type
heroku ps

to see all running app associated to you account, with an id associated, then
heroku ps:stop run.1

if the app you want to stop has the 1 id.
Note that the maintenance mode will not stop your app. Mine was wrongly configured and continued to crash with the maintenance mode enabled.
Answer: There's a Maintenance Mode in Settings now in 2019.
Comment: Dyno hours get counted even in maintenance mode.
Answer: Maybe turn on maintenance mode? heroku maintenance:on
Comment: @Benjamin I'm not sure this is correct - according to the DevCenter, turning on maintenance mode does not alter your web dynos, it simply serves a static page. I believe hours will continue to accrue unless the web dynos are scaled to 0. I have submitted an answer with this below.
Answer: You can use the add-on AutoIdle to automatically shutdown:
https://elements.heroku.com/addons/autoidle

How do i shutdown my heroku app?


Is there a Language Model that can accept huge corpse of tabular data and answr questions about?

Question: I have been researching Language Models that can work with tabular data. My main goal is to have a model to answer simple questions about my data. An example is having household sales data and asking simple questions like "What was the average sales during the last 2 months?". One of the best models I have found so far is TAPAS. However, it has limitations regarding the size of tabular data. My data size is approximately 1 million rows with 10 columns. Is there a robust model that can perform the mentioned task or is there an alternative approach to this problem?
Answer: Language models will experience difficulties processing in an analytical way tabular data and answering complex questions about it because of how they work (just predicting the next token). Maybe you can achieve some interesting results with really big models but an approach that seems more promising to me is to pass the basic structure of a dataset to the models, like describing what a row and what each column represents, and asknig the model to write a SQL query that answers your questions.
Example: "My dataset consists of household sales data. Each row is a sale and there are 3 columns: SaleID, Price, Year. Write a SQL query that generates the most expensive house sold by year."
Answer: Yes. Use GPT4 to generate code to print output, then it can read and interpret the output. This is already a product offered by a few companies that people use.
I have done exactly what you are describing on datasets that, coincidentally, also have almost exactly 1 million rows and exactly 10 columns.


String of sneeze responses after "Gesundheit"?

Question: Something that's just been nagging at the back of my head for the last decade. In high school, I knew someone who spent a year abroad in Austria, and they taught me that if someone sneezes multiple times, you first say "Gesundheit", then "Weisheit", then "Langes Leben", before no longer responding. (Though, for humor, they would respond to all further sneezes with "Geld".) For years I've just taken that at face value, but on a few occasions I've attempted to Google it and found nothing to support it. Is this an actual colloquialism in Austria, or is this more likely just something she picked up from a small group of people who came up with it themselves?
Comment: It does depend a bit on your peer group - when I was in school (last century), there was a short trend amongst teens of saying "Gips", as a summary of "Gesundheit, Intelligenz, Potenz, Schönheit".
Answer: As a native speaking Austrian, I can confirm that this can happen (I have done it myself too). Although it is not that common and happens only in a environment where everyone is close to each other (friends or family).
I like it to do, if I tell something to a close group and someone interrupts me (multiple) times during the talk. At that point you can wish the interrupting person pretty much everything nice. Like "Gesundheit", "Schönheit", "Weisheit", "Geld", "viele Kinder" and so on.
Comment: Aus aktuellem Anlass kann man "Impftermin" ergänzen.
Answer: As a native German, I can confirm that a variant of this habit is known in the Ruhr area. It might be declining in usage, but I might get that impression because I'm getting older while the youth still may be doing it. I certainly have the impression that everyone who went to school here does at least know this, even if they don't use it.
The variant I know starts with:

Gesundheit (health)
Schönheit (beauty)
Intelligenz (intelligence)

... and mostly stops there, because usually, one does not witness more than three sneezes in a row. But I remember that sometimes, people ponder aloud what comes next. "Reichtum" (richness) and "Sex" (copulation) are only two candidates that I remember.
I always got the impression that those wishes do purport an implied jab of "because you need it", which might be why I've heard it more often in juvenile contexts or among good friends.
Answer: I was born and raised in Austria and I have only ever heard "Gesundheit", "Zum Wohl"
"Helf Gott" and more locally "Wahr ist's".
I was able to find a different discussion on a german website here that corroborates the story though (altough in that forum it's "Schönheit", "Gesundheit", "ein langes Leben").
It seemed like the sotries where mostly around Bavaria (Munich), I definitely wouldn't describe it as "common" since nowadays saying anything past the first sneeze is very rare in my experience.
Answer: I like the "Wahr ist's" one ;) My family and friends start with "Gesundheit", "Schönheit (Beauty)", "Weisheit (Wisdom)", "Reichtum (Wealth)", and then whatever one wishes from there. So I guess there's variants, but it's generally known.
Comment: Welcome to German.SE. It is common that an answer either references to other answers to say "part x is answered there, I answer part y" or only to the question. So I prefer to delete the first sentence and the smiley. SE is more "trocken".
Answer: This is just a supplement to orithena's answer. I think it is widely practised in Germany to replace "Gesundheit" by other words like "Schönheit", "Weisheit" or anything else (in fact, there are no limits to your imagination) if someone sneezes more than once.
BUT: Only say this to close acquaintances (relatives, friends, sport comrades etc). It would be a faux pas to say it to strangers or in official meetings.
Answer: In my personal experience – mainly Bavaria and Rhineland-Palatinate – there is near-universal agreement that the first sneeze (typically) gets Gesundheit as a response and the second sneeze gets Schönheit. It would not be entirely uncommon to continue from there (my mother, for example, would continue with and a rich pharmacist towards friends or other family members, referring jokingly to the guy she married), but unlike the first two I am not aware of any ʻset' order.
In Bavaria, these first two are the basis of a number of joking responses after the first sneeze such as:

Schönheit, gesund wirst du von alleine

Schönheit, gesund bist du schon

and probably more.
Note: All responses except for Gesundheit are informal and should be used with appropriate caution.


Battery as reference voltage

Question: I am fooling around with a solar panel and I am trying to make a circuit, which would monitor its voltage and eventually switch the load on and off.
The thing is, I don't have a good "reference" voltage to compare with. The solar panel can produce anywhere from 0 to ~20V. If it is high enough I can use zener or even voltage regulator, but when it is (almost) dark both of these options will drop in voltage.
So, I was wondering if it is a good practice to use a battery (like a coin cell or something) just to feed one input of a comparator. It doesn't need to be precise, and I think there will be virtually no drain from the battery, so it will last very long.
Another option is to stick with the zener and abuse the gate threshold voltage of the NMOS (whos gate is connected to the comparator output). I mean, if the comparator outputs either ~0V or the zener voltage and that zener voltage drops low enough, the MOSFET won't turn on anyway.
I will probably ask a separate question with more details of what I am trying to do and whether it makes sense at all, but right now I am just asking whether using a battery as a reference voltage for a comparator (and nothing else) is something common, does it make any sense, etc.
Comment: This sounds infinitely much like fixing a problem that doesn't need fixing. When your solar panels output less than 1V, what, exactly, are you turning on/off with the ouput of the comperator? The answer is either: Something powered by something else -> Supply for your reference. Or: Nothing, because there is no power -> Why the hell do you need the comparator then in the first place?
Comment: There are a lot of pitfalls associated with switching a load connected to a solar panel based on voltage. For example, when you disconnect the load, the panel voltage will typically go up by a lot. This may cause your simple comparator to reconnect the load (after some odd microseconds). But reconnecting the load will cause the voltage to drop back down, so your comparator will disconnect again, etc. This is an oscillation, and can be bad or undesireable for lots of reasons. There are various ways to deal with it, but they can't be explained in a comment.
Comment: @mkeith: Actually, this is exactly the effect I am hoping to abuse - by rapidly switching the load on and off I could keep the panel near its "maximum power voltage" region, hopefully squeezing a bit more power in less-than-optimal conditions. Most probably I would be just wasting power, but it is still fun to try and experiment. I could even learn something in the process. But I agree with you - this is another topic, which I intend to post as soon as I've made up my mind enough to ask a meaningful question :)
Comment: In order for this to work well, you will probably want to use a capacitor on the solar panel side, and an inductor, diode and capacitor on the load side. Basically you are going to be designing a hystertic buck converter that maintains Vin at Vpp. The only practical application I can think of for this is a solar battery charger. An interesting idea that can probably be made to work. You will need to work out a way to avoid over-charging the battery.
Comment: Why not just combine the two - a small re-chargable battery and a precision voltage reference run from it to get you over those long winter nights.
Comment: @JImDearden: That's actually very smart - I should have thought of that myself :) I think in general that's the right thing to do if you need the precision and have the proper parts.
Answer: Don't use a battery as a voltage reference.  To quote my firmer boss and mentor: "Battery voltage is a nonlinear function of everything. [That includes temperature.]"
Zener voltage reference, or a bandgap voltage reference would work for you.  They are available in a variety of voltages.
Keep in mind also that most A/D converters inside microcontrollers have a built-in voltage reference, which can be enabled from code.
Answer:
Actually, this is exactly the effect I am hoping to abuse - by rapidly switching the load on and off I could keep the panel near its "maximum power voltage" region, hopefully squeezing a bit more power in less-than-optimal conditions.

What you are after is called MPPT or Maximum Power Point Tracking:

Solar cells have a complex relationship between temperature and total resistance that produces a non-linear output efficiency which can be analyzed based on the I-V curve. It is the purpose of the MPPT system to sample the output of the PV cells and apply the proper resistance (load) to obtain maximum power for any given environmental conditions.

Of the three types listed, "perturb and observe" most closely matches what you are attempting.
You certainly could use a battery as a reference, but batteries are inherently non-linear, the panel output will be non-linear, and the load will likely be also. That's a whole lot of variables which will likely make the system highly unstable and unpredictable. I'd suggest researching MPPTs and see what others have done for more ideas.
Comment: A specific solar cell will have a specific maximum power voltage that doesn't vary too much with light level. So it is half-way decent to regulate the panel voltage. There are some MPPT units that do this. But this only makes sense when the load can absorb the maximum power for long periods of time. The load power will vary with illumination level. I think it is a decent idea for a battery charger.
Comment: Being far from expert, I think what I am trying to do is a poor man's "Maximum Power Point Control", not MPPT ... the difference (in my head) being that I am not trying to actively track the MPP but instead just assume it is somewhere around a known voltage (17.5 according to  the panel specification and more like 12.5 according to my measurements) and try to keep the panel voltage close to it. I realize that even if it works it would be pretty bad compared to off-the-shelf solar charge controllers, but my goal is to experiment and learn, I don't really plan to use it for anything specific.

Battery as reference voltage


Gravitational waves detection using lunar retroreflectors

Question: According to Wikipedia, the wavelength of a gravitational wave is about 600,000 km.  The Earth moon distance is about 384,400 km.  Considering that the latter is roughly half the former, it seems to me that there would be an instant during which the space between Earth and moon were almost entirely squeezed or stretched as a gravitational wave passes through the Earth moon system.  I'm curious why the lunar reflectors cannot be used to detect those waves more cheaply and easily than LIGO, the kilometer long dedicated interferometer that actually succeeded in detecting them.  To do so, it needed to detect space-time variations on the order of a hundredth of the diameter of the nucleus of a hydrogen atom (2.40×10−15 m).  Considering the ratio of 600,000:1, wouldn't a retroreflector detection require about 600,000 times less resolution/accuracy than LIGO (1.44x10-9 m), achievable without a super-sensitive interferometer?
Comment: The [LISA](https://en.wikipedia.org/wiki/Laser_Interferometer_Space_Antenna) concept has a constellation of three spacecraft arranged in an equilateral triangle with sides 2.5 million km long.
Comment: Well, $10^{-9}$ m is about $10^{10}$ times smaller than the daily change in surface-to-surface distance caused by tidal forces in the solid earth and moon, so that is still going to need some pretty exotic instrumentation to measure it!
Comment: Could one not make use of an Earth orbiting satellite and take advantage of the fact that the tidal change is very slow compared to the passage of a gravity wave?
Comment: As I understand it, gravity waves are detectable because the universe shortens in the north-south direction at the same time that it lengthens in the east-west direction (this having to do with the fact that space-time is described by a tensor, or because gravitons are spin 2, or whatever your choice of reasons is).  So you need two sensors, ideally at right angles to each other.  So your idea would work, if only we had two or more moons.  It could be that if we put retro-reflectors at the moon's Trojan points that we could do this.  I don't know if it's been considered.
Comment: Or a single additional micro satellite to position an additional retroreflector at a suitable position in space, perhaps in lunar orbit.
Comment: There's a difference between a "gravity wave" (occurs in water) and a "gravitational wave" (ripples in spacetime itself).
Answer: There are a few issues with what you've described.  In no particular order:

The length of the arms determines the frequency of wave that can be detected.  So, for example, LIGO (ground-based) and LISA (proposed space-based) have vastly different length of arms.  That doesn't change the resolution, it changes which frequencies each detects / would detect.  This is analogous to changing the length of your antenna for electromagnetic waves.  You need a different size antennas for different frequencies of radiation.  That does not by itself say how good your amplifier has to be to detect small signals in any particular frequency.
Related, you'd have to check to see if there are plausible astrophysical sources of gravitational waves at the frequencies to which your moon-reflector system would be sensitive. (I don't know the answer off-hand because it's not a length that I've thought about much.)
You still need extreme resolution.  I'm not exactly clear what you meant with the ratio you stated, but you seemed to think you could have a less sensitive instrument because of different length arms.  That's not the case - you still need very sensitive measurements of change in distance.  Ala what's above, you've changed the frequency to which you're sensitive but not necessarily the tolerances on the arm-length change measurement.
The moon is seismically active.  I'm not expert on moonquakes, but I think it's likely that it's active enough to blow out your tolerance on the measurement, keeping in mind the extreme measures that LIGO takes to isolate itself from seismic noise and the fact that moon reflectors were put there in the 1960s with no thought for this type of precision.
You need a differential measurement in different directions.  LIGO uses two arms.  LISA has three legs, although interferometry is done pairwise on them.  You'd need to put something in orbit at a comparable length in order to have your second leg.  That's its own engineering feat. (Not necessarily impossible, but not as ready to go as you might hope.)
Assuming you are sending the laser beams from earth, you need simultaneous line of sight from the ground station to both the moon and the end of your new leg.  That's going to be a problem if you want continuous coverage.
You'd need an extremely good model of atmospheric effects on the propagation of the laser beam as these are probably bigger than the change in distance that you're trying to measure.  (LIGO pumps the arms to vacuum.  LISA would operate in open space.)

I could probably go on, but this may give the idea that what you're suggesting is much more complicated than perhaps it seemed at first.
Comment: An important one you missed: light intensity. The LIGO arms store lots of laser power, but the lunar laser ranging only became feasible about a decade ago when, after decades of effort, the team's started to get more than one photon on average reflected from each laser pulse.
Comment: Yes, that's a good one too, @rob.  I'll give it a little time but I may add to the list if there are other suggestions.  I definitely did not intend for this to be an all-inclusive list.
Answer: Gravitational waves are transverse, not longitudinal. You're talking about comparing the earth-moon distance to the wavelength, but if the direction of propagation is parallel to the earth-moon line, then there is no effect.


How to apply texture based on normal coordinate?

Question: I'm working on a project where I need to place two different texture one on the blue side and another on the pink side based on the output of Normal Coordinate from the Texture Coordinate node (See image below for better understanding) but I'm not able to figure out how to do that. Is there any way to separate the normals to use in a Image texture so it will only apply to normal value not the other one.
Answer: Texture coordinate/normal is just the object space normal.  You can use the dot product with an arbitrary, unit-length vector to sort the samples into two parts: those that are facing the arbitrary vector will have a dot product >0; those that don't, won't.  You can use a math/greater than node to mix between two image textures like so:

Faces pointing toward object +X (arbitrary vector 1,0,0, the +X vector) will use the second image, while other faces will use the first image.
Comment: Thanks a lot, I appreciate you for your time for helping me.


Pie chart howto in Rascal

Question: I was wondering if there is an option to create pie charts in Rascal.
It could be done by making separate pie slices but there is no angular option with the ellipse() method. There was a former Wedge() method, but that has been removed from the library.
Answer: The short answer: in the currently distributed visualization library  of Rascal there is no possibility to draw pie charts.
The longer answer: we are working on a new version that includes Google Charts (and hence also pie charts). Unfortunately, that does not solve your problem today.

Pie chart howto in Rascal


Is there a way to make a kill shooting through a tank window?

Question: Is it possible to kill a passenger or the driver of a tank shooting through a window with a scout rifle? Or I can only attack the tank in the normal way?
Comment: K bullets work against tanks, but I want to know if a clean shot through the window can reach the passengers.
Answer: Provided you are playing as the scout class, yes bullets can penetrate into the tank and kill the people inside.
Answer: Basically you can deal damage while any parts of their character body are visible. So if you are going for a clean shot just through the tank window, yes, it is quite possible to kill your opponent.


Azure build fails after Git push

Question: I have a web site setup in azure, which is configured to do deployments after I commit code to Git. Synchronization part works fine, as Azure is able to auto-detect pushes to Git and starts a build.
However, build fails with following error message:

EastVisionSystems.Util -> C:\DWASFiles\Sites\TheCastOd\VirtualDirectory0\site\repository\Platform\project\EastVisionSystems.Util\bin\Release\EastVisionSystems.Util.dll
SGEN : error : An attempt was made to load an assembly with an incorrect format: D:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\mscorlib.dll. [C:\DWASFiles\Sites\TheCastOd\VirtualDirectory0\site\repository\Platform\project\PaypalPaymentModule\PaypalPaymentModule.csproj]

Needless to say that solutions builds just fine on local machine. I can even deploy from Visual Studio to Azure and site runs OK.
I'm using VS 2010 Ultimate and targeting .NET 4.0. Configuration Manager is setup for "Any CPU".
Any help would be greatly appreciated.
Answer: This is a known issues per Microsoft. Should be fixed in 4-6 weeks.
Posted same question at MSDN

Azure build fails after Git push


Trust and interrupted user journeys

Question: I'm considering a user journey which will be hosted on a single site, but will launch into another site (e.g. PayPal) for the user to make a payment. I'm concerned that launching into a different site midway through a user journey may have a detrimental impact on trust. Is there any research available (or even anecdotal evidence) to support or reject this idea?
Comment: +1 Good question. I'm interested in the answers you'll get. Many workflows do this, including one in a project I'm currently associated with. But I've never seen any research on how users perform.
Answer: It's complicated
The fact that you're integrating with a third party means that you are, to some extent, reliant on the credibility they bring to the table. Are they recognized, trusted, reliable?
In PayPal's case the experience is awful but recognition is ubiquitous. Their miserable bounce around UX is how they choose retain control over brand and security. If you changed that workflow, PayPal users would wonder why your path deviates from their past experiences. PP doesn't give partners the option to deviate. They also have the scale and market recognition to make that demand. And some would argue that the simple presence of their logo brings credibility to your experience.
If you have to jump domains because of business or systems limitations, just be sure you keep the user informed. They need to know what to expect and understand why the hand-off is happening in the first place. Put it in positive, user-centric terms and most importantly make sure you're partnering with someone worthy of your user's trust.

Trust and interrupted user journeys


Creating a SMOOTH cylinder for 3D printing

Question: I understand that modifiers will create a smooth surface on cylinders for still works and animation but how do I achieve this for 3D printing? Also, do I need to be mindful of making a cylinder with more vertexes (64 instead of 32) to achieve this end?
Comment: The surface detail will mostly depend on your 3D printer, not the base model. Usually it's next to impossible to have a smooth surface but you can use tools to smoothen the surface after printing. Also the number of vertices to achieve a smooth surface will depend on the actual output scale of your model, and the printing settings when converting the mesh to machine code.
Answer: You can have hundreds of vertices to get a smooth cylinder, if u  like. There is no limit. The slicing program you use  might  get  slow  if  you have many verts(>100k on my machine), but it will  work. Modifiers only change the look of the object unless you apply them, this option is in the down pointing angle to the right  on the  modifiers. To add many verts to a newly created cylinder will give you  a similar result to applying a modifier. Look at the mesh in edit mode to see what the applying of the modifier did.
The resolution of most 3d printers are  such  that  a round  object will be perfectly round if the mesh in  blender has enough  resolution.
Comment: I have cylinder that will be rotating inside a hollowed out cylinder, much a like rod inside a collar joint. The cylinder inside the hollowed out cylinder must be a tight fit yet rotate effortlessly. I have 128 vertices now for both objects. Do you recommend upping the vertices or using a modifier to achieve this?


Counting points and lines in a plane

Question: Let $P_1$ be a set of 4 points in the Euclidean plane.  Formally, $P_1$ determines a set $L_1$ of 6 lines, which then determine only 3 points not already in $P_1.$  Let $P_2$ be the set of 7 points thus far determined.  Formally, $P_2$ determines only 3 lines not already in $L_1.$  Let $L_2$ be the set of 9 lines thus far determined.  Continuing in this manner determines sets $P_n$ and $L_n.$  What can be said about the cardinalities $|P_n|$ and $|L_n|$?
Comment: I assume you want $P_1$ to be generic; the counts go down if three points are collinear or are vertices of a parallelogram (though the latter degeneracy can be removed by working in the projective plane instead of the Euclidean one: in the projective plane,  all $P_1$ in general linear position are equivalent).
Answer: The question is discussed in Cooper, Joshua; Walters, Mark; Iterated point-line configurations grow doubly-exponentially, Discrete Comput. Geom. 43 (2010), no. 3, 554–562, MR2587837 (2011f:51016). I quote from the review by Tamas Szonyi:
Consider a quadrangle as the starting configuration (stage one). In each stage the process considers the lines joining pairs of points that were constructed in the previous stages and adds the (affine) intersections of these lines. The starting quadrangle has to be in such a general position that no lines in any stage are parallel.  The main results of the paper give doubly exponential upper and lower bounds on the number of points at each stage.
A preprint is also available on arXiv. See also https://oeis.org/A140468 and https://oeis.org/A243707. https://arxiv.org/abs/1406.5157 is entertaining.
Answer: As Noam Elkies commented, some arrangements allow for three points on a line, or more than two lines meeting at a newly created point. Combinatorially, and assuming such coincidences do not occur, n points determine $m=\binom{n}{2}$ many lines with each of the $n$ points on $n-1$ distinct lines, and the $m$ lines then determine $m(m -2n+3)/2$ new points, as a line intersects $2n-4$ other lines in its two old points.
However, each new line contains many of the new points, so the above when iterated provides a poor upper bound. If I can, later I will look at point-line incidences to see how to refine the above observations.
Gerhard "Geometric Lattices Can Grow Quickly" Paseman, 2018.07.18.

Counting points and lines in a plane


Does the Guards And Wards's Gust Of Wind effect tamper with the Guards And Wards's fog effect?

Question: In Pathfinder the spell Guards and Wards creates - among many other effects - magical fog inside your fortress or lair. In addition you can add one of five effects, one of which is a Gust Of Wind in a corridor. Now, does that Gust of Wind effect disperse the fog as normal fog even though it was created from the same spell and caster, or is the fog one of a kind so that it can't be dispersed by wind?
Answer: Yes, it does
The fog effect created by Guards and Wards affects all corridors in the structure protected by the spell.

Fog: Fog fills all corridors, obscuring all sight, including darkvision, beyond 5 feet. A creature within 5 feet has concealment (attacks have a 20% miss chance). Creatures farther away have total concealment (50% miss chance, and the attacker cannot use sight to locate the target).

However, the Gust of Wind effect will affect a single corridor or room, and no exception was given about how it handles the fog created by the spell. As such, if placed in a corridor (and not a room), the spell will behave normally and blow away the fog in that corridor:

In addition to the effects noted, a gust of wind can do anything that a sudden blast of wind would be expected to do. It can create a stinging spray of sand or dust, fan a large fire, overturn delicate awnings or hangings, heel over a small boat, and blow gases or vapors to the edge of its range.
Answer: This GM would have guards and wards' fog unaffected by any gust of wind
While the spell guards and wards does create a magical fog throughout the warded area, that magical fog's entire description is this:

Fog fills all corridors, obscuring all sight, including darkvision, beyond 5 feet. A creature within 5 feet has concealment (attacks have a 20% miss chance). Creatures farther away have total concealment (50% miss chance, and the attacker cannot use sight to locate the target). Saving Throw: none. Spell Resistance: no.

Later the spell says, "A dispel magic cast on a specific effect, if successful, removes only that effect."
Unlike, for example, the effect of the spell fog cloud that a "moderate wind (11+ mph) disperses… in 4 rounds [and] a strong wind (21+ mph) disperses… in 1 round" and other similar spells like obscuring mist, veil of ash, and even mind fog, there's no mention in the guards and wards spell of winds of any kind having an effect on the magical fog created by the spell guards and wards.
In short, because the guards and wards spell's magical fog effect doesn't mention being affected by wind, this GM wouldn't have the guards and wards own gust of wind effect (or, for that matter, any other gust of wind effect) "blow [the fog] vapors to the edge of its range."
This means wanderers within a guards and wards magical fog effect must tough it out or negate the fog effect with a dispel magic spell, the 6th-level spell's fog effect remaining in place in the face of any wind effect… which, to this GM, seems appropriate for a spell of its power and limited utility.
However, this player wouldn't flip the table and leave the campaign of a GM who ruled that the guards and wards spell's own gust of wind effect effectively leaves one place in his PC's stronghold fog-free like this fine answer suggests. I mean, seriously, it would take highly unusual circumstances for this player to have his PC pick the gust of wind effect when the guards and wards spell makes available deterrents that are bigger (like stinking cloud), deadlier (like suggestion), and creepier (like magic mouth).


How to put interface created with JavaFX on C code?

Question: I am creating server/client application. The server and client parts should be written in C language. However, for user interface I would like to use javafx. So, the question is it possible to combine javafx with C? If it is, then how do i do this in a proper way?
Comment: see [Why is "Is it possible to…" a poorly worded question?](https://softwareengineering.meta.stackexchange.com/a/7274/31260)
Comment: You can [call C functions from Java](https://stackoverflow.com/questions/5963266/call-c-function-from-java), but that's as close as you're going to get.
Answer: Nope, JavaFX is a Java API. You cannot use it from C. While you can use C and Java in the same process e.g. by creating JNI bindings, that requires substantial development effort and implies some performance overhead, as JNI has to copy all data between its C representation and its Java representation. It would likely be much easier and result in a much more stable program, if you either

write your client completely in Java, or
write your GUI in C or C++ as well.
Answer: So you are writing a program in C (your client code probably) and you want to add some user interface to it.
Notice that the C11 standard (read n1570) provides very limited features for user interaction (basically, program arguments and <stdio.h>). You probably want to use some external library, which usually would be operating system dependent.
You could at first consider making a command line program. Then your C program simply parses the program arguments given to it (i.e. arguments to main) and act accordingly. Even that is often OS specific, but this answer provides some guidance. FYI, the GNU Glibc library documentation has a chapter on parsing program arguments.
You might also define some syntax and semantics for your standard input, and use common parsing techniques on it. You could use recursive descent parsing techniques. But that might not be very user friendly (because your user could not easily edit his/her input).
On many systems, the user could interact with your program thru a terminal emulator (which is much more complex than what <stdio.h> provides). On Unix or POSIX systems, read about the tty demystified, and use libraries like termios(3) or preferably ncurses (or at least readline).
You could consider providing some GUI. In practice, you then need to use some toolkit, like GTK (or Qt in C++) or libSDL.
You might expect your user to use his/her web browser. Then you want to add some Web interface. For that, you should make your C program a specialized web server, using some HTTP server library like libonion or libhttp. Of course, you then need to be familiar with web technologies, including HTTP, HTML5, CSS, AJAX.
Since you mention JAVAFX in your question, you might split your software in several processes doing inter-process communication (then you would have a user interface program written in Java communicating with your C programs; how that is achieved is operating system specific).


How to check the bootnodes configured in my node

Question: Sorry if it's a very basic question, but I can't find it. I'm configuring a regular node in a private quorum network using geth. The node is not synchronizing and I'd like to check the bootnodes configured in the node. How can I get them?
Answer: I am not sure if there is a way to find it via command line directly.
However, when launching the node, you migth have the bootnode address indicated:
For example:
<code>geth --a buch --of parameters --bootnodes **'BOOTNODEADDRESS'**
</code>


Object turns black when selecting the new image to which texture will get baked to in Blender Internal

Question: There are many questions relevant to baking in blender internal mode. But i could not find any solution to my problem.
After creating the object I unwrapped it and saved the unwrapped image with a name. Next, I assigned a image texture in the texture properties panel.
Next, I selected the image texture from the drop-down menu in the UV/Image editor and the texture is getting applied.
Then, to bake the texture, I created a new image, and just when I am selecting the new image, the object is turning black. I can't proceed to bake any further. Still it's showing that no images found to bake to.
Comment: Can you upload the .blend? http://blend-exchange.giantcowfilms.com/
Comment: Ah yes, I uploaded the file [](https://blend-exchange.giantcowfilms.com/b/5039/)
Comment: textures arent saved..."File"->"External Data"->"Pack All into .blend"
Answer: If you Shift+ Z You will switch to "rendered shading mode" instead of "material shading mode" and will see the texture.
After you bake it, it should be viewable in material shading mode.
Your texture wasnt attached to the file, so I found a random one online
Comment: Great! that works. Maybe the problem was not creating a new UV map!  I face difficulty in executing the steps one after another. : )


Trying to set date on a Linux based machine from another machine

Question: I am running busy box on an embedded platform. I would like to set the date on the box properly each time I reboot the hardware. I have no way to save the time persistently, so am reduced to setting the time each time. I have LAN connectivity for it, but no SSH. My current hack for this is to redirect the output of 'date' to a file on my PC, access that file from my hardware platform through tftp, and then somehow parse the file, use its contents and then to set the date. I have no idea how to get the string from the file and then set it using the 'date' command. Any help would be appreciated. Any other way to set the date would be get. I have tried using ntpd, but that fails due to lack of internet connectivity
Comment: If you have a network connection to "another machine", you can run the ntp server there, and the ntp client on your "board".
Comment: In the old days, we used `rdate -s`.  That was before ntp came along.
Comment: @PaulTomblin I still use `rdate` for the simple clock corrections that I need on my desktops.
Comment: Thanks for the answers. rdate is not available on my platform. Also I cant use ntp, since I cant access internet on the board. I am more interested in a way to be able to parse the output of date from another machine and set that here at the moment
Comment: When I execute ntpd--help, the output I get is the same as at [link]http://lists.busybox.net/pipermail/busybox/2010-August/073087.html. (Link used for readability)  So I guess I will have to used ntpd -p IP
Answer: NTP (Network Time Protocol) is the standard way of getting the date. On a BusyBox system, you might want to use ntpclient.
You'll need an NTP server somewhere on the network.
Answer: To use the Network Time Protocol on the embedded machine, just run some lightweight NTP daemon (server) locally on your LAN - for example on the machine that you are currently trying to use for synchronization. Most, if not all distributions have packages like openntpd or ntp that provide an NTP server.
If you still insist on parsing the output of date, the best way is to use the generic +%s (seconds since 1970) format for both output and input. To do so, on the date source side use date +%s to obtain the date string and on the busybox machine, run date -s "@$VALUE", where $VALUE should be replaced with the value received from the source. Note that this approach must end up in results skewed because of communication and command execution times (which are both minimized when you make use of NTP).
Comment: Thanks for the hint on the date parsing.I will be using that as a fallback. I am aware that skewed times will be obtained, I am using this option as "Something better than nothing" ;-)  I will be trying to get a ntp server working on my LAN.
Answer: Using a cron job, you could write a file to your /tftp directory with a granularity of 1 minute.
* * * * * date "+%m%d%H%M%Y.%S" > /tftp/currdate.txt 2>/dev/null

The contents of that file are a single value, which is formatted conveniently in the same format the date command needs to set the date/time.
bash$ cat currdate.txt
102600052011.00

On the busybox side of things, you could just tftpget the file, and process it
cat currdate.txt | while read date; do
    date $date
done

If HTTP is an option, you could set up a php script that just returned the date when called, and have your script on the busybox side poll that URL, and process the result.  The granularity of the date would be closer, in that case.
With TFTP, you'll be within 1 minute.  Hopefully that's close enough.
Comment: This is in short what I was looking for. I know that running a NTP server is the best solution, but in my current scenario, this will do. I didnt know about cron jobs and the script to parse the date helped. It works now. One change I did, was I wrote a script to update the date, and scheduled that script in the cronjob. The way you wrote, didnt work for me
Answer: You can also use:
# ntpd -q -p ntp-server-ip-address

ntpd will update the time and quit afterwords. You can have your firmware execute this on every boot for example.
Answer: As per your comment.

Thanks for the answers. rdate is not available on my platform. Also I
  cant use ntp, since I cant access internet on the board. I am more
  interested in a way to be able to parse the output of date from
  another machine and set that here at the moment

The solution to your problem is to setup another machine on your LAN as a time server -- that machine should (preferably but not strictly necessarily) have access to internet, so that it itself can synchronize with an external time source.   the NTP server can configured to broadcast the clock on the LAN (1 UDP packet every 5 minutes or so), or it can just be a server which is accessed on request -- your choice.
The your busy-box which has LAN access (but not internet access) can be installed with a NTP client which picks up the time from the broadcast OR just asks your LAN server for the time when needed.
Answer: Another option:
date `ssh username@host date "+%m%d%H%M%H.%S"`

Remember to put your ~/.ssh/id_rsa.pub contents in user@host's .ssh/authorized_keys file.
Comment: The OP states to have no SSH connectivity on the machine.


Show that a continuous function f either has a root hence $f(c)=0$ or $|f(x)|> e$ for $e>0$.

Question: From what I understand, I am being asked to show that a function $f$ on an interval $[a,b]$ either has a root $c$ such that $f(c)=0$ or it does not have a root hence $|f(x)|\ge e$.
Should I apply the Intermediate Value Theorem for the first part?
Answer: This is a consequence of the continuity of $f$. Since $[a,b]$ is compact, the function $|f|:[a,b]\longrightarrow \mathbb{R}, ~x\mapsto |f(x)|$ attains its minimum on $[a,b]$. Note that $|f(x)|\geq 0$ always holds.
If the minimum of $|f|$ is zero, you have $f(x)=0$ for some $x\in [a,b]$, hence $x$ is a root. If not, the second part holds by the definition of a minimum.
Answer: Let $f:[a,b]\to\mathbb{R}$ be continuous. We want to prove that either
$(a)$ there exists $c\in[a,b]$ such that $f(c)=0$
or
$(b)$ there exists $\varepsilon>0$ such that $|f(x)|\geq\varepsilon$ for all $x\in [a,b]$.
It is enough to prove that if $(b)$ is false then $(a)$ is true (or vice versa).
Assume $(b)$ is false. Then, for all $n\in\mathbb{N}$, there is $x_n\in[a,b]$ such that $|f(x_n)|<\frac{1}{n}$. It follows from the Squeeze Theorem that $\lim f(x_n)=0$. Since $[a,b]$ is compact, there exists $c\in[a,b]$ and a subsequence $\{x_{n_k}\}$ of $\{x_n\}$ such that $\lim x_{n_k}=c$. As $f$ is continuous, we conclude that
$$f(c)=f(\lim x_{n_k})=\lim f(x_{n_k})=0$$
and thus $(a)$ holds.
Answer: It is continuous so for each $x\in\mathbb{R}$, f is defined and has a value like $y\in\mathbb{R}$. Using $x$ and $y=f(x)$, f can be represented in a cartesian system. It is clear that $\exists{x_1,x_2}: f(x_1)<0<f(x_2) \implies \exists{x_3}: f(x_3)=0$ because at some point f has to move from $y_{>0}$ part of the plane to the $y_{<0}$ part and since it is continuous, there has to be a defined point along this transition that actually crosses $x$ axis and that would be our $x_3$.
For the other part, $\nexists{x}: f(x)=0 \implies \forall{x}: f(x)<0 \:\lor f(x)>0$ this is obvious, that if some function doesnt contain 0 as the result, it either has to result in negative or positive number even if it is not continuous. then it's obvious that $\forall{x}: f(x)\ne0 \implies |f(x)|>0 \implies \exists\varepsilon:  |f(x)|\geqslant\varepsilon>0$, even if they are not continuous.
Answer: Two basic properties of a continuous $f:[a,b]\to R$, with $a<b$ :... (1).$ M=\max \{f(x) :x\in [a,b]\}$ and $m=\min \{f(x):x\in [a,b]\}$ exist....(2).The Intermediate Value Property (IVP) : $$\{f(x):x\in [a,b]\}= [m,M].$$ Therefore, since $m\leq M$, we have $$ 0 \not \in [m,M] \iff (M<0\lor m>0).$$ Now if $M<0$ then $$x\in [a,b]\implies f(x)\leq M<0\implies |f(x)|\geq -M>0.$$ While if $m>0$ then $$x\in [a,b]\implies f(x)\geq m>0.$$ On the other hand, by the IVP we have $$0\in [m,M]\iff 0\in \{f(x) :x\in [a,b]\}\iff \exists x\in [a,b]\;(f(x)=0).$$


Can light be warped by a magnetic field?

Question: I was thinking and came up with the question "Can the path of a photon be warped by a strong magnetic field?" I tried searching online for an answer but couldn't find much scientific evidence of it being possible or not.
So is it possible?
Comment: There is the Zeeman effect, but that's more a dispersion of the light, I believe
Answer: No. It is not possible without some complicated interactions with matter.
Maxwell's equations are linear. Which means that the superposition of two solutions is another solution. Physically,this means that if you have a laser beam traveling along, and you put a strong magnetic field in its path... the resulting field will be the laser + the magnetic field, with no change at all in the laser. The two are superimposed with no change.
If you have matter, it's a different story. The matter is already vibrating/doing its thing due to the laser, and the added magnetic field can change the properties of the matter, which changes how it reacts to the laser, etc.
Comment: Don't you know about the Faraday Effect that has been a validated proof that magnetic fields affect EM propagation vectors since Faraday discovered the phenomena and successfully reproduced it in experiment? The Faraday effect causes a rotation of the plane of polarization which is linearly proportional to the component of the magnetic field in the direction of propagation.
Answer: NB this is just a footnote to NeuroFuzzy's answer, and you should accept his answer not this one.
NeuroFuzzy says a magnetic field cannot bend light and I agree but ...

An electromagnetic field of sufficiently high strength will cause spacetime curvature. For magnetic fields this isn't a simple issue, as discussed in Does strong magnetic field cause time dilation?, because in practice you cannot separate electric and magnetic fields. However given that anything capable of generating a very strong magnetic field will cause curvature that means light rays will not follow straight lines.
If axions exist then in a sufficiently strong magnetic field photons can convert into axions, and this affects the propagation of the light. The CAST experiment is looking for exactly this penomenon. My recollection is that a few years back it looked as an effect had been detected, though it was later dismissed as a systematic error.

Both of these are vanshingly small effects (if they exist at all in the case of axions) and they don't invalidate NeuroFuzzy's answer. Still, it's these sorts of esoteric phenomena that make physics fun.
Comment: Less esoteric suggestion: on the quantum level, you'll start the effects of (virtual) matter in loop corrections even if you start with photons only. Imagine an (effective) four-photon vertex caused by an electron loop.
Answer: The similar to questions of the form "What is the charge of the photon?", "How do photons interact with electrons [if they have no charge]", and so on. A "photon" is a relatively complicated notion, as it lies somewhere in between the small wave description (it's supposed to be a plane wave, otherwise it's not an eigenstate) and the large scale point description (because usually we want a photon of finite radius).
A photon is just a wave of oscillating electric and magnetic fields, and since electric and magnetic fields combine linearly, they will not interact. Consider a long slinky. A photon would be a standing wave: a persistent, oscillating wave. (Or, if you want, if my slinky is a mile long, the photon might be just 10 meters of steady wave travelling one way.) An outside magnetic field would then be like holding the entire slinky up a few feet, or the slinky sagging in a parabola from its own weight. These will change the "shape" of the photon locally, but the photon is still a photon and consists of the same relative local changes. And once the photon or the magnetic field is gone, the other one is unaffected.
That light combines linearly like this lets a lot of cool things happen, indeed. As a example where this doesn't work, water waves, especially small ones, are pretty nonlinear: if I have one wave rippling along, it can look pretty different depending on whether the surface is on a large scale sloping up or down (the "external field"). For instance, little ripples act differently if they're going up or down the side of a marge larger wave.
Answer: In a conventional way, no. But it can.
As said by @NeuroFuzzy and @Alex Meiburg, a photon doesn't interact with a magnetic field by means of eletromagnetic force, so at first sigth the photon path can't be bent.
But a strong magnetic field, as imposed by the OP, can warp the spacetime because it contributes to the stress-energy tensor, and therefore bend a photon's path as predicted by Einstein's equations. To see more, go to https://en.m.wikipedia.org/wiki/Einstein_field_equations#Einstein.E2.80.93Maxwell_equations where the proper contribution of the eletromagnetic field for the stress-energy tensor is shown


A Metric Space is an open subset of itself Proof

Question: Say we have a metric space M=(X,d), then we know that M is an open subset of itself,right? If I'm not mistaken we need this in order to show that M is also a topological space, so how do we prove it? Which property of the metric d does this derive from? All the books I've seen so far(Kreyszig's and W. Rudin's being two of them) say it's obvious/trivial etc, but I do like to be cautious and rigorous, plus I have to admit that it's not that obvious to me. Thanks in advance :)
Comment: For a metric space, the whole space is also closed, and hence clopen (awesome word).  What's the definition of an open set?  If I pick a point, I can find a ball of positive radius that is still in the set.  Well, if the set you're looking at is X, there's nowhere for the ball to not fit, so it's automatically open.
Comment: I think this word "awesome" does not mean what you think it means.
Answer: You have a metric space $(X,d)$ and you want to see it as a topological space, i.e. you want a couple $(X,C)$ where $X$ is the same set as above and $C$ is a collection of subsets of $X$ which satisfies the three axioms that define a topology. The elements of $C$ are those that we call open sets. To turn your metric space into a topological space you declare that $U\in C$ if and only if $\forall x \in U$ $\exists \epsilon>0$ s.t. $B_{\epsilon}(x)\subset U$, where $B_{\epsilon}(x)=\{y\in X$ s.t. $ d(y,x)<\epsilon\}$ is the ball centered in $x$ with radius $\epsilon$. To be rigorous you have to show that the family $C$  satisfies the axioms defining a topology, in particular $X\in C$. To show this fix $x\in X$ and $\epsilon>0$ then $B_\epsilon(x)$ is the $\boldsymbol{subset}$ of $X$ which point satifies $d(x,y)<\epsilon$, thus $B_\epsilon(x)\subset X$.


project specific init file

Question: I have some customizations for emacs that I'd like to use for a single project, but not affect emacs globally. Is there any way I can have emacs load a specific init file when launched from a certain directory or automatically load all init files in the directory its launched from?
Answer: You might want to take a look at Directory variables. Basically you will need to create a .dir-locals.el file in your project root with all the project specific setting in it. Now whenever you open a file in the directory or any of its subdirectories emacs will apply the settings in the .dir-locals.el file.
So for example suppose you want to use the make package install as compile command only in project A, you will need to create a file named .dir-locals.el in root directory of the project and add something like the following
((nil . ((compile-command . "make package install"))))

Henceforth whenever you run compile command from any file under the directory A, the default compile-command will be the one specified above, however the compile command for files outside the directory A will stay untouched.
Answer: A less-featured alternative to .dir-locals.el is the EditorConfig standard, which has an emacs-package. It doesn't support nearly as many options, however, it allows a team of people to standardize on some settings and use them across different editors.
It behaves much the same way, with a project-specific .editorconfig file at the top-level.
Answer: I know this is an old question, with an accepted answer. I found this entry, because I had the same question. I also agree that EditorConfig is attractive in team-contexts, but that is not relevant for me (anymore).
In fact, the accepted answer does not fully answer the question; Directory variables only let you set configuration variables. This does not allow all features that are possible in an emacs init file, such as defining new functions that are only relevant for the current project (or it only allows that via a rather tricky mechanism).
I found that the following a approach works better for me and is an more complete answer to the question. Perhaps it helps someone else who finds this question.
Add the following to your global emacs init file (~/.emacs , ~/.emacs.d/init.el or ~/.config/emacs/init.el):
(if (file-exists-p "./.emacs-local.el")
  (load-file "./.emacs-local.el"))

Now, suppose there exist such a file:
$ cat ~/my-super-project/.emacs-local.el

;; -*-Lisp-interaction-*-
;; Experimental local config
;; ONLY AS AN EXAMPLE IN THIS STACKEXCHANGE ANSWER
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Comment-out the current line, in mode-specific way.
(defun comment-current-line (arg)
  (interactive "p")
  (beginning-of-line)
  (let ((beg (point)))
    (forward-line 1)
    (comment-region beg (point)))
  (end-of-line))

;; Always hit the # key to comment-out current line.
(global-set-key "\#"       'comment-current-line)

Then this function and keybinding become available after cd'ing into that project directory before starting emacs.
$ cd ~/my-super-project
$ emacs . &

Of course, the two-liner load instruction could be improved by checking if the file is also readable, by carrying the filename in a variable, by checking a few file-name variants, etc., etc.. But that is left as an exercise to the reader.

project specific init file


Humidity Drops Fast

Question: I have been working on a system to automate my like indoor grow tent, I have sensors to monitor the temperature and humidity.  I currently have come cucumbers in there that require a high humidity and what I have noticed is that once the humidifier() is turned off the humidity drops very rapidly.  I have a tent that is 38"x38"x6' and I was thinking maybe it was having a small fan that is running in there 24/7.  I ran a test by turning the fan off for a few hours and it did not seem to make a difference.  I have an exhaust fan attached to the end of some 8" exhaust hose(sorry for my lack of knowledge on the correct terms) but it was also turned off all day and normally only kicks on when the temperature or humidity get too high.  I have also closed the vent in the back about 80% of the way.  I would close it all the way but I do not have any intake venting and I worry that it is bad for the exhaust fan to run without being able to pull in any fresh air.  Is this a normal occurrence or is there something I can do to help with the issue?
Comment: what is the humidity inside the grow area and what is it outside the area? How are you measuring it?  Is the grow area tightly sealed?
Comment: The grow area is air tight other than the vent in the back and the zipper wich is close to air tight but I'm sure a small amount of air can get through the zipper.  I keep the humidity between 60-70 in the grow are and inside the house it is probably around 50.  I am measuring with a DHT22 sensor, I also have a DHT11 in there but I recently added the 22 and found it to be more accurate.
Answer: So you are saying you have a ventilation system to pull air out of the room...do you have  a way for fresh air to be pulled in passively?  Fans are critical for all indoor and greenhouse plants.  Do not worry, moving air has few if any negative effects for your plants.  Unless the plant is being moved in the back of a truck going more than 30mph, now that is too much.
Plants USE CO2 and give off O2.  The important thing is to get that O2 gas away from the leaves so that CO2 can move in to be available to the plant. As long as your room is not airtight, the air being sucked out will be replaced with fresh.  Lots of growers actually use heaters for instance that give off CO2 in their greenhouses.  Dry ice is another source to increase CO2 to increase plant production and vitality.
Depending on the plants you are growing, humidity is not a big deal breaker.  Consistency of heat, good soil and proper light are the critical factors.  Open that vent all of the way.  Air circulation regulates growth and curbs fungus.  If the vent is opened all the way and the temperature drops, close it down until the temperature is consistent.
Cucumbers in my experience do not do any better or worse for the humidity levels.  They DO get powdery mildew with high humidity and that definitely cuts your production.
Comment: Yes this is my first attempt, I believe I found the root of my problems, I replaced my water and user distilled rather than tap this time.  I also re balanced the nutrients and was much more careful about measurements.  This seems to have solved all my problems but thank you for the advice.  It seems across the board that the advice is worry about the temp and that humidity is never going to stay steady in a room with good air flow.  The guys at my local hydroponics store said the same thing as you did :)
Comment: Thank you for the response, I do have the vent open a bit and I have an oscillating fan that is on the plant 24/7.  I am growing in a DWC hydroponic setup right now.  I guess I will let it keep going and see what happens.  Also, you are correct I have some 8" vent hose running out of the top of my tent with an exhaust fan at the end to pull old air out and let new air flow in through the vent on the back of the tent
Comment: Hydroponics is NOT my area at all, grins.  I wouldn't worry about the humidity level it is part of your equation already.  Blowing air/air circulation is different than humidity levels.  For instance stepping off the plane in Hawaii, from a crazy dry atmosphere to soft wrinkle plumping moist plumeria scented air.......ahhhhh.  Keep those plants moving with the air.  Selective pruning to allow more air circulation.  Allow to dry out before watering.  Low nitrogen in relation to P and K.  Is this the first time you've tried to grow cucumbers in your tent?
Comment: That is so nice to hear, Sean!  Thank you.  Check out my answer to my own question; how to ensure more females!  And you've got to get Jorge Cervantes book The Cannabis Encyclopedia.  The most detailed garden book I've ever read because it is all about ONE plant.  He's able to go into light, chemistry, mechanics of automation, organics, soil and MORE.  Much of the book is about indoor growing under artificial lights.  Money is a big deal with this 'cash crop'!!  This is producing more studies more factual information that relates to all plants.
Comment: I actually have went through and love that book, also not sure how you did but you hit the nail on the head for what this project is created for.  Sadly the laws in the current state I reside in have forced me to test with cucumbers and peppers but in the future I hope to automate the growth of some cannabis.  Once I can get myself into a state with medical or recreational

Humidity Drops Fast


Being Descriptive

Question: I realise the title is somewhat ironic.
I have started playing a new game, it is exciting, well-paced, suspenseful; everything an rpg-er like me could ask for.
The issue is the description of, well, everything, is lacking. The GM is feeling a bit inferior in that respect. Some examples might be:

You are in the town square, with a large group of people in it, not too packed, but movement will be somewhat restricted
A short, gruff man answers the door. He only stands about waist-height and appears to be drunk.
You enter the clearing, The forest surrounds on all sides, save a gap in the trees opposite you. A web covers the ground with a hole in the middle that looks like a tunnel entrance

It's not that he's withholding information, he just doesn't have anything else to say.
He approached me about it, saying he wanted to improve on his story telling, and I gave him some advice, but I don't really have much experience in that area myself. What practices can he implement to try and boost him along to improving?
Answer: Not to experienced with this myself, but what I try to do is close my eyes, picture the environment, and then describe it in under a minute. This should be enough to give a good setting for the PCs, I usually relegate 10-15 seconds for an npc and 45 for an npc of importance.

Being Descriptive


Python 2.x class in 3.x

Question: I need to use a class written in Python 2.x, but get tons of errors in Blender 2.71 Python 3, any ways around this problem?
Answer: There isn't one single way to translate your class from Python 2 to Python 3.
You could try using the command-line tool 2to3 to do the translation, but it's not perfect, so you'll need to verify the results.
Answer: If it is a pure python class then you can run it through the 2to3 as @Garreth mentioned, this will give you the python-3 equivalent in pure syntax updates.
If the class has any Blender specific code, such as using the old Blender module, this has been replaced with bpy.
If you are creating an add-on, you will need to refactor your code to be registrable as a module. The bl_info, register() & unregister()
You will also have to take into account the various api changes that have occured,

animation IPO system replaced with F-Curves
BMesh & polygon based geometry system.
Interface code is done though bpy types

Python 2.x class in 3.x


P-value for precision recall curve significance

Question: I am computing the precision-recall curve for my ML model with 2 classes. I want to have a p-value that compare the observed area under the precision recall curve (AUPR_obs) and the area of such a curve with random labels (AUPR_rand). I know that the random area under the precision recall would be close to the proportion of the positive class. What method can I use to obtain the p-value comparing AUPR_obs and AUPR_rand? Would DeLong test be a solution?
Comment: I suggest avoiding presenting the confidence in a classifier's performance by giving a $p$-value for a performance metric; a $p$-value is *"the probability, given a null hypothesis for the probability distribution of the data, that the outcome would be as extreme as, or more extreme than, the observed outcome"*. A random classifier is a nonsensical null hypothesis. It is an unreasonable benchmark. If our classifier is say a RF with some feature engineering we should show we are consistently better than a Logistic regression with no feature engineering. We don't "classify by chance".
Answer: One of the simplest solutions to problems where one needs confidence intervals or hypothesis tests for non-standard metrics (for which there may be no ready to go solution out there), is to use bootstrapping - which should be relatively easy in the case you describe (I assume there is just a single ML model, a single "ground truth" and a reasonable sized test set that you are working with). There are some situations where bootstrapping gets really difficult (e.g. multiple readers look at X-ray images of multiple patients, but each patient gets look at by several readers, in that case simple bootstrapping does not work), but this scenario seems straightforward.
You randomly draw observations with replacement calculate the difference between the two areas under the precision recall curves and then calculate standard error and test statistic. For the one using a random predictors (i.e. predicting uniform random numbers between 0 and 1), you probably should not actually simulate the predictons (that just adds an extra source of simulation uncertainty), but rather calculate the performance directly (AUPRC for a predictor that predicts i.i.d. U(0,1) values is just the proportion of the target class in the bootstrap sample, I believe).
Unless the dataset is very large, calculating the difference in AUPRC between the ML Model and a random classifier for each bootstrap samples should be incredibly fast, so you can likely afford to do a pretty large number of boostrap samples (at least so large that the randomness of boostrapping no longer plays any meaningful role).
Answer: I recently faced a similar issue and implemented a bootstrap-based method to test the hypothesis that the real difference in PR AUCs is different than zero, see the R package usefun.
For your case, I agree that probably you shouldn't do that if one of the two PR curves is the random classifier, it's a nonsensical benchmark. Also note that DeLong test is only used to compare ROC curves.


What are the possible ways to measure electrostatic adhesion of particle to a substrate?

Question: I am interested to measure the force of adhesion of micron (1-10 micron) sized particles to conducting and insulating substrates. I searched for literature and found Force spectroscopy and tapping methods are used to measure the adhesion forces. Are there any other methods?
Answer: When I was doing this sort of work about 25 years ago our group used to do it by flowing a liquid (typically water) though a couette and measuring the density of the adhered particles using image analysis. The velocity gradient produces a force on the adhered particles, so by measuring the flow rate at which the particles detach from the surface you measure the force needed to pull them off.
On the downside it's a somewhat indirect measurement, and strictly speaking you're measuring the force at which the particles can roll, though in practice the particles generally detached cleanly. It works best for larger particles. The 10$\mu$m particles will be fine though I can't remember how well it worked at the 1$\mu$m end of your range.
On the upside, if the surface and/or particles are heterogenous you can measure the distribution of binding forces because the particles detach over a range of flow rates.


How we took adjusted odds ratio for meta-analysis when different studies put it in different ways in relation to explanatory variables?

Question: I want to do systematic review and meta-analysis but I am facing difficulties: how to take adjusted odds ratio (AOR) when studies classify the explanatory variables differently? For example one study may put the AOR for education in three ways — "No education" as a reference category, "Primary education"  with AOR (CI) , Secondary education with AOR(CI) — and the other study might put e.g. "Primary education and below" as a reference, "Secondary and above" with AOR (CI). So in the first study there are two adjusted odds ratios and in the second one only one adjusted ratio. Is it possible to take the crude odds ratio by calculating manually for meta-analysis?
Answer: The gold standard when you have studies which have used different levels of the same explanatory variable is network meta-analysis (also known as multiple treatment comparison). If you do not want to delve into that level of complexity you have a number of more or less satisfactory ways of going forward. You could just select two levels and use them throughout while just ignoring all the other results. If you have all the raw frequencies you could, as you say, recompute unadjusted odds ratios for one comparison (say none versus more than none). If the unadjusted and adjusted ratios are close this might be convincing enough for your audience.
Comment: mdewey . Thank you for your response but I don't know about network meta-analysis.  The studies are classifying the explanatory variables id different ways  some people recommending me pool the adjusted odds ratio if the studies classify in three parts.
Answer: You should in general not use the unadjusted odds ratio from observational studies. If education were randomly allocated to subjects, an unadjusted (e.g. for key covariates) odds ratio would be only be slightly biased towards no effect and an unadjusted odds ratio may be okay. However, given that these studies presumably use observational data without random allocation to education levels, there are all sorts of selection biases etc. that typically make it impossible to attempt to say anything about the effect of education without some adjustments.
How to correctly use adjusted odds ratios is another question. A simple network meta-analysis treating them as totally different interventions is not quite right, because some of the education levels are subsets or finer splits of others. However, if we know the number of each people at each (finely split) level of education in each study, then presumably we could write down a model for how they would combine. I could imagine that someone has already developed and programmed (and published) such a model, but if so, I am not aware of it.
Comment: Björn. Thank you for the response! I am not familiar with network meta-analysis.  I am saying already the articles put the adjusted odds ratio with CI but  the studies put the explanatory variables in different way. For example Study one put Educational level Primary and below  - Reference,   Secondary and above- AOD=2.8(1.78-4.5) . The second study put like this - No education - as reference category , Primary and below -AOR-3.4(2.76-5.89) , Secondary and above- AOR=2.18(1.01-4.65)  Study one classify in to two and there is only one AOR but study two have two AOR.


Do multimedia-objects work well in electronical publishings of fictional writing?

Question: Electronical publishings could include multimedia, like videos or music/soundsnippets. How well does that go together with fictional writing? Could that add something to the atmosphere? Or would it distract the reader too much and should be avoided?
Answer: If it's going to make the reader stop reading, don't do it. Your goal as an author is to absorb the author into your world and make them forget about anything going on around them. If a reader has to stop reading to watch your video or listen to a sound snippet, you're not accomplishing that goal. Instead, you'll annoy your reader and they won't want to finish reading your book or read any more. Electronic publication is also still new and with a lot of glitches still. If you throw in multimedia, you're just asking for more trouble. Readers also get frustrated if things don't work properly, so insert multimedia and having it break, will lose you readers.
Comment: Avid readers generally read faster than a video or audio clip would present whatever they are meant to present, so even if working perfectly these would be considered by most annoying and disruptive. Also, many of us read to escape the sensory noise of our overly electronic world: if we wanted that stuff we would watch TV or Youtube or listen to the radio!
Answer: "Multimedia" can include illustrations, which have been used to accompany text for centuries. In that sense, using multimedia for fiction is well-established.
Using music or video to accompany a story is a very interesting idea, and personally I'd encourage you to experiment, as it could be extremely effective. At the same time, doing this sort of experiment severely limits the ways in which you can present your story, as you need online storage, and a place where people can access your story and its accompanying materials.
Answer: The question is if you are going to write a book (intended to be read as a book on some book-style device, eg. e-book reader or tablet), or a transmedia story for the internet.
In first case it would be better to limit multimedia to minimum (make them rather illustrations than content itself).
On the other hand if you are writing for readers who are in a mood for browsing internet, switching tabs etc., rather than to read your work from beginning to the end without distractions, it would be better to split the book into smaller parts (lexias) to be read on its own, which could be multimedia but do not require one attention span for both paragraph text and videos or audios. This way the model reader reads one or two lexias, leaves for distractors (Facebook, other websites, lol-cats etc.), and then returns to reads next one, and the distractions should not degrade the reading process.
I suggest two main factors to be taken in account when writing such texts:

Read should be able to pause reading. Pausing videos is obvious. On the other hand paragraph text (with long paragraphs) does not allow user/reader to pause it. When (s)he loses focus the place where (s)he stopped reading is lost. To solve it I split my works into smaller parts (one screen) to be read at once, and instead of writing scrollable block of text I add hyperlinks or buttons (Next/Back or intertextual links depending on layout of website I designed for publishing the story). It is step toward hyperfiction but it does not stop you from making the story itself still linear.
Distractions should not break text comprehension. Parts requiring reading them at once should be one lexia (one screen, one part, whatchamacallit), and if part bigger than several paragraphs / one screen requires to be read at once to remain comprehensible, it should be rewritten to allow distractions.

For above reasons in my (hyper)texts lexias containing multimedia do not contain more than one (or two short) paragraphs of text.


When to enable/disable Viewstate

Question: I generaly disable viewstate for my ASP.net controls unless I explicitly know I am going to require view state for them. I have found that this can significantly reduce the page size of the HTML generated.
Is this good practice? When should be enabled or disabled?
Answer: Yes it is a very good idea. One could argue that it should have been disabled by default by Microsoft, just like caching.
To see how bad Viewstate is in terms of size increased you can use a tool called Viewstate Analyzer. This is particularly useful when you have an existing application developed with Viewstate enabled.
Another good reason to disable Viewstate is that it is really hard to disable at a later stage, when you have loads of components depending on it.
Answer: I think it's good practice. Many ASP.NET devs are unaware that their viewstates add tremendous baggage to the HTML that's being sent to their users' browsers.
Answer: You may find the information contained in the "ASP.NET State Management Recommendations" article on MSDN useful for making your decision.
Generally in ASP.NET 2.0 and above disabling the ViewState is less destructive due to the introduction of the Control State for storing informaton required for raising events etc.
Answer: It's a good practice. Unless you use ViewState values on postbacks, or they are required by some complex control itself it's good idea to save on ViewState as part of what will be sent to the client.
Answer: Definately a good idea, nothing worse that a page which a developer is binding a dataGrid in the Page_Load every time but also submitting the viewstate!
It's also a really good idea if you are planning on using the UpdatePanel from the AJAX Extensions, it means you're submitting less during the UpdatePanel request.
(Don't flame for saying that an UpdatePanel can be good :P)
Answer: _Viewstate can unnecessarily increase the number of bytes that need to be transferred.
So unless the data is going to be used the next time , it's a good idea to switch it off.

When to enable/disable Viewstate