IDataErrorInfo best practices

Question: I am working in a WPF project using MVVM.
What's the best practice to validate errors using IDataErrorInfo? In my Model or ViewModel?
Whats the best pattern to use to implement validation?
P.S. I am Using .NET 3.5.
Answer: I think there is no right way or wrong way. It all depends on your application and whether or not your using different patterns or architectures or have specific needs within your WPF application.
If your using different tiered architecture, you could put your validation within the business layer of your application. If that's the case, use This link.
Within my applications, I like to put the validation within the viewmodel. Obviously, in some cases this this is a bad idea, for example; If you have a FirstName property within your viewmodel, it means you are only limiting GUI to validate the FirstName property, but what if someone set it from other place.
It all comes down to the needs of your application and requirements. Personally speaking I put them within my ViewModel, as its quick and easy. But for best practices then I recommend that you read through the link.
I also recommend you read through the following links to give you a better understanding;
How to Use Model Validation Rules in WPF ViewModel
OR
Business Layer Validation Sample
Hope this helps!
Answer: If you bind your model to the view, it would be best to use Data Annotations and the Validator class. If you're binding to properties of your view model, then use IDataErrorInfo for validation.

IDataErrorInfo best practices


Is it ethical to share names and emails of survey participants?

Question: My friend has conducted a small pilot survey as part of research proposal and used anonymized results to present his case. Now adviser insists that my friend discloses names and emails of all the participants. Would it be ethical do disclose this information? Since it was a pilot study, my friend didn't bother with consent forms, and I feel like it would be incorrect to disclose this information. I understand that adviser wants to be sure that the study was real. Is there any way my friend can prove that study was real, without disclosing private information of participants?
Comment: This is exactly why consent forms (and IRB approval) are important even for pilot studies...
Answer: Your friend can seek retroactive permission from the participants. They can email all of the participants to ask them for permission to disclose their contact details with the friend's advisor for the purpose of validating the survey. They should probably also ask them to complete a consent form of some kind, the details of which your friend should discuss with their advisor. Without seeking permission, it would be unethical. Depending on what the survey is about, the participants may not want their details being shared with your friend's advisor.
Comment: The problem with this is that many people don't understand the risks of making such information public.  (If they did, Facebook would wither!).
Comment: @WGroleau I don't think the question is about making the information *public*. I understood the question to be about disclosing the participants solely to the advisor.
Comment: Ah, in that case, I would agree to reveal, but only the ones that give their consent and know exactly what they are consenting to.  And hope the advisor is ethical!  The disclosure, though, doesn't prove the study is real.  I can easily invent names and e-mail addresses.


Is there a way to customize the services in the direct contact shortcut?

Question: I added a contact shortcut to my home screen, and I noticed that the Messaging icon in the pop-up changed to Handcent when I changed the default messaging app on my phone. One thing that's always bothered me is that there's a Facebook icon in the pop-up. Is there any way to customize what pops up when you press on a contact shortcut?
Comment: My guess is that it will either require root access or will fall into the category that my question about customizing the "Share" popup, un-customizable even with root (at least thats what the consensus was).
Answer: If you stop syncing Facebook with your phone book, that option will disappear.  I realize this isn't an answer to your question about customizing the pop-up but it may just serve your needs until a more skilled Android ninja happens upon this question.
Comment: I've never synced Facebook with my phone book.
Comment: Wow, I didn't realize it, but one of the Android updates must have turned on Facebook sync in my contacts. It has now been removed.
Answer: What phone make and model do you have? What version of Android? What are you doing to add the shortcut for the contact?
If I go to add a shortcut after long clicking on the homescreen I get an option for "Person". Then I choose the individual to make a shortcut for and I have the option of some things to add for that shortcut. If you choose contact card or quick contact you get a decent amount of options. Contact card gives you everything for that contact. Not as many options as you might want sure, but whatever you select from the contact card will use the phone default.
Comment: As I said in the question, its a shortcut to a contact. Long press, add shortcut, contact. Phone make doesn't matter. Version 2.2.
Comment: Phone does matter which is why I was asking. Different phones use different launchers and different contact systems which changes the answer. If you have an HTC phone then chances are you have HTC Sense running and I would have an easy time helping you as I have an HTC phone running an HTC based ROM. If you are not using an HTC phone or are not using HTC based ROM I could still help you but would need to load my non HTC based ROM. Since you say you selected Contact after choosing shortcut I'm guessing you are using a non HTC phone. Correct?


Do peers advertise their chain work?

Question: If yes, is this how a node decides that the peer has the best chain for headers-first download?
Answer: They don't, actually.
The protocol for finding the best headers chain is fairly simple: a single peer is asked for the 2000 headers following the last known block header the node knows it and the peer have in common. When these headers arrive, it is asked for more. This process repeats until either a timeout is hit, or a point in time close to the present is reached. When the latter occurs, all peers are asked for their headers.
Of course, simultaneously, peers (all of them) are asked for actual blocks too, whenever they claim to have blocks for headers which we believe could be on the path towards the best chain. If peers fail to deliver these, they get disconnected. If they provide invalid blocks, they may become marked as "discouraged" (replacable), and if applicable, the block may get marked as permanently invalid too. If that happens, peers that provide other blocks or headers that descend from the invalid block will get punished too.
There exist some ideas about reverse headers syncing that's probably closer to what you suggest. This is not implemented anywhere, as far as I know.

Do peers advertise their chain work?


One God vs triune God

Question: There are many explicit passages of the Scripture that clearly declare the cardinal truth that teach that there is only one God: Exo. 8:10; Deut. 4:35,39; 6:4; 32:39; 2Sam. 7:22; 22:32; 1Kings 8:60; 2Kings 19:15; 1Chron. 17:20; Neh. 9:6; Psa. 18:31; 86:10; Isa. 37:16,20; 43:10,11; 44:6,8; 45:5,14,18,21; 46:9; Hosea 13:4; Joel 2:27; Zech. 14:9; Mark 12:29-34; John 5:44; 17:3; Rom. 3:30; 16:27; ICor. 8:4,6; Gal. 3:20; Eph. 4:6; 1Tim. 1:17; 2:5; 6:16; James 2:19; Jude v. 25. There are very few ambiguous passages of the Scripture used for triune God teaching. Where is the truth?
Comment: The doctrine of the Trinity teaches there is only one God, so you need to clarify what you think is inconsistent here
Comment: The Hebrew speaks of God being echad and not yachid. Adam and Eve became echad body Gen2:24 (two persons one body). This translates into the Greek with hen and monos. At all times when referring to God the Hebrew uses echad not yachid and the Greek uses hen not monos. Therefore in light of this the English word translated as 'one' cannot be understood to mean singular but united. "One nation under God" one people comprised of millions of individual people. The one invokes the idea of unity not singularity.
Comment: Even in early Israel, many deities are affirmed according to an emerging consensus among biblical scholars/Jewish scholars. In fact, the one God in early Israel had many bodies ( = many selves) which shows that early Israelite beliefs were compatible with the Christian beliefs in the Trinity and the incarnation (See Benjamin Sommers The Bodies of God and the World of Ancient Israel, 2009). This is how Israel is said to be 'monotheistic' (so early Israelites were not "unitarians". Unitarianism is anachronistic to earliest Jewish beliefs.
Comment: "On that same night I will pass through Egypt and strike down every firstborn of both people and animals, and **I will bring judgment on all the gods of Egypt**. I am the LORD. (Exodus 12:8) The OT is quite clear: gods in the plural sense are real. The radical monotheism of the second Temple period deviates from the literal OT which recognize a supreme deity (*Elohim*) among lesser deities. The Hebrew *Elohim* is plural, thus the fundamental nature of a triune God is inherent to both the literal language and the OT narratives.
Comment: Only when one ignores the literal texts and reimagines the historical narratives is the idea of radical monotheism (i.e. a singular God) possible. If one simply accepts the OT as written, *Elohim* is understood as both singular and plural, as a triune God among lesser gods would be described.
Comment: Although the question quotes numerous texts the question is not about those texts. The question is 'Where is truth ?' On this site, such topical questions which wish to debate and discuss a biblical topic, are off-topic. See the Tour and the Help (below, bottom right) as to the purpose and the functioning of the site.
Comment: *Where is the truth ?* - [The truth is out there](http://www.youtube.com/watch?v=Vpqffgak7To).
Answer: It is obvious from the Ten Commandments, "God" is not singular:

I the LORD am your God who brought you out of the land of Egypt, the house of bondage: You shall have no other gods beside Me. (Deuteronomy 5:6-7) [NJPS]
אנכי יהוה אלהיך אשר הוצאתיך מארץ מצרים מבית עבדים לא יהיה־לך אלהים אחרים על־פני

Both "your God" and "gods" are the same word, אלהים, 'elohiym. Commenting on Deuteronomy 5:7, Bernard M. Levenson explains the first of the Ten Commandments:

5.7: This first commandment takes for granted the existence of other gods; its concern is only to ensure Israel's exclusive loyalty to YHVH. This perspective, called "monolatry," is found frequently within Deuteronomy (see 6.4; 32.8-9, 43; 33.2-3, 27). The idea of monolatry is often expressed by representing YHVH as the ruler of the divine council (see 32.8 n.; Psalm 82; 89.6-8; cf. Exodus 15.11). That perspective almost certainly represents an earlier form of Israelite religion. Ancient Near Eastern sources similarly envision a chief god ruling over a council of other gods. During the Babylonian exile, perhaps under the influence of Second Isaiah, a very different understanding developed. Radical "monotheism" affirms God's greatness, not by portraying Him as more powerful than other gods but, instead, by denying the existence of other gods altogether (see 4.15-31 n; Isaiah 43.10-12; 44.6-8, 45.5-6, 14, 18-19, 22). Once that perspective became normative in the period following the exile, the earlier view was no longer intelligible. As a result, in the process of reading, preaching, and translating the biblical text, Second Temple Jewish communities sometimes read the later perspective of monotheism into texts that actually had in mind the earlier idea of God as ruling a divine council (see v. 9 n.; 6.4 n.; 32.8 n.). The original theology has also become unavailable to most contemporary readers, since many of the translations found in synagogue prayer books employ euphemisms to "explain away" the biblical text's clear references to other gods.1

The plurality of 'elohiym is inherent to the Shema:

"Hear, O Israel! The LORD is our God, the LORD alone b (Deuteronomy 6:4)
b: Cf. Rashbam and Ibn Ezra; see Zech. 14.9. [And the LORD shall be king over all the earth; in that day there shall be one LORD with one name.] Others "The LORD our God, the LORD is one."

Levenson notes "Modern readers regard the Shema as an assertion of monotheism, a view that is anachronistic."2

6.4-5: The Shema, with its call for complete personal devotion to God, became normative for the various Judaisms of the Second Temple period; in fact these verses were cited by Jesus as the "first" of all commandments (Mark 12.29-30). 4: The LORD…alone: NJPS correctly departs from the more familiar translation, "The LORD [YHVH] our God, the LORD is one" (see translators' note b, end). Each of the two interpretations is theoretically possible because, in Hebrew, it is possible to form a sentence by simply joining a subject and a predicate, without specifying the verb "to be." The Hebrew here thus allows either "YHVH, our God, YHVH is one" or "YHVH, is our God, YHVH alone." The first, older translation, which makes a statement about the unity and the indivisibility of God, does not do full justice to this text (though it makes sense in a later Jewish context as a polemic against Christianity). The verse makes not a quantitative argument (about the number of deities) but a qualitative one, about the nature of the relationship between God and Israel. Almost certainly, the original force of the verse, as the medieval Jewish exegetes in translators' note b recognized, was to demand Israel show exclusive loyalty to our God, YHVH – but not thereby to deny the existence of other gods! In this way, it assumes the same perspective as the first commandment of the Decalogue, which, by prohibiting the worship of other gods, presupposes their existence (see 5.7 n.). Once true monotheism became the norm in the Second Temple period, this earlier perspective became unintelligible. Second Temple readers and translators of the Shema were thus forced to read this and similar passages in a way that made them consistent with the normative monotheism (see 32.8 n.; cf. 4.15-31 n.; 5.9 n.). That process of reinterpretation is already evident in the Septuagint's translation (3rd century BCE): "the LORD is one." As the basis for most subsequent translations, that reading is the source for the common understanding of the verse. Alone: The traditional translation (see translators' note b) preserves the normal use of Hebrew "'ehad," "one," which may have contributed to interpreting the Shema as a declaration of monotheism. But what it might mean to say that God is "one" is unclear, since that is not the same as affirming there is only one God (Isaiah 44.6; 45.5-7, 14, 18, 21; 46.9). Nor is it likely that the verse intends to clarify that there is only one YHVH, as opposed to many YHVHs, since there was no difficulty in recognizing that different manifestations of a divinity could derive from a single god (Exodus 6.3). NJPS thus properly understands "'ehad" to mean "alone," i.e. "exclusively." This interpretation receives support in the prophet Zechariah's interpretation of this verse: "In that day there shall be one LORD with one name" (Zechariah 14.9 and translator note d).3

The modern interpretation is not only anachronistic, it is a polemic against Christianity; which can only mean, a polemic against the Christian understanding of the qualitive nature of 'elohiym to be fully revealed as the triune nature (Father, Son, Holy Spirit) of God. This is the most satisfactory explanation of how the Old Testament narrates the making of man:

And God said, "Let us make man in our image, after our likeness... (Genesis 1:26)

the LORD God formed man from the dust of the earth. He blew into his nostrils the breath of life, and man became a living being. (Genesis 2:7)

It is us (plural) who decide to make man; it is the LORD God (singular) who carries out the plan.

1. Bernard M. Levenson, The Jewish Study Bible, Edited by Adele Berlin and Marc Zvi Brettler, Oxford University Press, 2004, pp. 375-6
2. Ibid., p. 380
3. Ibid.
Answer: Actually, the best and simplest demonstration that God is both One (and only) and yet more than one person is the greatest text in all the Scripture, found twice for emphasis:

1 John 4:8, 16 - "God is Love"

If love is the very essence of the eternal God's existence and substance, and that love is other-centered, then the One God cannot be single person but must be more than one person but still a single God.  Such a truth is seen many times in the Bible.
In the NT we often see the ONE God referred to as three persons: Matt 3:16, 17, 12:28, 28:19, Mark 1:10,11, Luke 3:21, 22, John 1:32, 14:26, 15:26-16:14, Acts 2:33, 10:38, Rom 1:2-4, 8:9, 15:30, 1 Cor 6:11, 12:2-6, 2 Cor 13:14, Gal 3:11-14, 4:6, Eph 1:17, 2:18, 22, Titus 3:6, Heb 9:14, 10:29, 1 Peter 1:2, 3, 3:18, 4:14, Jude 20, 21.
In the OT we also see the ONE YHWH as more than one person:

Zech 2:6-12 – the LORD (= YHWH) claims three times that He has been sent by the LORD.
Isa 48:11-16 – again, the LORD has been sent by the LORD.
Isa 63:7-16 – the LORD (described as a Father) sends His divine servant (the angel of His presence) and His Holy Spirit who is grieved (compare Ps 78:40).
Ex 23:20 – the angel of the LORD's presence has the power to forgive sin (but will not).  This and the previous reference clearly make the angel of the presence the pre-incarnate Jesus.
Hos 1:7 – the LORD saves by the LORD their God.
Prov 30:1-4 – the Son of God is as unfathomable as God Himself.
Psalm 110 – "The LORD says to my Lord" – Jesus asked about this Psalm on how someone could be both Son and Lord of David – see Matt 22:44, Mark 12:36, Luke 20:42, Acts 2:34.
Ps 45 (quoted by Heb 1) talks about the "Son" being God in addition to God the Father.

Thus, we have the great truth that is is truly only ONE and one only God, but God is three persons who are ONE (Deut 6:4) just as in a marriage, the husband and wife are one (Gen 2:24 - same word, echad).
Comment: Absolutely proper to bring in the "God is love"! Indeed, those who claim a monadico-monopersonal Judaistic or Islamic deity,  necessarily must deny the truth of this phrase, for if monado-personal god is love, then before creation he could love only himself and be a greatest egotist. But this is absurd, for "love" in its true sense implies at least two persons. Or those ill-advised theologians must claim that He became "love" only after the creation of other persons. But how the one having not love in eternity would gain it in time? And even then "love" would be something adventitious to Him.
Answer: One God vs triune God. Where is the truth?
There is only  One God.
Father and Son are two distinct individuals
Matthew 26:39 NASB

39 And He went a little beyond them, and fell on His face and prayed,
saying, "My Father, if it is possible, let this cup pass from Me; yet
not as I will, but as You will."

If the Father and the Son were not distinct individuals such a prayer would be a hypocrisy, Jesus would be praying to himself, and the will would be his and not the Father's.
Jesus says that he is distinct and separate from the Father
John 8:17-18 NET

17 It is written in your law that the testimony of two men is true. 18
I testify about myself and the Father who sent me testifies about me."

Jesus is the beginning of God's creation, (Compare Proverbs 8:22)
Revelation 3:14 NASB

14 "To the angel of the church in Laodicea write:  The Amen, the
faithful and true Witness, the [a]Beginning of the creation of God,
says this:

Revelation 3:14 KJV

1 4 And unto the angel of the church of the Laodiceans write; These
things saith the Amen, the faithful and true witness, the beginning of
the creation of God;

Colossians 1:15-16 NASB
15 He is the image of the invisible God, the firstborn of all creation. 16 For by Him all things were created, both in the heavens and on earth, visible and invisible, whether thrones or dominions or rulers or authorities—all things have been created through Him and for Him.
My Father is greater than I.
John 14:28 KJV

28 Ye have heard how I said unto you, I go away, and come again unto
you. If ye loved me, ye would rejoice, because I said, I go unto the
Father: for my Father is greater than I.

"God is the head of Christ." Paul wrote this many years after Jesus ascended to heaven, such a statement would be a lie if Jesus was a coequal in the Godhead.
1 Corinthians 11:3 NASB

3 But I want you to understand that [a]Christ is the head of every
man, and the man is the head of a woman, and God is the head of
Christ.

Jesus is a Divine Being.
In John 1:1c, should the Greek word θεὸς be translated into English as "a god" or "God"?
Three great translators of the Greek scriptures, translate John 1:1c,into English "the Word was divine" (James Moffat, Edgar J Goodspeed, and Westcott ) Also Jason David Beduhn in his book Truth in Translation reaches the same conclusion.
James Moffat New Testament. (1926)

1:1 "THE Logos existed in the very beginning, the Logos was with God,
the Logos was divine."

The New American Translation by Edgar J Goodspeed and J.M.P. Smith (1949)

1:1 "In the beginning the Word existed, the word was with God and the
Word was divine."

ΚΑΤΑ ΙΩΑΝΝΗΝ 1:1 1881  (WHNU)

1 εν αρχη ην ο λογος και ο λογος ην προς τον θεον και θεος ην ο λογος

Holy Spirit = The Power of the Most High
Luke 1:31-32 NASB "And behold, you will conceive in your womb and bear a son, and you shall name Him Jesus. 32 He will be great and will be called the Son of the Most High; and the Lord God will give Him the throne of His father David;

34" Mary said to the angel, "How can this be, since I am a virgin?" 35
"The angel answered her, "The holy Spirit will come upon you, the
power of the Most High will overshadow you; hence what is born will
be called holy, Son of God." (J.Moffat Luke 1:34,35)

And Luke  says: Jesus started his ministry in the power of the spirit.  " And Jesus returned to Galilee in the power of the Spirit, and news about Him spread through all the surrounding district." Luke 4:14  NASB
Jesus promised his  Apostles that they will receive power when the holy Spirit comes upon you. "You will receive power when the holy Spirit comes upon you, and you will be my witnesses at Jerusalem, throughout all Judaea and Samaria, and to the end of the earth." (J. Moffat Acts 1:8)"
In his prayer,  Paul spoke that the disciples will be filled with joy and power of the  holy spirit.

" Now may the God of hope fill you with all joy and peace in
believing, so that you will abound in hope by the power of the Holy
Spirit."Romans 15:13  (NASB)

Conclusion.
If you want to know the truth about God you should not search the Bible hoping to find a text that can construe into a preconceived belief, and disregard the rest of the scriptures,  some of them mentioned above. Some verses may be read in more than one way, but when compared to other verses, their meaning becomes clear. Many texts used to support a triune God,  usually mention only two persons, not three. These verses do not prove that the Bible teaches the there is a coequal Godhead.
Answer: Just see and consider this: if, for example, in 1000 occasions a person, say a girl whom I like, behaves towards me in a way as to leave me in ambiguity whether she likes me romantically or not, but in just three occasions, or even one occasion she smiled towards me in a way that disseminated all my doubts and showed me her romantic openness towards me and only me in the whole world (for this is the true romantic liking, which suffers sharing itself with no other person in the world), then I will say that this one instance is enough for me to state like does the "Beatles" in its famous song: "She loves me, yea, yea, yea!"
Similarly, if in the whole Scriptures it was only John saying that "In the beginning was Logos, and the Logos was with God, and Logos was God" and further, that everything that is created is created through this very Logos who therefore is uncreated Himself and since uncreated, therefore God (for only God is other than created) in no lesser sense than Father is God, then consider that your beloved girl smiled back to you with no ambiguity left and you can sing joyfully without any trace of doubt: "She loves me, yea, yea, yea", and "Logos is God and co-worshipped with the Father, amen!", and Who gave you this salutary insight is of course the Holy Spirit, for nobody is able to grasp Jesus' Godhead unless by Holy Spirit (1 Cor. 12:3).
But not only John of course speaks about Godhead of Jesus, but it is said everywhere in the Gospels: in Him forgiving sins authoritatively; in Him working miracles authoritatively without prayers but Himself; in Him knowing human hearts, which only God can; in Him accepting worship and even urging people to worship Him just as they worship the Father etc. etc.
Answer: Q. Where is the truth?
As believers in the God of Jesus and the son He sent, we have the word left for us that teaches and reveals all we need to know and some of what we want to know.
The bible clearly does not teach or reveal a trinity unless one -

focusses on a partially corrupted text made to support a trinitarian version of God.
trusts writings from men centuries after the canonical books were written.
ignores plain and consistent teaching about a Jesus who said himself he was a man, who had, and has the same God we do, who is subordinate to the Father and God in everything - even once raised from the dead to new immortal life (by his Father) and exalted to 'heaven' to be with the Father for the first time.
cobbles together various 'proof texts' that on their own, seem to lend some support for a trinity, but when allowed to stand in context, and joined with the remaining verses, speak of a truth quite different to the one proposed in isolation.
persists with the traditionally taught (orthodox) Christian theology that is based on things the early church never heard of and certainly never believed in. (Furthermore, daring to make this contrived doctrine the foremost of all! Even requiring acceptance of such for salvation)
is prepared to accept a different gospel than the one left for us - the life of Jesus, experienced by Jesus' own disciples who became apostles and wrote the most important literary work on earth - the very word of God. The true gospel tells of a man, made like us in every way, who was tempted as we are, who could do nothing of himself, whose very words were from the Father, who died a human death and was brought back to life - a new life of spirit - the same one that faithful believers too will be endowed with at his return to realise the magnificent kingdom of God at last!

The truth then is ever before us - with the wide variety of quality resources, there is every opportunity to see God's word anew. However, the truth has been repressed for a long time - it is not readily recognised even when plainly visible and carefully explained.
People have older bibles like the King James and this has many 'adjustments' that are not helpful to see the truth intended by God. Just a quick look at some important verses across the many translations shows them all to have issues presenting the truth without bias. The biased reading is very familiar to us and hard to dismiss even when the error is pointed out.

May we recognise the additions and wholly dismiss them once and for all.
We can accept the words of Jesus at face value - as they were intended, without guile or mystery... We should not need a doctorate to understand the words of the son of God sent to save the world! 'I am a man who has told you the truth' John 8:40; 'The Father is greater than I, John 14:28'; 'I can do nothing of myself' John 5:30; when ascended, he still refers to God as 'his God' Rev 1:6, 3:12.
We can accept the words of the apostles who clearly and consistently echoed Jesus words about being a servant and forever subordinate to God the Father. Jesus 'offered prayers to the one who could save him from death' Heb 5:7; Jesus is appointed heir Heb 1:2 (which is odd if he supposedly made everything?)
If Jesus is God, he cannot be tempted by evil. The devil knew exactly who Jesus was Matt 4:6 and tempted him his whole life. Jesus was made like us Heb 2:17 either he was a man like us, or he was still fully God masquerading as a man - which is nothing like us.

He said to them, "But who do you say that I am?" 16Simon Peter answered, "You are the Christ, the Son of the living God." 17And Jesus said to him, "Blessed are you, Simon Barjona, because flesh and blood did not reveal this to you, but My Father who is in heaven. Matt 16:15

He had to be made like His brothers in every way Heb 2:17

Either he was or he wasn't. How can he be like us in every way and still be God? It's impossible. How can God be tempted or die? Either he was God or he wasn't. We need to pick one. The bible is clear - Jesus is a man - no one says he is God anywhere. Sure some verses might lend themselves to such a thought, but they must be understood by other plain and simple verses that do not need any interpretation. All the text must agree with itself. A God/man Jesus does not fit the complete text - it hardly fits any text.
The apostles mention, 'Blessed be the God and Father of our Lord Jesus Christ' so many times. There's no logical or scriptural way around Jesus having a God unless he is a man - made like us - in every way.
++++++++++++++++++++++++++++++++++++++++++++++++++++++
Someone asked about the corruptions. There have been dozens. Most have been rectified in recent times as it became impossible to ignore the purposeful changing of the biblical text to suit a trinitarian bias, but many remain.
These errors/additions have left a legacy of devoted readers and teachers who are not aware of the subverted truth in their hearts, minds and bibles. People still use these as proof texts - including here on BH.
God was manifested in the flesh 1 Tim 3:16 N/KJV
For there are three that bear record in heaven, the Father, the Word, and the Holy Ghost: and these three are one. 1 John 5:7
Jesus first rescued the nation of Israel from Egypt, but later he destroyed those who did not remain faithful. Jude 1:5
Many scriptures that refer to the holy spirit as a 'person' with masculine pronouns of he and him etc.
But of that day and hour no one knows, not even the angels of heaven, but My Father only. 'nor the Son' omitted NKJV NET ABE AKJV etc
The words 'return' or 'going back' have been added to simulate Jesus being in heaven before his birth and thus going back when resurrected John 16:5,28, 13:1,3, 20:17, 14:28
God who created all things. 'through Jesus Christ' added Eph 3:9
'to the knowledge of the mystery of God, both of the Father and of Christ' N/KJV
instead of, 'the knowledge of God's mystery, which is Christ' ESV & most others
John 1:18 'only begotten God'
While many errors have been remedied, changing Jesus to God, removing the word 'man' when referring to Jesus, adding 'return' to Jesus ascension and others have left a legacy of untruth and misinformation.
Who is responsible for these additions? Why are they still there? Why did they think this was important enough to add words, a whole verse and change many other words to promote another gospel?
Comment: And now the **evidence** of the corruption. Just saying it's corrupt is the fallacy of appealing to authority doesn't actually prove anything. I'm surprised you used only NT passages and I'm surprised that after you read Jude5 you didn't stop to think and apply it to OT passages like the very text I quoted in Isaiah 48 where The Redeemer is the sent one and God. Like I said, you're making a deliberate effort to look away, with a *probable* pre-commitment to a creed rather than the fidelity of the OT text.
Comment: *"From the first announcement I have not spoken in secret; at the time it happens, I am there. "And now the Sovereign LORD has sent me **(Son speaking)**, with his Spirit **(Sovereign Lord and Spirit sent Him)**. This is what the LORD says **(Son speaking)** - your Redeemer, the Holy One of Israel: "I am the LORD your God, who teaches you what is best for you, who directs you in the way you should go* in earlier verses He (narrator) identifies Himself *"Listen to me, O Jacob, and Israel, whom I called! I am he; **I am the first, and I am the last**.
Isaiah 48:12, 16, 17*
Comment: If you can't see the Trinity in the OT it's because you are making special effort to look away.
Comment: "focusses on a partially corrupted text that has been made to support a trinitarian version of God." Please explain in detail which texts have been corrupted and what the evidence is.

One God vs triune God


Views Table Grouping not working if group field is blank

Question: I'm using Drupal 7. In a field collection view, I have data in a table that has field groups. I have 3 fields I want to group on, the first two are required, the third is optional. Everything worked until I added the 3rd field. When there are records with no data in that field, the record shows up as a row of empty table cells. Can anyone suggest a fix for this?
Comment: I'm wondering if there's a way to conditionally control this. For example, can you turn grouping off if a certain field has a certain value? Or, if a field has no value?
Answer: I had a similar issue. If the field I was grouping by was empty in all the nodes under another grouping, no results would show. In my case it was State->Administrative Area, and if none of the nodes in the state had administrative areas no results would show under the state.
The solution that ended up working for me was to uncheck the 'Hide rewriting if empty' box in the Configure field: Content: Administrative Area->No Results Behavior section. 'Hide if empty' was already unchecked so I didn't fool about with it.
Answer: On the edit screen for your view:

Under 'Fields', click on the third grouping field.
Then click 'No results behavior'.
Check the box labeled 'Hide if empty'.
Click apply, and then save your view.


What is a Diatonic tendency tone?

Question: "In the four-part writing of diatonic seventh chords the fifth may be omitted, in which case the doubled note in a four-part texture should not be a tendency tone. The most common doubling is the root." (in Harmony text) What is a useful definition for a tendency tone in Harmony theory ?
Comment: May be this question is cleared by my answer here: https://music.stackexchange.com/questions/79284/why-do-certain-chords-lead-to-another
Answer: In diatonic harmony, tendency tones tend to be one of two things:

The leading tone, which has a tendency to resolve up to tonic (especially when in an outer voice), and
Chordal sevenths, which have a tendency to resolve down by step (no matter what voice they're in).

The logic is as follows: since these tendency tones have a tendency to resolve in a particular way, doubling a tendency tone will result in parallel octaves, which is of course one of the most strident errors in four-part voice leading.
Comment: And the reason for avoiding parallel octaves is that harmonics moving together as a group are (kind of biologically) perceived as belonging to the same voice, sort of like tracked as one single dot on the radar, so if you have moving parallel octaves, you don't have four voices anymore. :) Or like, if everyone sings in unison, there's in a sense only one voice, even if they're in different octaves. (I know you know this, but just to add to the answer, it's good to know that the "rules" are for a reason, they're not magical)
Comment: interesting rationale , merging the voices , as the 2 become one ...
Answer: In a dominant 7th - tonic progression, the notes that form the tritone in the dom7, the 3rd and 7th of the chord, have a strong tendency to resolve to the root and 3rd of the subsequent tonic.   (This desire of a dominant to reach a tonic is the harmonic basis of the whole Common Practice thing.)
We avoid doubling these notes because their active nature would predominate too much.  And, as @Richard said, because if both doubled instances resolved 'correctly' it would create parallel octaves.
Answer: I looked up tendency tones in several of my textbooks and online and was surprised to read so many different definitions. But, somehow, I've developed the idea the tones of the tonic triad are stable and the other tones have various tendencies to move to those tonic tones. I guess I accumulated this understanding from many sources over time.
Most of it is covered by the resolution of a dominant seventh chord to the tonic, as described in Lessons in Harmony: Complete. Parts I and II,
By Arthur Edward Heacox. Using solfege the dominant's tendency tones resolved to tonic are:

TI to DO
FA to MI
RE to DO

...SOL then is either static, being held in the upper voices in typical voice leading, or it leaps to the tonic, but I've always thought of tendency tones and their resolution in terms of step-wise motion.
That leaves out the tone LA. If we think of tendency tone resolution in terms of movement to tonic chord tones, then it follows that LA steps down to SOL. The only reference I could find to that is in Teaching Music Theory, By Jennifer Snodgrass, but the wording is fairly indirect. It's about an ear training warm up where presumably DO MI SOL is first sung to outline the tonic to establish the stable tones and then FA MI, LA SOL, TI DO, and RE DO are sung in turn to apparently demonstrate the various tendency tones resolving to tonic tones. So, we can add this to the list...

LA to SOL

Another way to think of this is the tendency tones are contain in two simple, basic voice leading paradigms: V6/5 to I, and IV6/4 to I...

What is a Diatonic tendency tone?


Find k closest numbers to the median

Question: The formal problem statement is: Given a set S of n distinct numbers and a positive integer k<=n, determine the k numbers in S closest to the median.
My thoughts:
I have read about the median of median algorithm, which goes like group n elements in groups of 5 and finds the median of them and then recursively finds the median of the resulting array, which will have size n/5. This runs in O(n) time. So once we have the median, how to go about finding the k closest element to it, that seems to be another tricky thing.
Answer: Hint 1: try to transform the $n$ elements in such a way that the $k$ closest to the median will be the smallest $k$ elements after the transformation.
Hint 2: now use a standard algorithm to find the $k$'th smallest value (also known as the $k$'th order statistic). You might have learned an algorithm that computes this as a variation of the quickselect algorithm
Comment: Changing to |a-median| will transform like that. But how will that yield k closest to the median. I am looking for an O(n) solution
Comment: okay, so once you have the kth smallest value, you can find all the numbers less than it in a single iteration

Find k closest numbers to the median


Bizarre Wordpress CSS update problem

Question: So I went and updated a line in layout.css twice.  Then, I undid those changes.  I'll call the different versions "CSS original, CSS 1, CSS 2".
Now I'm experiencing a problem where my browser is using the wrong css.  I cleared my browser's cache, but the problem still persists.  I thought it might be caused by server-side caching, but for some reason different browsers are using different versions of the same CSS: Firefox is using CSS 1 and Chrome is using CSS 2.  I have no idea what could be causing this problem, and this happens on different computers too.
EDIT: Found the problem, it was caused by a plugin called "Supercacher".  I purged the cache and it works now.
Comment: Please answer your question rather than edit it with the solution.
Answer: Found the problem, it was caused by a plugin called "Supercacher", which must have been caching my css files. I purged the cache and it works now.

Bizarre Wordpress CSS update problem


how to pass data to running thread

Question: When using pthread, I can pass data at thread creation time.
What is the proper way of passing new data to an already running thread?
I'm considering making a global variable and make my thread read from that.
Thanks
Comment: Once again, people are trying to close questions because they're beginner questions.  Do try to remember you were once a beginner yourself.
Answer: That will certainly work.  Basically, threads are just lightweight processes that share the same memory space.  Global variables, being in that memory space, are available to every thread.
The trick is not with the readers so much as the writers. If you have a simple chunk of global memory, like an int, then assigning to that int will probably be safe.  Bt consider something a little more complicated, like a struct.  Just to be definite, let's say we have
struct S { int a; float b; } s1, s2;

Now s1,s2 are variables of type struct S.  We can initialize them
s1 = { 42,  3.14f };

and we can assign them
s2 = s1;

But when we assign them the processor isn't guaranteed to complete the assignment to the whole struct in one step -- we say it's not atomic.  So let's now imagine two threads:
thread 1:
   while (true){
      printf("{%d,%f}\n", s2.a, s2.b );
      sleep(1);
   }

thread 2:
   while(true){
      sleep(1);
      s2 = s1;
      s1.a += 1;
      s1.b += 3.14f ;
   }

We can see that we'd expect s2 to have the values {42, 3.14}, {43, 6.28}, {44, 9.42} ....
But what we see printed might be anything like
 {42,3.14}
 {43,3.14}
 {43,6.28}

or
 {43,3.14}
 {44,6.28}

and so on.  The problem is that thread 1 may get control and "look at" s2 at any time during that assignment.
The moral is that while global memory is a perfectly workable way to do it, you need to take into account the possibility that your threads will cross over one another.  There are several solutions to this, with the basic one being to use semaphores. A semaphore has two operations, confusingly named from Dutch as P and V.
P simply waits until a variable is 0 and the goes on, adding 1 to the variable; V subtracts 1 from the variable.  The only thing special is that they do this atomically -- they can't be interrupted.
Now, do you code as
thread 1:
   while (true){
      P();
      printf("{%d,%f}\n", s2.a, s2.b );
      V();
      sleep(1);
   }

thread 2:
   while(true){
      sleep(1);
      P();
      s2 = s1;
      V();
      s1.a += 1;
      s1.b += 3.14f ;
   }

and you're guaranteed that you'll never have thread 2 half-completing an assignment while thread 1 is trying to print.
(Pthreads has semaphores, by the way.)
Comment: @Charlie: sorry, but I completely disagree about the wording of threads as "lightweight processes". In many OSs - including many unixoid systems (e.g. BSDs) and Windows - threads are the entities that *run* code, while processes are mere containers for threads, the memory space etc. Now, I realize that this may be nitpicking, but I think the distinction is very relevant and very important.
Comment: @SAD It's also wrong, both historically and factually.  Processes are memory spaces with one -- or with threads, more than one -- program counter.  A thread is a "thread of control" which includes a program counter and a stack. See eg the Wiki article on threads. http://en.wikipedia.org/wiki/Thread_(computer_science)  People get this confused now, but a good operating systems book will discuss the history and clear it up.
Comment: It's true that it can "work", but I think you should have done more to steer @monkeyking away from global variables.  It's not clean and it doesn't scale, not to mention would be a big WTF for any competent C programmer.  The extra `void*` that the thread creation APIs give you is meant exactly to pass this kind of context around, so idiomatic code would use it for this.
Comment: @R, go read an operating systems book and get back to me. @asveikau it seemed to me the underlying issue was not understanding the whole concept; if you would prefer to explain it some other way I think answers are still being accepted.
Comment: The idea that "threads are just lightweight processes that share the same memory space" is really a horrible misconception stemming from the original unusably bad, non-POSIX-compliant implementation of "POSIX threads" on Linux, known as LinuxThreads. It's completely contradictory to the standard's definition/usage of the words "process" and "thread".
Comment: Well, mine was a bit too wordy but I gave it a shot.  So did @R.. .  I guess I feel it's important to preach good style to beginners.  After all, SO is supposed to be helpful help, right?  Would you let a co-worker get away with this without comment?  Why then on SO?  I don't mean to be a jerk about it though.
Answer: I have been using the message-passing, producer-consumer queue-based, comms mechanism, as suggested by asveikau, for decades without any problems specifically related to multiThreading.  There are some advantages:
1) The 'threadCommsClass' instances passed on the queue can often contain everything required for the thread to do its work - member/s for input data, member/s for output data, methods for the thread to call to do the work, somewhere to put any error/exception messages and a 'returnToSender(this)' event to call  so returning everything to the requester by some thread-safe means that the worker thread does not need to know about.  The worker thread then runs asynchronously on one set of fully encapsulated data that requires no locking.  'returnToSender(this)' might queue the object onto a another P-C queue, it might PostMessage it to a GUI thread, it might release the object back to a pool or just dispose() it.  Whatever it does, the worker thread does not need to know about it.
2) There is no need for the requesting thread to know anything about which thread did the work - all the requestor needs is a queue to push on.  In an extreme case, the worker thread on the other end of the queue might serialize the data and communicate it to another machine over a network, only calling returnToSender(this) when a network reply is received - the requestor does not need to know this detail - only that the work has been done.
3) It is usually possible to arrange for the 'threadCommsClass' instances and the queues to outlive both the requester thread and the worker thread.  This greatly eases those problems when the requester or worker are terminated and dispose()'d before the other - since they share no data directly, there can be no AV/whatever.  This also blows away all those 'I can't stop my work thread because it's stuck on a blocking API' issues - why bother stopping it if it can be just orphaned and left to die with no possibility of writing to something that is freed?
4) A threadpool reduces to a one-line for loop that creates several work threads and passes them the same input queue.
5) Locking is restricted to the queues.  The more mutexes, condVars, critical-sections and other synchro locks there are in an app, the more difficult it is to control it all and the greater the chance of of an intermittent deadlock that is a nightmare to debug.  With queued messages, (ideally), only the queue class has locks.  The queue class must work 100% with mutiple producers/consumers, but that's one class, not an app full of uncooordinated locking, (yech!).
6) A threadCommsClass can be raised anytime, anywhere, in any thread and pushed onto a queue.  It's not even necessary for the requester code to do it directly, eg. a call to a logger class method, 'myLogger.logString("Operation completed successfully");' could copy the string into a comms object, queue it up to the thread that performs the log write and return 'immediately'.  It is then up to the logger class thread to handle the log data when it dequeues it - it may write it to a log file, it may find after a minute that the log file is unreachable because of a network problem.  It may decide that the log file is too big, archive it and start another one. It may write the string to disk and then PostMessage the threadCommsClass instance on to a GUI thread for display in a terminal window, whatever.  It doesn't matter to the log requesting thread, which just carries on, as do any other threads that have called for logging, without significant impact on performance.
7) If you do need to kill of a thread waiting on a queue, rather than waiing for the OS to kill it on app close, just queue it a message telling it to teminate.
There are surely disadvantages:
1) Shoving data directly into thread members, signaling it to run and waiting for it to finish is easier to understand and will be faster, assuming that the thread does not have to be created each time.
2) Truly asynchronous operation, where the thread is queued some work and, sometime later, returns it by calling some event handler that has to communicate the results back, is more difficult to handle for developers used to single-threaded code and often requires state-machine type design where context data must be sent in the threadCommsClass so that the correct actions can be taken when the results come back.  If there is the occasional case where the requestor just has to wait, it can send an event in the threadCommsClass that gets signaled by the returnToSender method, but this is obviously more complex than simply waiting on some thread handle for completion.
Whatever design is used, forget the simple global variables as other posters have said.  There is a case for some global types in thread comms - one I use very often is a thread-safe pool of threadCommsClass instances, (this is just a queue that gets pre-filled with objects).  Any thread that wishes to communicate has to get a threadCommsClass instance from the pool, load it up and queue it off.  When the comms is done, the last thread to use it releases it back to the pool.  This approach prevents runaway new(), and allows me to easily monitor the pool level during testing without any complex memory-managers, (I usually dump the pool level to a status bar every second with a timer).  Leaking objects, (level goes down), and double-released objects, (level goes up), are easily detected and so get fixed.
MultiThreading can be safe and deliver scaleable, high-performance apps that are almost a pleasure to maintain/enhance, (almost:), but you have to lay off the simple globals - treat them like Tequila - quick and easy high for now but you just know they'll blow your head off tomorrow.
Good luck!
Martin
Answer: Global variables are bad to begin with, and even worse with multi-threaded programming. Instead, the creator of the thread should allocate some sort of context object that's passed to pthread_create, which contains whatever buffers, locks, condition variables, queues, etc. are needed for passing information to and from the thread.
Answer: You will need to build this yourself.  The most typical approach requires some cooperation from the other thread as it would be a bit of a weird interface to "interrupt" a running thread with some data and code to execute on it...  That would also have some of the same trickiness as something like POSIX signals or IRQs, both of which it's easy to shoot yourself in the foot while processing, if you haven't carefully thought it through...  (Simple example: You can't call malloc inside a signal handler because you might be interrupted in the middle of malloc, so you might crash while accessing malloc's internal data structures which are only partially updated.)
The typical approach is to have your thread creation routine basically be an event loop.  You can build a queue structure and pass that as the argument to the thread creation routine.  Then other threads can enqueue things and the thread's event loop will dequeue it and process the data.  Note this is cleaner than a global variable (or global queue) because it can scale to have multiple of these queues.
You will need some synchronization on that queue data structure.  Entire books could be written about how to implement your queue structure's synchronization, but the most simple thing would have a lock and a semaphore.  When modifying the queue, threads take a lock.  When waiting for something to be dequeued, consumer threads would wait on a semaphore which is incremented by enqueuers.  It's also a good idea to implement some mechanism to shut down the consumer thread.

how to pass data to running thread


Why sort the points acc to y coordinates in closest point divide and conquer method?

Question: The divide and conquer strategy for closest point problem sorts the points according to x coordinates so that the median could be found. But what does sorting the strip (strip array contains all the points which are at most d perpendicular distance apart from the median line where d is the minimum distance till now) according to the y coordinates serve any purpose? Is there something that cannot be done by the already x coordinate sorted array?
Link for reference
Comment: Look at 3.2: *Thankfully, we can make another life saving observation at this point...*
Comment: The link works in my device.
Comment: @user12208242 you did nothing wrong with your URL. I'm seeing that Safari on Mac is Ok with the tilde "~" character as is, but somehow fails when it is properly re-encoded as "%7E". I tested this separately on a page on my Mac. But the current edit and your original seemed to work fine on Chrome from Windows. Also on Safari, a forward slash oddly shows up after ".html" before the anchor ".html/#anal" and that fails. So there are two things here that Safari on my Mac dislikes. I put in an edit that Safari seemed OK with but there's another edit instead that still fails for me.
Answer: I think the answer is in the previous section 3.2 I've quoted below. I think this answers your immediate question.

However, since we sorted the points in the strip by their
y-coordinates the process of merging our two subsets is not linear,
but in fact takes O(nlogn) time.


What is a blend file?

Question: I am 100% new to Blender and to the Blender Manual.  Could anyone tell me what a blend file is please.  It is discussed at length in the manual except for explaining what a blend file is.
Answer: The .blend files are the project files of Blender.
They are binary files with the .blend extension as in fileName.blend. Blender saves its data as .blend files and can only open .blend files.
Other 3D files types are not "opened", but imported.
Blend files contain the models, materials, the scene (camera, lights and animation) and the information for rendering and viewing along with the state of the user interface.
By default they don't contain images used as textures unless you pack them. Read: How to pack images into blend file
Also not contained as part of the file are simulation caches or the add-on used to create the scene.
Answer: a blend file is the extension used in saving a blender data which could be written as .blend popular examples of extension names are .mp3 for music, .jpg for images, .png for images, for blender files we use .blend which contain everything your have created within the software such as meshes, light, world, hdr(s), texture, materials etc.

What is a blend file?


Seeking free satellite imagery basemaps to be used in webapps with frequent updates

Question: I am looking for satellite imagery base maps to be used in my web application. I have been using Google satellite base maps, but they are very old. I need something which has frequent updates, weekly or monthly updates will work too. All I need is that it should be open source.
Comment: If you are looking for open data then [opendata.se] Stack Exchange would be a better place to ask
Answer: Seems like a hard ask for imagery that is updated weekly/monthly without a concurrent subscription to a supplier.
Maybe this will help: https://earthexplorer.usgs.gov/
Comment: hello and thank you so much for your comment. This is a great resource for downloading satellite imagery. but what I want is a base map that can be used in a web application. just like some leaflet plugins of google satellite imagery. all these are not real-time or near real-time. they are atleast a year old imagery.


BGP Convergence Design Question

Question: i read that good convergence method for BGP is to rely on IGP Convergence by declaring next-hop dead and not decreasing BGP timers because the latter will cause unstable network.
i really fail to see what is the diffidence here
Answer: I am not sure I understand your question completely, you should at least mention where and what you read about this issue.
Here is a good blog entry to help learn about BGP Convergence.
https://lostintransit.se/2016/02/25/ccde-bgp-convergence/
The main takeaway is that the choice and configuration of the IGP (usually OSPF or ISIS) makes a large difference in the speed of eBGP convergence because BGP convergence is timer/scanner driven while the IGP such as OSPF is event driven. Events that cause very fast changes in IGP can be used to push fast convergence changes in BGP through a few means mentioned in that link.
Some people recommend changing the peering/session timers for the eBGP peers but you can't make really large improvements that way without risking large increases in CPU load, or simply hitting the minimum timers. Event driven updates are much faster in any case. Using Fast External Fallover triggered by those events (like loss of signal on an interface tied to the peering) or using BFD to improve discovery of link issues between peers will help speed up convergence in the case of a peer state change much more effectively than simply changing timers can accomplish.
Another option is Prefix Independent Convergence (PIC) which allows BGP to have a 'backup' path (assuming you have a second path for anything) for some/all network prefixes installed in the BGP RIB and FIB so that if the installed route in the RIB/FIB fails because of an unreachable next-hop address, the router can immediately use the second path while convergence takes place normally.

BGP Convergence Design Question


Stop the lock screen! Jelly Bean 4.2.2

Question: How can I stop the lock screen locking itself every two minutes? How can I extend the time it takes to turn off automatically? I'm running Jelly Bean v 4.2.2 on a Samsung Galaxy S 4.
Answer: Go to Settings -> Display -> Sleep, and you can change the time out requirement from there.
Answer: If you want the timeout increased permanently, you can use the hint given in TronicZomB's answer. But keep in mind that display is one one the heaviest battery consumers -- so if you often forget to turn off your display manually, your battery might last much shorter.
A more intelligent approach would be using some automation software like e.g. Tasker or Llama, and have your display timeout set according to your situation. I use e.g. Tasker for that: when one of my reading apps (RSS, eBook, Web) runs in foreground, Tasker increases the display timeout to 3 minutes. As soon as I exit them (another app or the homescreen comes to foreground), display timeout is reset to 30 seconds.
Of course you can adjust those values to your needs. As a side effect, you will be able to automate a lot of additional stuff. For me, Tasker e.g. automatically activates GPS when I start some related app, and deactivates it afterwards (on 4.2, this will require your device to be rooted). It also switches WiFi off when I left home (and turns it back on when I return), and adjusts ringer/audio volumes when I'm in the office, plus more.

Stop the lock screen! Jelly Bean 4.2.2


Is this the correct way to hedge two securities against each other?

Question: Let's say I believe that $ts_1$ and $ts_2$ move together and I would like to pairs trade them. Am I correct in understanding that to hedge them against each other I would get their $Var_1$, $Var_2$, and $Cov_1,_2$ all in USD, then I would buy 1000 USD worth of $ts_1$ and then find how much money to put into shorting $ts_2$ by doing $\beta =  Cov_1,_2$/$Var_1$, and then doing $\$\_position\_ts_2 = $\$1000* $\beta$?
Comment: What you are looking for is called the hedge ratio. For your formula to make sense, you need to be dividing by $\beta$.
Comment: Just to make sure I follow, you mean $USD\_position\_ts_2 = 1000 USD/ \beta$ where $\beta =  Cov_1,_2$/$Var_1$?
Answer: This is (one way) how to hedge two securities against each other. I am synthesizing the material from here and here.
Let's call one security the $security_{market}$, and another $security_{unique}$. I'm taking for granted that you have done your research and believe that you found a good pair of securities for hedging.

Convert each security time-series from a price to a daily percent change. Call this $pct\_change_{market}$ and $pct\_change_{unique}$.
Get $Var(pct\_change_{market}$), $Var(pct\_change_{unique})$ and $Cov(pct\_change_{market}, pct\_change_{unique}$).
$\beta$ = $Cov(pct\_change_{market}, pct\_change_{unique}$)/$Var(pct\_change_{market}$).
Buy \$100,000 (or whatever amount) of $security_{unique}$. Now you need to know how many dollars to sink into $security_{market}$.
Multiply \$100,000 by the  $\beta$, this will be the amount of dollars to spend on your hedge.
Divide the number of dollars you came up with in step 5 by the price of $security_{market}$. Just to be clear, numerator is number of dollars, denominator is price of $security_{market}$. This will be your position for the hedge.

Note: Obviously, if you want to long one security then you will short the other security.


How much of a threat is Al Qaeda in the 2020s?

Question: I have been reading about al Qaeda and how support, even among extremists, for the terrorist group is waning and how they are losing recruits because they are failing to appeal to a younger generation of radicals. Is al Qaeda still a major threat in the middle east or has the organization lost most of the original intimidation and influence it once had?
Comment: Names and umbrella organizations are really not all that important. Some jihadists might have called themselves "al Qaeda" in the first decade of the century, then in the second decade the survivors & new recruits called themselves ISIS or the Quds Force.  In the third decade, they will almost certainly call themselves something else, but they will still be driven by the same motives, and probably use much the same tactics.
Comment: I am pretty sure no al qaeda or ISIS guy will ever call themselves quds force. They have very very fundamentally different ideologies regarding their beliefs, theology etc which are almost irreconcilable.
Comment: Didn't they even declare "jihad" against the IS and vice versa because they were concurring for the same radicals? I think with the weakening of the IS they maybe gain on power again. But that's just a theory.
Comment: @miep Relevant to that is that IS was started from survivors of Al Qaeda in Iraq.
Comment: @Nabil Farhan: Perhaps from the inside (I mean from the point of view of someone who understands Islamic theology), that's true.  (I wouldn't know - I don't even understand Christian theology, and I was raised by them.)  From the outside, there doesn't seem to be much difference: they all seem to think that making "terrorist" attacks on non-western targets (and often their own people who don't adhere to their ideas of what is religiously correct) is a good way to further their cause.
Answer: Al Qaeda remains active, most notably via its franchises. The al Shabaab group controls significant parts of rural Somalia, al Qaeda in the Arabian Peninsula controls some of Yemen, local affiliates are active in the Sahara, and Tahrir al Sham (loosely linked with al Qaeda) controls some of Syria. Al Shabaab has become more of a force lately, launching a suicide bombing in Somalia last month that killed at least 85 and a raid on a US base in Kenya this month which killed 3 American personnel.
Answer: Bin Laden, Al Qaeda's leader, was killed in 2011, and they seemed to have lost power ever since:

In 2009, President Barack Obama's so-called AfPak strategy gave top priority to the defeat of the al-Qaeda core in Pakistan. A relentless campaign, primarily using drones and highlighted by the 2011 commando raid that killed bin Laden in Abbottabad, gradually wore down the core by 2015.
In September 2014, Zawahiri [one of Bin Laden's lieutenants] planned his last major international terror plot: to hijack the Pakistani Navy frigate Zulfiqar and use it to sink a U.S. Navy ship in the Indian Ocean, provoking war between the United States and Pakistan. The plot was foiled only at the last moment. It was probably al-Qaeda's most audacious conspiracy ever. It could have changed the world even more than 9/11.

So they have put up a fight even after Bin Laden's death, but 2014 seems to be the last time they have made the news.
Of course, that's not if you're counting a few months ago:

Bin Laden's son and potential heir, Hamza, was killed mysteriously sometime this year with the assistance of the Trump administration.

So another potential leader was recently killed. Also, Zawahiri  doesn't seem to be in good health either:

With the group's leader Ayman al-Zawahiri in bad health and isolated, most likely somewhere in Pakistan, and Hamza bin Laden, who may have been next in line, recently reported killed, al Qaeda's most dedicated members seem to understand that its best chance to remain relevant is through its ongoing presence in Syria.

So their leadership seems to be crumbling and they seem to be losing power, but they are still around:

"We see active and deadly al Qaeda affiliates across the globe, including in Somalia, where al Shabab commits regular attacks inside Somalia and also has begun to attack its neighbors as well, particularly Kenya," he said. "We see active AQ plotting and activity elsewhere in Africa."

Some sources seem to think that it is slowly rebuilding itself and trying to become even stronger:

Al Qaeda seemed to be "quietly and patiently rebuilding" itself  while deliberately letting the Islamic State bear the brunt of the West's counterterrorism campaign.

So it could get stronger in the 2020s (Heaven forbid) but so far they haven't seemed to really have done anything major in recent years. ISIS seems to have filled the void Al Qaeda once held:

The heir of the al-Qaeda organization in Iraq—the Islamic State of Iraq and Syria—has lost control of most of the ground it once held in Iraq and Syria but remains a very dangerous terrorist threat, with offshoots in Libya, Afghanistan, and elsewhere. The Islamic State also has cells in Western Europe.


Hadoop DataNode is giving me an incompatible namespace ID

Question: When I run the start-all.sh script from my master node, some of my DataNodes fail to start; the log file reports a Java IOException: Incompatible Namespace IDs in /tmp/$MY_USER_NAME.
Answer: When the NameNode is formatted a namespace ID is generated, which essentially identifies that specific instance of the distributed filesystem. When DataNodes first connect to the NameNode they store that namespace ID along with the data blocks, because the blocks have to belong to a specific filesystem.
If a DataNode later connects to a NameNode, and the namespace ID which the NameNode declares does not match the namespace ID stored on the DataNode, it will refuse to operate with the "incompatible namespace ID" error. It means that the DataNode has connected to a different NameNode, and the blocks which it is storing don't belong to that distributed filesystem.
This usually means that you've misplaced your NameNode metadata somehow. If you have multiple HDFS installations your DataNode may be connecting to the wrong NameNode. If you only have a single installation then your NameNode is either running with a different metadata directory, or you've somehow lost the metadata and started with a newly formatted filesystem (which should only happen by running hadoop namenode -format). Try to find the correct NameNode metadata or restore it from a backup.
Answer: Every time the NameNode reformats it generats a new namespace ID, and some of your machines didn't get the memo. The easiest way to fix this problem is by reformatting the distributed filesystem; retrieve any files you can from the HDFS, then run rm -Rf /tmp/hadoop-$MY_USER_NAME on each server (the directory path may be different depending on your configuration). Then run hadoop namenode -format from your master server. After that, bin/start-all.sh should do the trick.
Comment: Note that this will delete **everything** stored in HDFS.


Join only if one line line intersects buffer. Do not if two

Question: I've got a road network (line features) and a trip of GPS-Points. I want to join attributes from the road network to every point. So for each point i create a buffer. If the buffer intersects with a line feature, the attribtes are written to the point. That is all no problem. However I do not want to write attributes to points if the buffer intersects with to or more lines. Any ideas how to do this?
I work in ArcGIS. Is there a way to do this without using python?
Comment: This appears to be a cross post of http://stackoverflow.com/q/27065858/820534
Answer: This can be achieved in several steps.

Run a Spatial Join for your buffer polygons and road network layers (right-click the buffer polygons layer in the TOC and choose Join and Relates > Join).

You will get an output polygon feature class which contains information on how many road features were located (even partially) within the buffered polygons.

Run a Join between the output feature class obtained in the step 1 and the source buffered polygons layer to find out which features you do not want to take into analysis (when you run Intersect and copying attributes).
Either set up a definition query or do a selection > export data to a new feature class when you have selected those features that have either null or 1 values (which are valid in your case) in the Count field.

If you use ModelBuilder to automate the workflow, please use the Add Join GP tool and Spatial Join GP tool.
Comment: Thanks a lot. That should work. Any idea how i could do this in modelbuilder. I can't find the join from "joins and relates" from the TOC in the toolbox.
Comment: @daverous, I have updated my answer.
Comment: Here's a good way to work this out in modelbuilder https://geonet.esri.com/thread/35325


Conditional formatting across documents

Question: I run several youtube channels and have an upload schedule for each.
I also have a master schedule that shows uploads across all channels. Each of these are different sheets within separate documents and they can't be combined
I've been manually changing cell colours (Red=planned, yellow=edited, green=live) and I'm trying to figure out if there's a way to link cells so when I tick a checkbox on the upload schedule it will change the cell colour on the master schedule.
So if the "EDIT" checkbox is [TRUE] in document A then the cell colour will change from red to yellow in document B
Answer: If you have a lot of cells that should be conditionally formatted the best way to proceed is to create a Google Apps Script on edit installable trigger.
Start by reading

https://developers.google.com/apps-script/guides/sheets
https://developers.google.com/apps-script/guides/triggers/installable
https://developers.google.com/apps-script/guides/triggers/events

If you have only few cells or you don't want to read the above or find it too complex / time consuming you might want to try first to use formula for conditional-formatting. You  will have to use IMPORTRANGE to import the data from the spreadsheet with the checkboxes and if you add the IMPORTRANGE in not the sheet with the conditional formatting rules your conditional formatting formula should use INDIRECT.
Please bear in mind that IMPORTRANGE and INDIRECT will be recalculated frequently and this might affect your spreadsheets performance.
Resources

IMPORTRANGE
INDIRECT

Related

How can I set conditional formatting on a particular cell that depends on another cell's value?
Conditional formatting across sheets

Conditional formatting across documents


Run local Selenium Tests via Jenkins/Hudson

Question: I would like to run local Selenium test script written in Java, via Jenkins/Hudson. Is it possible to run scripts from my local windows machine? So far I have written some simple Selenium tests in Java, which run perfectly if I execute them via Eclipse IDE. I would be thankful for an in-depth explanation.
Comment: Local machine - Windows?Linux? You want run your test on Jenkins?
Comment: on a windows maschine.
Answer:
Selenium test in Java: assuming them  to be laid out as unit tests (junit or testng), second assumption is that project is governed by either ant or maven, so there is some test (or rather integration-test) target or phase being present and be running smoothly when invoked from IDE.
When such tests are launched, they hit to a running selenium server (remote-control) which in turn launch a browser and runs its magic. Here are options: selenium server might be running in background (and be always available), or it might be started right before that testing and shut down afterwards. The latter is a common case for maven: pre-integration-test phase is configured to launch selenium rc, (then integration-test phase runs the tests against it), post-integration-test shuts selenium rc down.

So up to this moment we might want to learn what targets (ant) or phases(goals) your IDE invokes when it launches your tests successfully (also, what variables it sets or what profiles it enables).
If you invoke the same command from cmd (like 'mvn clean integration-test') and it runs successfully (same as IDE), then just instruct jenkins to run the same goals/targets (I assume that jenkins is running on the same machine, at the same user session).
If cmd doesn't do the trick (and you've looked quite well into what IDE does for you when it launches your tests), then I'd asked for more details.
So, involved participants are: 0. ant/maven that run your junit tests 1. selenium rc that should be running in bg or launched by ant/maven first 2. browser (path to browser executable) 3. jenkins (which was assumed to be running in the same environment).
If any of the assumptions are false, please come up with more details of your setup.


Django - How to carry the filters to the next view?

Question: I imagine something like this is possible in Django, but I don't know how to implement it:
I have a TableView, which has filters to filter the displayed queryset. I, then, have a DetailView which you can access from the TableView, to see the details of each element in the queryset.
The DetailView has a form, which uses the POST method. I can successfully send the form, and redirect to the TableView after the POST call. My question is, how can I make it so that after the user calls the POST method in the DetailView, and it redirects again to the TableView, the TableView keeps whichever values were on its filters?
I imagine I would have to either get access to the full request on the TableView (because it includes the ?param1=?param2= etc.), or be able to send the values in the filters when I call the DetailView.
Comment: You have access to the full request, the querysetring is stored in `request.GET`.
Comment: It is not entirely clear to me however why you use a POST request. Normally that is only done to *alter* the state of the app, or to send sensitive data. Exactly because a GET request encodes the data in the URL, and thus makes it easy to for example copy-paste the URL and retrieve the same search results.
Answer: I believe the POST data is stored in request.data. This should be stored in a dictionary so you could iterate through request.data with a for loop to extract the posted data into variables. Then you can do whatever with those variables.


Furnace burner going out

Question: I have a dual stage furnace. most of the time it works fine but 1 or 2 times a day it calls for heat, inducer motor starts, it lights up and the blower starts, after the blower being on 10 seconds the inducer slows down and the burners cut out. The blower goes for a bit and then turn off and the inducer starts again to start the process. But now the pressure switch on the condensate line clicks and when it comes time to start the burner it will not even start. The next time it starts hard and it still goes out. It does this for 10 -15 minutes each time getting better until it finally goes back to normal. I am trying to find out what the issue could be as we have checked the pressure switches themselves, the flame indicator and gas line.
Frigidaire
Comment: I'm no expert on this, but it sounds like a flame sensor. I have a boiler (US Boiler, K2) for hydronic heat in my home and it did almost the same thing:  Combustion blower would start, then the gas valve would open, burn for a few seconds and then go out.  It tried 3 times and then went into a soft fault and wouldn't retry for 15 minutes. I found instructions online for yearly maintenance which is basically cleaning out the condensate trap, removing the flame sensor and gently scrape off any debris with a Scotch brite pad.  It works about 90% better now. Your mileage may vary! No promises.
Answer: If this is a condensing furnace, make sure that all the condensate drains are open and not plugged with dirt. There is also a "drain trap" that may need to be flushed with water to clean it out. When the furnace fails count the flashes of the red light on the circuit board and it may indicate where the failure is.

Furnace burner going out


I have multiple accounts

Question: I have multiple accounts because I kept trying to start all over. Sometimes I will friend people and they say comments that are inappropriate. And I have forgotten the passwords to those accounts. How would I locate them and close them?
Answer: When you try and login to your Gmail account there will be a 'Forgot Password' button. You should be able to recover your password through either text verification if you have entered your phone number, or through security questions, or through a second recovery email which you would have connected to the account when you set it up.
Once you have accessed the password you can close it using these steps.

I have multiple accounts


gazebo with player

Question: I guess gazebo is more often being used with ROS and as standalone, has anyone tried to use gazebo ( version 1.0 and above) with player ? I am cool using gazebo with ROS (Electric) and also as standalone but have never done well with the installation with player. Any first hand experience may be useful. Which version of player to use with gazebo (version 1.0 and above) ? Also, is it advisable to use gazebo with player as player has not been a very active project for nearly the last 2 years (last version release (3.0.2) was in July 2010) ?
I had asked a similar question at email@example.com, however I hope to reach more people at answers.gazebosim.org.

Original comments:
Comment by Arkapravo on 2012-09-22 00:41:52.641179-05:00:
@nkoenig Yo ! I felt the same ! I will be using ROS - ROS is a big improvement on player.
End of original comments

Originally posted by Arkapravo on Gazebo Answers with karma: 1 on 2012-09-20 06:11:04.609245 UTC
Post score: 0

---JSON_START_ROS2022_SE_MIGRATION {'name': 'Arkapravo', 'score': 0, 'timestamp': '2012-09-20 06:11:04.609245 UTC', 'user_id': 11}---
Answer: There is limited support for Player within Gazebo. I believe it consists of position, camera, and laser plugins.
I haven't used Player in many years. But I think the latest version should work with Gazebo.
In short, I would recommend using ROS.

Originally posted by nkoenig with karma: 7661 on 2012-09-21 19:33:46.650602 UTC
This answer was ACCEPTED on the original site
Post score: 0

---JSON_START_ROS2022_SE_MIGRATION {'accepted': True, 'name': 'nkoenig', 'score': 0, 'timestamp': '2012-09-21 19:33:46.650602 UTC', 'user_id': 5}---

gazebo with player


Is the difference between two ordinal variables ordinal?

Question: Is the difference between two ordinal survey responses still ordinal?
Comment: Hand, D. J. (1996). Statistics and the Theory of Measurement. Journal of the Royal Statistical Society. Series A (Statistics in Society), 159(3), 445–492. https://doi.org/10.2307/2983326 with discussion and a later book on measurement by Hand cover many aspects of the debate with balanced conclusions. One implication relevant to the question is that often supposedly ordinal data are not purely ordinal (holding somewhat stronger information not preserved by all monotonic transformations), in which case subtraction can be at least empirically meaningful.
Comment: @TinaHeeley There are many types of data that are not really interval but more than ordinal. For example age categories and other supposedly ordinal variables carry somewhat incomplete quantitative information. Ranks have a numerical meaning even though this may differ from what is ranked. If Likert scales in questionnaires are presented with a numbering of categories, respondents may assume that these are numerically evaluated and interpreted, which may influence their response.
Comment: This regards not the question itself but some answers. The line taken seems to be to say that in analysis of ordinal data operations such as subtracting, averaging etc. should not be used. I just want to point out that this is controversial, see, e.g.,   Velleman, P.F. and Wilkinson, L. (1993) Nominal, Ordinal, Interval and Ration Typology Are Misleading. The American Statistician, 47, 65-72. https://doi.org/10.1080/00031305.1993.10475938. One argument is that assumptions of statistical procedures are about distributions of values rather than the meaning of the data.
Comment: Marks or grades given by teachers or academics are a frequent example that should be familiar. There is no independent check on whether someone getting 8/10 on a test is twice as good or as strong in terms of anything but the marking scheme as someone getting 4/10.  The same even goes for essays, dissertations or theses graded on a more nuanced scale, e.g. even down to a resolution of 1%.  Yet at many institutions working with averages or other summaries is expected and the problems with that are mostly not to do with what kind of measurement scale is being used.
Comment: (ctd) In short, by the high standards of measurement theorists such measurement is ordinal at best, but in practice it's often treated as interval. Tukey and others have underlined that -- although temperature is routinely regarded as measured on an interval or ratio scale -- for most of its history temperature measurement was based on all kinds of rough or indirect approximations. Even now length of mercury thread in a glass tube has no bearing on other ways to measure or estimate temperatures  in many circumstances, e.g. in astronomy.
Comment: Thank you Christian - could you explain the last point about the implications of supposedly ordinal data not being purely ordinal in more detail please? Sorry, my theoretical knowledge is lacking!
Comment: Anyways, the moment you start calculating differences you should stop calling the data ordinal. Maybe we need another word like 'quasi metric' or 'quasi interval scaled' but ordinal means 'not good enough for addition and subtraction'.
Comment: @Bernhard The term "ordered metric scale" is used on the Wilcoxon signed-rank test wikipedia [page](https://en.wikipedia.org/wiki/Wilcoxon_signed-rank_test): "a type of scale that carries more information than an ordinal scale but may have less than an interval scale" (citing Siegel 1956, p.76).
Answer: Clearly not, in general.  Take a 4-level pain scale for example (none, mild, moderate, severe).  Going from moderate to severe pain may be far worse than going from mild to moderate pain.  Yet they both have a difference of 1 if pain were coded 0,1,2,3.
Ordinal scale data need to be analyzed in a way that subtraction is not used.  This is discussed further here.
Comment: Thank you Frank! I have 2 separate variables (y1, y2) at a single timepoint. My variables might reasonably approximate interval spacing (more so than pain) and have a 7-point scale. I think my analysis options are:
 1. Assume interval spacing, treat the difference (y1-y2) as continuous, use linear regression
 2. Categorise the difference as >, <, or equal to and use ordered logistic regression
 3. Do not calculate difference, use y1 independent variable, condition on y2, and use ordered logistic regression
Any thoughts on the merits of each option or any alternatives would be appreciated.
Comment: I don't know that it's been extended to covariates.  But the advantage is that it is invariant to how you transform Y and doesn't assume symmetry of a distribution of change scores as the Wilcoxon signed-rank test does.
Comment: Some variation on the rank difference test may be in order: [see here](https://www.researchgate.net/publication/230264296_The_rank_difference_test_A_new_and_meaningful_alternative_to_the_Wilcoxon_signed_ranks_test_for_ordinal_data#:~:text=A%20new%20distribution%20free%20inferential,signed%20ranks%20test%20is%20applicable.)
Comment: I am not familiar with Kornbrot's rank difference test and it doesn't appear to have a Stata package. Why is it preferable to the Wilcoxon signed-rank test for my data specifically? Also, is there an analogous regression model to allow adjustment for covariates?
Comment: Wilcoxon signed-rank starts with subtracting one from the other.
Comment: Right and there lies the disadvantage of the signed-rank test.
Answer: If you are taking the difference of two ordinal responses, you are not treating the responses as ordinal, but instead treating them as if they were interval.
This isn't always appreciated.
One example is with the Wilcoxon signed rank test. the procedure begins by subtracting the paired response values, so isn't applicable for strictly ordinal data.
My understanding is that aligned ranks transformation anova procedure also begins by subtracting values.
I have seen people argue that data from scales created by summing several Likert-type items should be treated as ordinal.  But I would argue that once you are summing values, you are already treating the responses from the Likert-type items as interval.
EDIT: Based on some discussion in the comments, here is an example of using ordinal regression with unstructured thresholds for cut points, with a repeated measures design.  In R. (Can also be run at rdrr.io/snippets/.)
if(!require(ordinal)){install.packages("ordinal")}
if(!require(emmeans)){install.packages("emmeans")}

Respondent = factor(c(letters[1:12], letters[1:12]))
Time       = factor(rep(c("Before", "After"), each=12),
    levels=c("Before", "After"))
Score      = as.factor(c(1,2,3,1,2,3,1,2,3,4,4,4,
                         2,2,2,3,3,3,2,3,4,4,5,5))
xtabs(~ Time + Score)

   ###         Score
   ### Time     1 2 3 4 5
   ###   Before 3 3 3 3 0
   ###   After  0 4 4 2 2

library(ordinal)
model = clmm(Score ~ Time + (1|Respondent))
summary(model)

   ###           Estimate Std. Error z value Pr(>|z|)
   ### TimeAfter   2.7262     0.9758   2.794  0.00521 **

library(emmeans)
joint_tests(model)

   ### model term df1 df2 F.ratio p.value
   ### Time         1 Inf   7.805  0.0052

wilcox.test(as.numeric(Score) ~ Time, paired=TRUE)

   ### Wilcoxon signed rank test with continuity correction
   ### V = 4.5, p-value = 0.02475

Comment: Thank you Sal. I understand that the Wilcoxon signed rank test is a special case of ordinal logistic regression model. Given that it is widely used on ordinal data, though it is not strictly applicable as you say, it is therefore reasonable to use the subtracted paired response values as the dependent variable in an ordinal logistic regression?
Comment: Whether it's reasonable is up to you.  If you are subtracting values, you are treating them as interval rather than strictly ordinal. ... At least in some software implementations, you can analyze a repeated measures design with ordinal regression, without assuming equal spacing between the categories.
Answer: The only mathematical relations that exists between ordinal data is "greater than", "less than", and "equal". Any other mathematical relation, such as addition, subtraction, multiplication, etc., marks the data as being treated as a more complex data type such as interval or ratio data.
I think this quote from Frank Harrell's answer bears addressing:

Take a 4-level pain scale for example (none, mild, moderate, severe). Going from moderate to severe pain may be far worse than going from mild to moderate pain. Yet they both have a difference of 1 if pain were coded 0,1,2,3.

In ordinal data, the "separation" between different values isn't merely "not necessarily constant", it's not defined. The levels are being treated as having no defined metric. The numbers are merely labels that have a particular order. You could just as easily call the pain levels "banana, orange, apple, pear", as long as it's understood that the labels have that order. Saying "pear minus apple might be larger than apple minus orange" is meaningless. From a CS perspective, the pain level are objects with the methods .lt(), .gt(), and .eq(), .repr()and nothing else. There is no .minus() or .plus() method. Pain level "0" is just an object whose .repr() value is "0". It has no other relation to 0. Is it not the int 0, and you can't apply int operations to it.
Comment: This is overstating the extent of their incomparability.  In the four-point pain scale example, you can't compare the difference 0–1 with the difference 2–3 — but you can say some meaningful things derived from the original ordering, e.g. that the difference 1–4 is bigger than the difference 2–3.  (Mathematically, this is the fact that the formal differences between elements of an ordered set form a natural *partial* order.)
Answer: Ordinal variables are often not even numeric - the difference between ordinal variables isn't even a defined operation, much less an ordinal variable itself.
Consider three hot sauces, mild, spicy, and extra hot. How do you define (spicy - mild) or (extra hot - spicy)? There is no rationale in mapping these ordinal values to numbers and treating them as numeric variables.
If you had a rationale for claiming that the difference between mild and spicy is smaller than the difference between spicy and extra hot, you are now quantifying the differences between levels in a way that defies the definition of an ordinal variable, which indicates that you can only rank the levels but not comment on the "distance" between them. If you can quantify the size of the difference between levels, it's not an ordinal variable in the first place.
Comment: Your example is convincing as your example. The problem is that the label _ordinal_ has also been applied to quite different kinds of measurement (or "measurement").


What major difficulties are faced while planning an international trip?

Question: In order to help the clients (travelers) better, we'd like to understand the problems based on the general perceptions as well as personal experiences while traveling abroad.
Comment: Welcome to TSE. I'm afraid this question is far too broad to answer in the space of a StackExchange answer. The considerations that go into a backpacking gap year are different from a romantic weekend or family Disney trip, likewise the challenges facing a Somali and a Swiss, a young vegeterian and a mobility-impaired retiree will differ. Even among people of the same age, class, income, nationality, and health, individual tastes, priorities, and fears will make some things stressful for some people and not others.
Comment: If you have to ask such a question, you're not ready to help clients travel.  Do some traveling yourself.
Comment: You need to narrow down your customer base. In my case, 1. Can I get there without sleeping on angle flat seats? 2. Does my favourite hotel chain have a hotel in the city centre? 3. Other problems can be solved on arrival.
Answer: From my international travels, I always plan for things such as:

Do I need a visa?
What is the electricity voltage in the country?
What's the language?
What kinds of food should I prepare for?
What is the transportation like?
Is internet access sufficient (whether it's via cellphone or wifi)
Will my cellphone work?
What kind of money do they use? Currency, credit, debit, etc. Also how much more expensive/cheaper is this place as compared to home?
What's the whether for when I am visiting?
Where is the nearest embassy?
Do I need a vaccination?
What is the sanitation like there?
Does the hotel accept foreigners? (I learned this the hard way when I backpacked in China, a lot of hotels don't accept foreigners. I had to either find a hostel that did, or go to a big chain hotel.)

There are obviously loads of other questions and things to keep in mind. I think if I had to pick one, it would be what are my steps if I run into issues/trouble/get lost/etc.
If you are a novice travel agent, it can't hurt to call a seasoned travel company and ask them what they advise clients.
Answer: The biggest difficulties (IMO) according to what I see here...

Figuring out if you need a visa and which type of visa you need.
How can I use my phone while abroad (unlocking phone, sim card ... )
How to carry money (cash vs. debit vs. credit)
Do I need to learn the local language.

In my personal experience when traveling in Europe (from North America), the phone thing is the biggest pain (but it is mostly because I am too lazy figuring things out).
Answer: A trip is like a puzzle. The bigger and more complex the trip, the most difficult it is to plan. Recently, I came back from the most complex trip I have ever taken, an 80-day journey around the world with 15 international flights, 6 domestic ones, boats, trains, buses, etc.

The biggest difficulty is making the pieces fit together. You need transport between multiple points and time in between to actual experience each destination. This inherently comes with risks as there can be delay and changes beyond your control, so you must carefully be conservative even if the routing tables say something is possible, it doesn't mean it will happen.
The second part - which is only required for some trips - is obtaining visas. Every country seems to have a slightly different process and rules regarding this. The risky part here is that none will guarantee that you shall obtain the visa but in the process they may ask you for proof of lodging and onward travel. Hotels are commonly reserved in a way that the stay can be cancelled and you get reimbursed but fully refundable flights cost much more than non-refundable ones.
The third biggest challenge is deciding what to take and how to pack it, while making sure to be within the official limits restricting carry-on luggage, personal items, checked luggage. Allowance can vary considerably, from a certain amount to half, as I recently experienced. You basically have to predict what you need during the trip and fit any valuables and essentials within what you can take with you on board. So if you have to take an international flight but then a domestic one and follow it with a boat trip, you have to make sure that whatever your bags are allowed by all three transports, in size and weight.
Part of the above point is deciding what to use as luggage. A suitcase is a classic but there are many times when it becomes cumbersome. If you plan on hiking to go between places (not as a day trip where you can leave stuff and come back to them) then you should really use a heavy backpack, preferably with detachable carry-on/day-pack.
Access to money can be an issue depending where you go. Travelers must research if their Bank or Credit cards are expected to work where they are going. This means being careful about the networks available (Cirrus, Plus, Maestro, etc) and if cards with chip are required. Somethings can only be paid by card, like completely automatic gas stations, while others require cash. It is always possible to acquire the local currency when arriving but that also means having one that will be accepted (usually USD and EUR are most popular). Calculating how much money that is to be taken out is also a challenge, depending on fee structure (with flat fee you should take as much as needed, with percentage you can split and reduce risk). Changing money back at the end of the trip nearly involves a loss, good estimation is critical.
Transport and access to medicine can be a serious concern for those with certain health issues. They need to obtain sufficient medicine for the entire trip plus possible delay and they are rules governing how some can be transported such as refrigeration and use of needles for example. You might have to get refills abroad which means location suitable medical services and going through the language barrier to get them. Some medicines may be legal in one country but not in others which may cause problems.

There are certainly many many other things that must be handled with planning a trip but many of them are relatively easy with a few Google searches: Entry (visa) requirements, electricity voltage and plug type, weather, currency, language, vaccination requirements.
Honestly, while a phone is a nice safety item to have. If you have one that doesn't abroad, you can rent one or just the SIM if yours is unlocked and that is the issue, but even if you end up without a working phone. It is not much of an issue. Internet reaches far these days and you can make voice calls through Hangouts, Facebook and a number of over online services. Those who travel for business may be a little more concerned about this though.