Note-taking for self-studying

Question: What is the best way to take notes when self-studying? I myself swing rather wildly between writing down everything and writing nothing. Obviously, neither is a good approach. I also have troubles with the neatness of my notes, especially because my handwriting isn't exactly pretty. What tips do you recommend for taking good, neat, understandable notes?
Comment: This may sound like an odd question, but what is your goal?  Is the purpose of the note-taking to have a reference for later, or is it to get the most information into your mind as you read? Following the cognitive research, the latter goal can lead to a very different process than the first.
Comment: @BenI. to be honest, both are useful to me. I went back and forth on this, and in general, I can figure out what's going on, but not necessarily remember it. I find writing notes helps solidify the information in my mind (along with problems/programs/practice, of course) and also is handy for a later reference. I can't tell you how many times I've had to check my linear algebra notes (for example) for the definition of an eigenvector or whatever, just because I don't use linear algebra often enough.
Answer: There are two reasons (at least) for note taking

creating a shorter, abstracted, version of your sources that you can save to return to later without recapitulating your whole education.
learning something about the topic - getting it in to your head.

For the former, you can type up notes as you go. Try to focus on the main points, not the detail. Leave lots of references in your notes so that you can easily return to the source as needed.
However, if your objective is to actually learn the material from an operational perspective - using it - then typing up notes doesn't help nearly as much. Writing out things long hand is much better - but you may need to practice with the pen. And the fact that it is slow is also an advantage, since you engage with the material over a longer period.
If you are studying for a field in which you want to become a professional, take notes by hand with a pen on good paper. In fifty years you will still be able to use those notes whereas the computer notes are likely inaccessible.
The reason for long hand writing (even printing) is that your brain is more engaged in the process than it is with typing. That is how you learn - engaging the brain, not the motor muscles in your hands (unless you are learning a physical act like rock climbing or a martial art, where muscle memory is equally important.
Moreover, to learn some subjects you need to also use the knowledge you are gaining. In math you solve a lot of problems. In CS you write a lot of programs. I History you pose a lot of theses. Whatever is appropriate, but it involves problem solving and creation in some way.
See https://cseducators.stackexchange.com/a/1168/1293 for additional comments, including the other answers to the same question.
If you search this site for "changing the brain" other hints will reveal themselves.
Comment: **"_In fifty years you will still be able to use those notes whereas the computer notes are likely inaccessible._"**  Really have to disagree there.  While there's a need to avoid proprietary formats, electronic notes have far more endurance through time than paper.  You can back 'em up, search through them, transfer them, share them, parse them, translate them (via Google Translate-like services), etc..  By contrast, 50-year-old paper notes are a pain to recover; they take forever to navigate, they're often faded and the paper's wrinkly, they're usually in a box somewhere, etc..
Comment: My  friend the archivist was discussing this a few years ago. She told me that the most crappy acid ridden paper, would last 50 years, and archivist paper could last a few hundred. If you write it on velum then longer. Where as she was struggling to get digital information past 10 years. Things become obsolete. You need to actively manage it, transferring it from one medium to another, and then be lucky enough to to suddenly loose it.
Comment: As a researcher, I've kept all of my notes - paper and electronic - but honestly the paper notes are in a box in the basement.  I mean, seriously, even if you know exactly what you're looking for, it takes forever to dig through them all to find that exact thing.  But on the computer, I just do a directory search through all of my documents for keywords, and I have all of my related notes in seconds!  It's so much easier.
Comment: My experience is just the opposite. I've lost electronic goods, but been able to retrieve work from the early 60's that was on paper. But yes, it takes forever. Papyrus and stone tablets are still readable after millennia. But you can have the cake and eat it too. Work electronically but back up by printing to good paper. Keep it dry and away from mice, of course. Though I don't know the expected lifetime of laser printed work. I'd guess not permanent.
Comment: Why backup to paper, or use it at all, though?  Just backup on other devices, the cloud, etc..  Nothing short of the world ending will destroy remotely distributed copies, but any sort of paper can go up in a fire or simply be lost.  Plus it's just not very usable and whatnot.
Comment: @richard Weird; I've still got all of my notes, personal information, etc., from throughout my life.  It's never been a struggle.
Answer: Optimal note-taking depends on the goal.  For example, if all you want is to pass a quiz next week, then a quick, flimsy style's more appropriate.  Here, I'll write about taking notes that a life-long learner intends to keep-and-extend into life as a researcher.
Always typed; never written
Electronic notes are vastly superior to hand-written notes because:

They can be:

backed up;
transferred;
searched (e.g. Ctrl+F in documents);
modified (e.g. add sections, fix mistakes);
arbitrarily annotated (e.g. adding "Comments" in MS Office applications).

They're cleaner and consistent.
You can carry all of them with you always.

A library can fit into a storage device the size of a small coin (e.g. a micro SD card) and kept on a cloud storage account.

Contain active content, such as:

links to websites;
spreadsheets (e.g. Excel sheets can be embedded in Word documents);
calculations (e.g. the MS Mathematics add-in for Word);
and also inactive content like images.

Spell check and grammar check are helpful.
You can use formatting.

Simple formatting like bold/italics.
More complex formatting is possible through features like "Styles" in MS Word.

Tip:  If you don't have it already, you should add styles like code style to your default style set in your favorite word processor.

Neatly organized with other note materials, like:

Downloaded journal articles.
Spreadsheets/databases.
Source code.

Date everything
Everything should be dated; ideally, you'd prefix all filenames with a time stamp of when they were created (originally - not just when the actual file was transferred/copied/downloaded/etc.).
As always, use ISO 8601 for time stamps and other dates.

-"ISO 8601", xkcd

Dates are important for a few reasons:

They help you trace through your notes to find something that you recall but need to reread.
Especially in research, understandings constantly change.

You want to know if your notes or downloaded papers are from a month ago or 10 years ago; it really matters.
But you still usually want to keep old stuff.  It can help you both trace conceptual histories and aide you in recalling something that you've seen before.

Can help you establish the context other authors are in.

If another author writes a lot in a field, their own understanding will evolve in time.  If they contradict themselves over the years, comparing dates can help, because their more recent opinions are generally the result of having gone through a shift in understanding and likely to be more well-considered than their earlier opinions.

Try to keep the formatting future-proof
You want your notes to endure, so avoid systems that might break in a few years as best you can.  Sometimes document formats like PDF make sense despite being proprietary, though it's best to avoid relying on them as much as possible.
Tips:

Avoid relying on third-party solutions whenever you can't easily-and-reliably convert away from them at any time without losing the prior content.

MS Office applications can often save to open-format variants, so they're an example of something that you can migrate away from.
But, MS Office add-ins that rely heavily on VBA or other Office-specific mechanisms are far less reliable and migratable, so avoid reliance on them as much as possible.

Avoid third-party solutions that you can't verify for security.

You may not care about security now, but as you get further into your career and start developing content that you need secure, the potential for a backdoor (whether intentional or due to bugs) may force you away from software that'd otherwise have been nice to use.

Print webpages to files, e.g. using print-to-PDF that many browsers now offer.

Websites can go down or have their content change.  Sure, you might be able to try to look them up on an archiving service with varying degrees of success, but that slows you down.  So, do save/keep the links, but also cache a copy of the current version that you've found useful.

Remotely back up.

Keep your notes on various devices - not just separate files on the same computer.
Thumb drives aren't known for their reliability, so don't rely on them as absolute security measures, but if you copy to several thumb drives stored in different locations, that's one cheap way to get a significantly reduced risk profile.
Cloud storage accounts can also help.

Absorb non-electronic notes
If you do have non-electronic note materials; e.g., hand-written notes, images, lab book notes, or handouts from a class; if they're potentially important, try to get them on the computer.  Scanning them or snapping a picture with your phone can be better-than-nothing.
Optical character recognition (OCR) can help make some hand-written notes into electronic copies.  It's not particularly reliable or stress-free just yet, but as long as you have something for future OCR to work on, it remains an increasingly useful tool.
Comment: You may wish to add comments about LaTeX to your answer - it's a very nice, non-proprietary, math-friendly editor. Otherwise, this is a *fabulous* answer - I should start doing this! Currently, I just have a heck of a lot of messy paper notebooks.
Comment: I wonder if you've had to retrieve notes from fifty years ago. Your prescription for safekeeping is good, but only if you follow it faithfully. Libraries have a lot of trouble with electronic records. So yes, do all this, but never fail. Attend to it, say monthly. The cloud won't save you either. Companies fail, taking your stuff into the aether.
Comment: While I share the enthusiasm for legible typed notes, it's worth to issue a warning against solely relying on typing.There's some evidence from psychological studies suggesting handwritten notes are better for actual learning opposed to conserving content because you are forced to summarize what's said. Also, e.g. in lectures, computers are highly distracting, not only for yourself but for your peers as well. Personally, if I'm not in a programming class, I prefer to take handwritten notes and type or scan them later. Takes a bit more time, but is usually worth the effort (at least for me).
Comment: The interesting discussion which was occuring here should be continued  [in chat](http://chat.stackexchange.com/rooms/62312/discussion-on-answer-by-nat-note-taking-for-self-studying).
Comment: 1330300800 is 2012-02-27 (not 2013-02-27)
Comment: This is a very Microsoft Office Word-heavy answer. I myself like text formats because they are diffable/mergeable in git, they're future-proof, and open source software can use them. Examples are Markdown, LaTeX and HTML (depending on the purpose I may use either -- e.g. markdown or just plain text for quick notes; LaTeX for a document; or HTML for a document with interaction or an informative webpage; and of course I can convert Markdown to HTML etc.).
Answer: I find note taking to be the most useful when it's done in the bullet journal way in real time. Make points while listening closely, write down the few terms which resonate, leave space for the rest(which you can write as revision after class). Make the notes well spaced, so that you can also add a few key points which you learnt yourself.
Comment: Hi Sie! Welcome to [cseducators.se]. I hope to see you contributing your knowledge elsewhere as well.
Answer: From what I have read.
Most of us agree that digital information is more accessible.
Some of us agree that paper is more durable.
Some have stated that writing will produce better memories.
I will just add a few bits.

Don't waste your time trying to make notes, for reference, that are already in the books. Use books and the internet for this.
Write down anything that surprises you.
Write down references.
Summarize your notes every evening, then again at the end of the week, then again at the end of a term. Each time making them shorter.
Now that we are going to summarize our notes, we can start by writing on paper in lessons, and summarize to computer.
If we use a computer, then use open formats.
If we use a computer, then use a revision control system.
If we use a computer, then synchronize our data everywhere. In computer security there are two main concerns

Don't let the wrong people get hold of confidential/secret information: for this use encryption.
Don't lose information, for this copy data everywhere.(use a synchronization system that treats data as immutable).

Note-taking for self-studying


Using Earth's magnetic field for an electric propulsion system

Question: If you were to use a spacecraft built of copper in Earth's magnetic field, could you produce enough energy to propel yourself?
Comment: No. OTOH, if you have an alternative energy source, you might be able to propel yourself against the magnetic field. Although, due to some engineering and physics caveats, the achievable thrust is really minuscule.
Comment: Is this question about extracting energy from the magnetic field, or about generating thrust, using energy from elsewhere?
Answer: There is a question on the World Building Stack Exchange relevant to this.  The consensus there seems to be no you can't.
This answer in particular by user Schwern seems to have the answer to your question.  Note that the original question was about power generation for a living space in Jupiter's orbit, but it answers your question too.

Jupiter has an enormous magnetic field, and your house is moving
  through it. You could wrap some wire around a coil and extract
  electrical energy from this field! Brilliant!
...except by doing so you're creating an oppositely charged magnet
  which Jupiter's magnetic field draws in creating a drag on your
  house's orbit. You're mortgaging your house's orbit for electricity.
  This is a theme.
You could kick the electro-magnet out into space. Then it will be in
  its own orbit. It would send the energy back to you with a laser (also
  a theme) and eventually crash into Jupiter.
Comment: The answer quoted states that orbital velocity and power are interconvertible, which means you have utterly misunderstood the applicable conclusion. If you can draw power from the magnetic field by slowing down your orbit, it stands to reason that by putting power in, you can speed up your orbit.
Answer: There are magnetic fields everywhere in space. If it were possible to use them for propulsion the achievable speeds would be incredible. Place two magnets close to each other and see how fast they come together.
Comment: Magnetic force rapidly falls off with distance (proportional to the third power of distance), so the behavior of magnets up close is no indication of what a magnetic propulsion system will do.
Comment: You should try to demonstrate this on Earth using its magnetic field. Good luck, you will need it. Moving a compass needle does not count, try a toy car.


の (no) vs ~i for colors, can they be used indistinctly?

Question: There is this title of a manga called "Ao no Exorcist". Is this exactly the same as Aoi Exorcist? can they be used  indistinctly or there is a nuance or something?
Answer: の is a linking particle that has a wide variety of meanings, and 青のエクソシスト (literally "exorcist of blue") can potentially refer to various things.

exorcist who is somehow related to blue or symbolized as blue
exorcist who belongs to a group somehow related to blue
exorcist who has a title/license related to blue

In this case, this exorcist uses special blue flame to defeat enemies, so it's used in the first sense. Similar examples include 鋼の錬金術師 ("alchemist of steel"), 愛の戦士 ("warrior of love"), 自由の女神 (Statue of Liberty; literally "goddess of liberty") etc.
青いエクソシスト ("blue exorcist") usually just means someone whose skin or uniform is blue. It may also mean "an inexperienced exorcist" (see the last definition on jisho).
Answer: Short answer: No, they have completely different meanings, especially when used in this case.
Long answer:
[青]{あお}のエクソシスト, when directly translated, means "Blue's Exorcist" due to the の particle, which could be better worded as "Exorcist of Blue". (The exorcist is exorcising blue.)
[青]{あお}いエクソシスト, however, uses 青{あお}い as an い-adjective to describe エクソシスト, so when translated would mean "Blue Exorcist". (The exorcist is blue.)
And so, "Blue Exorcist" and "Exorcist of Blue" are pretty different things. (Also I'm not so sure about the details of this particular manga, but I translated [青]{あお} directly as "blue" in this answer.)
Answer: The の-particle with adjectives is typically used in this case to indicate that the exorcist can be identified because it's blue.
If you say 青いエクソシスト, you're saying the exorcist is blue, but there may be other blue ones too.
青のエクソシスト is the only blue one of its kind, so the other person immediately knows which exorcist you mean. You could use 「青の」 to say "the blue one", in essence.


No link to the Meta site from the main profile?

Question: It seems that each exchange can, to some degree, customize the new profile display (or even choose not to implement it). What is odd here on Reverse Engineering is that there doesn't appear to be any link to the meta profile from the main profile. All of the other sites I've thumbed through have that link in the upper right corner. I'm assuming this is in error?
Answer: Hmm I have a link to re meta under the help dropdown. Is this missing in some other spot?
Comment: The link is there now. I'm not sure how to explain this, unless it is just something quirky and random.
Comment: Peter, would you do me a favor? Visit my profile on Computer Science. I'm not seeing a link there either. I now have a screen shot. But I suspect that if I bring up the Meta, then the link will appear. I just need some independent verification that in fact the link is not there. In which case, I will delete this and repost it on the Meta exchange.
Comment: In fact now that I'm really going through, it looks like the Meta link has disappeared from a good number of my profiles: Physic, Information Security, MathOverflow, etc.... Hmmm.... It's probably not a big deal as I know how to find those respective sites. But if this is happening to new users, that's a bad thing.
Answer: Well that's interesting. The link is showing up now! It wasn't there before. I wish I had screen shots. I'm going to leave the question and answer here as I still think there is something funny about this. But will delete if this is just some random non-reproducible event.
Comment: Ok good to know.


Usage of public VPN before TOR

Question: Could usage of public VPN before TOR be more dangerous than only TOR ? With public VPN we hide from ISP that we are using TOR, but VPN know our IP and that we use TOR. Could VPN use some scripts that deanonymize TOR ?
Answer:
With public VPN we hide from ISP that we are using TOR

If an ISP carefully observed VPN traffic, it could discern that you were using Tor over the VPN. It might provide plausible cover to a casual obvserver but likely wouldn't stand up to scrutiny. The VPN may encrypt the traffic, but packet timings and other artifacts of the traffic being sent across the VPN would still be possible to discern (with closer technical inspection) and VPNs make no attempt to obfuscate them.

Could VPN use some scripts that deanonymize TOR?

Not on it's own, no. It sees as much as your ISP does however VPNs could act as a choke point into the network, if many people used some VPN to connect to Tor over then that VPN gets to see a lot of peoples Tor entry traffic and knows who those people are, if had a collaborating evil exit node then it could make you more vulnerable to correlation attacks and as noted, the ISP too could probably act in this position, with or without a VPN.

Could usage of public VPN before TOR be more dangerous than only TOR ?

Potentially. Using a VPN can increase risk since it exposes your traffic to more parties that it ever needs be exposed to, providing more positions where your traffic could be observed from than are needed.
It depends who's looking, what they're looking for and how hard they're looking for it.

Usage of public VPN before TOR


Can humans use god ki?

Question: In Dragon Ball Super, Battle of Gods and Resurrection 'F', gods of destruction, beings belonging to Whiss's race (some sort of angels or angels), supreme kais and super saiyan gods can use "god ki". In DBS and Resurrection 'F' also, others no super saiyan gods saiyans like Vegeta can obtain the power of god ki without transforming into super saiyan god by training (and also becoming super saiyan god super saiyan by transforming) . Can other Dragon Ball races like humans or namekians or  Frost Demons obtain god ki by training too?
Comment: Well its all based on speculation but i would say yes, however if we look back at the gap between saiyans and the other races its questionable if they will ever reach the required level to activate the god ki. We could get a hint from fighters from another universe though, if they are capable of fighting goku then they also have the potential to activate god ki (or should have it). In the end, these are all speculation, maybe super will give some more hints as it progresses.
Comment: @Proxy Hit might have the possibility.
Comment: @HappyFace yeah, he is so far the most likely candidate but his fighting style is a bit different but we will see
Answer: Simply yes, not only humans, all mortals could obtain or use god ki via various ways:

Through special rituals, such as Super Saiyan God Ritual. Unfortunately this kind of rituals don't exist throughout human history, but maybe it do exist in other races.
Highly intense training under the supervision of an angel, for example Whis. It's most likely to obtain god ki by entering the Hyperbolic Time Chamber.

(Source)
Comment: @Pablo I think that it's plausible if Super extends beyond the world tournament arc of Dragon Ball Z. IIRC. Goku basically takes on Uub as his disciple and trains him to be the new protector of earth. So if Super reaches that far. I'm sure Uub could reach god ki status. But that's a big if.
Comment: without a major external power up, i would say no. The humans from the Z warriors are nowhere near the level goku and vegeta are. Maybe some humans from another universe are strong enough to achieve it though.
Comment: do you think we will ever see a human learning to use god ki in Dragon Ball Super?
Comment: @KazRodgers you know, I was just thinking about Buu too. He was in the level of Goku in base form being a kid. There might be another candidates though. Tien was able to hold his own against Trunks in base form, in the movie just after Goku died, and many years has passed from that. He might be in the level of some super saiyans (like the kids or Cabbe) or an android by now
Comment: By the way, even Yamcha was able to overpower Olibu and another fighter, and Olibu made a decent fight against Paikuhan, who gave enormous trouble to Goku SSJ

Can humans use god ki?


right hand rule using left hand?

Question: im kind of confused, the right hand rule is used to know where the direction the magnetic field created by the current is going .
is there any particular reason why the right hand is used to determine the direction of the Magnetic field?
Comment: Duplicate: http://physics.stackexchange.com/questions/1229/is-there-any-situation-in-physics-where-the-right-hand-rule-is-not-arbitrary ? I'll merge them unless people think they should stay separate.
Answer: No,  there is nothing special about your right hand as compared to your left one.  (Well, there might be, if you're a baseball player or a fiance, but there's nothing in classical electromagnetism that makes it special.)
If you set up two wires next to each other and run current through them, they will attract if the current runs the same way and repel if it runs opposite directions.  As long as the way you're doing electromagnetism reproduces this and other experimental results accurately, your system of electromagnetism is valid.
If you use a left-hand rule, you'll essentially multiply all cross products by $-1$.  That means the $B$-field calculated from a law like $\nabla \times B = J + \frac{\partial E}{\partial t}$ will be multiplied by $-1$.  However, when you look at the Lorentz force law, which says $F = q(E + v\times B)$, there will be another $-1$ introduced by the second cross product, and the force on a charged particle comes out the same.  Or if you look at the Poynting vector $E\times B$, that also gets another factor of $-1$ so energy flux comes out the same.
The reason to use the right-hand rule is that everyone else uses it, so when you see a picture with magnetic field lines drawn, the author has always used the right-hand rule to generate that picture.
Comment: ""No, there is nothing special about your right hand as compared to your left one. "" Nothing aside being chiral, meaning "handedness". Makers of gloves know that.
Comment: Of course left and right hands are kinematically different.  That basic fact underlies the answer.  The point is that despite the kinematic differences between left and right handed chirality, the physics is the same.  There is no electromagnetic phenomenon that works with a right-handed version, but doesn't work with a left-handed version.
Comment: ""hands are kinematically different"" O sancta simplicitas!
Answer: It's convention. If Benjamin Franklin had used the opposite convention for positive and negative charges (electrons positive, protons negative), we'd probably be using the left hand rule in order to cancel out the sign change we'd get out of ${\vec F} = q {{\vec v} \times {\vec B}}$.
People will probably get into obnoxious pedantry involving hodge star and the fact that $\epsilon_{xyz}=1$, but all that was developed to describe electromagnetism, not the other way around.  Had it been more convenient to start with, we would have defined a different cross product/Levi Civita symbol/hodge star that is different than ours by a minus sign, and we would be using the left hand rule.
Comment: In retrospect, I realize a simpler solution to fix Maxwell's equations in a $q$-reversed world would be to just reverse the direction of the magnetic and electric fields.  Either way, it is still just convention.
Answer: The magnetic field was initially defined by the effect it had on a bar-magnet/compass: The direction was indicated by the north pole, and magnitude by the torque aligning the bar magnet with the magnetic field. It was then found that a wire carrying a current creates a magnetic field, with the direction of current being defined as the direction in which positive charge moves when a potential difference is placed across the wire. The direction of the magnetic field is then given by the right hand rule.
So the right hand rule was used because of the way the magnetic field and direction of conventional current was defined, and is still used today because more modern definitions are still compatible with the initial ones. Defining the direction of the magnetic field to be indicated by the south pole, or choosing the direction of negative charge flow instead of positive flow for the direction of current would mean we'd be using the left hand rule today, whereas changing both would leave us still with the right hand rule.
Comment: @Georg yes so I've made things a little clearer in that respect.

right hand rule using left hand?


Compatible Photoshop format for GIMP

Question: I am using GIMP on my Ubuntu, and need to open a file some one else made with Photoshop. What file format preserves the layers, colors and preferably the text/fonts when exporting from Photoshop and importing to GIMP?
Answer: GIMP can open fairly basic PSDs (those with layers and text layers), but not all the features of Photoshop are supported, so there may be loss of things like Layer Effects/Styles.
GIMPs native format is XCF. You should save in XCF for full compatibility with GIMP, if you want to preserve layers, etc.
Photoshop doesn't support XCF at all, unfortunately.

Compatible Photoshop format for GIMP


Pre-existing arguments when using queries

Question: I am struggling to understand how queries work with get_posts(), query_posts() and WP_Query().
In particular I do not understand what pre-existing selection may exist when using these on a given page template.
From various blogs it seems that the default situation is that query_posts() and WP_Query() apply any pre-existing filters whilst get_posts supresses them.
However the codex says query_posts() ignores other parameters it receives via the URL (such as page number or category.)
Are these filters / parameters the same or something different?
How can I definitively tell what pre-existing selection will exist when I create a query?
Answer: When should you use WP_Query vs query_posts() vs get_posts()?
Comment: Hey that's fantastic.
Sorry I missed finding it for myself.
Many Thanks


Does every 8 by 8 DCT matrix have a valid (in range) IDCT?

Question: For a given quantization level of JPEG compression, are all possible DCT matrices have valid IDCTs. By valid, I mean matrices whose elements are in the range [0,255] ?
Comment: @LaurentDuval extrapolating from the previous question, the point is that when 2D-DCT transforming an 8x8 matrix, the entries of the resulting matrix aren't inherently all within the 8-bit range. The question is whether

"image (sufficiently bounded) ->DCT -> differing quantization per bin ->IDCT" might lead to images that are not sufficiently bounded, due to the quantization possibly adding energy
Comment: The possible DCT matrices depend on the quantization method. Thus, your question is inanswerable – JPEG doesn't restrict the quantization matrices at all, and it's up to any compressor to choose the quantization matrix for a quantization level; those aren't standardized.
Comment: I believe the context could be clarified: By valide, do you mean integer? If not, some floating-points issues may prevent the IDCT from being always integer. What is the quantization level? The percentage proposed in most JPEG compression interfaces?
Answer:
All images blocks that are applied by DCT matrix have a valid IDCT - i.e. they can always bring back original pixels and in general inverse transfer is theoretically as well as computationally viable.
However, while your pixels have values in range 0-255 - the DCT matrix of the block never results in values which are confined between 0-255. Not only that, they are not even integers - they are real values. So while they are valid numbers, they can't be stored in the same container as pixels.
Given that they are real numbers, it would be useless to be used for compression against integers of the original source. So hence they are confined in a particular range and then divided by a specific number - this is a process of quantization. Hence, what really goes inside your JPG or MPG are quantized co-eofficients.
The quantization is not equal. Certain components are preserved more than others (with finer quantization) - hence dynamic range of each component, though finite, is not 0-255 but different for each DCT co-efficient. this is practically taken care by Huffman coding which maps these values into binary bits.
So they are valid in 'general' definition but not what you are interpreting as.


Facebook 'real name' problem

Question: I've tried to set up a personal Facebook account but it keeps blocking me out because it says I need to use my 'real name', but I am!! and it's a very ordinary British name. There are a lot of other people with the same name as mine on FB, so why can't I set up an a/c?
Answer: You may have changed your name multiple times or done some other suspicious activity. Try creating a new account.
Or else, in some automatted way which is basically used to target advertisements Facebook would have wrongly detected you to be belonging to some totally another country like srilank or china and so a British name is not getting accepted.
Answer: Try signing up with a fake name.
My name is "World" but I can't prove it. I even tried to upload my driver's license and got rejected.
Comment: It's a work-around.  Sometimes a work-around is as close as you can get, or at least good enough for Real Life.
Comment: Sorry, but this is not [an answer](http://webapps.stackexchange.com/questions/how-to-answer).
Answer: You need to use the following form to setup your account with the name that you desire
https://www.facebook.com/help/contact/245617802141709
and will need to provide a scan of a government approved ID (such ad driving license, birth certificate etc)

Facebook 'real name' problem


Can I ask an author to send me his ebook?

Question: I'm working on my research paper. My subject is quite original and I even had difficulties to find a supervisor. In short, I found a fairly recent book on the Internet (2017), which is exactly what I am looking for, but it is not available in the libraries of my country. Could I ask the author to send it to me by email or even to send me some chapters?
Comment: I recommend Interlibrary Loan for accessing hard to find books.
Comment: Check Open Library. They sometimes have ebooks for your studies. Of copyrighted books, you can digitally borrow up to 5 copies for 3 weeks. https://openlibrary.org
Comment: Anecdotally: I asked an author and they sent me a digital version of their book which was out of print and selling for $600 on AbeBooks. They didn't seem offended, but happy someone wanted to read it. But being out of print for a long time is quite different from a recent book which you just can't find for free.
Answer: Certainly you can ask. There is nothing wrong with that. If you explain a bit about your use and the restrictions you face it might make it more likely that the author might try to help you.
But the author might not be able to comply with your request due to contractual arrangements with the publisher (if any). So, you might get a reply that starts out "Sorry, but..."
On the other hand, I'm surprised that libraries don't have access. I would guess that if you take your request to the librarian him/herself, you might learn that copies of nearly everything can be borrowed. Librarians have a vast, legal, network of sources for academic/scientific works. Even my town library, which has no formal relationships, can find just about anything I need, though the sources are usually all in this country.
But there are no ethical issues about asking. Etiquette only requires politeness and being honest about your needs.
Comment: Actually I have asked a similar question some time ago (https://academia.stackexchange.com/questions/96932/is-asking-an-editor-for-soft-copy-of-his-book-acceptable) and general consensus (to my surprise) seemed to be that asking for a copy is rude, even though in my case I personally knew the editor.
Comment: @lukeg, there were only 4 votes there, so maybe not a consensus, exactly. But the circumstances seem different here. The book not being available in libraries would make the situation different. I don't think I'd answer the earlier question much different from what I say here.
Answer: I recommend, as others have, starting with a librarian.  I'd follow up with looking for papers by the same author.  Sometimes, the reference list of books is available, and you can pore through that getting works that are seminal.
I'm not sure where I am with respect to asking.  I lean toward not doing it.  "You can always ask" is certainly true, but sometimes, merely asking is rude. I don't know where I draw the line.  I just asked an artist for permission to use a particularly apt cartoon, with attribution, in a course lecture.  The artist was absolutely thrilled that I asked for permission, and sent me a higher-res copy!  That said, here's an artist, who makes a substantial part of his living doing this sort of stuff, and I asked him for a free use. The way I justify this in my head was "I don't really need this, and it's not something I'd pay more than a few dollars for, and if he says no I just won't use it (and I wouldn't!)"  Perhaps the better way to have done this was to contact him with the question "Is there a reasonable way I can license this for this low-volume use?"
Answer: Working for a university library purchasing resources, I am asked this question by students and academic staff fairly regularly.
As others have implied, one of your options in getting access to the ebook is to contact the library with which you are affiliated, whether this is via an InterLibrary Loan request, an email to its resources department (which exists in all libraries in some form or another) or a question at the front desk. From my experience, these requests eventually get funnelled to a librarian, who is usually tasked with asking a book supplier to make the ebook available for purchase online, or directly asking the academic whether a copy could be made available to the library.
Importantly, the library will have the money to make a purchase for you, if necessary. However, whether it will pay for you may depend on its purchase and lending policies. Moreover, if copyright issues arise or the library decides that they'd like the book to form part of their collection (and therefore available for others to use), then they'll be in a better position to negotiate these processes on your behalf.
Of course, there's no harm in contacting the academic yourself... In similar situations in the past I've contacted academics expecting a hefty fee only to find they're all too happy to provide their materials for free!
Answer: Someone asked me once if I could send them a free digital copy of a book I had published recently and I was happy to send it to them for a few reasons:
A.) I'm happy that someone actually wants to read it as I put a lot of time and effort into writing it.
B.) If the person likes it, they might tell other people and so get good publicity for it.
c.) It's only one book.  The amount of money you would get for selling one copy of a book is negligible, so you are not really losing anything by giving them a free copy, especially if the person seems genuinely really interested and respectful.
So I would definitely just ask, they might even be pleased to send you a free copy.
Answer: If the book is that important to your research, you should be willing to buy it from a store or online retailer. If the book is not on sale, it may be reasonable to ask the author where/how you can buy it.
Comment: I don't see what relevance a political complaint about some foreign company has to this post. Beyond that, importing a book from another country can be quite expensive.


Empty AppCenter

Question: just installed my third machine with Elementary OS but AppCenter results are blank when searching or following categories. Wifi connection is fine - I've tried apt-get remove --purge and reinstalling but it's still blank. Any help please?
Answer: A possible solution could be:
After removing appcenter reboot your computer.
Then install appcenter again (do not forget sudo apt-get update after installing).
If not solved try rebooting again after sudo apt-get update and check if this last reboot solved the problem.
This is a known bug on high priority and with a $50 bounty.
Answer: If you run AppCenter without running sudo apt update at least one time, it shows up empty. As you might have guessed, run sudo apt update and then open up AppCenter and things should work.
This is a known bug on high importance and with a $30 bounty.

Empty AppCenter


Lightweight reverse tunnel

Question: I have been told that reverse tunnels can be created using SSH or I can solve the problem the big way and create a VPN. Both these methods are heavy-weight. For the SSH tunneling I need an SSH server on both sides, for VPN I need a VPN server and a client (and setting it up is a nightmare). SSH is simple, but on windows I have no way to get a lightweight SSH server (cygwin is too much, OpenSSH's last windows release is several years old). All I want is a lightweight program/script which does only one thing: reverse tunneling connections. An SSH server or a VPN is just too much. Any suggestions?
Answer: Here is the thing; going by your other post, what you are asking is not a "lightweight" problem. You are looking to turn your PC behind the NAT into a router for traffic. So you are not simply looking at port forwarding or tunneling, you need a router as well. You need to run a service for this. You can create a simple tunnel by using port forwarding on a program such as Putty. But then how do you forward the traffic from the outside to inside your network?
This is the very definition of a VPN.
If you are just looking for "lightweight reverse tunnel" then you just need an SSH client and Putty will do the job. If you are looking to route traffic; you will need a VPN solution.
Comment: I see, I was misinformed about reverse SSH tunneling.
Answer: you only need an ssh server on one side, also ssh i don't believe has changes in a few years itself ether. So using the windows server, or a nix server and the plink client with windows is the simplest wayt to do this.
You could also look into using hamachi, but that I do not think supports network to network wide forwards.  Hamachi is a vpn service that easy to setup since the servers are all controlled by Hamachi.
Answer: Indeed I agree with Jimsmithkka.
An ssh server gives you the greatest flexibility. You just setup the tunnels as you need them. Since ssh can do reverse tunnels with -R or forward tunnels with -L you only need one ssh server.
Hamachi is a decent alternative but you are relying on their peering service to work. If their service goes down so does your p2p vpn.
I think ssh is almost the lightest weight tunnel you can find. You could of course use netcat but yes it has to be installed too and the traffic is not encrypted.
Comment: also netcat is totaly unencrypted, and cryptcat uses really weak encryption

Lightweight reverse tunnel


Can you use both melted and creamed butter for cookies?

Question: I've been reading up on cookie science, and read that melted butter makes a denser cookie, and creamed room temp butter makes a cakey cookie. I'm looking to make a cookie thats mostly thin and very crispy on the edges with a little chewiness on the inside. Would mixing butter be a bad idea/does anyone know what the outcome would be if i did a 50/50 melted/creamed butter mix?
Answer: The process of mixing butter and sugar is called 'creaming' and the purpose is "Creaming adds air. Air is fluffy." so you are on the right track, but unlikely to get consistency out of just using 'melted butter'. The creaming process is time sensitive, that is, the more you do it, the more 'cake like' your cookies will be. Rather than using melted butter, which will not mix well with your sugar, just cream for a shorter period of time. In this picture you see the results of creaming over time...

These are from the linked article [above] showing minute-by-minute
  progress of creamed butter, with the egg added in the last stage.

You are probably looking to only reach #3 or #4 to consistently get the results you seek. (Have fun experimenting to get it 'just right')
Comment: Also, the 16ish percent water content in the butter makes steam which slightly leavens the cookie! If it's clarified butter, that would make it much more dense.


How to Detect Salesforce app is being accessed from a desktop or a sf1 app?

Question: I need to write  a javascript function ,or any event to detect whether the salesforce app is being accessed from a  desktop or sf1 app
can you help me on this ?
Answer: The answer on the post below checks if the user is currently using desktop or salesforce1 within a visualforce page. Hope this fits your requirements.
Here's the post from stackexchange forum:
Detect if Visualforce Page is in Salesforce1


Does Multisig have any privacy drawbacks?

Question: Does implementing multisig at the protocol level raise any privacy concerns? In other words, because several people are now involved in a trx, does that raise the probabilities of de-anonymizing the trx? If you know lets say that 4 people were involved in a transaction, does that make it 4x easier to trace the transaction? Or if you know that someone uses multisig at a particular exchange, can you use that fact to narrow down the pool of possible trxs?
Answer: No, it doesn't. Monero multisig addresses look and work exactly the same as any other Monero address, and so do transactions. All the "magic" is done off-chain between the wallets involved. The reason that multisig has not been implemented pre-RCT is because the work would have been wasted since non-RCT transactions are becoming obsolete.
Bytecoin, Monero's predecessor implemented multisig (or at least had a documented method for implementing multisig), but it was completely absent any privacy measures so all amounts and so on could be easily deduced as it could not be used without mixin = 0. Ring signatures (together with CT) on the other hand enables the same degree of privacy regardless of whether it is multisig or not. Multisig transactions should be indistinguishable from a normal transaction on the blockchain.
Comment: They'll be indistinguishable. Stealth addresses will ensure that no address will be indentifiable as being part of a multisig transaction.
Comment: My response is too long, so I'll add an edit above.
Comment: So with RingCT we will (theoretically) be able to use any mixin level for multisig trxs and they will be indistinguishable from normal trxs, or will the absence of amounts on the blockchain be the only privacy factor for multisig?
Comment: Thanks for your answer, but I'm not 100% clear here. Will multisig txs have full RingCT privacy functionality or will they rely only on stealth addresses for privacy (while mixin remains 0 and amounts are public? You said in your original answer that RingCT would enable privacy for multisig, but then above it seems like stealth is the only privacy factor.
Comment: Whoah, looking back at this I see it's total BS (sorry). Monero multisig addresses are exactly the same to an outside observer and so are the TX-es. It could work with non-RCT, too! I think we were waiting for RCT just to avoid the double job - to first implement it for non-RCT, only to have it become obsolete and do it all over again for RCT. @ferretinjapan If you don't mind, I'd like to edit out the nonsense :)


Title tag not overriding after using meta tag module

Question: I have created a content type for uploading user details. I have changed the title as UPLOAD PAGE using drupal_set_title. I have installed Meta Tag module, now page title remains same but title tag i.e. (title displayed in browser tab) are different. Please guide me. Thanks
Answer: Try theme_preprocess_html and modify the title using variable header_title
Sample code:
function mytheme_preprocess_html(&$vars) {
  $vars['head_title'] = 'TITLE';
}

It works for me.
Answer: Thanks @Vamsi - $vars['head_title'] did the trick for me after lots of frustrating experiences trying different module/UI and code based methods. Here's how I ended up using this to override a particular view one page at a time:
function mytheme_preprocess_html(&$vars) {

  // customize <title> tag for a complex view with url structure /people/%
  if (arg(0)=='people'):
    switch (arg(1)) {
      case 'faculty':
        $vars['head_title'] = 'People - Faculty - My School';
        break;
      case 'graduate-students':
        $vars['head_title'] = 'People - Graduate Students - My School';
        break;
      case 'alumni':
        $vars['head_title'] = 'People - Alumni - My School';
        break;
    }
  endif;

}


Are there any non-finite automata?

Question: In automata theory, we all read automata as finite automata, from the very beginning. What I want to know is, why are automata finite? To be clear, what is it in an automaton that is finite - the alphabet, language, strings made with regular expressions, or what? And are there (in theory) any non-finite automata?
Comment: Certainly not the language or the "strings made with regular expressions"; many simple regular expressions match an infinite number of strings (but they can be recognized by a finite automaton.)
Comment: I asked a question having an infinte one in mind: https://cs.stackexchange.com/questions/55864/is-there-a-name-for-a-useful-turing-like-machine-that-is-more-powerful-meaning
Answer: The full name is "finite state automata". The crucial part is that the state of the automaton can be fully characterized by an element of some finite set of discrete states. This means that if the (relevant) state of the automaton involves a real-valued variable, there is an infinite number of potential states (putting aside the finiteness of floating point representations), and the automaton is not finite.
This might not ever happen in theoretical computer science, but it's not too exotic in the domain of modeling real number sequences. Hidden Markov Models can be used to model a number sequence as the output of a probabilistic system consisting of one output filter for each state of a (discrete, finite) Markov model with unobservable states. The filters compute the next real-valued output from a vector of the previous outputs ("autoregressive" model), but the underlying Markov model is finite since its transition probabilities only depend on the current Markov state.
However, this article (full text) develops a variation where the transition probabilities also depend on the real-number vector of prior outputs. The state of this system is the combination of a discrete Markov state and a tuple of real numbers ("mixed state Markov model"), hence it can be in an infinite number of different states.
In short, non-finite automata are theoretically well-defined, and occasionally even encountered.
Comment: I think it's perfectly okay to reference own work where appropriate -- if you're one of the leading experts on a topic, we're glad to have you! -- and a plain disclosure as yours is quite enough. Thanks!
Comment: Full disclosure: I am one of the authors of the paper mentioned. I'm not sure if that's considered proper disclosure or irrelevant self-promotion...
Comment: I think he's trying to ask why you didn't use a more conventional non-FSA like a pushdown automaton instead of jumping to something like real-valued state variables.
Comment: Well, mainly because that's the example I thought of! But also the "state" of a mixed-state Markov model consists of a fixed number of parameters, but there is still an infinite number of states (defined as current position + transition probabilities) because some of the parameters are real numbers (but affect the transitions, not just the output). In the PDA case, the non-finiteness comes from the unlimited size of the stack; but there are still only a finite number of rules, which are of finite length, so at ony one step there is only a finite number of possible bebaviors.
Comment: Finite-state automata don't include pushdown automata, right? Is there a particular reason all the way to real-number states? I'm not sure if I'm missing something here about why this obvious example wouldn't work or if you merely just happened to pick an unusual example instead.
Comment: Mehrdad, FSA and PDA are different automata and recognize different classes of languages. But I don't understand what you are trying to say with "Is there a particular reason all the way to real-number states?".
Comment: @user2357112: Thanks for clarifying, yup that's exactly my question. alexis: And I don't mean it as a criticism, but rather as a way to make sure I'm understanding your answer correctly, given that it wasn't the kind of answer I expected.
Answer: All automaton models you'll typically encounter are finitely represented; otherwise there would be uncountably many, which means they are not captured by Turing-complete models. Or, in CS-think, they'd be useless¹.
"Finite automata" are called finite because they only have a finite set of configurations (the input string aside). Pushdown automata, for instance, have a stack that can have arbitrary content -- there are infinitely many possible configurations.

Nota bene: Configurations of PDAs are still finitely represented! In fact, any computational model that falls inside Turing-computability has to have finitely representable configurations, otherwise TMs wouldn't be able to simulate them.

I consciously disregard hypercomputation here for the purpose of this question.
Comment: Comments are not for extended discussion; this conversation has been [moved to chat](http://chat.stackexchange.com/rooms/69846/discussion-on-answer-by-raphael-is-there-any-non-finite-automata).
Answer: In a finite automaton, there is quite a bit of finiteness: the number of states, the size of the underlying alphabet, and the lengths of the strings accepted by the machine.
You can certainly relax the finiteness condition on these by allowing, say, the machine to have infinitely many states but if you do, the resulting machine becomes uninteresting, in the sense that such machines can be designed to accept any languages at all.
Comment: If the automaton is finite but the alphabet is infinite, then the automaton will have a finite number of transitions out of each state. Any character not associated with one of the transitions will not be recognized by the automaton. As a result, you could replace the infinite alphabet with a finite alphabet containing only the characters appearing in the automaton's transitions, and the automaton would still accept exactly the same language.
Comment: @parvin Not really. You'd need have an infinite number of transitions between your (finite number of) states then - which you still cannot represent. If you go for predicates (like "all even inputs go from A to B, all odd inputs go from A to C"), you basically break your alphabet down into a finite number of equivalence classes.
Comment: And what if it's only the alphabet that is infinite? what if we are working with a regular expression on Natural numbers for example? is that possible?
Comment: @Kevin, that depends on how you define "finite number of transitions". Consider an ordinary (finite) FSA, with the next state chosen according to any finite partition of the natural numbers: e.g., by the remainder of division by 7. Or consider a similar situation involving real numbers. The state diagram is fully finite, but it is well-defined over an infinite alphabet.
Comment: @Parvin I'd say the answer is "yes" (see my previous comment).
Comment: One example of an automaton with infinite states that *is* interesting is the prediction automaton used in the Adaptive LL(*) parsing algorithm.  This is essentially an infinite automaton that is lazily elaborated so that only the parts of it that are actually visited by the input string are ever produced. It can therefore be used to calculate the correct choice in an ambiguous LL grammar (a task which a finite state automaton is unable to perform) with complexity equivalent to using a finite state automaton for the purpose (as long as the parts of the language explored are generally similar).
Answer: In fact, in automata theory (which departs a lots from the origins of Kleene, Rabin and Scott), there are many forms of automata that are not finite. This arises for several reasons.
Pushdown automata, for instance, are automata that have an infinite set of configurations (these have a finite number of states, but the reality is that these should be thought as 'infinite automata').
In the same vein, there ar other examples of infinite automata for which the state space is infinite, but with a lot of structure. For instance one considers the class of automata that have as state space a (finite dimension) vector space, and as transition functions linear maps (plus some initial an final things). These are known as weighted automata over a base field (due to Schützenberger in 61). These can be minimized and tested for equality. Other examples include register automata (these automata have a finite set of registers, and work over an infinite alphabet: these can compare letters with registers and store letters in registers), and the more modern form of nominal automata (that have the same expressiveness, but have better foundations and properties). Emptiness of such automata is decidable.
But, even for studying finite state automata, it makes sense to talk about infinite automata. Indeed, consider the category of finite state deterministic automata that accept a fixed given language L, equipped with the standard notion of automata morphism, then this category fails to have an initial and a final object. However, if you live in the category of all deterministic (say countable) automata, then there is an initial object (the automaton that has as states $A^*$, as initial state the empty word, when it reads letter $a$ in state $u$ it goes to state $ua$, and a state is accepting if it belongs to L). There is also a final object (that has as states languages!). The existence of these two objects are one way to explain at high level why deterministic automata can be minimised and is tightly linked to the Myhill-Nerode congruence.
To conclude, there are infinite automata, but the models that are first studied in a lecture are always the finite state ones.
Answer: I think the question is assuming the conclusion that there are no infinite state automata when there are, they just aren't worth bringing up.
In Automata Theory, there is a hierarchy of powers of different virtual models.  The one I learned had 4 (that I remember, it has been some time), the one I found on Wikipedia has 5.  The weakest in either finite state automata, and the strongest is Turing machines.  There is a some concept of a level more powerful than Turing machines that is loosely called hypercomputation.  Many different descriptions of virtual machines fall into one of these levels.  Turing machines are especially known for numerous models all having the same level of computational power.
An infinite state automata, at least one formally defined, will fall into one of these levels.  There may something a little interesting in showing how a certain rigorous definition of an infinite state automata fits into one of these levels, but other than that, it wouldn't be of much use given there are far more well studied virtual machines representing each level.  It's similar to how there isn't much interest in a billion tape Turing machine, since it would be no more powerful than a single tape Turing machine but more complicated to deal with.
Now, if you happened to find an infinite state automata that wasn't equivalent to an existing level of the hierarchy, that might be interesting.  But without that, infinite state automatas are already captured within the existing hierarchy, and given the added complications of dealing with infinity, we just avoid them in the same way we avoid any overly complicated Turing machine model.
Answer: The (naive) infinite version of deterministic finite state machine is too powerful. Such a thing would be capable of "memorizing" any language at all, so there is not much to be learned from considering them.
For example, over a binary alphabet, consider an automaton in the form of a complete binary tree of infinite height. Every possible string you could consider as input corresponds uniquely to a node of the tree, so you can construct a decider for any language at all simply by making the corresponding nodes accepting states.
Answer: There is such a concept as an "infinite" automata, however, they are not normally as interesting as finite automata practically to software or hardware designers. There is some research and research papers on infinite automata, but I'll give a  simple (and practical example) below, and you may see why no-one talks about infinite automata except for perhaps, mathematicians, but I dare say some of them have interesting properties.
The counter:
Given some event you want to count, then the infinite automata yields the output, where for the sake of simplicity it's state directly maps to the traditional output symbol in an alphabet (giving the answer). Both state and output symbol space is infinite in this case, and is the set of natural numbers [0..infinity)
<code>count = 0

count --- [event] ---> count + 1
</code>
Essentially this is "counting". It is however also a state machine, but it's so trivial that we say "counter".
(Note that computers may a have limit on the size of the counter, but the premise of the machine is still valid.)
Things may get more interesting with real values and complex mathematical functions, for most people, these are mathematical functions, and not state machines. The marking thing to note about a state machine, however, is that they can be in a given state, and change state based on some external input, like the counter above, and they do so over time through a sequence of inputs.
Answer: Infinite automata, that is, like finite automata but with an infinite number of states, are a particular kind of transition system. Infinite transition systems of various kinds are commonly used to describe the behaviour of discrete systems.

Are there any non-finite automata?


Minimal size of a context-free grammar which defines $L_n=\{a^k\mid 1\le k\le n\}$

Question: I am looking for the minimal size of a context-free grammar which defines the finite language $$L_n=\{a^k\mid 1\le k\le n\}.$$
The size of a grammar is defined as the total length of all right-hand sides of the rules.
For example a grammar with
$$S\to A_1A_1\\A_1\to A_2A_2\\A_2\to A_3A_3\\A_3\to A_4A_4\\A_4\to aa$$
has size $5\cdot 2=10$.
It is well-known that the minimal context-free grammar which defines the language only accepting the word $a^k$ has size $\Theta(\log k)$ (see the example above for the construction of the word $a^{32}$).
Now, I am interested in the size of a grammar constructing all strings $a^k$ ($1\le k\le n$) for a given $n$. By the information above it is easy to create a grammar for $L_n$ of size $$\Theta(n+\sum_{k=1}^{n}\log k)=\Theta(\log n!)=\Theta(n\log n)$$
since we can create all words by a grammar of size $\Theta(\log k)$ and connect those grammars with a start rule of size $n$ (one symbol for each word). But since the final grammar is allowed to share nonterminals this construction is clearly not optimal. Maybe the smallest grammar has asymptotically the same size, but i don't know. Any help?
Comment: Adding $A_4\to a$ and $A_4\to \lambda$ would help a lot in your case, and seems to be applicable in general.
Comment: Do you consider the empty rule $U\to\lambda$ as having size $0$ or
size $1$. --- Is there a specific reason for this choice of grammar size definition, or was it just arbitrary? You could have considered also a cost of 1 for each rule. --- Besides, I am curious as to the applications or context
for this problem. Do you have any?
Comment: @babou The empty rule hase size 0 in this definiton. Yes there is an application. There are so called straight line programs (SLPs) to compress words with context free grammars. The the size of a grammar as defined in my question is the usual way in various papers to define the grammar size in this context. If we consider some kind of normal form like CNF it is also possible to count the rules since it is nearly the same. My question comes from this context, because in my opinion it is senseful to think about grammars as a compressor for languages instead of single words, too.
Comment: Thanks. So given your application, I guess absolute optimality is as
important as asymptotic growth optimality? Or is it?  This might just be an
example for complexity assessment? Your title says "minimal size", not
"minimal asymptotic size growth" --- But is your existing application
for single word languages, or is it also for languages like $L_n$ ?
--- And I suppose you use strings that are more structured than $a^k$.
Comment: My interests are mostly about asymptotics, but you are right, the exact size is also very interesting, so thanks again for your answer. The original purpose of SLPs is about compressing a single word. But there is related work in the recent literature about compressing finite languages, too.
Comment: Well. I am asking because I have improved my result, but it is signficant work to write down, and I was wondering whether you are interested. Of course, asymptotics is the same, but absolute size may be reduced signiicantly
Comment: Of course this topic normally deals  with arbitrary strings about larger alphabets, too.
Answer: There is a grammar of size $O(\log n)$ using repeated squaring.
Let's start with the simpler case $n = 2^m$:
$$
\begin{align*}
&S \to a B_0 B_1 \dots B_{m-1} \\
&B_i \to A_i | \epsilon && (0 \leq i \leq m-1) \\
&A_i \to A_{i-1}A_{i-1} && (1 \leq i \leq m-1) \\
&A_0 \to a
\end{align*}
$$
Here $A_i \to a^{2^i}$ and $B_i \to a^{2^i}|\epsilon$.
More generally, suppose $n-1 = 2^{d_0} + 2^{d_1} + \cdots + 2^{d_\ell}$, where $d_0 > d_1 > \cdots > d_\ell$. The corresponding grammar is:
$$
\begin{align*}
&S \to a B_{d_0} | a C_0 B_{d_1} | a C_1 B_{d_2} | \cdots | a C_{\ell-1} B_{d_\ell} | aC_\ell  \\
&C_j \to C_{j-1} A_{d_j} && (1 \leq j \leq \ell) \\
&C_0 \to A_{d_0} \\
&B_i \to B_{i-1} A_{i-1} | B_{i-1} && (1 \leq i \leq d_0) \\
&B_0 \to \epsilon \\
&A_i \to A_{i-1}A_{i-1} && (1 \leq i \leq d_0) \\
&A_0 \to a
\end{align*}
$$
Here $A_i \to a^{2^i}$, $B_i \to \{a^k : 0 \leq k < 2^i\}$ and $C_j \to a^{2^{d_0} + \cdots + 2^{d_j}}$.
As an extra property, both grammars are unambiguous.
Comment: I can read of that the grammar is of size $\Theta(d_0 + \ell) = \Theta(d_0)$ (since $\ell \leq d_0$). The only immediate bound on $n$ I see is $n \leq \ell \cdot 2^{d_0} + 1$; from there, I don't get to the logarithmic size bound. What am I  missing?
Comment: @Raphael You are missing that $2^{d_0} + \cdots + 2^{d_\ell}$ is the binary expansion of $n-1$.
Comment: Ah, right: $n \leq 2^{d_0 + 1}$. Thanks.
Comment: It seems that you have the answer to most of my questions, thanks again.
Answer: This is a solution using repeated squaring, developed independently of
that of Yuval Filmus. My purpose was to get as small a size as
possible, not just low complexity. The resulting grammar is ambiguous,
unlike that of Yuval Filmus.
The size obtained is bound by: $3\lfloor\log_2 (n-1)\rfloor+4$
This is about as low as one can get given that the squaring alone will require about $2\log_2 (n-1)+2$ size in optimal situations, when $n-1=2^p$
We define:
$L_n=\{a^k\mid 1\leq k\leq n\}$
$H_n=\{a^k\mid 0\leq k\leq n\}$
Note that $L_n=aH_{n-1}$ and $H_n=L_n\cup\{\epsilon\}$
We can define recursively the rules
$A_p\to A_{p-1}A_{p-1}$
with a base case $A_0\to a \mid \epsilon $
Recall that a non-terminal can be read as the set of strings that
derive from it. The advantage of squaring a set $A_k$ that contains
$\epsilon$ is that $A_k$ is contained in the square $A_kA_k$ :
$A_k\subseteq A_kA_k$
Taking the first $p+1$ such rules with $A_p$ as initial non-terminal
symbol, we have a grammar that generates $H_{2^p}$ for any $p\geq 0}
with a very small size.
That makes size $2$ (or is $\epsilon$ with size 0 ?) for the base rule
and size $2$ for the other rules, thus $2(p+1)$ for the grammar size
for $H_{2^p}$
We see that using $\epsilon$ is convenient, but it is not supposed to
be in the final language, so we take one terminal $a$ aside, to be
concatenated in the end.
Instead of considering $L_n$, we consider $H_{n-1}$, since $L_n=aH_{n-1}$
Now, to get a grammar for $H_{n-1}$ we consider the decomposition of
$n-1$ into a sum of powers of two. For that one uses the binary
representation of $m=n-1$ as:
$$m=n-1=\sum_{i=0}^{i=q}m_i2^i \text{ where } q=\lfloor\log_2 (n-1)\rfloor$$
Then you take in your grammar all the $q+1$ rules defining $A_i$ for
$i\in[0,q]$, with a total size of $2(q+1)$
Then you add a last rule
$S\to A_{i_1}\ldots A_{i_k}\ldots A_{q}$ where the indices $i_k$
are all the indices such that $m_{i_k}=1$, the last one being of
course $q$. The length of the right-hand side is at most $q+1$.
This addition of this last rule with $S$ as initial symbol defines a
grammar for $H_{n-1}$.
To get a grammar for $L_n$, we must concatenate it to $a$, which can
easily be achieved by adding $a$ to the right-hand side of the last
rule which becomes:
$S\to aA_{i_1}\ldots A_{i_k}\ldots A_{q}$
This rule has a size which is $1$ more than the previous version, thus
is upperbounded by $q+2$.
With the $q+1$ rules with total size $2(q+1)$ defining the $A_i$, we
have a total of $q+2$ rules with a size upperbound of $3q+4$.
Taking $S$ as initial symbol, this grammar generates the language
$L_n$, with $q=\lfloor\log_2 (n-1)\rfloor$.
Note: one thing here was inspired by Yuval Filmus: it was to use a
single very long rule of size at most $q+2$ for the last one, rather
than a CNF equivalent which nearly doubles the size to $2q+2$. Without this change the multiplicative constant would be $4$ instead of $3$.
Answer: I'm not sure if I understand correctly, but is there just a trivial $O(N)$ way to do this?
$A = a$
$S_0 = ""$ (I mean the empty rule, or $a^0$.)
$S_1 = S_0A$
$S_2 = S_1A$
$S_3 = S_2A$
$\cdots$
Please tell me if I misunderstood your problem (and feel free to ignore or delete my answer in that case).
Comment: This grammar generates $a^n$ rather than $\{a^1,\ldots,a^n\}$.
Answer: There is a simple grammar of size $\Theta(n)$:
$\qquad\displaystyle\begin{align*}
  A_1 &\to a \\
  A_i &\to aA_{i-1} \mid a, \quad 2 \leq i \leq n
\end{align*}$
with starting symbol $A_n$. The right-hand sides sum up to $3(n-1) + 1 = 3n - 3$.
Comment: This can be exponentially improved.


How to make emacs automatically kill buffer after invoking delete-file command?

Question: Whenever I delete a file that I no longer need in emacs using delete-file command, the buffer associated with the file is still open in emacs. Is there a way I can change this behaviour so that whenever I delete a file, the buffer associated with it is also automatically deleted.
Answer: I wrote this method, which differs slightly from the one in the other answer:
(defun delete-file-visited-by-buffer (buffername)
  "Delete the file visited by the buffer named BUFFERNAME."
  (interactive "b")
  (let* ((buffer (get-buffer buffername))
         (filename (buffer-file-name buffer)))
    (when filename
      (delete-file filename)
      (kill-buffer-ask buffer))))

If you have the buffer open in Emacs, I find it easier to specify the buffer to delete, mainly because Emacs defaults to the current buffer.
So if point is in the buffer you want to delete, you can just hit enter, rather than having to type in the filename you want to delete.
Comment: Previous version of my answer was similar http://emacs.stackexchange.com/posts/26278/revisions, but your is better.
Answer: You could use this function instead of delete-file
(defun delete-file-kill-buffer (filename)
  "Delete the file buffer is visiting and kill the buffer."
  (interactive "fFile name: ")
  (progn
    (delete-file filename)
    (message "Deleted file %s" filename)
    (when (find-buffer-visiting filename)
      (kill-buffer (find-buffer-visiting filename)))))


Visit Brisbane during a layover

Question: I'm flying with Virgin Australia from Port Moresby to Singapore in 2 days. On the way back, I will have a layover of 6.30 hours in Brisbane International Airport. Will I have time to leave the airport (BNE) and visit the city of Brisbane? I already have a transit visa 771, to allow me to enter Australia.
Answer: Brisbane Airport is not far from the city, and the Airtrain service takes you to the city centre in 20 minutes, running every 15 minutes. It's not cheap though: $30 for a return ticket.
Allowing for 30 minutes to get out of the Airport and a reasonably safe 2 hour margin to be back before departure, that leaves you about 3 hours in the city.
Brisbane doesn't really have any big, impressive sights, except perhaps the Queensland Museum. If the weather is good, I'd just cruise around on the river using the public ferries, take a stroll through the botanical gardens and the south bank parklands, and look for a nice place to eat.
Comment: You could try [GoMa](http://www.qagoma.qld.gov.au) instead. Right next door to the Queensland Museum and much more interesting.
Answer: As Michael says, the Airtrain will quickly whisk you into the city centre. Book online to save a bit, if you're sure your inbound flight is on time! Try to check your bags through, so you don't need to take them with you / don't need to check them in later, and get your onward boarding pass if you can before leaving the airport. Also, check with the airline when you need to be back to clear security, then add a bit of padding, to work out when you need to head back.
The AirTrain will drop you at Brisbane's Roma Street station. That's right next to a large park (Roma Street Parklands)  which I quite like - there's lots of variety there, and some really cool Dragon Lizards to spot.
If there's also time, head over the river to the Cultural Centre on the South Bank. There are several great free museums here, where you can learn more about Queensland, see classical and modern art from the region etc. The South Bank also has nice parks, and if you wanted to stay outside (bring suncream!) you could go down through the South Bank parks, over the Goodwill Bridge, and back through the City Botanic Gardens (which even has free wifi!)

Visit Brisbane during a layover


Any tips for someone with short fat fingers trying to play guitar?

Question: Any tips for someone with short fat fingers trying to play guitar?
I find that when trying to play chords, I accidentally cover other strings.
Does anyone know of a way to solve or work around this problem?
Comment: http://music.stackexchange.com/questions/2749/fingers-too-short-for-barre-chords Here is some good advice!
Answer: the flexibility to stretch and fret chords accurately can be developed over time regardless of your fingers. I've taught many students of different hand sizes, and they all struggle with this same problem and eventually overcome it once they are trained in the right technique.
It's easier to demonstrate this in person, but you want to make sure that your fretting hand is pressing down on the strings with the finger tips, not finger pads. The fingers should "stand tall" so as not to accidentally mute the neighbouring strings. Here are a couple of things you can try:
(1) make sure that the joints in your fretting fingers are bent
(2) make sure that the thumb in your fretting hand is not hanging over the front of the neck excessively - if you're having trouble with chords like C, F, Am, or D, try placing the thumb in your fretting hand below the middle line of the back of your guitar neck. Your left arm/elbow should be pressing against your body. This should automatically make your fretting fingers "rise" and stand taller so as not to mute other strings, and also help you to stretch to reach frets easier.
I hope this helps.. It can be frustrating in the beginning, but the other thing this also requires is time and repetition as you train your muscles to contort in uncomfortable new ways!
Answer: Go finger by finger. If you can't hold all the notes in a chord, try to hold just a few of the notes. Then, one-by-one try placing your fingers to the right position, while checking for cleanliness between every move. It is a slow and tedious process, but ultimately you will be able to learn even the difficult chords this way. Also, for inspiration, check out these amazing players with short fingers: Shawn Lane, Michael Romero. So, don't think short fingers can stand in your way.
Comment: [Robert Conti](https://www.youtube.com/watch?v=jcKkNZc4goU) does OK with fat fingers too.
Answer: When I first began playing I was trying to look at my chord forms, and unknowingly this was tilting the fretboard toward my body. This meant an even greater stretch of the fingers and an uncomfortable wrist position. First idea, get comfortable with the chord shapes, don't try playing until you can place them without looking. Also my first guitar was a cheap and nasty one, my playing started to improve when I earned enough for a narrow, curved fretboard. Worth keeping at it!
Answer: Others have answered re technique, but I wondered about the guitar itself. Horses for courses.. maybe your guitar doesn't suit your hands?
Neck width:
Not all guitar fretboards are the same. Acoustic guitars, especially nylon string guitars, tend to have wider necks meaning there's more space between the stringss, so if you have larger finger pads, you stand a better chance of baing able tofret a note cleanly. The flipside is that you may have to reach further across the neck. Sometimes the difference doesn' look like much but when yo come to play the guitar, it can feel quite a lot different.
This is also true of electric guitars, although the divide is less obvious. Different models of the same guitar have different neck widths. Eg a Fender Stratocaster can but in standard or wide neck form, and Yamaha guitars tend to have good variance. It's probably worth going to a well-stocked guitar shop and explaining the problem, and trying a few.
Neck depth:
This is the amount of wood on the nect that you have to reach around. If this is too chunky, you need to reach further which won't help.
Neck length:
Some guitars have shorter necks, too. eg if you're looking at electric guitars, Gibson generally tend to have slightly shorter necks than Fenders, meaning the frets are nearer so you have to stretch less.
Action: A further aspect is the Action (the distance between the guitar string and the frets). If this is too high, then any guitar will feel like a handful to play. 2-3mm is usually about right, around the octave (13th) fret.
The Nut: This is the bridge nearest the tuning pegs. If this is set too high then the action at that end is high, and all the "usual" chords played at the low end of the neck (C, E , especially F) will feel like real hard work.


Bike ride not smooth

Question: I've a full suspension mountain bike with a 26 inch knobby on the front wheel, this knobby has got these rectangular knobs poking out. My problem is that I find my bike's ride "not so smooth". I currently inflatate my front tire to 32 PSI and the rear one, with a better tread and sleeker dimension, to a 34 PSI. The knobbies are particularly buzzy and make this very unlikeable buzz, even on low speeds. Plus my bike's rear hub makes the rear wheel and freewheel wobble, plus the wheels doesn't rotate very smoothly, what should I attribute the bumpy and seemingly harsh ride to? Also, what degree of changes should I make to my inflation levels? My knobby front is new, so changing is really not an option and well, the knobby owes itself to my unknowing self a while back. What I'm looking for is a better riding experience and satisfaction. And, how urgent is the rear hub overhaul, really? I mostly ride on nice paved roads with zero dirt trail encounters (a metropolitan, no far-off excursions)
Answer: I have similar treads and vibration on my hardtail. Some solutions:

Reduce the pressure, but this will increase rolling resistance, thus reducing efficiency. I don't recommend this one. I would prefer to keep the vibration than to reduce my efficiency.
Just replace the tires to smoother ones. I recommend this one because smoother tires will not only make your ride smoother, but also increase efficiency. You should do this unless you are on a limited budget.
Comment: Well, the budget here is a problem and further, the pressure is  low already if you noticed: 32, 34 PSI while the recommended goes up to 45. Another thing I've noticed, the buzzing kind of goes up if the pressure goes below 32 on the front one.
Comment: @Dan you can cut some/all knobs with a wire cutter, but you might damage the tire in the process. If you decide to do this cut the middle knobs and keep the side ones because they can help in sharp turns.
Answer: On the road knobby will buzz.  If you want less buzz then less knob.  You need to get the hub serviced and wheel trued.   Why did you buy a knobby if you mostly ride on roads?
Comment: So you are never going to ride your full suspension mountain bike in the dirt?   Got to ask why did you get a full suspension mountain bike?
Comment: Well, I was an amateur in matters of tires then, let's just say that.
Comment: Buck it up and save your knobs for the dirt.  You will burn through them on the street.
Comment: I mentioned I get no time for the dirt, a rather scary metropolitan with no dirt around?
Comment: A gift, actually and then my miserly housemates never bothered to let me get more. Tho I do have a hardtrail with even noisier Kenda knobbies. A hardtrail, yep! And that wasn't me either.
Answer: Increasing pressure a few PSI may help or it may be worse - you'll need to experiment yourself on this.
You can try wearing your knobs off by riding, but this will leave you with relatively thin carcass and more vulnerable to punctures.  And it'll buzz until worn smooth.
I've never tried this, but I have seen someone's effort to make slicks.
http://www.instructables.com/id/Homemade-bicycle-slick-tires/

However this will drastically reduce your tyre life, and one slip with a grinder will leave you needing a new tyre anyway.  Plus it makes a huge mess.
Also, the rubber inside the tyre is softer than the rubber on the surface, so it will wear quicker.
Comment: A brand new commuter tyre is $13 USD retail price.  Just buy two (and you probably need thinner tubes to go inside them as well)    http://www.wiggle.com/lifeline-essential-commuter-26-tire
Comment: You see, Criggie, I don't reside in the States. Thanks for the suggestion :)). My problem does seem to have to do with the front tire plus the rear hub plus the pressure. I'll just be patient with tire now, though, and will get the hub overhauled soon enough.
Comment: @dan Neither do I.  There are a bunch of on-line shops that will freight stuff worldwide, and if you exceed a minimum (about 50 pounds or 80 euros) then freight is free.   Wiggle is based in the UK, Chain Reaction is based in Ireland.  Freight to New Zealand takes 2-3 weeks.   Or try your Local Bike Shop - you get the parts immediately, and generally they're not much more expensive
Comment: @dan Another option is to look for a donor bike, and swipe all the useful parts.  Downside there is tyres are consumables and may be no better than yours.
Comment: Thanks for the help @Criggie. I'll get some supplies at once to save the fright then. :) Um yeah and I've got some pretty awfully kept bikes but, again, they're hardtrails and the one that's not happens to be fully worn out, so yeah you're right there. My region isn't very bike infested and the local shops here are terrible, so yeah I'm gonna get some nice slicks once my pockets can take it.

Bike ride not smooth


Is there a better way to memorize the stroke order of 恵, 専, and 敷?

Question: The three kanji 恵, 専, and 敷 share the same first 6 strokes.  Using the traditional radicals I could describe them as being composed "一, 日, 丨" at the start and then finishing "...心", "...寸", "...⼂, 方, 攵" respectively.  However, are these 6 strokes derived from some older kanji?  If so, does this kanji have a meaning and what would it be in Japanese?  For example, many kanji use 冫 on the left side and this is derived from 水 which means water or みず in Japanese.  The trouble I have is the three kanji (恵, 専, and 敷) don't seem to share any meaning in common that I can use to give meaning to strokes they share.
Comment: Welcome to languagelearning.SE. Unfortunately your question is off-topic, as this is a website on how one learns languages, not how specific languages work. You might check out https://japanese.stackexchange.com/ ; please first see if your question has been answered and whether it is on-topic.
Comment: I like this question, nevertheless. Nice one.
Comment: Oh how embarrassing.  I thought I was posting on the correct site but I see now it's not quite on-topic for languagelearning.stackexchange.  I've edited the question so hopefully it's a bit better if not on-topic at least less embarrassing :).
Comment: I will just share very basic knowledge that I know about Chinese characters. I am currently trying to learn Japanese with its grammar and Kanji. 冫 is kinda like a radical. I know that氵is used with sheep ("半") to make ocean 洋.  Sorry if this is perceived as rude but perhaps maybe a quick search might reveal some information?
Answer: Historically, Japanese kanji are copied from or derived from Chinese hanzi. The stroke order of the kanji 恵, 専 and 敷 is identical to the stroke order I would expect if they had all been Chinese hanzi, even though only 敷 has exactly the same form in Chinese. MDBG lists 恵 and 専 as Japanese variants of 惠 and 專|专, respectively. Note, however, that Japanese stroke order is not always identical to Chinese stroke order.
Since kanji typically derive from hanzi (there is also a small set of kanji that were invented in Japan), it is somewhat relevant to know that there are various categories of hanzi based on formation. The largest category are so-called pictophonetic compounds, which have a semantic and a phonetic compound. However, the phonetic compound is based on the pronunciation of 200 BC, which has changed considerably since then. The phonetic components of these characters are only a somewhat reliable guide in Chinese. Since Japanese is an unrelated language with a different set of phonemes, and since the Japanese reformed their writing system both before and after World War II, resulting in a reduction in the number of Kanji and hence an increase in the number of readings per kanji, the original semantic and phonetic components have become much less reliable guides to meaning and pronunciation than they currently are in Standard Chinese.
Of course, the radicals haven't disappeared, but since there are only 214 radicals (based on the Kangxi-era list) for thousands of meanings, they can only tell you that character X has something to do with the concept denoted by the radical (氵: something to do with water; 冫: something to do with ice; 刂: something to do with a sword or a knife; 土: something to do with earth; 木: something to do with trees or other plants; etc.). They can't do much more than help you disambiguate between meanings that you already have in mind, rather than suggesting meaning when you have no clue.
Conclusion:

With regard to stroke order: some people learn general rules about character components etc., while I learnt stroke order by copying characters from sheets that showed the stroke order, so that after a few hundred characters, I had unconsciously derived the rules for stroke order without ever going through that boring kind of theory.
With regard to meaning: some university students are expected to learn the radicals, including their stroke order and meaning. I learnt characters in a more natural way but radicals were sometimes discussed in class, and we had one or two reading exercises where we were asked to infer the meanings of certain words within a specific context (e.g. prices of railway tickets: hard seats versus soft seats in Chinese trains) based on radicals. Knowing radicals can be useful in Chinese; I'm less sure about Japanese.


How does the "Chakra induction paper" react when someone has multiple chakra natures

Question: A Chakra induction paper can be used to detect an individuals Chakra affinity. In cases where a person is born with affinity to multiple Chakra Natures, do all those characteristics happen simultaneously to the "induction paper"? Or does the paper react only to an individuals strongest Chakra Nature. If so then how do Jonin level Shinobi check for their secondary Chakra Natures or decide what other elements would be a good fit for them.
Comment: Canon doesn't say much, but I've seen a lot of fanfiction where the paper just reacts to all the natures. e.g. from ch. 16 of [this cracky fanfic](https://archiveofourown.org/works/3334637/chapters/7291826): `Sakura's paper moistened, then crumbled. Sasuke's moistened, crinkled, split in half, crumbled, and burned. Naruto's did nothing for a second. Then, just when Kakashi was about to ask if the blond was sure he was following the instructions correctly, the slip of paper flashed, shining like a thousand watt lightbulb in the boy's hand, before exploding into a shower of multicolored sparks.`
Answer: In cases where a person is born with affinity to multiple Chakra Natures, do all those characteristics happen simultaneously to the "induction paper"? It is not known or rather, it was never shown in the manga as far as I know. In Chapter 315, it was not stated whether the litmus paper test is applicable to people using two nature types. However, it is implied that any person only has one nature affinity, regardless if they have Kekkei Genkai or not, or if they can use multiple natures. As far as I know, there were no people mentioned that have multiple chakra nature affinities, only those who can wield multiple ones. The existence of the litmus paper test in itself is proof that people only have one nature affinity. They would've thought of a way for another test if ever there was a person with two nature affinities. So yes, the paper reacts only to an individual's strongest chakra nature or the nature which he/she has a strong affinity towards.
How do Jonin level Shinobi check for their secondary Chakra Natures or decide what other elements would be a good fit for them? Again, this was never stated nor elaborated in Chapter 316 so we can only guess. However, if I were to guess, it was never the case that they have to find out their second strongest affinity to another nature but rather, they would probably choose a second nature to master that would give them an advantage, especially on situational cases. Also, they would probably master a secondary nature that is strong against a nature they are weak on. For example, if one has an affinity towards or if they have their strongest jutsu in Fire Release, they would probably master Earth Release to counteract against Water Release. Or it would be possible that they will just master any element they can. The only thing that can be said is that we can never truly say that a certain chakra nature is a good or bad fit to another certain chakra nature, or that you shouldn't master a certain nature if you possess or have an affinity towards another certain nature since it depends on many things.
Apparently, you can master all releases through training. Examples of shinobi who did so are Hashirama Senju, Tobirama Senju, Hiruzen Sarutobi, Orochimaru and Mū. Other possible ways to acquire master all chakra nature include:

Possession of the Rinnegan to shorten the learning process.
Acquiring the Six Paths Senjutsu and Truth-Seeking Balls.
Possession of the Bashōsen allows any shinobi the usage of all five
natures.
Using Earth Grudge Fear to gather hearts with other chakra natures (Kakuzu)
Comment: Yup. In short, it's implied that everyone only has one affinity. This just means that it's the chakra nature that's easiest for a shinobi to learn. Lots of shinobi master natures outside of their affinity, but this is not the same as their affinity.
Comment: I think thats what is kinda confusing me @ahiijny lets take Boruto for example, he is stated to have 3 chakra natures.  Does he have affinity to all 3 elements, if not then what is his main affinity? cause I actually developed this question when i was thinking what would happen if Boruto used the "Chakra induction paper".  And note that he never had difficulty in mastering wind or lightning, which lead me to think that he was born with an affinity to multiple nature types.
Comment: Also, logically speaking, a person with a kekkai genkai ability to form tetiary releases, e.g wood or ice can use 2 elements simulteneously to create something new. In such cases don't they have affinity to multiple elements?
Comment: @Rumpelstiltskin To use an analogy, I'd imagine that "affinity" is sort of similar to first-past-the-post voting. A shinobi's chakra affinity is like the candidate who gets the most votes. That's just by definition; affinity is the chakra nature that a shinobi would find easiest to use. But this doesn't say anything about how wide the gap is. e.g. it could be that a shinobi finds two natures pretty easy to use, but it's just that one nature is just slightly easier to use than the other one (e.g. like the winner winning by only 1 vote). There would still only be one winner.
Comment: And of course, like the ["nauseated" vs. "nauseous"](https://english.stackexchange.com/q/125961) distinction, lots of people in practice use words in ways that the original definers didn't intend, and language evolves. People these days seem to tend to also use affinity to mean "well they're pretty good with that nature". This is unlike chakra paper, which allegedly only responds only the #1 strongest nature. As for kekkai genkai, they're weird edge cases, so I'm not sure about those.
Comment: As for Boruto, he can use those 3 elements pretty easily, so it's not clear which element is his affinity. Some have speculated that it's lightning release because it was so easy for him that he added it to his rasengan without thinking, but apparently this was wind release in the novels, which is pretty confusing :/
Comment: I'd like to add, that Chakra strength/weakness forms a circle. Having a affinity to one chakra nature, makes it easier for you to learn it. hte second chakra nature a jonin must be able to controle is often a neighbor of their affinity, since that is easier for them to learn too because its next to the affinity one.


Best drawing / illustration software for Windows?

Question: Any good Windows XP software for drawing or illustration using a Wacom tablet for example?
Answer: Adobe Illustrator / Adobe Photoshop would be my picks. After using them I can't find anything else that compares.
Comment: Come on, down vote and provide a reason.
Answer: If your goal is to draw more like you would draw on paper, or paint, then you could be interested in ArtRage.
This program's purpose is to imitate the feeling and appearance of an actual drawing or painting. I have tested it, it feels really quite naturaly with a tablet.
Answer: It's got to be Corel Painter - it is fantastic natural painting software.
A cheaper alternative is SketchBook Pro - I've not tried it but it might be of interest.
Answer: I haven't used it with a tablet, but I find Inkscape to be pretty handy for vector illustrations.
Comment: A good complement to Inkscape is Gimp, for rater images.
Answer: Depending on your budget, here are some ideas:
Limited budget:  There are a few web-based apps you may want to consider; one that I like is called Sumo Paint; there are others out there; wikipedia has a nice listing.
Sumo paint is at
http://www.sumopaint.com
ArtRage: They are on version 3 now, but there is still a free version which is totally worth the download. I use it and love it's ease and simplicity; I did end up buying the full version back when that only cost $20. You can do a lot with the free version and there is a lot of support from the forum of users, posting tools & add ins for the program. (I believe the same folks helped develop the a program now known as "Painter")
Corel Painter: You'll pay a lot; it's a little tricky to learn at first but only because there are SO many options; it's like having every art material under the sun! Very exciting to some of us deranged artist/technology types. I have version 9.5; they are up to 11 now.
And if money is no object, the industry standard Adobe Creative Suite would round out the Holy Grail of dream artist software. I have CS3 and I couldn't imagine living without it; they are up to CS4 now; and holy cow it's expensive. For the serious, rich, or lucky only!
I would start with the web-based Sumo or the free Art Rage; then try free demos of Painter and Adobe CS4 before splurging; each has functionality which may cater to your personal taste or methods.  I hope that helps!  Happy sketching!
Answer: We are developing Black Ink, a new drawing software, actually in open beta.
If you have a good graphic card, you can try it here
Black Ink is not an ordinary painting program on many aspects: its user interface, its performance on very big documents (10Kx10K) or its unique new brushes. But today it also can be called a generative art software thanks to the new controllers system.
Controllers are a whole new way to customize your brushes. You can assign behaviors  in any parameter you want and make your brush act exactly as you like using a simple visual block-based system.
We need as much feedback as possible to improve it.
With you it will be certainly one of the best drawing software for Windows. ˁᴖᴥᴖˀ
Thank you
Géraldine
Note: here you have tutorials if you want
Answer: If you want your digital canvas work more like reallife(tm) ones, I would suggest out trying Corel Paint 11. I used it and if I had any more skill, it would be my #1 choice for tablet painting.
Answer: If you have Windows 8, Microsoft Fresh Paint (free on Windows Store) is awesome