Best practice for Facebook authorization / action on mobile without plugins

Question: I'm writing an app using Phonegap.
I'd like to give some perks to the user for posting about the app on their wall (or something of the sort) if they wish to do so.
There's a neat Cordova plugin which covers Facebook's functionality pretty thoroughly and more importantly it appears that it does so as natively as it can manage.
If a plugin like that is not available however, what is a high-level overview for having a user:

authorize with FB
post something canned on FB
ascertain that they have in fact posted what was given to them

I believe there's a way to do these things using Facebook's JavaScript SDK, but I've never seen an app ask me for my username and password (that wasn't the actual Facebook app) and I don't imagine Facebook would be happy with that, so what's the best way to go about that?
Additionally, if I want for a user to log in using Facebook in my app, (think Tinder) what is the data that I should be saving? Facebook login token and device ID? What are the best practices when it comes to using facebook and phone data to identify and store user account information server-side?
Comment: You might want to make that second question (the last paragraph) into its own question--it'll get more attention that way.
Answer: Facebook Login for Android -
The Facebook SDK for Android provides methods to implement Facebook Login for your app. The SDK provides Facebook Login support for the these common scenarios:

Your app uses only Facebook Login to authorize people using your app.
Your app provides two login options: Facebook Login and your own
login mechanism.
Your app uses your own login initially and Facebook Login is an
option to switch on certain social features.

For more - login-with-facebook.
Manually Build a Login Flow -
The easiest and quickest way to implement Facebook Login is with our official SDKs for JavaScript, iOS, and Android and we recommend you follow our separate guides for these platforms.
However, if you need to implement browser-based login for an app without using our SDKs, such as in a webview for a native desktop app (for example Windows 8), or a login flow using entirely server-side code, you can build a Login flow for yourself by using browser redirects.
This guide will take you through each step of the login flow and show you how to implement each one without using our SDKs:

Checking login status
Logging people in
Confirming identity
Storing access tokens and login status
Logging people out
Make direct HTTP requests to Graph API endpoints to retrieve
and post data.

For more check - manually-build-a-login-flow.
Pros:

No plugin dependency and no uncertainties when new versions of
Cordova or the Facebook SDK are released.
Works for all platforms, including platforms for which a version of
the plugin doesn't exist.
Works for both browser-based apps and Cordova apps.

Cons:

Not full-fledged, less out-of-the box features.
Integration not as tight. For example, no native dialogs, etc.

The logic is integrated together and is available on github as OpenFB.
Sample Example -
Login using Facebook:
openFB.login(scope, successHandler, errorHandler);

Get the user's list of friends:
openFB.api({path: '/me/friends', success: successHandler, error: errorHandler});

Post on the user's feed:
openFB.api(
    {
        method: 'POST',
        path: '/me/feed',
        params: {
            message: 'Testing the Facebook Graph API'
        },
        success: successHandler,
        error: errorHandler
    });

Answer: Either you have to use Facebook connect plugin to post something from cordova app, or the other way that I use to post something about my app review is using the URL way. Facebook has feed dialog / share url system to post in facebook. Simply calling it with native browser and correct parameters does the job, facebook takes care about the authorization and posting , I don't need to handle that.
https://www.facebook.com/dialog/share?
  app_id=145634995501895
  &display=popup
  &href=https%3A%2F%2Fdevelopers.facebook.com%2Fdocs%2F
  &redirect_uri=https://developers.facebook.com/tools/explorer

Found here Don't know will it work in inAppBrowser or not, I just call the native browser.
And AFAIK to post from within the app, it has to be the plugin.
Answer: You would just use the JavaScript SDK to do this. See https://developers.facebook.com/docs/facebook-login/login-flow-for-web/v2.0
You have an option to use standard components or make your own buttons. You can also let users auto-authenticate after granting permissions initially or always press the button etc. The FB docs are easy to follow though.
Answer: OpenFB is even better than the Apache Cordova Plugin. The plugin isn't well maintained. Sometimes it takes months to update to the latest version of Facebook OpenGraph. OpenFB is constantly updated.


Inline CSS on Header Tag

Question: Does putting inline CSS on a heading element such as
 and
 affect SEO? If so, how?
Comment: This isn't the 90's, Google and Bing wouldn't care less about your markup ratio. Ignore those outdated, non-sense, online SEO checkers.
Comment: *text-to-html ratio* was never a consideration. It was a typical ridiculous machination by yet another so-called SEO professional. At the time this theory appeared, Google for example, was well able to separate content from the rest of the page and evaluated content completely separate from the HTML. Ratio was never a metric or an indicator of value or quality.
Comment: No, why would it?... however inline CSS is something you should avoid if possible, as its harder to manage and increases page size.
Comment: yes cause it will lower the value for text-to-html ratio. @SimonHayter
Comment: so you are just referring to the Page Speed of the Site? @SimonHayter
Answer: What counts for a search engine is textual content, it will filter out everything else.
In-line CSS will contribute to the payload of the page and that affects the load speed.
Comment: Presumably, his inline styling of a h1 element will be insignificant.
Answer: Recent SEO tests show that Google doesn't pay much attention to tags anymore.   Using
 tags is not really important at all anymore.
Google does give more weight to text that is large bold, above the fold, and centered.   IE, text that looks like a heading.  Styling your h1 tags such that they don't look like headings is going to be counterproductive.   Google is going to treat the text inside an h1 that is styled to look less prominent as if it were not in a heading tag at all.
Conversely, styling a  or
 to look like a heading (big, bold, and prominent) will give the text in it more SEO weight.  It doesn't matter if that styling is inline, or done through a linked CSS file.
Answer: The main thing is that you should use separate css file for styles that improve your site's load time. On top of that, you can hide your .css from the SE bots whereas any evil inline css you use will be plainly visible to all the bots.
But if you're using nicely, there really is not a big effect on SEO or ranking.
Answer:
Does putting inline CSS on a heading element such as  and  affect SEO?

No, but it might slow down the page a notch since you're expecting the web browser to apply a style on-the-fly.
If your clients support javascript, consider styling the tag with it so that most of the page loads very quickly and the style comes on after the bare bones of the page have loaded. For example:

Main content

It may add a few hundred more bytes to the HTML but at least all the text-based content will load before any styling is applied to it. This means users can see text sooner.

Inline CSS on Header Tag


How do you inject build-specific configuration into an APK?

Question: I have an Android app which I distribute to several different market providers; the app is functionally the same for each, but requires certain distinct configuration parameters.  Ideally I would like to produce all the individual APKs in one build step.  Is there an "official" way to achieve this?
I am considering an approach in which I have a template file in the project structure, and at build time use ant to interpolate values into an output file such as res/xml/config.xml.
Thanks in advance!
Answer: There are a couple ways to approach this:
1) Setup an Android Library Application
(designed for Eclipse)
This is the method suggested in the Android documentation. With this method, you would setup your application to be a "Library Project".
Then, for each specific build you would like to produce, you would setup a new Android project that references the previously created Library Project. This project would need to have its own AndroidManifest which declares the components used from the library application. Since each application has its own manifest, almost any type of customization can be made by swapping out components or changing information. However, while allowing for complex differences, this does create some redundancy in maintenance if there is few differences.
2) Built an ANT script or other build script to manipulate the configuration
An ANT script could at build time manipulate the sources or XML files to allow for custom configuration. The easiest way to do this would be use the unix sed or a python/ruby script to do the customization. This is ideal where the customization is limited to small changes and/or just textual replacements. This is my route of choice in most cases.
I recommend copying the source tree to a temporary directory prior to making the manipulations such that it can be cleared on an "ant clean" and will not affect the working copy of the source.
One warning with this is that I would design the modifications such that the source still builds without running the script (i.e. so you can do standard builds while developing in eclipse or any other environment without requiring the special script to run).
Answer: You could just set up a Maven Android Plugin based build for your apk that uses resource filtering and profiles for your different configurations. Check the morseflash example of the official samples project to see how it is all done in detail.
Once you have the profiles set up you can use the maven invoker plugin to run it all in one sweep. And if you want to have it automated just put the build on Hudson.
http://code.google.com/p/maven-android-plugin/
http://code.google.com/p/maven-android-plugin/wiki/Samples
http://www.simpligility.com/2010/11/release-version-management-for-your-android-application/
Answer: I use an ant script, which reads a few build-time parameters and generates the appropriate APK for me (appname-1.1_ggl, appname-1.1_amz.apk which contain links to the Google Market or Amazon Market, respectively). Manually running it twice isn't a big deal.
It may not be realistic, depending upon how many permutations you have (you don't mention), but you could use subant. Using a different buildpath and subsequent build.properties for each permutation you need to call.
Answer: I use a library project that has all the code and two (or more) projects referencing that library.
The library project has a resource file called config.xml in its res folder and this file is overridden in the other projects.
that way I can have different application settings and each build has its own manifest.xml so you can really configure things differently for each build type.
This also allows you to have specific code/permissions/... that is only required by a specific build and makes the build process very easy.


Is it possible to go by ship from Djibouti to Egypt?

Question: I want to go by ship from Djibouti (any port) to Egypt (again any port).
Cargo ship, passenger ship / ferry, dhow any vessel will do.
Is this possible and at what costs?
Comment: I looked into this a few years ago and couldn't find anything definite. You can of course charter a dhow, but I couldn't reliably find any scheduled services.
Answer: There doesn't appear to be direct ferry or ship connections as straightfoward as Djibouti to an Egyptian port.
You'd have to cobble together a series of voyages to take you the length, and breadth, as described by The Traveller's Guide to the Red Sea

This vast sea stretches from the Bab Al Mandab strait, separating Djibouti and Yemen in the south from Suez in the north. It is 2,250km long but, at its widest, only 355km across.

By boat, Wikitravel notes:

There are ferry services connecting Djibouti to Yemen. Djibouti City is one of the main ports of eastern Africa so it's well trafficked.

Again, from The Traveller's Guide:

Arab Bridge Maritime (abmaritime.com.jo) operates daily catamarans and ferries between Aqaba and Nuweiba, with fares from US$60 (£34). Ferries also link Sharm and Hurghada, as well as Saudi ports such as Duba and Jeddah from Suez, Safaga and Port Sudan.
Further south, you could haggle for deck space aboard vessels plying between Mokha (Yemen) and Massawa (Eritrea).
Louis Cruises (0800 018 3883; louiscruises.com) runs regular mini-cruises between Suez, Sharm and Aqaba. The Voyages of Discovery 13-day Egypt to India cruise (0845 018 1808; voyagesofdiscovery.co.uk), departing Sharm on 8 December, sails the full length of the Red Sea, with two stops in Oman before reaching Mumbai. From £999, including flights and all meals.


What authentication using SQL Server out of process

Question: That means user name and password will be stored in SQL Server?
What is difference between SQL Server and state server authentication
Answer: sqlserver uses an SQL database to store session info. State server uses a windows service called ASP.NET State Service to store session information.
Either one allow for more than one web server to "share" session information across multiple servers.


is it safe to remove soil from basement footing?

Question: I'm planning to renovate my basement so that I can use it as additional storage room and access for internal stairs. My basement is half concrete and half soil covered. I'd like convert the soil area to concrete so it will be cleaner and bright. I've got a question around the basement footings as I noticed they're covered with soil that's fenced around them. Is it safe to remove the soil around the footings ? does the soil provides additional protection to the footing? what can I do if I want to tidy my basement and also still maintain the integrity of the footings?
Comment: What is under the foundation walls?  Is there a buried footing or is the concrete just sitting on the ground?
Answer: The footings need to stay on the originally compacted soil, if possible, surrounded by several feet of soil for support, which is also supported against subsidence.  They have uniformly settled to where they now sit. If you disturb any of them, you may end up replacing all of them and having to jack your posts (if not floors) to get everything back into level, plumb and square (as if).
I have an old (1920s) country house in which the original fieldstone fireplace pedestal was left surrounded by three feet of undisturbed soil, supported with a wall of reinforced concrete, with everything else in the basement excavated 8 feet deep for a new slab and all new footings and posts.
A structural engineer explained why we have to sacrifice those 120 sq ft of basement floorspace "forever".
Comment: Two very important words in the prior comment: structural engineer. Before you disturb any soil hire one to do an evaluation. You can do the construction yourself. But not the engineering.
Answer:
they're covered with soil that's fenced around them

I don't think so.  The footings for the pillars in the half-depth basement are the concrete pads under the concrete pillars.  These footings must rest on, and be surrounded by, undisturbed soil.  Obviously, they are not.
But I'm not a structural engineer.  You should consult one on an urgent basis.
While you're waiting, read this.


Which part of solar radiation (VIS, NIR) keeps Earth warm?

Question: Which part of solar radiation (visible light vs. infrared radiation) plays main part in keeping Earth's surface warm?
Comment: The answer to your question is "both". I'm trying to find a good reference, but you cannot say one is more important than the other as the Sun's energy is close to evenly split between the very narrow visible band and the much, much broader infrared band. Unreliable sources indicate the split at the top of the atmosphere is roughly 10% UV, 40% visible, and 50% infrared. Much less than 1% of the solar radiation energy at the top of the atmosphere lies outside the UV / visible / infrared bands.
Comment: @DavidHammen And the albedo is the same for VIS and NIR?
Comment: No, it is not, and neither is the absorption. The Earth's stratosphere absorbs much of the ultraviolet, and the troposphere absorbs more infrared than visible. However, that warming of the Earth's atmosphere indirectly warms the surface of the Earth.
Comment: For future reference it's preferred to ask for a moderator's help to migrate a question than to [delete one copy](https://astronomy.stackexchange.com/q/40623/7982) and then post a second copy somewhere else. Even though it's invisible to many users deletion is not really deletion as much as it is a partial invisibility cloak.
Comment: [A link to the first copy of your question](https://chat.stackexchange.com/transcript/message/56567464#56567464) is still visible, but for people below a certain reputation score if they click that it will be invisible, and *your message linking to the new copy* which is now in a deleted post would also be invisible https://i.stack.imgur.com/NslVP.jpg to many/most users.
Answer: Electromagnetic radiation converts based on frequency and exposure. Visible light and Infrared waves are the predominant energy sources that can penetrate the atmosphere. Higher energy wavelengths (UV and above) do interact but are often bounced by significant portions. Those radiations interact with atmospheric gases; emit infrared waves in the process.
Comment: Infrared is stated to be the biggest contributor to heat (50%), followed closely by visible light (40%), then ultraviolet (10%).
Answer: Edit
I asked an AI your question, and got the following response.  I then analyzed / researched / verified it in the following sections.
Short answer - Infrared radiation is what heats the Earth the most, followed closely by visible light, though all frequencies do somewhat heat the earth.
AI generated answer to the question "Which part of solar radiation (visible light vs. infrared radiation) plays main part in keeping Earth's surface warm?":

The AI correctly responded with high confidence "Infrared Radiation".

My own human analysis of the AI's response:
This is produced by the Dragon AI in AI Dungeon, which is likely correct because infrared light has more of a heating effect than visible light.  This is correct per the data I researched below as well:
Researched answer: https://ag.tennessee.edu/solar/Pages/What%20Is%20Solar%20Energy/Sunlight.aspx

Much of the energy from the Sun arrives on Earth in the form of infrared radiation. Sunlight in space at the top of Earth's atmosphere at a power of 1366 watts/m2 is composed (by total energy) of about 50% infrared light, 40% visible light, and 10% ultraviolet light[1]. At ground level, this decreases to about 1120-1000 watts/m2, and consists of 44% visible light, 3% ultraviolet (with the Sun at the zenith (directly overhead), but less at other angles), and the remainder infrared. Thus, sunlight's composition at ground level, per square meter, with the sun at the zenith, is about 527 watts of infrared radiation, 445 watts of visible light, and 32 watts of ultraviolet radiation. The balance between absorbed and emitted infrared radiation has a critical effect on the Earth's climate.

If anyone can come up with another reference to strengthen this (or if anything contradicts this), please comment.  I was not able to find anything beyond this link online.
Comment: Unfortunately, the sole reference on the linked page is to a Wikipedia article that does not support the claim.
Comment: -1: What is this? First part of the answer states "only IR" while the second part of the answer and comments above clearly show its "not only IR". How can the author of this answer not see this blatant discrepancy and comment on it at least? Also the 'human analysis' (your work?) essentially says "its IR because its IR", which is circular logic and therefore doesn't say anything. Please improve.
Comment: @AtmosphericPrisonEscape The first part is what the AI said, the second part is my reasoning, and finally, the "proof" - the research that backs up the answer.  Infrared is indeed the biggest contributor per the research stated.  I personally find it impressive the AI was able to correctly answer the question, and kind of funny it bragged about it.   To clarify, infrared is the biggest contributor to heat, which was the original question.  This is closely followed by visible light, then ultraviolet light.
Comment: @AtmosphericPrisonEscape - I think I see and have addressed the source of your confusion: the question the AI answered was "Which part of solar radiation (visible light vs. infrared radiation) plays **main** part in keeping Earth's surface warm?"  It correctly answered Infrared.


parallel regions

Question: To me the statement "two line segments are parallel if they are parts of parallel lines" is clear. How can we identify two different regions are parallel? Is it the statement "two regions are parallel if the planes in which they lie do not intersect" correct? Or when we say "two different regions are parallel" we mean intuitively the two regions are being an equal distance apart everywhere? For example, we often say "the bases of a right circular cylinder are parallel".
Answer: Two planes are parallel if every line in them is parallel to some other line in the other plane and vice versa.  In $\Bbb R^3$, this amounts to the planes never intersecting (or being the same).  I don't really like the distance definition because we then have to define what we mean by distance between a point and a plane, etc.
Answer: Two different planar regions can be called  parallel if it's normals are parallel.

parallel regions


Not able to view my earlier post!

Question: Are all posts that I have posted till date available? If so where to search? To search my previous posts, I clicked my name on the top of the page. But there one post (regarding learning perl - web materials) which I had posted nearly a month back wasn't there. It's too important for me as it contains useful links for learning perl.
How to get that post please?
Comment: What specifically was this Q about? Perhaps it was migrated to another SE site or deleted?
Comment: Looked thru the last 30 days worth of deleted Q's and didn't see any about Perl. If you give me more info I can try and find out what happened.
Comment: Was it this Q? http://stackoverflow.com/questions/18469686/how-to-split-files-using-perl
Answer: The question is here. It was closed pretty fast as being opinion-based, and was categorized as abandoned by the system and automatically deleted. Questions aren't really supposed to hang around closed; in theory they either get fixed and reopened, or eventually deleted.
There weren't any answers, and the only place the comments linked to was the Perl website, which doesn't seem like it would be hard to find on your own, but here are the links again:

http://perldoc.perl.org/
http://perldoc.perl.org/index-tutorials.html
http://www.perl.org/books/library.html
Comment: Yes, that's the one! Thanks a lot!
Comment: Seriously I have an issue. I had been searching for good materials for understanding packages/namespaces in perl. But the docs/links aren't able to clarify this concept. It seems it assumes some knowledge of package/namespace already. But for me who is the 1st time learner of package, the docs fails to clear the fundamental from scratch. 1st I went through `modern perl` to understand package but it was not from basics and seemed to be a bit advanced. So, I went to `perl for begineers` book but here also the same issue. What sort of books are these that can't clear the fundamentals from scratch
Comment: @Ravi I have no idea, I don't know Perl, and this isn't really the place to try and explain it if I did. If you can come up with a specific question about Perl, feel free to post it; if you're just looking for a tutorial, Perl is pretty old, so I imagine that googling your issue will find tons of them
Comment: Just one thing I would like to add to my last comment above that the physical text books which I purchase and read are so nicely explained that once you read chapter 1 , the next chapter would be clear automatically and so on. It's too interesting to read physical books. But these online books mentioned aren't made that way. If you read a chapter, some terms would be such which had never appeared earlier. So, I have to search that term. Now, to understand this term, I need to understand other terms and finally I would find that I am only wandering, that's all! Also addressing @goldilocks
Comment: @Mat As Mat has assisted in the materials, I am addressing him also the above comments.
Answer: Clicking on your name is the easiest way to access your stats page, from there you can click the "Questions" link towards the bottom to get the list of all the questions you've asked on a given SE site.
Comment: Oh!! Yes I checked this earlier but missed clicking `recent deleted posts`. I hope all my posts should be available always there so that there is no need to copy it on my system?

Not able to view my earlier post!


Is a bridge more stable on concrete or soil?

Question: I understand that foundations are used in structures to support and spread the weight of the bridge over a large area. However I am struggling to understand why certain materials such as concrete are used in foundations over others. My first thoughts were based on how uplift may be effected.
Answer: Concrete is a strong, reasonably low cost, readily available, versatile construction material.
It lasts forever and keeps getting even stronger over time.
It can become into a very flexible, or very stiff part of the structure, depending on the type of reinforcement and their position.
It can be placed in a wide range of weather conditions and will last submerge under running corroding water.
It can be used almost all over the world from Antarctica to hottest arrid climates in the desert.
It can be modified, drilled into, attach brackets or hardware to to receive new configuration of superstructures.
It is responsible for some of the wonders in modern engineering and architecture in the world. Some examples are the highways in Europe, high-rises in Dubai and Hong Kong.
All are built on concrete foundations that withstand the harsh salty ocean waters, none of which would be possible without concrete foundations.
Comment: It is also responsible for CO2 emissions...


Who wrote that Achashteranim were eight-leggged animals?

Question: The Bible (Esther 8:10, 8:14) references an animal called האחשתרנים (the Achashteranim). I have seen Jewish Medieval commentators, including R. Joseph Kara and R. Elazar Rokeach of Worms (unavailable online) who explained that this refers to eight-legged animals. However, both of those works were first published in the last few decades. I also found that R. Jacob Emden (1697-1776) in his glosses to the Talmud (Megillah 18a) writes the same thing (see here) in the name of "writers of the provinces," which seemingly refers to non-Jewish chroniclers. It is unlikely that Emden's source are those Jewish Medieval commentators who I mentioned because their works were published after his lifetime. So what is the source that Emden used for this?
Comment: Ester 8:10 "Mordecai wrote in the name of King Xerxes, sealed the dispatches with the king's signet ring, and sent them by mounted couriers, who rode fast horses especially bred for the king." Which 8 legged animal can be ridden by couriers? In context an 8 legged animal does not make sense.
Comment: @David D  If the dispatch rider rode one horse, with a second one tied to run alongside as a change-over when the first horse began to flag, there you would have eight legs!
Comment: @Anne So, two horses = an eight legged animal? Would 4 horses = a sixteen legged animal?
Comment: @David D  No. Take 8 equine legs, divide between 2 horses = 4 legs per horse. Take 16 equine legs, divide between 4 horses = 4 legs per horse. If the word in question allows for a plurality of creatures, that would solve it, but that would take the Q into the Hebrew language category, or mythology if it is a singular creature.
Answer: In Esther 8:10, 14 the King James Version of the Bible says that the letters were sent "by posts on horseback, and riders on mules, camels, and young dromedaries."  The New International Version, New Living Translation, and English Standard Versions all say fast horses specially bred for the king.
External sources have this to say:

In Es 8:10,14 we find the doubtful words (8) 'achashteranim, and (9) bene ha-rammakim, which have been variously translated. the King James Version has respectively "camels" and "young dromedaries," the Revised Version (British and American) "used in the king's service" and "bred of the stud," the Revised Version margin "mules" and "young dromedaries."  https://www.internationalstandardbible.com/H/horse.html

Another source makes this comment:

achashteranim (Esther 8:10,14, the King James Version "camels," the American Standard Revised Version "that were used in the king's service".

There are a few unusual words which have been translated "camel" in text or margin of one or the other version. (See list of words at beginning of the article) Bekher and bikhrah clearly mean a young animal, and the Arabic root word and derivatives are used similarly to the Hebrew. Rakhash, the root of rekhesh, is compared with the Arabic rakad, "to run," and, in the Revised Version (British and American), rekhesh is translated "swift steeds." Kirkaroth, rammakhim and 'achashteranim must be admitted to be of doubtful etymology and uncertain meaning.  Alfred Ely Day  https://www.biblestudytools.com/dictionary/camel/

There may be a mythological eight-legged animal, however. Rav Yaakov Emden in his glosses to Megillah 18a, says that he saw in Persian history books that this is a unique breed of camels with two humps and eight legs, that run very quickly.

Can we identify what sort of camel Rav Yaakov Emden was discussing? I think we can. I believe he was referring to the Sarabha. From Essays on Indo-Aryan Mythology (and thus that of Persia):

Thus, the word Sarabha was used for real animals, such as peacocks, wild buffalos, young elephants, and camel. There is also the "fabulous" Sarabha, which is ashtapad, having eight legs, four of which are upward.

I don't know if in any of these texts, it is both eight-legged and a camel. It is certainly possible; it is also possible that Rav Yaakov Emden was relying on some text that conflated the normal Sarabha, a camel, and the fabulous Sarabha, which was eight-legged. Or else it spoke of Sarabha in different contexts and Rav Yaakov Emden put two and two together....

I think, therefore, that Rav Yaakov Emden was misled, and that this creature is surely not the same one as in the pasuk in Esther. This is one of the pitfalls of Torah UMaddah -- where the madda fails, the peshat fails as well.

He is likely on the right track, though, in saying that this is some sort of camel. After all, the typical Sanskrit word for camel is ushtra. Compare with achastranim. This is therefore likely some sort of fast camel, bred for its swiftness.
http://parsha.blogspot.com/2010/07/rav-yaakov-emdens-eight-legged-camel.html

I hope you find this useful.


How to start developing project management tool?

Question: I have been nominated for developing a project management tool for my organization where all project related information, check list and related information to be stored (as of now, no concrete requirements are listed). With reference to that, how shall I start listing requirements? Basic requirements I've listed are, project information (where scope, objective, title and other related information to be saved), checklist mapping with the entitled project, Task, reports, etc... What are the other requirements which could be part of this project? What approach do I need to follow? Any reference or open source PM tools?
Comment: You want the internet to provide your requirements?! Unfortunately this question is likely to be closed as either "Too Broad" (the requirements are potentially unbounded) or "Opinion Based" (Everyone's point of view is equally valid). Beyond asking for some requirements suggestions there doesn't seem to be an actual question here.
Comment: I humbly submit that if you have to ask this level of question, you may not be the right person for the job? If the project is important to your organization, they should invest in the human capital expertise or source a third party developer. In all likelihood there is probably an off-the-shelf product for Real Estate project management that would fit the bill nicely and avoid re-inventing the wheel.
Comment: After you have your requirements/specification, you should take them to Software Recommendations https://softwarerecs.stackexchange.com where it is appropriate to ask the question of what software best meets these specifications.
Answer: Requirements flow from desired business capabilities. So first step is to engage your stakeholders/internal customers to figure out what business capabilities they want. For example, is this a tool for PMs to manage schedule and budget better? Or is it intended to support timely reporting to senior management? Is monitoring risk a big thing or a little thing? What about long term benefits realization? And is there an off-the-shelf solution that can deliver the business capabilities that I need?
You also need to consider what requirements exist outside of mere systems, in other words what processes does the tool support and how do the tool and processes relate to your organization. Remember that this is just a tool, if you don't have an effective way to use it or if it isn't aligned with your organization the tool could be worse than useless.
Comment: @kartik - I'm not sure if you understood the implications of the answer I gave. You need to identify your stakeholders and talk to them, not a message board, to understand what they value and derive your business capabilities and requirements based on that. Read through http://calleam.com/WTPF/?page_id=2338, doing requirements on your own will result in you meeting the first three causes of failure under stakeholder engagement.
Comment: Thank you for your quick response and I must say it is very much informative. I have been asked to submit proposal, like what things shall we include in this tool. (Currently It will be used for real estate project)

Here I would also like to highlight that, I want to make this tool generalize so that it could be used in any industry by making minimum changes.

Would you please help to figure out what business capabilities could be included?
Comment: Any reference document or link will be appreciated.
Comment: Yes true. I've already arranged meeting with stakeholders. I will update that soon. I was just saying, is there anything I shall recommend to them?
Comment: Information provides in the given link is informative. Thanks.


remove gitorious excessive usage restriction

Question: I've installed a new local gitorious server, however when I configure the users\projects\permissions I get:
Slow down!
Seems like you are just a tad busy, creating all those records that fast. Too much coffee?
To prevent abuse, we have denied your request due to excessive usage.
Feel free to contact us if you believe you have received this message in error.

That's great and all for later, but now I really need to configure a bunch of stuff. How can I remove this restriction?
Answer: set:
disable_record_throttling: true

in gitorious.yml


Multiple apps sharing same reference data . .

Question: I have multiple winforms applications that download large sets of reference data on startup.  I realized that there might be a more efficient way to store this data locally instead of duplicating the memory in everyone one of the applications.  This data is used for large drop down pick lists and data mappings.  Does anyone have an out of process memory map solution or something that would allow this to avoid the duplication and reduce memory overhead in each applications.
Comment: How much data is it? 1 megabyte? 1 gigabyte?
Answer:
you can use Microsoft Enterprise SSO to store configuration data (this might be an overkill). the data will be accessible through SSO API.
SSO Configuration Store
make a windows service to cache data for you and you can access data through IPC
can use .Net remoting to access data across applications


random forest: omitting variables with high importance does not change test error

Question: I wished I could post a reproducible example but the following is observed in a specific large data set that I cannot share.
A set of variables shows consistently high variable (permutation based) importance in random forests. However, leaving out those variables leads to unchanged OOB and test MSE.
Note that replacing these variables with their residuals from a regression (or even a RF) on all the other variables does not change the variable importance ranking much.
I cannot think of a sound explanation of this apparent contradiction.
Comment: Don't forget that all real world data has intricate internal correlation structure.  It's totally possible that other variables pick up the slack in capturing the information the omitted variables contained.
Answer:
I cannot think of a sound explanation of this apparent contradiction.

Those variables might achieve supreme perfection at separating the classes.
Nevertheless, it is possible that the remaining variables after you drop those supreme ones are still positively excellent. Therefore you wouldn't see a difference because your data-set is just very easy to classify.
Answer: Random forest is robust.  Think of it as an ML analog to the median.  If you remove one point in an ensemble, it doesn't impact the median much.
How do you measure your importance?  If you have many thousand rows, and a p of 1%, then you might have a problem.  I would look at the plot of importances, and cluster within it.
It may be that the "important" variable can be, in a moneyball sense, "reconstructed in the aggregate" from other columns that are noisier.  Those columns will show up as less important by themselves, but when the most important is missing, they will be brought into play.
If you can give a little detail on how you determined importance, that might help.


Showing that sequence is convergent by proving it is Cauchy sequence

Question: $x_n=\frac{n+sin(n)}{n+7}$
I'm still new on this field and I would be so pleased,if someone let me know that my steps are valid and I haven't done any mistakes
My attemps for showing that $|x_{n+1}-x_n| < \epsilon$ failed because I'm having 2 terms $sin(n)$ and $sin(n+1)$, and both of them cannot get their max values for same $n$.
And when I chose $n'$ as $2n$, I've got
$\epsilon>|x_{2n}-x_n|=|\frac{sin(n)(2(n+7)Cos(n)-2n-7)+7n}{(2n+7)(n+7)}|\leq\frac{9n+7}{(2n+7)(n+7)}<\frac{9n}{2n^{2}}=\frac{9}{2n}$
So now I can assume that $n>\frac{9}{2\epsilon}$ and choosing $n_0=[\frac{9}{2\epsilon}]+1$ this statement would remain true.
$\forall\epsilon>0,\exists n_0=[\frac{9}{2\epsilon}]+1, \forall n,n' \in N, |x_{n'}-x_n|<\epsilon$ so I can assume that this is Cauchy sequence so is convergent.I'm not really sure that this is true for $n_0$ I've got. Also 1 more question, Is there more simple way to prove this?
Comment: well, the goal is not getting the limit, but to prove convergence by Cauchy's criterion. I'm thinking there might be a more simple way, than I used
Answer: Note that for all $n\ge1$,
$$
\frac{n-1}{n+7}\le\frac{n+\sin(n)}{n+7}\le\frac{n+1}{n+7}
$$
Thus,
$$
\frac{n+k-1}{n+k+7}-\frac{n+1}{n+7}\le x_{n+k}-x_n\le\frac{n+k+1}{n+k+7}-\frac{n-1}{n+7}
$$
which can be written as
$$
\frac6{n+7}-\frac8{n+k+7}\le x_{n+k}-x_n\le\frac8{n+7}-\frac6{n+k+7}
$$
The last inequality implies that
$$
|x_{n+k}-x_n|\le\frac8{n+7}
$$
Comment: This statement is true enough. but how to get $n(\epsilon)$ dependence from it to get starting point for a formal proof, as you have also added another value k.
Comment: I've added more. Can you see how to get what you want now?


Constructor not visible error when importing custom class into Android project

Question: I wrote a FileIndexer class in Java, and am attempting to import it into my Android app. However, I get the following error...
The constructor FileIndexer(File) is not visible

Here is where I attempt to instantiate:
import mpss.categorizer.FileIndexer;
...
try {
        FileIndexer indexer = new FileIndexer(getExternalFilesDir(null));
    } catch (Exception e) {
        Log.w("Indexing", "Error creating FileIndexer: " + e.getMessage());
    }

And here is the constructor inside FileIndexer:
public class FileIndexer {
    private FSDirectory fsDirectory;
    private ArrayList<File> queue;

    public FileIndexer(File f){
        try {
             fsDirectory = FSDirectory.open(f);
        } catch (IOException e) {
             System.out.println("Invalid location: " + e.getMessage());
        }
    }

I created a jar of FileIndexer, and then added it to my Android buildpath. Also, my manifest includes:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

So it's not that I don't have access to external storage. Any idea why I'm getting this error?
Comment: This is a compile time error, right? Are you sure you have imported the correct FileIndexer? What other constructors of FileIndexer are there?
Answer: Do you have a same class named FileIndexer in your package?
I ran into visibility issue in import once and this was the cause.


Membership.GeneratePassword

Question: I am looking for a method to generate a onetime password for provisioning purposes in ASP.NET-MVC. I came across the Membership.GeneratePassword which is in the System.Web.Security namespace. Is this a secure way to generate a one time use password?
Answer: Yup, it's fine.  Underneath the covers it users the RNGCryptoServiceProvider to generate the password data, which is .NET's wrapper around the CryptoAPI's CSPRNG to generate the data for the password.   It's good enough for strongly random key material, so its certainly also good enough for a one-time use password as well.
Comment: @bdawg Note that while it's a very secure way to generate secure random strings, it's actually a very bad way to generate passwords. You have no control over the character set and you'll end up with passwords like this https://i.imgur.com/1usU3E8.png that are horrible to handle, give to users, write down, type. The only good time to use it is when you're generating passwords that go into your password manager.
Comment: @bdawg For a better alternative that you can control, have a look at CodesInChaos' answer here http://stackoverflow.com/a/19068116/
Comment: @adi yes I am aware of this. The passwords are unrememberable.

Membership.GeneratePassword


Bootstrap consistency for maximum likelihood

Question: I'm looking for references (textbook if possible) that treat the strong consistency of bootstrapped maximum likelihood (MLH) or more generally M-estimators.
By strong consistency I mean that the difference between the cdf of the original statistic and the bootstrap counterpart goes a.s. to zero uniformly (see below).
So far I have been following the textbook:
Shao, Tu: The Jacknife and Bootstrap. 1995.
that provides a really nice account of the bootstrap and theorems of this type.
For example, see Theorem 3.1 (page 80) in Shao & Tu, denote by $\bar{X}_n$ the sample mean of $X_1,\ldots,X_n$ (i.i.d.), and by $h\colon \mathbb{R}\to\mathbb{R}$ a function such that $h'(\mu) \neq 0$ and $h'$ is continuous at $\mu$, where $\mu = \mathbb{E}[X]$ and $\mathbb{E}[X^2] < \infty$.
For a statistic
$$
T_n = h(\bar{X}_n)
$$
with bootstrap counterpart $T^*_n$ we then have
$$\Vert F_{T_n^*} - F_{T_n} \Vert_{\infty} = \sup_{x\in\mathbb{R}} \vert F_{T_n^*}(x) - F_{T_n}(x) \vert \xrightarrow[n\to\infty]{a.s.} 0.
$$
Here $F_{T_n^*}$ and $F_{T_n}$ are the respective distribution functions and the convergence a.s. is necessary since $F_{T_n^*}$ is random.
This settles method of moment type estimators (in fact in Shao & Tu the general multivariate version is considered), but I'm wondering about implicitly defined estimators like MLH (or M-estimators).
My question is therefore, if $\mathcal{M} = \{f_{\theta};\theta\in\Theta\}$ is a parametric statistical model and $\widehat{\theta}_n$ is the MLH estimator based on $X_1,\ldots,X_n$ (i.i.d. with density $f_{\theta_0}$) what can be said about the limit
$$\Vert F_{\widehat{\theta}_n^*} - F_{\widehat{\theta}_n} \Vert_{\infty}.$$
I'm looking for references that either give conditions and a proof, or, preferably, a textbook that outlines the results in a digestible way.
Answer: It depends on what you count as 'digestible', but I like the version in van der Vaart's Asymptotic Statistics, which develops consistency of the bootstrap from the delta method in both the finite-dimensional and infinite-dimensional case.


Bug on home page?

Question: The home page is blank for me. It is the same with meta. Anyone else with ideas/solutions/problems?
Comment: It isn't for me, but PPCG is quite slow at the moment, which might be related.
Comment: @MartinBüttner A timeout when querying the database, perhaps?
Answer: Thanks for bringing this up. We experienced numerous attempted DDoS attacks last week. I'm almost certain that this was the cause of your issues. Questions will not appear in the case that the time taken to load them is too long, which would happen under heavy (DDoS-like) load. You should not be experiencing this issue at this time, since we are not currently being DDoS'd. Sorry for the inconvenience.
Answer: As Martin suggested, it's probably due to the site being slow. Even though it lags a bit, I can now fetch the list of questions occasionally (it takes a bunch of refreshes, though... still a bit of a problem).

Bug on home page?


How Facebook link preview happens?

Question: When you type a URL into facebook, it automatically comes up with the "post a link" feature. With most websites, it automatically loads a selection of images it pulls from somewhere in the page to go alongside the link and description. does anyone have an idea of how to implement that same feature for our own site without any FB API etc.. just javascript or JQuery ?
Comment: I've just released a client-side library for that purpose. Check it out: [bootstrap-linkpreview](https://github.com/Ekito/bootstrap-linkpreview)
Answer: Due to security restrictions, JavaScript cannot load any page from any server. Facebook actually asks the Facebook servers for information about that page, and the servers in turn query the page to extract the information. You, too, will need a server-side implementation of this.
Aside from that, it's fairly simple: use an HTTP client library for your language of choice to connect to the provided URL, then use an HTML parsing library to extract the title tag, identify a significant piece of text in the body tag, and extract the img tag sources that seem the most appropriate.
Once your server is able to extract information about a page, it's a fairly simple exercise to call it through AJAX.
Comment: Victor is right. There's no way for JS to load and process a page from another server. You have to do an AJAX call to a page executing the HTML parsing which returns the information you need.
Comment: Yep, that has to be the only way to show the preview. What interests me is the image. Is there any mechanism to detect the most appropriate image to show as representative of the page?
Answer: @Keshan.
I developed myself a Facebook Link Preview with PHP and jQuery that is on my website. Take a look... The source code is free... I didn't post the whole code here because they are many files... But if you prefer the code to be posted here, tell me and I'll post.
It's available on Github https://github.com/LeonardoCardoso/Facebook-Link-Preview
Facebook Link Preview - PHP + jQuery
Comment: Thanks !! i will have a look.
Comment: In fact. But they are not few codes. It also is available on Github https://github.com/LeonardoCardoso/Facebook-Link-Preview where many people have forked. Although my website provides a full explanation about this plugin, I'm not trying to generate visit flow to there.
Answer: I think following steps are involved

Using Javascript find the links in the written text
From the found links get the last link in the text (FB shows only for last link)
Using AJAX send this link detail to a server side page (PHP/ASP/JSP etc.)
The server side page gets the required data (from Meta tags) including

Title (Preferably Open graph og:title if missing from <title>
Description (Preferably Open graph og:description if missing from <meta name="description" ....
Images (Preferably Open graph og:image if missing from <img src=....

In PHP you can get these datas either using curl or file_get_contents and parse for required data detailed above. Not sure about other Language.
Show the result thus found in the AJAX request.

Additionally I think FB stores the data, once found, in database and 1st queries there. This helps them to get faster result and hence same article shared and liked generate the image and details from the stored data.
You will need Javascript to show this preview in runtime (while you write in the textarea). However if you only need it after posting of data it can be done with pure server side language (you can avoid javascript) and following above steps just remove AJAX call.
Answer: Surprisingly there aren't that many services out there doing this. As the previous commenter posted, your browser can't do this without a server element.
So, the workflow is really this:

Parse the inserted text to test it's a valid URL
Whiz that URL value via AJAX to a bespoke service or roll your own.
The service (mine is written in .Net) loads up the page in memory and parses it with an DOM parser. I use the HTML Agility pack you could use AngleSharp etc.
You need to extract the Open graph meta elements with (typically) fall back to standard Meta Title/ Description et all.
Pack up all that OG goodness and return this model via AJAX
Put the returned values on screen as a preview.
If accepted write the logic to insert the values into your DB

If you are not up to creating the server object, there are third-party services that can do the retrieval bits:
http://unfurl.oroboro.com/
https://guteurls.de/
best of luck.

How Facebook link preview happens?


Guidelines for building Data Acces Layer with SQL

Question: There are a lot of information on building DAL with ORM ((N)Hibernate, LINQ to SQL). But I can't find any recomendations on doing it with plain SQL or mixed (ORM + SQL) approach.
I wonder, are there any resources (sites, books) on this subject?
Besides common best practices I've got a few points of interest:

how organize storing of sql strings
dynamic generation of sql strings
transforming queries resultsets to domain objects
querying associated collections
minimize boilerplate data access code
Answer: ExploringDifferentDatabaseOptions


Bitcoin core doesn't see transaction

Question: I've created address in bitcoin core from rpc and send some bitcoins on it, but my balance still zero. Transaction exists I've checked on blockchain info. Getaddressinfo returns "ismine": true, but getreceivedbyaddress returns zero
Comment: Are you fully synchronized with the blockchain? You won't see the transaction until you are.
Comment: I use prune mode, the last time I used it, it worked well.  Where can I read about this?
Comment: Pruning has nothing to do with it. What do you see with `getblockchaininfo` RPC?
Comment: `"chain": "main",
  "blocks": 445138,
  "headers": 614383,
  "bestblockhash": "0000000000000000002de7741730df4307a0b07af877fdac1f03b9be9e97da54",
  "difficulty": 310153855703.4333,
  "mediantime": 1482716862,
  "verificationprogress": 0.3696978576853237,
  "initialblockdownload": true,
  "chainwork": "00000000000000000000000000000000000000000034fc10a015a432503589bd",
  "size_on_disk": 533371171,
  "pruned": true,
  "pruneheight": 444665,
  "automatic_pruning": true,
  "prune_target_size": 576716800,
`
Comment: You'll need to wait until blocks == headers. You're about 3 years worth of blocks behind.
Answer: As pointed out by Peter in the comments of your question, you will need to wait until your node has synced with the longest chain. At the time of your comment, you are 169,245 blocks behind which, unless your transaction took place ~3 years ago, will not be known to your node yet. As soon as the block containing your transaction is verified by your node, you will be able to see the transaction.

Bitcoin core doesn’t see transaction


"rain was coming till tomorrow"

Question: I am asking this question on behalf of a friend of mine. Do tell me, can and when or why can we use past form when we predict something in the future. I agree the phrase is not full. Anyway, the friend said that she heard it on the radio and it was the weather forecast. She was a little surprised by the past form. Unfortunately, she could not remember any sentence before or after.
Comment: Or maybe: "She said that rain was continuing till tomorrow."
Comment: The only way I can make sense of that is if there was a *not* in there.  `The weatherman said the rain was *not* coming till tomorrow.`
Comment: I think your friend must have heard wrong. If you report a weather forecast to someone else, you might just say: "She said that rain was coming tomorrow." But I seriously doubt that any weather forecaster would utter the words: "Rain was coming till tomorrow".
Comment: I would understand the forecaster to be meaning two things: 1) Rain is coming now. 2)Once it starts, the rain will continue till tomorrow.
Comment: Maybe the sentence was : He would have bought an umbrella if he knew the rain was coming till tomorrow
Answer: The simple answer to your question is that you don't use a past construction to talk about the future.  We talk about the future using will, going to, present continuous, or present simple.
The only guess I can make for what your friend heard is that she heard reported speech, and the 'is coming' became 'was coming' because of the back-shifting of the verb when we report. Could she have heard something like "The forecast said no rain was coming till tomorrow"?
Answer: Assuming that your friend reported the radio announcement correctly, and assuming that the announcer was not mistaken, then the announcer was not speaking Standard English but some English dialect or pidgin.
In Standard English neither the simple past, past continuous nor future in past are used to denote a future event or possibility of future event. However, in languages that do not have tripartite tense systems, such as Hebrew, the past tense can be used to denote future events or a condition depending on a future event. It could be that the construction that your friend heard in an English dialect is a loaned construction from a neighboring language without tripartite tense. If so, it would be interesting to know what dialect this is.

"rain was coming till tomorrow"


The origin on why '%20' is used as a space in URLs

Question: I am interested in knowing why '%20' is used as a space in URLs, particularly why %20 was used and why we even need it in the first place.
Answer: It's called percent encoding. Some characters can't be in a URI (for example #, as it denotes the URL fragment), so they are represented with characters that can be (# becomes %23)
Here's an excerpt from that same article:

When a character from the reserved set (a "reserved character") has
  special meaning (a "reserved purpose") in a certain context, and a URI
  scheme says that it is necessary to use that character for some other
  purpose, then the character must be percent-encoded.
  Percent-encoding a reserved character involves converting the
  character to its corresponding byte value in ASCII and then
  representing that value as a pair of hexadecimal digits. The digits,
  preceded by a percent sign ("%") which is used as an escape character,
  are then used in the URI in place of the reserved character. (For a
  non-ASCII character, it is typically converted to its byte sequence in
  UTF-8, and then each byte value is represented as above.)

The space character's character code is 32:
> ' '.charCodeAt(0)
32

Which is 20 in base-16:
> ' '.charCodeAt(0).toString(16)
"20"

Tack a percent sign in front of it and you get %20.
Comment: Is it therefore completely legitimate to use spaces in file names for the internet, so long as they're correctly percentage encoded?
Comment: Sure, that's what percent encoding is for.
Answer: Because URLs have strict syntactic rules, like / being a special path separator character, spaces not being allowed in a URL and all characters having to be a certain subset of ASCII. To embed arbitrary characters in URLs regardless of these restrictions, bytes can be percent encoded. The byte x20 represents a space in the ASCII encoding (and most other encodings), hence %20 is the URL-encoded version of it.
Answer: It uses percent encoding. You can see the Percent Encoding part of the RFC for Uniform Resource Identifier (URI): Generic Syntax

A percent-encoding mechanism is used to represent a data octet in a
component when that octet's corresponding character is outside the
allowed set or is being used as a delimiter of, or within, the
component.  A percent-encoded octet is encoded as a character
triplet, consisting of the percent character "%" followed by the two
hexadecimal digits representing that octet's numeric value.  For
example, "%20" is the percent-encoding for the binary octet
"00100000" (ABNF: %x20), which in US-ASCII corresponds to the space
character (SP).


How to get latest revision number from SharpSVN?

Question: How to get latest revision number using SharpSVN?
Answer: The least expensive way to retrieve the head revision from a repository
is the Info command.
using(SvnClient client = new SvnClient())
{
   SvnInfoEventArgs info;
   Uri repos = new Uri("http://my.server/svn/repos");

   client.GetInfo(repos, out info);

   Console.WriteLine(string.Format("The last revision of {0} is {1}", repos, info.Revision));
}

Comment: If you want the latest revision for a given path (not the entire repo) you can return `info.LastChangeRevision` instead.
Comment: this code is not working for me as below
`using (SvnClient client = new SvnClient()) { SvnInfoEventArgs info; Uri repos = new Uri("svn://india01/repository/branches/mybranch1"); client.GetInfo(repos, out info); lblMsg.Visible = true; lblMsg.Text = (string.Format("The last revision of {0} is {1}", repos, info.Revision)); }`
whenever i m running my webpage it's keep on searching only..
any solution for this.
Answer: I am checking the latest version of the working copy using SvnWorkingCopyClient:
var workingCopyClient = new SvnWorkingCopyClient();

SvnWorkingCopyVersion version;

workingCopyClient.GetVersion(workingFolder, out version);

The latest version of the local working repository is then available through
long localRev = version.End;

For a remote repository, use
 var client = new SvnClient();

 SvnInfoEventArgs info;

 client.GetInfo(targetUri, out info);

 long remoteRev = info.Revision;

instead.
This is similar to using the svnversion tool from the command line. Hope this helps.
Answer: Ok, I figured it by myself:
SvnInfoEventArgs statuses;
client.GetInfo("svn://repo.address", out statuses);
int LastRevision = statuses.LastChangeRevision;

Answer: i googled also a lot but the only one thing which was working for me to get really the last revision was:
public static long GetRevision(String target)
    {
        SvnClient client = new SvnClient();

        //SvnInfoEventArgs info;
        //client.GetInfo(SvnTarget.FromString(target), out info); //Specify the repository root as Uri
        //return info.Revision
        //return info.LastChangeRevision

        Collection<SvnLogEventArgs> info = new Collection<SvnLogEventArgs>();
        client.GetLog(target, out info);
        return info[0].Revision;
    }

the other solutions are commented out. Try by yourself and see the difference . . .
Comment: This command retrieves all revisions to obtain a single revision number... That is a bit of overkill and certainly not the fastest way to obtain the information.
Answer: Well, a quick google search gave me that, and it works (just point at the /trunk/ URI):
http://sharpsvn.open.collab.net/ds/viewMessage.do?dsForumId=728&dsMessageId=89318
Answer: This is a very old question, and it has been answered well in the top two answers. Still, in the hopes it might be of some help to someone I'm posting the following C# method to illustrate how to not only get the revision numbers from both the repository and the working copy, but also how to test for typical situations that might be considered as problems, for example in an automated build process.
  ///
  /// Method to get the Subversion revision number for the top folder of the build collection,
  /// assuming these files were checked-out from Merlinia's Subversion repository. This also
  /// checks that the working copy is up-to-date. (This does require that a connection to the
  /// Subversion repository is possible, and that it is running.)
  ///
  /// One minor problem is that SharpSvn is available in 32-bit or 64-bit DLLs, so the program
  /// needs to target one or the other platform, not "Any CPU".
  ///
  /// On error an exception is thrown; caller must be prepared to catch it.
  ///
  /// <returns>Subversion repository revision number</returns>
  private int GetSvnRevisionNumber()
  {
     try
     {
        // Get the latest revision number from the Subversion repository
        SvnInfoEventArgs svnInfoEventArgs;
        using (SvnClient svnClient = new SvnClient())
        {
           svnClient.GetInfo(new Uri("svn://188.8.131.52/Merlinia/Trunk"), out svnInfoEventArgs);
        }

        // Get the current revision numbers from the working copy that is the "build collection"
        SvnWorkingCopyVersion svnWorkingCopyVersion;
        using (SvnWorkingCopyClient svnWorkingCopyClient = new SvnWorkingCopyClient())
        {
           svnWorkingCopyClient.GetVersion(_collectionFolder, out svnWorkingCopyVersion);
        }

        // Check the build collection has not been modified since last commit or update
        if (svnWorkingCopyVersion.Modified)
        {
           throw new MerliniaException(0x3af34e1u,
                  "Build collection has been modified since last repository commit or update.");
        }

        // Check the build collection is up-to-date relative to the repository
        if (svnInfoEventArgs.Revision != svnWorkingCopyVersion.Start)
        {
           throw new MerliniaException(0x3af502eu,
             "Build collection not up-to-date, its revisions = {0}-{1}, repository = {2}.",
             svnWorkingCopyVersion.Start, svnWorkingCopyVersion.End, svnInfoEventArgs.Revision);
        }

        return (int)svnInfoEventArgs.Revision;
     }
     catch (Exception e)
     {
        _fLog.Error(0x3af242au, e);
        throw;
     }
  }

(This code does include a couple of things specific for the program it was copied from, but that shouldn't make the SharpSvn parts difficult to understand.)


API GET requests from Specific IP - Requests Library - Python

Question: I'm looking to switch existing PHP code over to Python using the Requests library. The PHP code sends thousands of GET requests to an API to get needed data. The API limits GET requests to one every 6 seconds per IP. We have numerous IP addresses in order to pull faster. The faster the better in this case.
My question is is there a way to send the GET request from different IP addresses using the Requests library? I'm also open to using different libraries in Python or different methods to replace the IP addresses.
The current code makes use of curl_multi_exec with the CURLOPT_INTERFACE setting.
As far as code goes, I don't necessarily need code examples. I'm looking for more of a direction or option that will allow such features in Python. I would prefer not post code, but if its necessary, let me know.
Thanks!
Answer: I don't believe Requests supports setting the outbound interface.
There is a Python cURL library, though.
Comment: Thank you for your quick response Amber. I appreciate the information you provided.


Why I can't find an A-mount to Canon EF Adapter?

Question: I looked online for an adapter from A-mount to Canon EF but I couldn't find. The Minolta/Sony A-mount flange focal distance is 44.50mm and Canon EF flang focal distance is 44.00mm, in theory A-mount lenses can be used with a proper adapter on Canon EF system, but I can't find one, I'm curious why?
Comment: did you checked ebay? There are some: http://www.ebay.com/sch/i.html?_nkw=sony+to+canon+mount+-nex&_sacat=0&_odkw=sony+to+canon+mount&gbr=1&_fcid=56&_osacat=0&_from=R40&_clu=2
Comment: @Juhele those are Canon FD (not the current EF mount) to Sony adaptors. The original question was about Sony to EF.
Comment: Does this answer your question? [Can I use lens brand X on interchangeable lens camera brand Y?](https://photo.stackexchange.com/questions/62000/can-i-use-lens-brand-x-on-interchangeable-lens-camera-brand-y)
Answer: First of all, this leaves only .5 mm for the adapter, which isn't a lot. With a mount that's a lot smaller in diameter most of the adapter could sit inside the EF mount ring, and you could probably do it. From what I recall of the diameters, they're similar enough that this would be extremely difficult, if possible at all (and I'm leaning toward "probably not possible").
Second, EF mount uses an electronic connection for both aperture and focus, where A mount uses a mechanical linkage for aperture, and either mechanical or electrical for focus (but electrical was introduced relatively recently, so most older lenses being adapted would probably be mechanical).
Since (most) A mount lenses don't have aperture rings, you'd have to build an aperture control into the adapter. If it was purely mechanical, you could do stop-down metering. In theory, an adapter with some sort of built-in servo could receive the electrical signals from the body and translate them to mechanical movement for the lens. Given the small difference in flange distances, neither of those would probably be simple or straightforward -- but without it, you'd have no aperture control, so you could only shoot at the lens' minimum aperture (typically f/22) -- pretty useless. You could build a fixed stop into the adapter to always hold the lens at, say, f/8 I suppose, but it would still be quite limited, even at best.
Answer: There is a FotodioX adapter which has aperture control and maintains infinity focus through an optical element.
FotodioX Pro Lens Mount Adapter for Sony A Lens to Canon EF Mount
Answer: It's the mount throat diameter difference that causes the problem. The throat diameter for A-mount is 49.7 mm. Canon's EOS mount is 54mm.
The diameter of the Minolta AF/Sony A-mount is smaller than that of Canon EF. Which means the lens mount itself can be too wide to actually fit inside the mount and has to sit completely on top of the adapter. The farther out the lens sits, the more far focus range you lose with a simple ring adapter that has no glass elements.
The depth difference (0.5mm) is also too thin for someone to reliably machine a ring to a consistent thickness for adapting the bayonet differences.
So, even though the registration difference (the distance the lens is held from the image plane) would theoretically allow A-mount to adapt the same six mounts (Nikon F, Leica-R, Contax/Yashica, Olympus OM, M42, and Pentax K) Canon can, in reality you can only adapt M42 and Leica R with simple ring adapters.  M42 is the only one with a small enough throat diameter to fit appropriately, and Leica R's registration distance is so deep, the diameter doesn't matter.
In addition, Canon EOS-mount lenses don't have aperture rings.  So adapting one to A-mount would probably mean loss of aperture control unless the adapter can translate the electronic communication from the camera body as well.
Comment: This answer seems to assume OP wants to use EF lenses with A-mount camera. However, OP asks about using A-mount lenses with EF camera.
Answer: An adaptor will always take up some space, so whilst the A-mount flange-focal distance is 44.5mm by the time you have a 2mm adaptor in the way your lens will be mounted 46.5mm from the sensor, which is probably enough to lose infinity focus with some lenses.
Comment: As I know, they are able to solve this by adding an optical glass element in the adapter.


EE 1.x missing entries?

Question: Has anyone ever seen this behavior before? I seem to have random entries missing from my site. This has been going on for a few months now and I've chalked it up to some weird anomaly when it first started happening. Now, I'm noticing that entries are missing because I'm getting crawl errors inside of Analytics and Adsense admin. I probably haven't deleted an entry in five years so something weird is going on.
Answer: This is NOT good.  A couple of possibilities occur to me.

Your host migrated your site to a new database server and failed to import the data correctly.
Someone has exploited a vulnerability in EE1.

If you look at the EE1 Change Log there are security fixes right up until the final version (1.7.3).  If you are running a version older than that there are certainly vulnerabilities.  If you are 1.7.3 there are very likely vulnerabilities as the code is not longer being maintained.
I'd start by going through my server log files to look for unusual control panel access, but some vulnerabilities might not even require this.
If you have database backups I'd look at those as well to see if you can determine when the missing data disappeared.
Updating to the latest version of EE1 might help but for the longer term you must get off of EE1 for the sake of security.
Comment: My old host was EngineHosting and I had been with them for years. I'm pretty certain they didn't do any moving to a new database server while I was with them. In fact, up until I moved to a new host, they didn't want to move me to a new server for that fact that I was still using EE 1.x.

I've only been on the new host for a few weeks. I'll have to see if I can access to the server log files and see if I see anything. There's not rogue member accounts setup in the Admin (just me). So, I know someone hasn't added a new Admin account or anything.

I'll also see if I can update to EE 1.7.3
Comment: I'm planning on redeveloping the site with Python/Django anyway, but that won't be for a few months probably at least. That's really the reason I don't want to pay to upgrade to EE 2.0 and worry about getting addons working again and all that.

EE 1.x missing entries?


How steep a grade can a LEGO train go up?

Question: I realize this would change based on how much weight it's pulling. How about using an engine pulling 3 cars? I'm guessing that sets available for sale now would have similar power. I have the engines from sets 60052 and 60098.
Thanks for any input you can provide.
Comment: Carriages can be very different, and as such a poor unit of mesure for weight. Typically we say that any train should be able to handle a climb of one plate for each piece of track (16 studs).
Answer: I've successfully run a single motor pulling two cars from 7938 and the locomotive all the cars from 79111 up a spiraling incline of two plates per track segment. I terminated the experiment after I ran out of track and table space. If the track was straight I probably could have pulled more weight.
Answer: Anecdotal input:
I run my 7745, 7740, 7735 (with extra carriages), 4458 (with 2 clubcars), 4563 and 4564 up a 14 brick total height using 16 sections of straight track.
On the main sections this is one brick per 16 long track section but at the top and the bottom I smooth out the incline with 2 plates and then 1 plate. (Otherwise the carriages, especially the club cars, bottom out on the track).
These are 12v and 9v models and not the Power Functions models you list so your motor and track characteristics are likely to be different.
Space limitations are the reason I use such a steep incline and I do have to make sure I keep the electrical contacts clean to ensure constant power delivery or I can get some slipping and wheelspins.
Also this is likely putting a fairly heavy load on the motors, luckily I have spares and I don't run my trains for long periods of time but I don't run my 7727 on this section of track for fear of damaging it's precious red motor!
I think this is the absolute steepest you could get away with and if you have the space, two plates or one plate per track section as suggested here and in other places on the web should be your goal.
Comment: Thanks for your input! I've been doing LEGO for a long time, but this my first foray into trains and I'm hooked.


Generator size for well pump

Question: Well, pump and pressure tank installed in 2018, 500 ft uphill from house. Separate grid service to well, with professional installed transfer switch with 4-prong connector for generator. In panel, 2x100 amp fuse from grid switching to 2x30 amp fuse; well pump connected via 2x20 amp fuse; 4 GFI receptacles connected via one 20 amp fuse. Pump is Flowise model 10 gpm, 1.0 HP, 230v (do not know motor manufacturer). Pump is at 145 ft depth and static water level is 24 ft. Would be nice but not necessary to power the GFI receptacles also.
Comment: My question is what size generator? I understand startup W >>> running W
Answer: Realistically the smallest generator you can find that has a 240v receptacle is usually rated around 3500w.
For an actual calculation the nameplate rating for the pump would be nice, but it's probably submerged. A typical Franklin 1 hp pump draws about 5A @240v, you need a minimum of 50% overhead for startup, that gets you to 1800w, plus whatever accessories you need in the pump house.
I have heard people having difficulties using cheap inverter style generators with motors, they seem to be too sensitive for inrush. The inrush on a motor under load given an ideal source can easily be 5x the rating during the first couple seconds. I think the solid state circuitry of an inverter has to be protected with less tolerance than a wound rotor generator.
Comment: IME there's nothing cheap about inverter style generators.  They just tend to be small-ish. But it makes sense that motors would overload them, since the whole point of the inverter is to reduce their RPMs to the minimum needed, so they have no rotational momentum to draw surge energy from.
Comment: @Harper, you're right there are some nice expensive inverter that may even work ok. Op being 500ft from well probably isn't so concerned about noise, and was trying to discourage cheaper imported inverter types you can find on Amazon or HF.
Answer: The purpose of using 240V is to reduce the voltage drop over the 500+145' wiring length.  Normally you associate 240V with high-power loads like a water heater, but that's not the case here.
However, generators that small are generally only 120V.  Unless you're going to do something fancy with a transformer, you'll be forced up into a 3000W+ generator simply to get 240V.
But we can do a bit better
First, my pet peeve is houses that are completely broken without mains power.  That is unnecessary.
On this water supply, your magic word is "uphill". People don't say that for 2% grades, so at 500' I'm guessing we have at least a 30 foot elevation difference, and my guess is, a fair bit more.
30 PSI water pressure is considered fine for a city house (but you can get by with less).  You get 1 PSI for every 2 feet of elevation difference. If you have a big tank at the top of a hill, your water system will passively pressurize all by itself from gravity.
All you need to do is keep the tank topped up every few days or weeks, depending on your tank size vs your usage. A 500 gallon tank, in my household, means spinning up the pump every 5 days if we ignored the power being out; we could stretch it to 20 days if we really had to. If you want a 10,000 gallon tank, those are available too.
Go look at Pure Living For Life's early videos on their homestead build; they go deep into their hilltop tank system.  They are amateurs and bumble through it quite sloppily and make a lot of mistakes (that system is overkill), but that's the gist.  (At the time they were going for wholly off-grid; they couldn't make the solar work due to inexperience so they finally got grid power. But in an outage, they will have water for a month.)
The rest of the house
"Ah, but my furnace needs power". Not to make heat; merely to push the heat around.  One or two well-placed Empire style wall furnaces can take care of that passively with convection.  Further, they can be configured to run off a Nest when power is available and off a millivolt thermostat when power is not.
The refrigerator needs power too, but that is within the reach of a modestly sized battery system, which can be replenished either from a generator or solar.   That battery system can also handle basic lighting and entertainment.
You use any generator, possibly a borrowed one, to top water tanks and batteries.
Comment: This is helpful, Made me think of getting a larger tank instead of a generator; that would work because of the 20 ft vertical drop. In light of our circumstances we opted for a small pressure tank at the well, and wiring for a backup generator.
Comment: PS, You're right about whole house planning. Especially since we're at the dead end of a 2.5 mile gravel road through forest with not many neighbors (lowest priority for power company). if we had not drilled a 600 ft dry well at the house, we could have afforded the planned whole-house solar/battery with grid backup :-)    For now, a gas range, small inverter gen, and two gas fireplaces keep us from shivering in the dark! Thanks again.

Generator size for well pump


What prevents me from calling an investment property an intended primary residence to take advantage of lower down payment requirements?

Question: I know that most banks will require 20%/25% down on a conventional loan for an investment property. The requirement is much lower - 5% - for a home I intend to use as my primary residence. If something legitimate happens that means I cannot live there anymore (illness, tragedy, loss of job, etc...) I am able to then rent out this property. But what if I do this intentionally? Purchase with 'intent' to live in it as a primary residence and then just make up an excuse to turn it into a rental property? Clearly, this is mortgage fraud. But how would anyone, like the bank who has likely packaged my mortgage and sold it to someone else, know that this was my plan all along and hit me with mortgage fraud?
To be clear, I am not trying to do this. It just seems so simple and hard to detect/prove that I am struggling to understand why this isn't done all the time? I feel like I must be missing part of the equation as mere PMI doesn't seem a sufficient deterrent to prevent this from being rampant in real estate.
Comment: This _may_ be better suited to [LawSE](https://law.stackexchange.com/) (but check their guidelines first), as it's going to be about the small-print of the lender's terms and conditions, and the "burden of proof" required in any potential court-case. E.g., if the Ts&Cs allow them to take action "_where we **suspect** fraudulent statements / intentions_" they _may_ be able to impose sanctions without a court-case (accepting that such a clause may be deemed unfair). [**cont**]
Comment: [**cont**] If it goes to court, a criminal case (at least in the UK) requires proof "_beyond reasonable doubt_", and a _single_ instance of doing this may not be enough. However, (again in the UK), I believe a _civil case_ only requires "_on the balance of probability_" so a single instance _may_ be sufficient for them to win. As I said: probably more a question for lawyers.
Answer: Penalties for occupancy fraud can be severe.
Yes, in any occupancy fraud case, there will be an element of intent - did you knowingly defraud the bank by misrepresenting the intended occupancy status, or was this a genuine change of plans that could not have been predicted? If you come up with a very good fraud scheme, the bank may have a hard time proving intent. But if they can prove occupancy fraud, penalties could include having the entire loan called due immediately, foreclosure if you can't pay, or even prison time. If you buy a home and tell the bank it's your primary residence but never use it as a mailing address and never appear as a resident in the tax records, you can probably expect some scrutiny from the bank.
You might be able to commit occupancy fraud, get away with it, and save yourself a few tens of thousands of dollars over the course of decades. Or, you might commit occupancy fraud and get caught, bankrupting yourself and going to prison as a result. For most people, the risks outweigh the benefits.
One could ask this question about why most people don't commit any kind of fraud or even any crime at all, for that matter. The expected benefit of the crime doesn't outweigh the potential downsides, whether that is an internal "cost" (remorse, guilt, stress about being caught) or external one (bankruptcy, foreclosure, prison). Even a low probability of severe consequences is enough to deter most people.
Answer: A long time ago I had a mortgage on a condo, but after a few years I wanted to sell it a move to a bigger property. The market was bad so I rented the condo to a tenant. I obtained a mortgage on my new place and moved in. A few years later the mortgage on the condo was sold. A few months later is was sold again. A few months later the newest mortgage company realized I didn't live in the condo, so they sent the mortgage back to the previous company, who did the same thing. So now I was back with the original mortgage company.
I did nothing wrong. I didn't try to hide anything. I had the original mortgage for more than 4 years before I rented the condo to the tenant. The problem was that the newer mortgage company didn't want to own mortgages on rental properties, and they wanted to send back ones they didn't want.
How did they know? The tax information at the county assessors office showed that I owned it but didn't live there. My mailing address on the mortgage file at the lender showed I didn't live there. The record at the condo association showed I didn't live there. A check of my credit file would have showed multiple mortgages, one of which was on a property address that match my mailing address.
This was back in the early 1990's. Today with all the electronic files, it would be even easier to double check this information.
If this happens in the months after you get the mortgage, they will investigate. They may ask for proof that you moved in. They may want to know when you advertised the place for rent. Check the loan paperwork to see if there is a minimum amount of time you must occupy the place.
Comment: @glibdud Intent probably doesn't matter. If the terms of the mortgage state that you need to use the property as your primary residence, and you aren't, then you are in breach of contract. *Why* probably doesn't matter; it's your responsibility to refinance with a mortgage without such a restriction.
Comment: I don't think the question is "how can they tell I don't live there", but "how can they tell I never actually *intended* to live there".
Comment: Did something happen in consequence to this?
Comment: @chepner Agreed, just pointing out that the original answer didn't quite match the question as it was asked. It's been at least somewhat addressed with the added last paragraph.
Answer: To add to mhoran's answer - The agreement you signed to get the mortgage shows your obligation. It's typical to see that the "owner occupied" requirement is for a one year term. There are those who buy a house in need of repairs, move in, renovate every weekend, and after a year, buy a new place to do the same and rent out the prior one.
The key is to read the fine print, and ask the right questions.


Should I write an email to my potential supervisor before interviewing?

Question: I've just got into the interview selection of PhD funded program. As I failed another university interview just a week ago, I am quite apprehensive about this upcoming one. As I've read about interviewing tips somewhere, some mentioned emailing potential supervisor and ask for advice for the imminent interview. Should I do this?
Comment: Yes, but do take time to read several papers published by your potential supervisor before writing that email. If the PhD is computer science related, also have a look at [RefPerSys](http://refpersys.org/)
Answer: If there are things you genuinely need to know (How long will the interview last? Do they want you to give a presentation? What sort of questions can you expect?) then an email query is sensible and should be well received. This may be particularly important if you're moving institutions/countries so norms will be different. But don't send an email for the sake of sending an email.
Comment: Thank you so much  for replying to my concern as it has been bugging me lately. As long as it relate to queries concerning the interview, do you reckon with would be reasonable. As my last interview, I found it was strange to see my potential supervisor didn't ask me much questions revolving around my project even though it is a funded project. I had the feeling she didn't like me much because the feedback demonstrate that my research ideas were not coherent enough


Is there a way to convert a P2PKH address into P2TR?

Question: As far as I understand, Taproot enhances privacy by allowing someone to only reveal a specific key path, which in my understanding means that it's fairly flexible - is it possible to construct a P2TR address that'd be spendable by someone with (knowledge about the possibility and) "access" to an existing P2PKH address?
Comment: Please don't vandalize your posts. By posting on the Stack Exchange (SE) network, you've granted a non-revocable right, under the CC BY-SA license (https://creativecommons.org/licenses/by-sa/4.0), for SE to distribute the content (regardless of your future choices). The question prompted an answer that may be interesting for other users in the future and removing the question makes it harder for those users to understand the context.
Answer: Short answer: no, at least not via the key path (and using a script path would be less efficient than using P2WPKH instead)
Longer answer: no, and even if it were possible, this would be a terrible idea. The address a receiver gives you is how they expect you to pay them. Giving them money by paying in a different way is not something you should expect them to honor. Specifically, their wallet software may not support taproot, making the money unspendable for them. Even worse, their wallet could include a hardware security module or other security mechanism that can't just easily be upgraded to support taproot.
If they want you to send to a taproot address, they'll give you one.
Comment: Well, yes, a receiver could craft an arbitrary script and communicate that script's address representation in order to get paid. The sender unilaterally making unsupported assumptions how they may change the instructions to pay the receiver will certainly lead to conflict, if not outright lost funds.--Imagine you're running a restaurant in the US and when you bring the bill, the customer pays in Euros instead. Would you accept that?
Comment: The analogy I've used in the past (when this question came up about converting P2PKH to P2WPKH) was that it's like someone "paying" you by at night coming to dig a hole in your lawn and bury an enveloppe with money there. Sure, the money is there, on the receiver's property. But the receiver might not even notice it's there unless you tell them. Similarly, with such converted addresses, the receiver likely won't even recognize it as a payment to them.
Comment: Aren't you supposed to be able use an arbitrary redeem script? Surely there's a way to P2TR wrap P2SH-like script (which itself can wrap P2PKH).
Comment: Yes, but that'd be very inefficient. You can't construct a P2TR address that uses the key path (as you need the X coordinate of the public key, not just its 160-bit hash) given just a P2(W)PKH address.


Shimino FC-C201 Replacement

Question: I'm looking to replace the FC-C201 on a 2000 Diamondback Crestview, which uses an RD-C201, FH-RM40-8 rear hub (135mm), and CS-HG40-8I cassette.  I've measured the bottom bracket at 68 x 122.5mm.  The crankset is 48/38/28 170mm and the chain line is 47.5.  If I replace it with a Shimano M361 48/38/28 crankset with a chain line of 50, what size bottom bracket should I use in order to keep the chain straight?
Answer: Because M361 is no longer showing up in current year, first you dig through the archived Specifications .pdfs on si.shimano.com until you find it, like so:

We see 123mm gets you to 50mm chainline. Since we're only talking about modern symmetrical cranks and BBs, to go in 2.5mm on the drive side you need a 5mm shorter spindle (2.5mm per side). So, 118mm should recreate the chainline pretty closely.
If you just use the spindle you've got, it's likely to work fine after the front derailleur is re-adjusted, albeit with wider than necessary Q-factor and chainline. You should plan on needing to adjust the FD either way.

Shimino FC-C201 Replacement


The effects of design on application delivery time

Question: Some developers when given a task go straight into the IDE and start coding with very little design. They may have an idea of where the application is going as they are coding. I am 1 of these developers. I do this because I feel that if I spend a lot of time designing my application delivery time will be much higher as compared to if I just sit and code away the ideas in my head. My question is that how does application design effect the delivery time of the project and does it have a big advantage over coding the agile way?
Answer: Give you a example, when you want travel,
If your destination is near or in your town, you can start right away.
When you want travel to another country, you need package your self first.
Design is for preparation, without it , you cannot go too far(or go the wrong way).
Comment: I'd add distance in travel relates to size in the project. This can be 'amount of code', 'amount of requirements' (think high scalability demands) or 'team size' (a simple app, but it needs to be done fast, so we want to put 15 people at it)
Comment: Also if you want to have a bunch of people with you along the way to make it fun, you'll have to organise it so that everybody can join you. Actually like this allegory.
Answer: It is not a black and white situation: for some projects it is much better to jump in and start coding, for some it's better to have an extensive planning stage, and for others it is not clear cut.
If the project is small and simple enough that only a single developer is working on it, and how to build it is obvious enough that they can imagine every aspect of it in their head, then they can very well jump in and start designing.
The need for more extensive planning comes about when you have multiple developers, or when the project is large and complicated enough that a developer cannot know everything possible about how it will work from the outset, because it is too complicated to know all aspects of it in your head.
Answer: This approach only really works well if you are working on your own. If you have to work within a team of people, it is important to have a good plan so that everyone else knows what you think is the end goal. This doesn't reduce creativity it just allows you to make sure everyone is on the same page, and it reduces the opportunities for confusion.

(source: yang.id.au)
Answer: What you describe only works well if you are writing something well well understood and contained.  If it is similar to other software you've written you don't need a new design because you can just re-use the old one.  however, if it is something totally new, designing on the fly will get expensive.  You'll find yourself rewriting too much of the code or worse, stuck with a poor architecture which slows you down.  Likewise, if you need your code to be extensible, planning ahead is necessary.  If you need it to work with components from other people, planning ahead is necessary.
Answer: Just to add a line of thought to your equation scenario, let me contribute this little bit hereafter: I work in a business called YES INTERNATIONAL CORPORATION (www.yesintl.com.au) Sometimes, it does happen that developers may have developed something before so in that case the design is already in the mind. For example, I have developed database solutions in the past which makes us a very fast delivering corporation compared to our competition when I sit down and start developing a project. More experience will make you super perfect as the time goes by... I hope this helps... Andy


Why does carbon molecules and water have broad bandwidth of infrared absorption?

Question: I am kind of curious to know how a single element molecules can absorb many infrared frequencies not every single frequency in band but most of them.how is this possible because a molecule absorbs infrared photon if the photon frequency is in resonance with molecule frequency and all the transitions can be from v=1 TO V=v+1 and the frequency of each molecule should be unique because they don't have exactly same environment.please tell me how is this possible
Answer: If you model the vibrational modes of molecules classically, in terms of masses and springs, you get the impression that molecules should vibrate at a few precisely defined frequencies.  However, according to QM, every spectral line is broadened by three phenomena: (1) inherent linewidth reciprocal to the lifetime of the initial state, in accord with the uncertainty principle, (2) collisions that shorten its effective lifetime before dephasing or deexcitation, and (3) doppler shifts from thermal motion.
Even more importantly, there are QM selection rules that demand rotational fine structure, splitting each vibrational line into many resolvable lines.  There will also be purely rotational transitions that do not involve changes of vibrational state.  Dipole transitions require the angular momentum L to change by one unit, up or down.  It is easy to describe the fine structure for a diatomic or rigid linear molecule, but harder for water.  The rotational energy levels are ${{E}_{L}}=L(L+1)\ {{\hbar }^{2}}/2I$, where I denotes the moment of inertia.  If the basic vibrational frequency is $\nu $, traditionally stated as spatial frequency in units of cycles per cm, the observed lines will be at $\nu \pm \Delta {{E}_{L}}/hc$ where $\Delta E=(2L+1)\ {{\hbar }^{2}}/2I$.   The relative strength of the lines depends on degeneracy and populations of the initial states, hence $(2L+1)\exp (-{{E}_{L}}/kT)$ for an up-transition.
Taking carbon dioxide as an example, its IR-active vibrational modes (those that make for an oscillating electric dipole moment) are its two degenerate bending modes at 667 and its asymmetric stretch mode at 2349 $c{{m}^{-1}}$.  The symmetric stretch mode at 1388 is IR-inactive for lack of an electric dipole moment.  It has no purely rotational dipole transitions because it is nonpolar.  Since no molecule is an ideal simple harmonic oscillator, you should not expect evenly spaced vibrational levels, and there will be sum, difference, and overtone lines as well.  Given its moment of inertia, the spacing of its rotational fine structure lines is about 0.9 $c{{m}^{-1}}$, but dozens of lines to either side of the vibrational frequency will be significant at atmospheric temperatures.
Comment: Is it only the co2 molecule or other type of carbon molecules?
Comment: The facts I recited are specific to CO2.  (It is the prime suspect in global warming, after all.)  Larger molecules will have many more vibrational modes, finer rotational structure, etc.
Answer: $CO_2$ and $H_2O$ are light molecules so the have high vibration frequencies. They also have polar bonds or even a dipole so they couple well to the electromagnetic field. The other molecules in air, $O_2$ and $N_2$, lack polar bonds. Other molecules such as $NH_3% also have these properties but do not occur in air, unless something is drastically wrong.
Each of these properties are not unique. It is the combination of these factors that make $CO_2$ and $H_2O$ prominent IR absorbers.
Comment: Is that why infrared is not passing through walls,due to presence of co2 on surface of walls and hydrated molecules of brick in the walls?


accomodating non-negativity constraint in the dual

Question: Suppose the objective implicitly imposes non-negativity constraint, say, the objective is sum of square roots of the decision variables. Is it necessary to consider the inequality constraints imposing nonnegativity and have dual variable associated with them? Then those dual variables and those inequalities will appear in the lagrangian and the dual function.
Answer: It depends. What are you trying to accomplish? (By the way, I hope you are maximizing that sum of square roots. Otherwise your model is not convex.)
If you just want to compute the Lagrange dual, then you do not have to add explicit non-negativity constraints to the primal problem. Of course, as is often the case when computing the dual, you may end up with implicit constraints in the dual function. You will have to decide whether it is natural to move those implicit constraints out of the dual function and make them explicit dual constraints or not.
If you are trying to solve the problem, using some method that requires the dual, you may need to add the constraints. That is because, for the case of square root at least, the gradient of the objective will be infinite at the origin. Some algorithms won't be able to deal with that very well. For instance, if you employ a barrier method, I'd recommend going ahead and adding explicit non-negativity constraints.
Comment: Thanks for your pointers. Yes, I am maximizing a sum of square roots.