Are there any examples of balistas, scorpions, or other catapult-like weapons being used in field battles

Question: I know balistas, scorpions, and other war machines were used for sieges, but I'm wanting to know if they were ever used as offensive weapons for field battles. I've heard about the Battle of Jaxartes, but couldn't really find much information about the use of them in the battle. I would really appreciate any information you might have on the subject.
Answer: From Wikipedia:

Several attempts to use artillery in the field are recorded but they were mostly unsuccessful, except when the artillery could be deployed in some protected place. For example, in the Battle of Jaxartes Alexander used catapults to clear the further bank of the river.

https://en.wikipedia.org/wiki/Greek_and_Roman_artillery#Use
This article seems to be well-researched, and cites mostly contemporary sources.
Comment: [In the article about this battle](https://en.wikipedia.org/wiki/Battle_of_Jaxartes#Disposition_of_the_armies)
one can read: *[...] he ordered his **artillery** to cover the soldiers in the ships. (**Catapults** have a longer range than bows.) This is the first recorded incident of such a thing occurring.*

There is even a source cited: [Alexander - A History of the Origin and Growth of the Art of War from the Earliest Times to the Battle of Ipsus](http://books.google.com/ebooks/reader?id=0RcwAAAAYAAJ&printsec=frontcover&output=reader&source=webstore_bookcard&pg=GBS.PA475)
Answer: There are carvings of wagon mounted "carroballista" (artillery) shown on Trajans Column in Rome. Trajans column is a commemoration of the Emperor Trajans conquest of Dacia and shows his Legions and their equipment carved in great detail. Being mounted in wagons would suggest the Carroballista were highly mobile and could be deployed in the field to fire missiles at the enemy.
https://en.wikipedia.org/wiki/Trajan%27s_Column
Answer: Romans didn't even use archers that much. They relied heavily on their very well trained infantry; and history shows that they could adapt to nearly any situation effectively. Any other troop types were auxilia kept for situational backup. It wasn't until the late period that other troops dominated the field. Artillery is slow and vulnerable to attack. A battlefield is always moving around and it takes specialised skill and calculation to use artillery. So, it's letting fly at a charging enemy long distance with wind and poor accuracy at play, recalculating every shot as they move; or firing over your allies heads, in which case you need high ground without obscurities or a vulnerable flank position.
The Romans of course had a highly trained standing army with specialised units. Medieval armies were not so, other than later mercenaries. But the same issues applied.
Therefore, artillery was best used in siege warfare, against a large,still target. It was impractical elsewhere and mainly a tool of intimidation and a show of power in the field.
Answer: The Romans used ballistae and catapults all the time in battle. I've even got high definition video:

The catapult is in the back, the ballista are the items in the front with the arrows coming out of them. This is out in the field (notice trees in background).
Comment: I doubt that Roman battles were filmed:-) Screenshots from 20s century movies cannot be used as arguments here.
Comment: Still, Hollywood has been known to take liberties with historical truths if they got in the way of a story. So this can be only a starting point for further research, as @TylerDurden pointed out.
Comment: No, this is Hollywood paying ancient history consultants big bucks to authentically re-enact a Roman battle. Some Roman history classes include Gladiator in the syllabus. Not only that, there is an entire book called "Gladiator: Film and History" published by Oxford University Press detailing the historical elements represented in the movie.
Comment: So this isn't just Hollywood getting it wrong?
Comment: The head academic consultant for the movie, Kathleen Coleman, is a chaired professor of classics at Harvard and one of the top historians in the world on Roman culture.
Comment: @Alex - No, this one was shot by Roman Polanski.
Comment: Historical correctness is the last concern of movie makers, with VERY few exceptions.


suffix in front of SSH public key

Question: I generated varios(DSA, RSA, ECDSA, etc) SSH keys with ssh-keygen and with latest version of PuTTY Key Generator and both utilities suffix the public key with a same string. I mean, for example, both suffix RSA key with ssh-rsa, ED25519 key with ssh-ed25519 or RSA-1 key with a key length(for example 2048). Does this suffix format come from some standard? Are those same suffixes used by all utilities which generate an SSH key-pairs?
Answer: Nit: these names come before the blob and thus are prefixes not suffixes.
This standard for the publickey file format is set by OpenSSH, which also also uses it in the known_hosts and authorized_keys files with some more (also prefix!) fields added. See man sshd on Unix with OpenSSH installed or the latest version on the web under "AUTHORIZED_KEYS FILE FORMAT" and "SSH_KNOWN_HOSTS FILE FORMAT". All version 2 keys use a string for keytype and a base64-encoded blob of the publickey as transmitted during SSH(v2) key-exchange, which is defined by several RFCs.
The online manpage no longer includes version 1 keys, although AFAICT all releases to date (through 7.3) still support version 1 BUT strongly discourage its use because it is long obsolete and broken. Version 1 used three decimal numbers: nbits, exponent (small), and modulus (large).
PuTTYgen proactively displays the OpenSSH format, but the SavePublicKey button (or File menu item) writes the different though related format defined by rfc4716 which is also used by OpenSSH ssh-keygen -e/-i. I understand the 'commercial' SSH implementation (fka Tectia) uses this format can't confirm personally.
Keytypes for 'plain' keys are generally defined by the SSHv2 RFCs, linked by an IANA registry. OpenSSH also supports its own form of certificates using keytypes in the vendor-defined format email@example.com which aren't registered. Finally, OpenSSH uses the standard-form name ssh-ed25519 even though AFAICT this is still in draft and not yet an RFC.

suffix in front of SSH public key


Freezing Bananas With Less Waste

Question: My wife likes to freeze bananas by removing their skin, wrapping them in aluminum foil, and placing them in the freezer.  She eats a couple of bananas per day.  So, this is using up a lot of aluminum foil.  She tries to reuse the foil as much as possible.  But, they get easily ripped after a couple of uses and we have to waste water washing them.  Is there a way to freeze bananas that isn't so wasteful?  For her to try it out, it will have to produce the same effect as using foil.
Comment: *" For her to try it out, it will have to produce the same effect as using foil."*   What are the "effects" that she is currently getting by using foil to wrap them in individually?
Answer: I freeze bananas in a plastic container, which I wash and reuse. I also wash and reuse Ziploc-type plastic bags, which work equally well, but don't last quite as long.
If your wife prefers aluminium, you can probably find an aluminium container (e.g. in an outdoor store), which should last you for several decades.
Answer: I simply freeze them, they don't need a container if you're going to eat them soonish (within a month, perhaps).
When you take one out if you run it under water for a few seconds the skin loosens up and they just pop out.  I squeeze them into my smoothies.
If your wife eats them as a whole fruit, rather than in a smoothie, you can improve the condition a bit by putting them inside a slightly insulated container so they freeze more slowly.  If you can slow down the speed of freezing they will crystallize less, making them seem a bit fresher when they thaw (the crystallization harms the cells and makes them mushy).
Answer: Like other fruits and vegetables I would just put them into a plastic container. It is practical to separate the pieces by plastic foil so that they can be easily separated in the frozen state.
Both the boxes and foils can be reused without washing for a limited time when kept in cold. Later they can be washed and reused again.
Answer: We just freeze bananas in their skins. But I do that when they're getting a bit old, and when I thaw them it's for cooking, so I'm not sure how edible they are.
Answer: I would chop them into suitable chunks and pop into a freezer bag, making sure the bags are not over filled and freeze only a few bags at a time on a clear bit of freezer shelf.
Once frozen then can be stacked as normal in your freezer. Now I can grab the quantity I need.

Freezing Bananas With Less Waste


Can I delete sitemap.xml from my website, Will it have a negative impact?

Question: For some reasons, I want to delete the sitemap.xml from my website.
Will it have a negative impact in Google SEO ranking ?
Answer: I'm going to post a controversial reply that many will likely disagree with. Is sitemap.xml still necessary? It's no longer crucial, no. Is it good to have, and does it help? Sure. Should you delete it? Can't say, because I don't know what your aforementioned reasons are.
Take a look at this article, written by my former colleague with many years of experience in the fields of SEO, UX, and web dev; I agree with a lot of this:
https://www.imarc.com/blog/do-sites-really-need-a-sitemap-for-seo
If you don't actively update your sitemap and don't submit it in GSC or Bing Webmaster, then you probably don't need it. A sitemap is a suggestion to search engines about how your site should be crawled. Thus, think about sites such as news sites, with hundreds of thousands of pages: sitemaps have size limitations, so for news sites they don't contain every article published, but those articles are found, indexed, and ranked anyway.
If your website is regularly updated; has a clear information architecture and category hierarchy; and includes a well-planned internal linking structure, search engines will eventually index and rank the content, regardless of the sitemap's existence.
However, do keep in mind that you'll lose the ability to submit the sitemap manually in GSC, which re-triggers a crawl. You'll also lose the ability to suggest to search engines which parts of your site are most important, or what the latest articles are.
Many SEO's still say that XML sitemaps are crucial, but that's conventional SEO wisdom. Crucial is not how I'd define it; helpful is more like it, from what I've observed in the last few years. As for your case, it'll depend on your reasons for deleting it, and on how much you maintain it currently.
Comment: Note: Sitemaps can be split into multiple files (with a "sitemap index") to get around the size limitations. This lets you list potentially up to billions of pages in your sitemap files. https://support.google.com/webmasters/answer/75712?hl=en
Comment: It shouldn't be controversial.  Sitemaps have minimal impact on SEO.  They don't help rankings and most sites are crawlable even without them.  If a site can't be crawled,a sitemap will help a little but only making it crawlable will really optimize it for search engines.
Comment: @MaximillianLaumeister Absolutely. CSM plugins like Yoast do this automatically, too, even for small websites. The downside here is, a sitemap with that many links may exhaust the site's crawl budget without pointing out which bits are more crucial to crawl. (Though lastmod metadata can help to alleviate that, to a degree.)
Comment: @StephenOstermiller Agree. I think with time, more people in our profession will come around to this point of view.
Answer: Yes sure. You can delete your site map.xml. Just head to the root directory of website and find the site map.xml file and delete it.
In the perspective of SEO sitemap is too crucial because it provides the definite roadmap of your website to the googlebot. And its make easier for the bot to find your website pages.
You should not delete the sitemap. It helps
Answer: I would recommend you to update the sitemap rather than deleting it. Make whatsoever changes you want to make and use the attribute of last modified date in the sitemap. Which will inform the googlebots that you made some changes which should be considered.
For more details you can read this article which was posted on Aug 17, 2017
https://www.google.com/amp/s/www.seroundtable.com/amp/google-url-last-modification-date-24319.html
As deleting the sitemap is not an seo freindly practice unless you want to shut down your website.
Comment: Google ignores the last modified date in a sitemap.
Comment: @StephenOstermiller Currently google do not use priority attribute in sitemap. You can check it on google own support blog. https://support.google.com/webmasters/answer/183668?hl=en
Answer: You can delete your website sitemap in the root directory of the website. For your website to difficult to crawl and index your webpage. Sitemap defines all internal page information to index on which website content.


Intuitive idea of Expectation of random variable?

Question: I'm studying probability for preparing myself for machine learning.
I came across this notion of Expectation of (random variable) or (function of random variable) like $E[X]$ or $E[g(X)]$.
Can anybody explain me the intuitive idea of the above notion (taking into consideration it's implications in machine learning, may be)
Answer: Expected value means the average value of the random variable. It is a weighted average of the values of the function, weighted by the probabilities of taking those values.
Expected value is a linear map from some random variables to numbers. This map throws away all of the information about a random variable except one number. This number is the center of mass of the distribution.
In case the random variable is a statistic you can measure from a sample, you can imagine repeating independent samples many times. In that case, the Strong Law of Large Numbers (a theorem) says that the average of the results will be close to the expected value in that the limit of the averages will converge to the expected value. This does not mean that you need a statistic to come from a repeated experiment for the expected value to make sense. Expected value makes sense even if you can only observe a statistic once.
If your text doesn't spend a lot of time on the central and fundamental idea of expected value, it could be that the author assumes you have already read another text which has done this, and so you might look for a more elementary text.
Comment: Thanks for the answer. So, in case of NORMAL mean we just add the elements (considering 100% probability of each of them, which's rarely the case in the real world) & divide them...etc, but in case of EXPECTATION, the probability of individual elements (contributing to average) counts, so that the the average makes a real-world (full of uncertain info.) sense. Is that so? Correct me if I'm wrong somewhere.
Comment: Mean and expected value are interchangeable. Both are weighted averages.
Answer: Think of you operate a gaming machine in a casino and it has $0$ $10$ $20$ $30$ $40$ $50$ usd prizes with each prize having probability of $p_1,p_2,\ldots p_6$,
If X is random variable defining amount of the prize, each time a game playing person wins, then say $E[X] = 5$ means that, on average lets say $1000$ people played a game, casino would pay $5000$ from its cash.
And again assume that for playing a game each time you buy a ticket which is $5$ USD.
Now $X$ is the prize amount you win, $5$ USD ticket fee, now casino gives $X$ USD to you but you give $5$ USD to casino. Now casino loses $(5-X)$ amount of money each time if $x=0$ it wins $5$ USD if $x=50$ it loses $45$ USD. I as an owner of casino want to calcculate long term profit or loss I use $E[f(X)] = E[5-x]$, now if I already know $E[X]$ in some way it its easy to calculate $E[f(x)]$
Brief note: I'm not an expert in probability so some of my intuitions might be wrong anyone please correct if so.
Answer: In calculating the average value of a random variable the underlying assumption is that all possible outcomes of the random variable are equally probable.
Let's say that random variable $X$ has $3$ possible outcomes, $x_1,x_2,x_3,$ and all three are equally probable.
The average value of variable $X$ is : $(x_1+x_2+x_3)/3$ or $0.333(x_1) + 0.333(x_2) + 0.333(x_3)$
Also the probability of each outcome is 0.3333. So the expectation is :
$$
E(X) = 0.333(x_1+x_2+x_3) = (x_1 +x_2 + x_3)/3
$$
In the case where the outcomes were not equally probable and occurred with a probability of $p_1,p_2\text{ and } p_3$ respectively, then
$$
E(X) = p_1\cdot x_1 + p_2\cdot x_2 + p_3\cdot x_3
$$
for the discrete random variable $X$.
Generalizing, we could write
$$
E(X) = \sum p_i\,x_i
$$
where the sum is over all outcomes.
Comment: Welcome to the site! I LaTeX-ified your answer. Please feel free to roll back my edits if you think I messed up your exposition.


What do the words ויהי כן (Beraishis 1:15) mean? It seems the "making" happens in the next verse?

Question: In Beraishis, the posuk often says ויהי כן. But, for example, regarding Day 4, after Hashem says "there should be luminaries" (verses 14 and 15) then it says ויהי כן (verse 15), and then it says Hashem MADE them (verse 16) So what do the words mean?
Comment: כו is not "them"
Welcome to mi yodeya.
Comment: I may be misunderstanding this question, but do you interpret the ויהי as a future tense? In that case you have missed the vav hapuch, which turns it into a past tense. If not, than I am at a loss what your confusion is.
Answer: ויהי כן is translated as "and it was so". That is, It was as Hashem had decreed and the details are about to follow in the next pesukim. This follows the general methodology ot the Torah of a general statement followed by the relevant details. I explain this regarding the "two" creation narratives in Differences between Genesis 1 and 2. This principal is followed within the parsha of creation. We see this elsewhere in the creation pesukim. For example, Breishis 1:11

יא וַיֹּאמֶר אֱלֹהִים תַּדְשֵׁא הָאָרֶץ דֶּשֶׁא עֵשֶׂב מַזְרִיעַ זֶרַע
  עֵץ פְּרִי עֹשֶׂה פְּרִי לְמִינוֹ אֲשֶׁר זַרְעוֹ בוֹ עַל הָאָרֶץ
  וַיְהִי כֵן:
11 And God said, "Let the earth sprout vegetation, seed yielding herbs
  and fruit trees producing fruit according to its kind in which its
  seed is found, on the earth," and it was so.
יב וַתּוֹצֵא הָאָרֶץ דֶּשֶׁא עֵשֶׂב מַזְרִיעַ זֶרַע לְמִינֵהוּ וְעֵץ
  עֹשֶׂה פְּרִי אֲשֶׁר זַרְעוֹ בוֹ לְמִינֵהוּ וַיַּרְא אֱלֹהִים כִּי
  טוֹב:
12 And the earth gave forth vegetation, seed yielding herbs according
  to its kind, and trees producing fruit, in which its seed is found,
  according to its kind, and God saw that it was good.
Comment: Thank you, I had to get 50 points to be able to write THANK YOU! because I'd originally asked this question as a guest. I appreciate the answer. It makes sense. But it does leave the words וַיְהִי כֵן as seeming somewhat redundant. In the Possuk you gave, on some level the earth participated in the creation of the plants. But in the one I gave, Hashem goes on Himself to make the Great Luminaries. So I like your answer but I still wonder why the words וַיְהִי כֵן are there.
Comment: They show that he actual creation occurred as Hashem gave the command. What follows are the details of the ויהי כן
Comment: so the next words, after  ויהי כן , are a description of what has just happened?
Comment: can't be. Because the earth, as Rashi says, did NOT do it the way Hashem just said in the previous Possuk.


What is the meaning of Bhagavan as per Shiva Purana?

Question: Here is a similar question which asks definition of Bhagavan from Vishnu Purana:

Definition of Bhagavan as per Vishnu Purana

Here I'm asking about definition of Bhagavan as per Shiva Purana. So, what does Shiva Purana state about meaning of the word 'Bhagavan' ? Is the definition reflected in other scriptures like Vedas too?
Answer: Shiva Purana Vidyesvara Samhita chapter 16 gives definition of what is meant by 'Bhagavan' and why is Lord Shiva called Bhagavan:

भं वृद्धिं गच्छतीत्यर्थाद्भगः प्रकृतिरुच्यते ।
  प्राकृतैः शब्दमात्राद्यै प्राकृतेन्द्रियभोजनात् ।।
  भगस्य दं भोगमिति शब्दार्थो मुख्यतः श्रुतः ।
  मुख्यो भगस्तु प्रकृतिर्भगवाञ्छिव उच्यते ।।
  भगवान् भोगदाता हि नान्यो भोगप्रदायकः ।
  भगस्वामी च भगवानन्भर्ग इत्युच्यते बुधैः ।।
  भगेन सहितं लिंगं भगं लिंगेन संयुतम् ।
  इहामुत्र च भोगार्थ नित्यभोगार्थमेव च ।। (Shiva Purana 1.16)

The word Bhaga means the Prakirti because it increases and flourishes. The Sabda matras etc. (the cosmic sound principle it: all objects of enjoyment) evolved out of Prakrti, being enjoyed by the sense organs, the word Bhaga comes to mean that which gives Bhoga. Bhaga is of course the Prakrti and Bhagavan is Lord Shiva himself. Bhagavan alone bestows the Bhoga of everything. No one else except him bestows the Bhoga. Bhagavan is indeed the lord of Bhaga, therefore he is also called Bharga. Bhaga is meant for Linga and the Linga is meant for Bhaga in this world as well as in the Paraloka. Shivalinga of Mahadeva should be adored with Bhaga.

Thus Bhagavan means the one who owns 'Bhaga' or the Lord of Bhaga is known as Bhagavan. From the above passage we find:

1) Bhagvan is the one who is Lord of Bhaga (Prakirti)

2) Bhagvan is the one provides Bhoga.

3) Lord is also called Bharga as he is Lord of Bhaga.

4) Lord is worshipped in Linga form along with Bhaga (which is Yoni/Vedi of ShivaLinga)

Regarding the above conclusion some questions may arise such as:

Is Lord Shiva associated with 'Bhaga' ?
Yes, he is associated. For eg. As described in answer here SataRudriya section of Yajurveda itself associates Lord Shiva with Bhaga:

Namaste Astu Bhagava
  Tâsãmishãno Bhagava
  Parãtã Bhagavo vapaha

Also the Maitryayani Samhita of Sri Rudram itself calls Lord by addressing as 'Bhagavan'. Similarly Svetasvatara Upanishad also states 'Sarvavyapi sa Bhagavan'
The definition of Shiva Purana says 'Bhaga Swami cha Bhagavan' or 'he who is Lord of Bhaga is Bhagavan.' So Is Lord Shiva called Lord of Bhaga also?

Yes, he is called in Svetasvatara Upanishad 6.6:

स वृक्षकालाकृतिभिः परोऽन्यो
                यस्मात् प्रपञ्चः परिवर्ततेऽयम् ।
  धर्मावहं पापनुदं भगेशं
                ज्ञात्वात्मस्थममृतं विश्वधाम ॥ ६॥
  He from whom this universe proceeds is higher and other than all forms of the Tree of the World and of time. When one knows Him who is the indweller, the bringer of good, the destroyer of evil, the Lord of Bhaga, the immortal support of all, one attains final Liberation.

The definition of Shiva Purana also says 'Bharga itiuchyate budhai' or 'That's why he is also called Bharga.' Is Lord Shiva also called Bharga?

Yes, 'Bharga' denotes Lord Shiva. Actually the word 'Bharga' in Gayatri Mantra also denotes Lord Shiva. It is stated in Maitrayani Aranyaka as:

अथ भर्ग इति यो ह वा अमुष्मिन्नादित्ये निहितस्तारकोऽक्षिणिवैष भर्गाख्यः। भाभिगंतिरस्य हीति भर्गः । भर्जयतीति वैष भर्ग इतिरुद्रो ब्रह्मवादिन । (Maitrayani Aranyaka 6.7)

  Now he who is called bharga is he who is placed in yonder Aditya, or he who is the pupil in the eye. And he is so called, because his going (gati) is by rays (bhabhih); or because he parches (bhargayati) and makes the world to shrivel up. Rudra is called Bharga, thus say the knower of Brahman.

Thus Lord Shiva is called Bhagavan because he is the Lord of Bhaga (Bhagesha), Provider of Bhoga (Bhogadãtã), worshipped along with Bhaga (Bhagena Sahita Lingam) and also called as Bharga.


Collision test solution for hack&slash game

Question: I want to ask you what is the best way to deal with collisions in hack&slash game, I know that collisions must be very accurate. My first idea is to use sphere bounds ( I making hack&slash in 3d), but how to deal with hitting with sword some enemy, do you know some better solution for this type of game ?
Comment: collisions must be very accurate, or don't have to? Hard to tell from your current sentence.
Answer: You could treat your sword as a line segment and continue treating your enemies as spheres. Line segment + sphere intersection would be very cheap and you'd probably gain sufficient accuracy for a hack and slash.
Determining the location and orientation of the line segment could be challenging, especially if it needs to correspond with animation.
Answer: I came up with a method for testing collision awhile back. I haven't used it so I don't know how useful it will be but the basic idea is this. if point x is inside triangle ABC (collision) then the area of triangle AxB + BxC + CxA will be approximately equal to the total area of triangle ABC. If point x was outside of triangle ABC then it won't be equal. This same idea could then be applied to 3 dimensional objects just using the formula for volume and testing all points within an object to another object. I'm not sure how CPU intensive it would be but I assume it would be too slow with testing lots of points every frame so I thought of only testing two objects if they were close to eachother. Hopefully you can use this information to come up with something.
Answer: First
Simplicity is key.
Second
Expandability is necessary.
What I would do, if I were making a "hack n' slash" is create a simple bounding box technique. Define the height and width of the attack, then check collisions with the box. Keep in mind, that if your character can go inside of other characters you want to include your own collision dimensions in the attack box.
Simple, and expandable.


Started lifting again and am gaining weight but my clothes seem to fit better. What is the cause?

Question: I've been lifting consistently for over a month and have noticed that i'm gaining weight (unfortunately) but you wouldn't know by the way my clothes are fitting.  I would think that the extra weight would be causing my clothes to be tighter.  I've heard muscle weights more than fat but the doesn't seem logical...a pound of muscle and a pound of fat still weigh a pound.  It seems a contradiction to gain weight and clothes to fit better, what is the reason behind this?
Comment: 1 pound of muscle and 1 pound of fat have the same weight, but the *volume* is different. When someone says "muscle weighs more than fat", they're talking about weight by volume. 1 cubic inch of muscle weighs more than 1 cubic inch of fat. So it's possible that you're losing *volume*, which is what affects how much you fill your clothes, while still gaining *weight*.
Comment: To illustrate, imagine you have 50 lbs of bowling balls and 50 lbs of of inflated beach balls. You want to put each group of balls in a box, and you want to use the smallest box possible. If you have five 10 lbs bowling balls, you could fit them in a moderately sized box. But if you had twenty-five 2 lbs beach balls, you'd need a very very large box to fit them.
Comment: I appreciate the input.
Answer: You're right that a pound of fat and a pound of muscle both weigh a pound, but a pound of muscle takes up less space than a pound of fat. So, if you have the same volume of muscle and fat, the muscle will weigh more. If you're working out a lot, you may be toning up and getting smaller but still gaining weight - this is because you're converting fat to muscle, which takes up less space. This article puts it pretty clearly: "muscle weighs more by volume than fat."
Comment: Thanks for answering. The graphic in the article you provided drives the point home.  It was a good read.  I provided my friend with the link - we were discussing this earlier today.
Answer: It is important to note that in and of itself lifting weights will not cause you to gain weight. You gain weight by eating more than you need.
Exercise will change your body composition (fat->muscle).
It sounds like you have both going on.
Comment: Thanks for the info...Now I have to figure out the balance between eating just enough to avoid the unnecessary weight gain and still fueling the tank for energy during my workouts.
Comment: Again, two distinct problems. Having energy for athletics is rarely about volume of food and more to do with the actual food eaten. A small pre-workout meal of whole-foods eaten 30 minutes prior to exercise followed with a post exercise snack of protein and carbohydrates (e.g. skim milk and a banana) is enough for the majority of post-adolescent athletes.
Comment: I appreciate the education.  This site is amazing and so beneficial.  Thanks.
Answer: First converting fat into muscle is a myth, it's physiologically impossible. Fat is made out of Adipocyte while muscle is made out of mostly proteins.
You can improve your body composition by increasing your muscle mass while decreasing your body fat but the two are happening independent of each other.
Another myth is toning. Again very similar to muscle -> fat. It's possible to achieve a 'toned' look but I prefer not to use that terms since its misleading.
As for the reason why you are gaining weight from strength training. It comes down to several factors:

Inflammation and water retention: lifting causes trauma to the muscle and skeletal systems which causes an inflammatory response in order to repair the damage. This leads to hypertrophy and anabolism if you eat and rest sufficiently. More specifically this causes water retention which increases your bodyweight.
Increased glycogen storage: any type of anaerobic lifting uses the immediate energy supply found in the muscle which is glycogen. Lifting encourages the body to store more glycogen so it's better prepared for future activity. This again increases your overall bodyweight.
Increased lean mass: lifting will cause you to gain more lean body mass. This isn't simply increased muscle mass but also increase in the systems that support the muscle like connective tissue. For someone on a caloric deficit you would be lucky to gain .25lbs per week, most likely less.

So there you have it, those are all the factors which impact your weight in relation to training.
Comment: If i build more lean muscle won't I burn more calories at rest so as long as I maintain my current calorie intake (all things being equal) shouldn't i eventually start to lose weight?
Comment: It's much more complicated than that. Muscle increases your BMR but only be a small amount. So lets assume 1lb of muscle requires ~20 calories a day to maintain. And you can gain .25lbs per week. To increase your BMR by 200 calories you would need to gain 10lbs of muscle, which will take you 40 weeks. Not to mention, fat also increases your BMR, so you can argue you should gain fat in order to burn more calories. Just eat at a caloric deficit, that's the fastest way to lose fat.


Least worn tyre: front or back?

Question: Where should I put the least worn tyre? on the front or the back? This is for XC MTB.
Comment: In addition to the comments below, laziness is certainly a factor.  Quite often the rear wears out before the front is showing any wear at all, and moving the front to the rear (for twice as much work) only slightly improves the tread on the front.
Comment: For illustration purposes only: It's possible to ride without any rear tyre at all: https://youtu.be/acAlAd15pZA -- Do this without a front tire and instantly crash; you need the most traction up front.
Answer: The Good or less worn tire should go on the front wheel as indicated in this Sheldon Brown Article on Tire Rotation
Although the article does hint to the fact that you should not be really rotating tires to the front wheel that may have been used on the rear wheel.

The only time tire rotation is appropriate on a bicycle is when you are replacing the rear tire. If you feel like taking the trouble, and use the same type of tire front and rear, you should move the front tire to the rear wheel, and install the new tire in front.
The reason for this is that the front tire is much more critical for safety than the rear, so you should have the more reliable tire on the front.
If you have a blowout, if it is on the rear tire, you have a very good chance of bringing the bike to a controlled stop. If your front tire blows, you can lose steering control, and a crash is a real possibility.
Answer: Generally you want the best tread on the front, as a front tire skid is much more dangerous than a rear tire skid.
However, I tend to ride my tires until the cord nearly shows, and, given that flats are about 5x more common on rear tires than front tires (and front-tire flats are much easier to fix), I'd be tempted to put the better tire on the rear, to reduce flat potential.
Comment: +1 for a good argument in favor of a strategy contrary to the common practice. This might mean each rider must make the informed decision regarding what to do, instead of there being one right answer. (Now the rear-tire-flats-more-often theory would be a tough subject to debate... :oP)
Comment: @heltonbiker : Agree it's probably subjective - would live to see some hard numbers. Possibly an observation/reality caused by under inflated tires - the back carries more weight than the front and many riders put the same pressure in both. This means the back, being more likely to be under inflated, maybe more prone to snake-bite type punctures.  I admit though thats is at best a thesis with no facts to back it up....
Comment: I think the back punctures occur more often primarily because steering with the front "scrubs" it, so something that attaches to the front tire doesn't stick to it very well, whereas on the back the "something" will stay there for hundreds of revolutions, working its way into the tread.  And of course there's more weight on the back tire, so objects are forced through it more rapidly.  (And there's always the fact that nature is perverse and wants to puncture the back tire because it's so much harder/messier to change.)
Comment: A simpler explanation is that worn tires are more likely to puncture, the back wears faster than the front so most of the time the back is more worn than the front and so is more likely to puncture.  I'm sure there are other contributing factors but this seems to be the most likely cause.
Comment: @swl10-speed - My first back tire puncture with my current bike occurred on its test ride.
Comment: I ride my Marathon Plus tyres until the blue foam part is worn away to show the rubber underneath, or until they puncture. Usually they puncture while there's still blue foam. But I'm too lazy to rotate tyres unless I'm testing.
Answer: @MrDaniel has a very good answer, however if the bike is used XC MTB a blowout is less of a concern than handling when compared to a road bike, as MTB tires (in true off road conditions) loose performance as they loose tread, unlike a road tire. Your riding style and ground you ride will dictate to some extent what you do. If you have steep, slippery uphills and traction your most important problem, a better tread on the back helps. If control is your problem and you find the front a bit sketchy - then the new one on the front would be better.
If in doubt, don't loose any sleep over it - put it on either the one you are replacing (easy - only one tire change) or the front.
Don't forget that with MTB tires they are all quite different characteristics, build for particular combinations of riding conditions and tradeoffs.  Some are designed specifically for back or front, or you change the rotation direction between front and back - therefore it is not as simple as just considering tread wear.
Answer: Least worn tyre on the front, always.
I have pretty worn tyres, the back is completely smooth, and the front has maybe half a mm of tread in the middle.  Both have lugs on the shoulders.
We have been training hard for an upcoming 12-hour MTB endurance social event.  All my rear-wheel slips have been recoverable, (at least a dozen), while both front wheel slips were complete wipeouts resulting in skidding, blood and one smashed phone.
That said - "sufficient" tread on both is a really good idea.  You can get away with less tread on the road than off-road Except when the road is wet. If you have low tread on a road bike on a wet road - you will probably go down.
Comment: Except when the tire set has front and rear specific tyres.  Then buy a new set.
Comment: They are less common than they used to be, but I believe a few companies are still making them.
Comment: [Fat Albert](http://www.schwalbe.com/en/offroad-reader/fat-albert-rear.html) is one example.
Comment: @SuspendedUser  good point - I was unaware that such sets existed.  I know some riders prefer wider tyres on the rear for comfort and increased load support.
Answer: Place the less worn tire on the front. You need very little tread to achieve traction on the rear tire when climbing. Though counter intuitive, tire tread has very little impact on keeping your rear tire from slipping and spinning out on a climb. Maintaining traction is much more about torque, and weight and body positioning on the bike.  I intentionally use a rear tire with low worn out center tread to reduce drag and increase rolling efficiency. Center tread on the rear tire may help keep the tail from bouncing and sliding around a bit, but this is not critical in maintaining control.
Answer: Very thoughtful considerations, especially directing the thinking towards MTB terrain given that so many folks drive to trails and might not worry about pavement wear and those safety concerns as much.
My knee-jerk reaction to the original question was a more superficial performance thought for a MTB:
If you rely on a knobby tread and encounter sloppy (muddy/wet) conditions with a worn-down rear tire and a newer front tire, you might be better served rotating the newer tire to the drive tire in the rear. It would have to be a pretty bald rear tire to make the swap noticeable though.
If I have two bald tires and only enough money for one tire, I'd definitely replace the back one first if the conditions are sloppy.
Comment: So with sloppy conditions and good traction provided by the single good-threaded tire on the rear, how does one HANDLE the bike with a bald front tire in the first place?

Least worn tyre: front or back?


What are the differences between the versions of AppleSoft BASIC?

Question: Apple did make some changes to AppleSoft BASIC over the years between the first version on the Apple II and the last version on the Enhanced IIe and IIe card. What are the differences between the versions of AppleSoft BASIC?
Answer: The Wikipedia entry is a bit jumbled, ambiguous, and in some cases wrong.
Perhaps it makes more sense to list changes by Apple II model, as documented by the fantastic Apple II History site. (The book has even more detail.)
Apple II (1977)

APPLESOFT I, based on Microsoft 6502 BASIC version 1.1
Documented in the November 1977 "Blue Book"
Available on tape
Loaded into memory at $800-$29FF (8.5k)
Program and variables at $2A00 up
No built-in commands to manage hi-res graphics
Option of allowing either LET and REM statements or the use of lo-res graphics
Lo-res graphics commands: PLTG, TEX, PLTC, PLTP, PLTH, PLTV
AND, OR and NOT perform bitwise operations

Apple II Plus (1979)

APPLESOFT II, based on Microsoft 6502 BASIC version 2
Documented in the August 1978 "Blue Book"
In mainboard ROM (also available on tape, disk, firware card ROM)
Tape version loaded into memory at $800-$2FFF (10k)
Tape version programs and variables at $3000 up
ROM version in memory at $D000-$F7FF (10k)
ROM version program and variables at $800 up
Added commands for hi-res graphics: HGR, HPLOT ETC
Lo-res graphics commands renamed to Integer BASIC keywords: GR, PLOT etc
AND, OR and NOT perform boolean operations
Many new commands:

Error-trapping: ONERR...GOTO and RESUME
Machine-routine shorthand call: &
Screen-clearing: HOME
Text-output control: NORMAL, INVERSE, FLASH and SPEED=
The print-space function: SPC()
Cassette tape storage of numerical arrays: STORE and RECALL
Device response: WAIT
Program-line deletion: DEL
Machine-routine access: CALL
Peripheral device access: IN# and PR#
Memory range control: HIMEM: and LOMEM:
Execution tracking for debugging: TRACE and NOTRACE
Screen-positioning: HTAB and VTAB
Subroutine aborting: POP
Read the analog controllers: PDL()
Read the low-resolution graphics screen: SCRN()

Apple //e (1983)
Same as the Apple II Plus version
Apple //e Enhanced (1985)
Same as the Apple //e version, except:

Allowed entry of lowercase commands
Screen output commands (PRINT, TAB, HTAB, etc.) more properly handle the 80-column screen
Program listings were changed to begin in column 2, making screen editing easier

Apple //c (1984) and //c Plus (1988)
Same as the Apple //e enhanced version, except:

All of the cassette tape routines (LOAD, SAVE, SHLOAD, STORE, and RECALL) were removed
The lo-res graphics commands (GR, HLIN, VLIN, PLOT, and SCRN) work with double lo-res
PLOT had a destructive range bug

Apple IIgs (1986)
Same as the Apple //c version, except:

Fixed the PLOT range bug
Comment: @MichaelShopsin Applesoft BASIC is contained in ROM on the IIgs, not in the file named BASIC.system; the latter is just the code that acts as an intermediate between BASIC and Apple ProDOS, allowing the entry of ProDOS command at the BASIC prompt and the use of ProDOS commands from within BASIC programs using the same PRINT CHR$(4)+ method as in Apple DOS. (and yes I know this is an old discussion, just to set the record straight).
Comment: @JosephCarter [link]http://fileformats.archiveteam.org/wiki/Applesoft_BASIC_tokenized_file#Tokens Two things I notice about its list: at B8 184, which says "DEF FN", the token is just for DEF because FN has a separate token. At CC 204 it shows a semicolon; it should be a caret mark ^ (exponentiation).
Comment: @Nick_Westgate thanks for the comprehensive answer that corrects the Wikipedia page. I've seen at least two versions of the IIgs Applesoft BASIC, any idea what changed, maybe just the PLOT bug fix?
Comment: I've just summarized the changes as documented by the Apple II History site and the two blue books, and borrowed some textual descriptions from Wikipedia. But I maintain my answers, so I'll have a look through the ROMs when I have time to correct and elaborate. What do you mean by "two versions of the IIgs Applesoft"? Different ROM revisions?
Comment: @Nick_Westgate I stand corrected, I compared the BASIC.system file from GSOS 3.x and GSOS 6.0.1 and they are the same except for one byte. So all version of AppleSoft BASIC supplied with GSOS are the same.
Comment: @NickWestgate, do you have a link to a comprehensive BASIC command token list that might accompany your excellent summary?
Answer: The AppleSoft BASIC Wikipedia page has quite a bit of info on this:
Not really a feature, but the RAM footprint changed between the 1 & 2.

AppleSoft I - 8.5 kb
AppleSoft II - 10 kb

AppleSoft I had these features over the "Integer BASIC" (which Woz had written):

Atomic strings: A string is no longer an array of characters (as in Integer BASIC and C); it is instead a garbage-collected object (as in
  Scheme and Java).  - This allows for string arrays; DIM A$(10)
  resulted in a vector of eleven string variables numbered 0–10.
Multidimensional arrays (numbers or strings)
Single-precision floating point variables with an 8-bit exponent and a 31-bit significand and improved math capabilities, including
  trigonometry and logarithmic functions
DATA statements, with READ and RESTORE commands, for representing numerical and string values in quantity
CHR$, STR$, and VAL functions for converting between string and numeric types (both languages did have the ASC function)
User-defined functions: simple one-line functions written in BASIC, with a single parameter

Additionally, AppleSoft II had these feature improvements over AppleSoft I:

All commands supporting Apple's "high resolution" graphics (9 total)
Error-trapping with ONERR...GOTO and RESUME
Machine-routine shorthand call &
Screen-clearing HOME (a call to a system ROM routine)
Text-output control NORMAL, INVERSE, FLASH and SPEED=
The print-space function SPC() is listed among reserved words in the Applesoft I manual, but is not otherwise documented (the TAB() print-function is documented in it)
Cassette tape storage of numerical arrays: STORE and RECALL
Device response: WAIT

Apple III Microsoft BASIC added:

INPUT$() function to replace Applesoft's GET command.
LINE INPUT statement to input an entire line of text, regardless of punctuation, into a single string variable.
LPRINT and LPRINT USING statements to automatically direct output to paper.
LSET and RSET statements to left- or right-justify a string expression within a given string variable's character length.
OCT$() function for output, and &- or &O-formatted expressions, for manipulating octal notation.
SPACE$() function for generating blank spaces outside of a PRINT statement, and STRING$() function to do likewise with any
  character.
WHILE...WEND statements, for loop structures built on general Boolean conditions without an index variable.
Bitwise Boolean (16-bit) operations (AND, OR, NOT), with additional operators XOR, EQV, IMP.
Line number specification in the RESTORE command.
RESUME options of NEXT (to skip to the statement after that which caused the error) or a specified line number (which replaces the
  idea of exiting error-handling by GOTO-line, thus avoiding Applesoft
  II's stack error problem).
Multiple parameters in user-defined (DEF FN) functions.
A return to the old Applesoft One concept of having multiple USR() functions at different addresses, by establishing ten
  different USR functions, numbered USR0 to USR9, with separate
  DEF USRx statements to define the address of each. The argument
  passed to a USRx function can be of any specific type, including
  string. The returned value can also be of any type, by default the
  same type as the argument passed.

Apple Business BASIC had big changes around direct memory access, and even removed PEEK and POKE from the language.  Their provided functionality was replaced with functions like:

BUTTON() function to read game-controller buttons.
WINDOW statement to define the active window of the text screen by its coordinates.
Use of the KBD, HPOS, and VPOS system variables.
Comment: You don't think of Applesoft as having evolved over time at all, but it did, at least a little.
Comment: @Aaron thanks for your overview of the changes in Applesoft BASIC over time. Nick_Westgate gave a more model specific answer but your information is great too.
Answer: There was a lot of material quoted VERBATIM from the Wikipedia article that was "a bit jumbled, ambiguous, and in some cases wrong". I might ask what elements of the article these terms apply to.
Judging from the respective Applesoft I and II "blue books", it's not really possible to assert with certainty that the print-space function SPC() was added with Applesoft II. In the Applesoft I manual, it's never discussed, but "SPC" IS listed among "reserved words". What sounds likely is that the function did exist in Applesoft I, but they simply forgot to document it in the manual. But this can only be speculation.
Similarly, Applesoft I did not have commands called IN# and PR#, but among its reserved words were IN and OUT, not otherwise discussed in the manual. These MAY have been Applesoft I's equivalents of IN# and PR#, just as its lores graphics commands had different names.
One other point is that in Applesoft I, the argument for the USR function was the address to be called for its machine-language routine, not an argument "for the function" to utilize in calculating the function's value, as it was in Applesoft II. It's odd that in the Applesoft I manual, there is not one word said about having USR return a useful value of its own. Whenever an example in the manual employs USR to obtain a value, it just depicts the user-routine storing the value in some location that is PEEKed in a later statement.


Create a bar chart within a table in InDesign?

Question: I want to represent numbers in a table I've created in InDesign as a scaled bar chart, similarly to the image below. Is there a way to do this in InDesign or Illustrator without manually adding and sizing rectangles for each cell? What about replacing the numbers with glyphs to represent scale?
Comment: Just to be clear.... you know that Illustrator has a Graph tool, which makes bar charts, right? And for some reason you're saying that's insufficient for your needs?
Comment: I'm trying to clarify your situation without asking you to violate your NDA. So you have a table of text. And you have this chart. And you want *each* of the bars of the chart to be in *one* table cell? Why would that be useful? Why wouldn't you just create a graph as a single image and drop it *into* one cell? I'm struggling to understand the problem you're trying to solve, and why having a regular graph won't work.
Comment: @LaurenIpsum: I don't believe I said anywhere in my question that it was insufficient for my needs--in fact, I asked it as part of my question. The reason I am hesitant to use it is because I would like to have only one bar per cell in an InDesign table. Is that possible with Illustrator's Graph tool?
Comment: You can't automate this inside multiple table cells, unless maybe if you go into scripting. You might just stick to manually scaling a square-shaped glyph horizontally, but that would be tricky and won't save much time. Why does it have to be inside the table? That's unusual and/or made to be complicated. Post your full page here and maybe we'll have another suggestion.
Comment: @Lucian -- I need it to be within the table because it's part of a larger table with other data. I unfortunately can't post the full thing here because I've signed an NDA with my employer and that info is proprietary.

Since I'm on a tight deadline, I ended up just creating a bar chart in Illustrator, removing the axes and aligning it over the cells in my InDesign table. Appreciate the suggestions; would love to learn how to do this in a less quick-and-dirty fashion.
Comment: I find this pointless. Draw the chart and import it as an image. No one is going to actually *measure* the bars to ensure it's all mathematically correct. All you need in 99.9% of cases is a close approximation regarding the relation of the bar lengths to each other.
Answer: The cool way
There's a font for this called FF Chartwell (no affiliation), which I have personally used for different annual reports and white papers. All the data is editable as numbers via the Story editor in InDesign, as the presentation video shows.
Each of the styles below sells as a separate font for about 20$. What you probably need is the 'FF Chartwell Bars Vertical' seen in the first graph below.

If you must construct this chart inside the table
I would use the black square character found in Arial. Any other font would work if it includes a square-looking glyph. I would insert this in each cell and construct the bars by scaling and positioning this inside the cell. With the proper settings it could be perfectly aligned inside each cell, then size it by doing some simple math.
You could extend the 100% value to 1000% horizontal scaling, then multiply with 0.94 for the 94% value and so on. This way you are not linking external files, not using anchored objects or overlays, and the bars will stay in place whatever other edits you do to the table.
Comment: FF Chartwell is a pretty incredible font. It's pretty amazing they are able to work that type of information into a font file.
Comment: Thanks! This was something I came across and I am definitely considering. I'm also hoping there's a way to do this without asking my boss to break out the credit card for another font.
Comment: I edited my answer and added an alternative without the need for AI files or special fonts. Just use Arial and play with a square glyph.
Answer: Imho, I would use Illustrator graph tool.
Now, let's have some fun and bring some magic into INDD using GREP.
The idea is to create character styles that would apply a strike-through to space after a given number. In the example below, I used 5 to 5 steps:
Then use Grep styles in your paragraph style in order to catch the space, in regard of the given number.

Finally, type any number from 0 to 100, press tab and space bar and enjoy the magic...

Edit
@Jooja suggestion to combine Grep style gives better accuracy, using a combined GREP style for dozens, then units. With about 20 styles + 20 grep, you can get every number from 0 to 100:

Decimal numbers could also be set up with advanced Grep.
I.e: <code>(?<=^2\d\t)\s|(?<=^2\d\.\d\t)\s</code>
Result:
Comment: Imagine characters  you can scale separately so with 2 styles you get 3 different combinations etc. For example say you have 2 spaces you can modify and styles for 50%, 12.5%, 20%  and 0% then you can get following combinations with 4 styles: 12.5, 20, 50, 25, 32.5, 62.5, 40, 70, 100 with just 4 styles. With 4 spaces and 4 styles you get even more 24 values in fact.
Comment: This seems interesting, but not sure i can follow. How can you control a space stretches to exactly 77% for a 77% value? Do you need 100 character styles for each value or am i missing something?
Comment: As I said, I used 5 to 5 steps, meaning "only" 25 char styles. In a perfect world, 100 styles would be needed, well 101 in fact, including zero. Honestly, I wouldn't go that way (I'd use AI graph tool). This is just an illustration on how powerful Grep are, and how you can tweak them with a little creativity.
Comment: Its neat but not very practical, since many times these graphs need to be accurate and working with 100 styles for each value is so-so. Also, percentages are not always the unit, sometimes its millions, etc which makes this harder to follow in some cases. But still I agree this is a good workaround.
Comment: @Vinny couldnt you make use of some pattern with say 4 spaces then you could combine a few styles for many more combination than styles.
Comment: @Lucian I do agree it's tedious and would work only on a % scale.(Although on a percentage scale, it would be accurate).
Comment: @joojaa Sorry I don't understand what you meant (english is not my 1st language)... Could you be more specific?
Comment: @joojaa, I think I got the idea. Sounds very interesting, I'll look into it and will edit my answer.
Comment: If you could please share the updated source file with us? :)
Comment: Sorry my dropbox is full, and I don't have time for a clean-up^^ Here's a Wetransfer link for 7 days... https://we.tl/RRXtBId0Um Note: INDD CS6 - Win 7
Answer: I apologize ahead of time, because this answer seems simple enough that you may have already decided it wouldn't work for your situation.  But, I know that I often over-complicate things and need someone to point out an obvious solution, so I thought I would post this anyway.
You could just create a table with 41 columns, with the numbers in the leftmost column and 40 cells.  Fill the entire table with green, and set thick green row strokes.  Add your numbers to the left column and then fill the applicable number of cells to the right of each number with blue.  I chose 40 columns so that I could fill 10 cells in the row labeled 70.  While creating the table, I had an additional row at the top with an asterisk character in every fifth column to make the counting easier.  I deleted this row when I was done filling the cells with blue. You will probably have to tweak some of the default cell margins to create a table as narrow as your example.

I saw in your comment that you were hoping to have one bar per cell, and this doesn't seem to fit that criteria, but otherwise it might work for you.
Comment: Not very effective to construct this way. Way too many cells.
Comment: I agree. I think that your suggestion to resize a glyph would be better assuming the OP can manage to adjust the scale to work.  However, in my defense, I have used my solution a number of times when I was in a pinch, and it works pretty well.  Not the prettiest or most elegant, but it definitely works, and doesn't require a separate program, purchasing a font or anchoring an image inside a table, which can be problematic.


Freefom, Captcha and Ajax Submission

Question: I have a Solspace FreeForm 4 form (free version) which I need to submit using Ajax. I can handle all the field validation in my JS but how do I handle a captcha error?
Comment: Why not use something like snaptcha or honeepot so you don't need to validate as it'll pass by default unless the robot tries to fill it in.
Comment: Sean brings up a good point in that there are better options out there over captchas. Sean I'd consider adding that as an answer as it seems like a good option either way and could be helpful for someone in the future if not now.
Comment: Just a quick note, for the ajax work - I'd look at something like [jQuery Form Plugin](http://www.malsup.com/jquery/form/#getting-started). I've implemented on top of all sorts of EE forms - User profiles, Login & Registration forms...
Answer: I've been using Snaptcha http://devot-ee.com/add-ons/snaptcha on my recent sites, I can attest that it works very well, No one enjoys filling out these captchas anyway, and their efficacy is doubtful anyway.
Answer: When a Freeform form is submitted with AJAX Freeform can provide JSON response containing errors or success, which can be used to display errors. This has worked well for me on previous versions of Freeform. The docs for the latest version of Freeform say that Freeform will detect AJAX automatically and provide a JSON response you can use to display user error/success feedback.
See the ajax parameter in the documentation.
There is actually an example of ajax form submission with validation at the end of the documentation, too.
Comment: Yes, it takes all the error messages that Freeform would normally show as a "system message" and returns them as JSON. Error messages such as "The captcha word you submitted is incorrect. Please go back and try again" or "In order to submit this form
you must complete the captcha field" are included in the JSON as appropriate. Its basically the system message(s) and a status (error or sucess) returned as JSON so that you can use it as needed.
Comment: And this handles captcha errors as well?
Answer: The captcha message comes back when the form is successfully posted.  You can grab it in the success function of the ajax call:
var form_data = $('#form_id').serialize();

$.ajax({
    type: "POST",
    url: 'desired_url',
    dataType: 'html',
    data: form_data,
    success: function(responseText, statusText, jqXhr) {
        if (responseText.includes("errors")) {
            var msgArray = $.parseJSON(responseText);
            var errorMessage = msgArray['errors'][0];
            // do whatever you want with the errorMessage.
            return false;
        } else {
            // continue
            return false;
        }
    },
    error: function(jqXhr, statusText, errorThrown) {
        console.log(errorThrown);
        return false;
    }

});

Freefom, Captcha and Ajax Submission


How do you define interactions in a mockup?

Question: I'm both a programmer and a UX/UI designer. When I design things, I generally make static images of what the interface will look like. The problem is, most UI's aren't static; they change and resize from user input. Of course, I know exactly how the interface should respond to such input, but for large projects the client and other programmers have to be able to take my mockups and understand the interactions. So how do you show in a mockup how your design interacts and responds to the user?
Answer: The best way to describe interaction is to model it with an interactive prototype.
There are various prototyping tools such as Axure or the one we're developing, Handcraft. Whichever one you use, the point is that they allow you to show your client, peers, etc. what happens when you interact with elements in the mockup. You'll get much better results using a prototype to show interactivity than you will with a clickable mockup, however. It's possible to show basic state changes with mockups, and there's a phase in the design process where this can be useful, but there are some things that are hard to describe with static images, such as animations (vital in certain situations), responsiveness (a key element of interactivity) and in the case of native or web apps, the "feel" of using that particular platform.
37signals talks a lot about how they skip wireframes and go straight to HTML. I wrote a blog post a few months ago about a talk they gave in which they described their process.
However, if you want to enrich static mockups, Jakub Linowski's Interactive Sketching Notation is a good starting point for a UML-like way to describe interaction:

See Pros/cons of PSD vs HTML mockups for a similar discussion:

If you're building a web site or
  application, HTML mockups are far
  superior because you're designing the
  mockup in the format as close to the
  final product as possible. This allows
  you to set expectations much more
  easily, it constrains you to just
  what's possible in the final product,
  and it affords much greater
  flexibility.
Comment: Another tool that is available for interactive mockups is Flash Catalyst. Though I've never used it myself, so I can't vouch for its effectiveness.
Comment: Thanks for the write up. Very comprehensive answer. Although I am primarily a Flex/Flash developer, going straight to a deliverable has some great benefits.
Comment: @Lèse I haven't used Catalyst yet either, although I suppose I should give it a try at some point--me also being a developer, I'm entirely scared of the code that it "generates" for use in Flash Builder (roots from Dreamweaver's generated html/css markup).
Comment: Update: I tried using Catalyst. It's a complete waste. It's actually _less_ useful than Flash Builder's design mode in my opinion. You can only use it to convert artwork into components, not an application. There's no way to visually make Groups or Containers.
Answer: When an interactive mock-up isn't an option, try text. You can add numbers that point at parts of the static image or wireframe, and then provide interaction notes for each number.

Above: an example of a pointing number.
Comment: +1 - I was going to suggest this very answer ;-)  It's how I do my first cut at wireframes when I need to communicate interaction to the client or team.  It's also very useful for programmers to begin technical design.
Answer: If you don't have the option of something like Axure (or another interactive prototyping tool or even HTML or Flash), I think your best bet is to wireframe the "standard" or "default" view, and then show in additional wires the alternate states of particular modules.
In my experience relying on text-based annotations to convey the changes is usually insufficient -- I've done too many projects where perfectly annotated wireframes were misunderstood or built incorrectly because clients/developers/etc. missed important textual details that would've been better captured visually.
Answer: I know this one is half a year old, but since nobody has mentioned it yet, I will:
Bill Buxton has written a book called "Sketching User Experiences" which deals with interaction design's "sketching" problem - how can we convey interaction concepts and patterns in an explorative manner, i.e. quickly and low-cost, but not too abstract?


Making `wget` not save the page

Question: I'm using the wget program, but I want it not to save the html file I'm downloading. I want it to be discarded after it is received. How do I do that?
Comment: So what's the point to download it then?
Comment: @Anonymous I assume to stress the remote server.. If you don't care about the content..   I'd probably use apachebench (ab) though.
Comment: I'm new to Linux - Would the `/dev/null` thing work?
Comment: The point is likely to trigger a webhook (commonly used in IoT / smart home).
Answer: You can redirect the output of wget to /dev/null (or NUL on Windows):
wget http://www.example.com -O /dev/null

The file won't be written to disk, but it will be downloaded.
Comment: This doesn't save the page, but it send email to me. Also is it possible to disable emailing ?
Answer: If you don't want to save the file, and you have accepted the solution of downloading the page  in /dev/null, I suppose you are using wget not to get and parse the page contents.
If your real need is to trigger some remote action, check that the page exists and so on I think it would be better to avoid downloading the html body page at all.
Play with wget options in order to retrieve only what you really need, i.e. http headers, request status, etc.

assuming you need to check the page is ok (ie, the status returned is 200) you can do the following:
wget --no-cache --spider http://your.server.tld/your/page.html

if you want to parse server returned headers do the following:
wget --no-cache -S http://your.server.tld/your/page.html

See the wget man page for further options to play with.
See lynx too, as an alternative to wget.
Comment: I'm confused. `--no-cache` in the man page says it causes wget to "send the remote server an appropriate directive ('Pragma: no-cache') to get the file from the remote service"
Comment: It says to the server your client don't want a cached version of the file .. we want to get the very last release of the resource we are requesting for
Answer: In case you also want to print in the console the result you can do:
wget -qO- http://www.example.com

Comment: I like this option best. It let's me see what it gets but doesn't save it. The switches are specifically `q` quiet mode, (it doesn't output progress and other info), and `O-` (write the retrieved document to console).
Answer: $ wget http://www.somewebsite.com -O foo.html --delete-after
Comment: Thanks a lot. The `--delete-after` option is the choice when you have to download recursively but you want to discard the actual content.
Comment: +1 for me, the command is intuitive -- at a glance, I can more quickly comprehend what's going to happen than `-O /dev/null`
Answer: Another alternative is to use a tool like curl, which by default outputs the remote content to stdout instead of saving it to a file.
Answer: Check out the "-spider" option.  I use it to make sure my web sites are up and send me an email if they're not.  This is a typical entry from my crontab:
46 */2 * * * if ! wget -q --spider http://www.rochesterflyingclub.com/ >/dev/null 2>&1; then echo "Rochester Flying Club site is down" ; fi

Answer: If you need to crawl a website using wget and want to minimize disk churn...
For a *NIX box and using wget, I suggest skipping writing to a file .  I noticed on my Ubuntu 10.04 box that wget -O /dev/null caused wget to abort downloads after the first download.
I also noticed that wget -O real-file causes wget to forget the actual links on the page.  It insists on an index.html to be present on each page.  Such pages may not always be present and wget will not remember links it has seen previously.
For crawling without writing to disk, the best I came up with is the following
 mkdir /dev/shm/1
 cd /dev/shm/1
 wget --recursive --relative --no-parent ...

Notice there is no -O file option.  wget will write to the $PWD directory.  In this case that is a RAM-only tmpfs file system.  Writing here should bypass disk churn (depending upon swap space) AND keep track of all links.  This should crawl the entire website successfully.
Afterward, of course,
 rm --recursive --force /dev/shm/1/*

Answer: Use the --delete-after option, which deletes the file after it is downloaded.
Edit: Oops, I just noticed that has already been answered.
Answer: According to the help doc(wget -h), you can use --spider option to skip download(version 1.14).
Download:
  -S,  --server-response         print server response.
       --spider                  don't download anything.

Comment: How does this add to the other answer that mentions --spider ?
Comment: It explains what `--spider` means. Thanks.

Making `wget` not save the page


Is anyone using an iPhone/Pad/Pod to record from a MixPre-D's USB output?

Question: I'm thinking about using my MixPre-D as a USB interface for my iPhone for field recording, thus keeping the signal from having to convert to analog again (and again to digital) after the mixpre's A/D conversion. Has anyone done this, and does anyone have any recommendations for good app's to use to do the recording?
Answer: I tried this with a mixpre-d and an Android tablet (so same idea) and it worked fine,but, and this is the rub, it had slightly more self-noise than running a line level out into a recorder. A surprise to me, but testing was pretty rigorous. Given that using a rugged mixpre-d to an iPad/iPod/nexus is not very field use friendly either, so it would better on all grounds to use line out xlrs. Of course, the aes output may be better, but I suspect not: the da converter on the mixpre-d is not as good as on the usb-pre2. Hope this helps.
Answer: I've used a usbpre2 with my iphone 4s and works really well. Use Rode Rec, it's a great app for recording. Not sure if it's the same with a MixPre but when I updated the iOS the interface stopped working with it. I've not tried it on the iPhone 6.


Why didn't Ali (RA) punish the assassin of Usman?

Question: I've read in many places that he was hesitant to punish his killers, which eventually led to the fitnah and then his own death. If he'd had punished them possibly the battle of Karbala could've been averted. So can anyone please tell?
Comment: Shouldn't this be on History Stack Exchange? Short answer, because he couldn't. Muawiya R.A. demanded that when Ali asked him to step down, Ali replied he needed time but Muawiya rejected that and so first fitna started. Then Ayesha R.A. and Ali R.A. agreed to do that at the end of Camel war, but 10,000 members of his army proclaimed themselves to be murderers of Usman, threatening Ali. He couldn't touch them because they were the bulk of his army and his supporters and he needed to bring  the empire into order first and fight Muawiya and Amr bin Al-Aas.
Answer: Salaam

It must be considered that Uthman was not killed by a single person, whom can be sentenced to death by the Islamic ruler. Massive revolution by the Muslims, ultimately, led to death of Uthman. Therefore, Imam Ali (PBHU) could not punish tens of thousands of revolutionary people. A revolution that Uthman himself was not blameless in creating it.
In confirmation of this, the book "Siffin war" states that:

"
  Abu Amayma bahli (ابو امامه باهلى) and Abu Darda (ابو درداء ), who were in Levant, came to Muawiya, and said to him: "O Muawiya!, on what basis are you fighting with Ali (AS)? We swear to Allah that he was Muslim before you became Muslim, he is more worthy than you in ruling Muslim's society, and he is closer to the Prophet Muhammad (PBHU) than you. So why do you fight with him?
Muawiya responded: I fight against him in revenge of Uthman's blood, because Ali has sheltered Uthman's murderers. Tell him to permit us to reach Uthman's murderers and show them to us. In which case I will be the first person dwelled in Levant with whom I swear allegiance."
Then, they went to Ali (AS) and informed him of Muawiya's statement. Ali (AS) said: "If you want Uthman murderers, this is what you see." There were twenty thousand people or more who were wearing iron armor, except that their eyes could not be seen and they were saying: We are all his killers, they should take retaliation for all of us if they with to retaliate. So Abu Amaymah and Abu Darda returned and did not attend any of the wars, and this happened in the month of Rajab. [1]"

This question can also be raised if Muawiya really wanted to defend the oppressed, why did not he rise up to defend and take revenge of Hazrat Hamzah (AS)? Is there anything else but he and his father interfered in that? And was not Uthman's death only an excuse for Muawiya to pursuit his political intentions?

Reference:
[1] المنقرى، نصر بن مزاحم، وقعة صفین، ص 191، تحقیق، عبد السلام محمد هارون، القاهرة، المؤسسة العربیة الحدیثة، الطبعة الثانیة، افست قم، منشورات مکتبة المرعشى النجفى، 1404 هـ. ق.
You can read online this book here. (in Arabic).
Comment: While I understand this is the Shia view, I am afraid to note that this is simply not accurate historically. As for Hamzah RA, he was Hashami, Muawiya RA and Usman RA were Umvi. Muawiya had no close kinship with Hamza unlike the one he had with Usman. Muawiya was loyal to Usman and he even tried to persuade Usman to accept Syrian Armies in Medina. Naturally he felt suspicious when supporters of Ali RA murdered Usman and then Ali becomes Caliph. Even today, investigations begin with the person who benefits from the murder.
Comment: That in no way implies that Ali RA was in fact complicit in the rebellion instigated by the troublemakers, there is no historical proof in this regard and Ali himself did not approve of the murder and rebellion. But there can also be no doubt that the rebels were supporters of Ali and wanted to make him Caliph on baseless allegations against Usman.
Answer: <code>           In the name of Allah, the Entirely Merciful, the Especially Merciful
</code>
Briefly speaking, De facto, Othman was not murdered by just an individual, that he/she can be able to be punished by Islamic ruler, but there was a great revolution from Muslims  that ultimately was led in murdering of him. As a result, Imam Ali (a.s.) couldn't punish tens thousands of people that Othman himself was not without fault in that.
Source and further information:
www.al-islam.org and this
Answer: Muawiye and the appointed governor of Egypt were not really concerned about the murderers of Othman.  Their main objective was getting the caliphate for themselves.  The umma chose Ali (rdlhn) as the khalifa to succeed the martyred Othman.
This is verified by the fact that Muawiye never followed up on this investigation of who killed Othman soon after the death of Ali.  Muawiye was the caliph after the death of Ali and he signed a non-succession agreement with Ali's oldest son Hasan.
Othman's relatives asked Muawiye at that point to bring the murderers of Othman to justice as late justice is better than no justice and Muawiye had rebelled against Ali for Ali's reluctance in this regard. Muawiye then changed his mind and never sought the justice for Othman's family as he was never sincere in this in the first place.
Ali had appointed his own sons, Hasan and Hussein to defend Othman but they were overwhelmed by the mob that entered Othman's home.  Ali was more interested in preserving the unity of the umma than adding fuel to the flames of rebellion.  If Muawiye had not caused the fitna, things would have calmed down and this justice would have been pursued in accordance with Sharia. Muawiye and his cohorts never allowed the Islamic state to form and instead caused fitna and civil war.
Answer: If hazrat ali sons were there to protect usman my question is they are the witness of the murder. Naturally 20k ppl cant slaughter a man together there must be one of two individuals who must have committed the crime. So if thet were there it was wat easier to hild them accountable only and negotiate the rebels to habd them over. Had ali and muawiyas forces combined and asked tge rebels to habd over the actual killers it would have been difficult for them to resist and incase of war could easily have been overwhelmed. It appears that ali considered the murder of usman justified and muawiya used the event to get power.


Change existing template in Joomla 2.5

Question: My live website is not user-friendly, and I'm considering to use a new template. I bought a template, but how can I use the new template for the same content with some modification? If I use new template, will it be harmful for SEO? If there is no problem with SEO then I was thinking to modify the website in local server and when it is ready then will upload to live server. will it work this way?
Comment: Rule of thumb - templates should affect only Presentation to the use, not your data or business rules
Answer: First of all, you should absolutely work on a copy of your website when doing major layout changes. I recommend using Akeeba Backup, and restore a copy on your local server.
Templates are installed just like any other extension (through Extensions -> Extension Manager). Once installed, you can set it as default from Extensions -> Template manager by clicking the star next to the new template. You can also preview your template by adding ?template=template_name to your URL (e.g. http://example.com/index.php?template=Beez3).
A template does not affect your content. You should however be aware that different templates might use different module positions, especially if they are from different template developers. That means you probably have to change the position of all your modules to make the site look right. For example, the sidebars has many different names depending on your template, I've seen left & right, sidebar1 & sidebar2, side-a & side-b etc. It's possible that some of the positions in your current template are unavailable in the new one.
In addition, modules often use Module Class suffixes in order to obtain a certain layout:

This is also template dependent.
The best way to find the available module positions is to visit the template developers website. The template demos usually has a menu item called "Module positions" (or similar) that shows available positions and suffixes.
At the end, installing a new template is not overly difficult, but it will take some time to make it look right with your existing articles and modules.
Good luck!
Answer: Yes, a new template could significantly affect your SEO, either negatively or positively. Not only do you have to consider document semantics and elements like microdata but you must also know that performance and mobile-friendliness is also is a metric considered by search engines.
Will a template that uses semantic sectioning elements, Landmark roles and microdata perform better in SEO terms than one that doesn't? Yes.
Will a faster template perform better in SEO terms than a slow one. Yes.
Consider accessibility and performance as key criteria when choosing a template.
Answer: Step 1: Log into your Joomla administrative dashboard.
Step 2: In the top menu, click Extensions and then click Template Manager.
Step 3: You will see two types of Joomla templates, Site and Administrator.
In the list of templates, click the hollow star next to the Site Template that you would like to activate your new uploaded template. You will then receive the following message:
You get successful message!
Message
Default style successfully set

Comment: These instructions are already provided by @johanpw  Please only post an answer when you have new and unique advice to offer.

Change existing template in Joomla 2.5