What is the oldest historical evidence of the Sabbath commandment?

Question: What does history say about the practice of keeping the Sabbath holy? What is the oldest historical evidence of this commandment? Can we find evidence of Sabbath keeping prior to the Israelites and/or in other cultures?
Answer: At the very latest, in Babylonia, which is where exiles from the Kingdom of Judah picked up their own month names as well.

By "in other cultures," I'll take this to mean that you're looking for non-Judeo-Christian answers.
And first off, let's define what we mean by "prior to the Israelites." Per Encyclopedia Britannica:

The earliest record of the reading of a "Torah book" is provided by the narrative describing the reformation instituted by King Josiah of Judah in 622 BCE following the fortuitous discovery of a "book of the Torah" during the renovation of the Temple.

That's our starting point.
Sumeria (~2600-2100 BC?)

[...] there is every probability that [the Hebrew Sabbath] had its origins in Babylonia. In that country, however, it was not the rest-day ending the seven-day week [...] but was due to the festival of the full moon on the 15th day of the month, when the earth's satellite 'rested' for a while at the height of his brilliancy. [...] The word by which the Babylonian Sabbath is designated is the somewhat rare term sappatu or sabbatu [...] u-hut-allum, from the Sumerian u-hul-gala, which they translated by umu limnu, "evil day[,]" [was] the 7th, 14th, 21st, and 28th days of every month, so that, as the Babylonian months had 29 or 30 days each, every month consisted of seven days each, and one of nine or ten days, according to the length of the month. [...] The following is a paragraph given by hemerologies for the observance of the seventh day of the month as a sabbath:

The 7th day is a holy-day (nubattu) of Merodach and Zer-panitu--an acceptable day, an evil day (u-hulgallu). The shepherd of the great tribes (nisi rabati) shall not eat salted meat cooked over the embers, he shall not change his body-clothing, eh shall not be clothed in white, he shall not offer a sacrifice. The king shall not ride in a chariot, he shall not talk victoriously. The seer shall not make a declaration with regard to a sacred place. A physician shall not touch a sick man. It is not suitable to make a wish.

Source: Encyclopedia of Religion and Ethics, James Hastings, ed.,  page 889-890 of the book/912 of the scan. Forgive me, as there are many accents on the Akkadian(?) words there that I am not able to easily reproduce. (Note: Source is from 1918.)
To me, that last bit sounds strikingly like an Orthodox Jewish Sabbath.
However, I'm wildly unsure of the year here. Wikipedia calls the Babylonian calendar a successor to a 21st century BC Sumerian calendar. The Sumerians were definitely into sevens (source page 1, source page 2):

The Sumerians not only regarded seven as the perfect number, but even recognized seven-day periods, prototypes of the week. As early as 2600 B.C. Gudea, able priest-king of Lagash, built a seven-roomed tower temple and dedicated it with a seven-day festival. [...] Seven-day periods are mentioned also in the Assyro-Babylonian epic of Gilgamish, whose origins go back to the third millennium B.C., or to Sumerian times. [...]

The source then goes on to describe the 7th, 14th, etc. days as evil days, as previously mentioned.
Deir el-Medina, ancient Egypt, ~1550-1080 BC
(Estimated years from Wikipedia)
The Egyptians constructed their year into months of three ten-day periods called decades, plus a five-day intercalary month.

A reconstruction of a festival calendar of Deir el-Medina, however, has been  compiled by Wolfgang Helck by utilizing references to working and inactivity in the  administrative documents pertaining to the royal artisans' community. [...] Helck  collated  the references to  working  and inactivity into  tables  and,  by  analysing these, he was able to conclude that the ninth and tenth days of a decade were 'as a  rule'  work-free.

Source, page 39 of the paper/45 of the PDF. The source then lists 17 feasts that would have also been work-free.
However, I'm not sure that this really counts, as I don't see a reference to keeping the 9th and 10th days holy per se.
Assyro-Babylonia, 7th century B.C.
In any case, it seems pretty widely-accepted that the Jewish calendar got their month names after the period of Jewish exile in Babylon (source). Here's part of the text of a "Assyro-Babylonian epic of creation," which includes Sumerian material (quoted here).

Then Marduk assigned to the moon god
Control of the night and said:
'Each month your tiara of beauty
Shall shine on the evening's head.
For you shall measure the cycles;
Six days you shall show horns of light;
The seventh your crown shall be finished;
The fourteenth both halves shall be bright.
Answer: The early christian gentile apostolic churches did not keepany sabbath.
Blotting out the handwriting of ordinances that was against us, which was contrary to us, and took it out of the way, nailing it to his cross; and having spoiled principalities and powers, he made a shew of them openly, triumphing over them in it. Let no man therefore judge you in meat, or in drink, or in respect of an holyday, or of the new moon, or of the sabbath days: Which are a shadow of things to come; but the body is of Christ. Colossians 2:14-17
The Sabbath is mentioned at the beginning of the creation [thus]: "And God made in six days the works of His hands, and made an end on the seventh day, and rested on it, and sanctified it." Attend, my children, to the meaning of this expression, "He finished in six days." This implies that the Lord will finish all things in six thousand years, for a day is with Him a thousand years. And He Himself testifies, saying, "Behold, to-day will be as a thousand years." Therefore, my children, in six days, that is, in six thousand years, all things will be finished. "And He rested on the seventh day." This means: when His Son, coming [again], shall destroy the time of the wicked man, and judge the ungodly, and change the sun, and the moon, and the stars, then shall He truly rest on the seventh day. Moreover, He says, "You shall sanctify it with pure hands and a pure heart." If, therefore, any one can now sanctify the day which God has sanctified, except he is pure in heart in all things, we are deceived. Behold, therefore: certainly then one properly resting sanctifies it, when we ourselves, having received the promise, wickedness no longer existing, and all things having been made new by the Lord, shall be able to work righteousness. Then we shall be able to sanctify it, having been first sanctified ourselves. Barnabas (A.D. 70-130) ch. 15
Further, He says to them, "Your new moons and your Sabbath I cannot endure." You perceive how He speaks: Your present Sabbaths are not acceptable to Me, but that is which I have made, [namely this,] when, giving rest to all things, I shall make a beginning of the eighth day, that is, a beginning of another world. Wherefore, also, we keep the eighth day (Sunday) with joyfulness, the day also on which Jesus rose again from the dead. And when He had manifested Himself, He ascended into the heavens. Barnabas (A.D. 70-130) ch.15
If then those who had walked in ancient practices attained unto newness of hope, no longer observing Sabbaths but fashioning their lives after the Lord's day, on which our life also arose through Him and through His death which some men deny. Ignatius: to the Magnesians (A.D. 35-105) ch.9
But again their scruples concerning meats, and their superstition relating to the Sabbath and the vanity of their circumcision and the dissimulation of their fasting and new moons, I do [not] suppose you need to learn from me, are ridiculous and unworthy of any consideration… And again to lie against God, as if He forbad us to do any good thing on the Sabbath day, is not this profane? Letter to Diognetus (A.D. 125-200) ch. 4
The new law requires you to keep perpetual Sabbath, and you, because you are idle for one day, suppose you are pious, not discerning why this has been commanded you: and if you eat unleavened bread, you say the will of God has been fulfilled. The Lord our God does not take pleasure in such observances: if there is any perjured person or a thief among you, let him cease to be so; if any adulterer, let him repent; then he has kept the sweet and true Sabbaths of God. If any one has impure hands, let him wash and be pure. Justin Martyr (A.D. 160) Ante-Nicene Fathers vol.1 pg.200
Do you see that the elements are not idle, and keep no Sabbaths? Remain as you were born. For if there was no need of circumcision before Abraham, or of the observance of Sabbaths, of feasts and sacrifices, before Moses; no more need is there of them now. Justin Martyr (A.D. 160) Ante-Nicene Fathers vol.1 pg.206
"You hypocrites, does not each one of you on the Sabbath-days loose his ox or his ass, and lead him away to watering? And ought not this woman, being a daughter of Abraham, whom Satan has bound these eighteen years, be loosed from this bond on the Sabbath-days?" It is clear therefore, that He loosed and vivified those who believe in Him as Abraham did, doing nothing contrary to the law when He healed upon the Sabbath-day. For the law did not prohibit men from being healed upon the Sabbaths; [on the contrary,] it even circumcised them upon that day, and gave command that the offices should be performed by the priests for the people; yea, it did not disallow the healing even of dumb animals. Both at Siloam and on frequent subsequent occasions, did He perform cures upon the Sabbath; and for this reason many used to resort to Him on the Sabbath-days. For the law commanded them to abstain from every servile work, that is, from all grasping after wealth which is procured by trading and by other worldly business; but it exhorted them to attend to the exercises of the soul, which consist in reflection, and to addresses of a beneficial kind for their neighbors' benefit. And therefore the Lord reproved those who unjustly blamed Him for having healed upon the Sabbath-days. For He did not make void, but fulfilled the law, by performing the offices of the high priest, propitiating God for men, and cleansing the lepers, healing the sick, and Himself suffering death, that exiled man might go forth from condemnation, and might return without fear to his own inheritance. Irenaeus (A.D. 180) Ante-Nicene Fathers vol.1 pg. 471
To His disciples He said, who had a priesthood of the Lord, to whom it was lawful when hungry to eat the ears of corn, "For the workman is worthy of his meat." And the priests in the temple profaned the Sabbath, and were blameless. Wherefore, then, were they blameless? Because when in the temple they were not engaged in secular affairs, but in the service of the Lord, fulfilling the law, but not going beyond it, as that man did, who of his own accord carded dry wood into the camp of God, and was justly stoned to death. Irenaeus (A.D. 180) Ante-Nicene Fathers vol.1 pg.471
And in Exodus, God says to Moses: "And you shall observe My Sabbaths; for it shall be a sign between Me and you for your generations."… But the Sabbaths taught that we should continue day by day in God's service. "For we have been counted," says the Apostle Paul, "all the day long as sheep for the slaughter;" that is, consecrated [to God], and ministering continually to our faith, and persevering in it, and abstaining from all avarice, and not acquiring or possessing treasures upon earth. Irenaeus (A.D. 180) Ante-Nicene Fathers vol.1 pg. 481
It follows, accordingly, that, in so far as the abolition of carnal circumcision and of the old law is demonstrated as having been consummated at its specific times, so also the observance of the Sabbath is demonstrated to have been temporary. … And through this arises the question for us, what Sabbath God willed us to keep? For the Scriptures point to a Sabbath eternal and a Sabbath temporal. For Isaiah the prophet says, "Your Sabbaths my soul hates;" and in another place he says, "My Sabbaths you have profaned." Whence we discern that the temporal Sabbath is human, and the eternal Sabbath is accounted divine. Tertullian (A.D. 198) Ante-Nicene Fathers vol.3 pg.155
Comment: @Josef....so many non canononical references here for your belief im am surprised you believe there is such a thing as Christianity. Perhaps your religion is called "council of forefathers". Christianity follows the Christian canon and in that canon Jesus clearly came to this earth and lived a life of example. That example spent many Sabbaths in Gods house (not mans house, or Moses house). If we are to follow Jesus example, would not one automatically keep the Sabbath? Before you consider that question search the "Patience of the Saints" (then carefully contemplate its meaning for Christian's
Comment: @Josef...if this were true, and you have gone to great lengths in an attempt to rationalise it, in expanding on my previous comment, how then do you explain the patience of the saints in Revelation?  "Here are those that keep the commandments (The moral Law written on 2 tablets of stone by the finger of God Himself) and have the testimony of Jesus! Add to this Jesus statement, "not one jot or tittle...until heaven and earth pass away". Big big problem with your entire argument.
Answer: Theories finding Babylonian origins for the Sabbath have fallen out of favor.  See William W. Hallo, "New Moons and Sabbaths: A Case-study in the Contrastive Approach", Hebrew Union College Annual 48,1-18(1977).  The Babylonian calendar was entirely oriented to the phases of the moon.  The Israelite sabbath, all the evidence tells us, had nothing to do with the phases of the moon.
The Sabbath is pre exilic, for it it mentioned by the prophet Amos:

Hear this, you who trample upon the needy
and bring the poor of the land to an end,
saying "When will the new moon be over,
that we may sell grain?
And the sabbath,,
that we may offer wheat for sale? (8.4-5)

This presupposes that there was no buying or selling on the sabbath.
Proof that the sabbath was a continuous 7-day cycle is found for the exilic period in the Book of the Prophet Ezekiel:

Thus says the Lord God:  The gate of the inner court that faces east shall be shut on the six working days; but on the sabbath day it shall be opened and on the day of the new moon it shall be opened. (46.1)

The simplest conclusion is that the pre-exilic sabbath was a continuous 7-day round also.
Comment: This is a good answer, +1 from me


Guitar Sounding Synth

Question: I am trying to make a synthesised sound thats kindof sounds like a guitar/vocoded synth that is currently present in this track by Fedde Le Grand from 1 minute 32. It kinda sounds like something Daft Punk would also use.
Comment: Hello Olly, and welcome to AVP!  A friendly suggestion... add a bit more information to your question.  I think you'll be more likely to get useful answers (and more quickly) if you include information like:  what hardware/software you're using; what is your level of expertise; what have you tried already; etc.  Cheers
Answer: To me, that "guitar" sound seems fairly close to a square wave - maybe a saw that has been heavily low-pass filtered with little or no resonance and then heavily distorted. The "vocoder" sound you are hearing is probably just a vowel / formant filter. If you don't have a formant filter, you can use parallel bandpass filters to accomplish the same thing.
Distortion is a big part of the electric guitar sound. The problem guitar players have is that a plucked string decays quickly. If you want your note to last longer, you amp it way up. This causes the characteristic distortion that we associate with electric guitars, but it also takes longer for the massively amplified signal to decay past the clipping point. During that time, it sounds like the note is being held, when it is actually decaying before the amp.
If you want something more guitar-like, try Karplus-Strong synthesis. You can get a decent guitar sound by sending a very short click or burst of noise through a delay that is between 1 and 50ms. Adjust the length of the delay to tune the "string". Turn up the feedback of your delay (probably 80%-99%) to get a realistic note. Note that you will still have the same problem that players of real guitars have with sustain.
Comment: I will give this article a read later and see what i can come up with.  Im getting kinda close with this Formant Filter but not sounding as good
Answer: You can get this exact sound from various digital effects pedals - my Line6 HD500 and an earlier Zoom 9000 both had presets that could do this.
You need a noise gate and compressor - to give you a sharp attack and then keep the signal gain at a high level until you stop the note. Once you have that envelope shaping, you can use whatever waveform you need, and as ObscureRobot suggests, a square wave will give quite a good synth noise.
Comment: Can you say more about the relevant presets on your Zoom and Line6 pedals?
Comment: I'll add a bit on settings later once I check the names, but there are synths that can create noises from strings and sirens to robots and voices.
Comment: Unfortunately i dont have access to either of those pedals!  You dont happen to know of anything that will carry out the same action via a VST do you?

Guitar Sounding Synth


Can all pass filers have a pole/zero at the origin of the root locus

Question: I came across this root locus diagram in my DSP class. It has a pole at the origin, another pole within the unit circle and a zero just outside the unit circle. I understand that the poles and zeros should be complex conjugates for an all pass filter. So will a pole or a zero at the origin prevent the system from being an all pass?My professor tells me that the pole at the origin is allowed. So that is basically leaving me confused.Can anyone explain how this is possible?
Answer: a delay is also an APF of sorts.  it passes the same magnitude and it affects the phase (in a linear manner w.r.t. frequency).  a delay of one sample has transfer function
$$ H(z) = z^{-1} = \frac{1}{z} = \frac{1}{z-0} $$
which means there is a pole at $z=0$.  and it is true that $\left|H\left( e^{j \omega} \right)\right| = 1$, so it's an APF.
so, if the remaining pole/zero pairs are at reciprocal values this extra delay changes the phase of your APF a little, but not the magnitude response, so i think, strictly speaking, that it's still an APF.
Comment: ok.What happens in the case of zeros at the origin.If H(z)=z(z-0.5)/z-2;theres a zero at the origin and the other pole/zero pair is reciprocal.I assume the system still should be an APF.right?
Comment: @sacjohn: Yes, but it's not causal anymore. A causal and stable allpass filter has all its poles inside the unit circle and all its zeros outside the unit circle.


What's the best website for showcasing my work to the public?

Question: Wondering which website is more popular for posting own photography art and maybe get some feedback from community in other words a way to carry photography to mass public. FB is not the right place.
Comment: In the intent to get feedback your question is somewhat duplicate to the question "What's the best way to get constructive critique of your photographs?" http://photo.stackexchange.com/q/4698/2317
Comment: In addition to what @Leonidas suggests, there's a number of related questions like [What are the best sites to share photo galleries with friends?](http://photo.stackexchange.com/questions/295) and [What is a good pre-built website platform for displaying my photos?](http://photo.stackexchange.com/questions/7508/).
Comment: +1 I have the same "issue" :) I created a flickr profile, but not a single view for about a week :D
Comment: An important question is: _why_ do you want feedback? Do you want artistic or technical critique, or advice on marketing/promotion, or do you want to generate positive buzz?
Comment: @mattdm: Mostly to generate positive buzz and have some motivation for learning more, achieving more skills.
Answer: Flickr is definitely a good fit for what you're after:

It's public by default (unlike Facebook which tends to be private).
It's huge: it definitely ticks your "mass public" box.
It has excellent social features that make it very easy to interact with new users (people you don't already know) and get your photos seen.
It doesn't over-compress your images (like Facebook does) so it's a great place for a high-quality showcase.

In response to Kiril Kirov's comment ("I created a flickr profile, but not a single view for about a week :D"), it sounds like you're not using Flickr to its full potential. If you want other people to notice your work, try the following:

Give your photos meaningful titles, descriptions and tags to ensure they appear in search results.
Add your photos to relevant groups and join in the group discussions.
Find other users whose work you like and add them as a contact. It's not obligatory to reciprocate but many people will. At the very least, they'll usually check out your stream to see who you are.
Look for other photos you like and comment/favourite them. Again, there's no guarantee people will reciprocate but many do.
Join a Flickr group local to your area and go along to a meet-up. (If they don't seem to have them, try arranging one! If there's no group, create one!)

Even though Flickr is public by default, you do have to invest some time in it before you'll come to other people's attention. But the same is true of any other photo site. Plenty of people choose other sites (such as 500px, SmugMug or Zenfolio), often because they have a more professional "portfolio" look, but for social features Flickr just can't be beaten.
Comment: Oh, and one big **don't** to add to that list: don't leave comments along the lines of "Cool shot, please view my photostream". They look like spam and people will ignore them (or even block you). Make your comments mean something, even if secretly you're still fishing for views. ;)
Answer: An alternative to Flickr is 500px.com. I like the fact that users can provide a rating on any uploads and how you display your photos is more flexible than Flickr
Answer: Honestly, Google+ is becoming a fantastic place to showcase photos. It seems to be mostly inhabited by photographers, and the community is huge.
Comment: @benmanbs: It's just a list of users. It's not like a single circle which I can add and have dozens to share. Have to add them one by one, which will send them notification that I have added them and so on.. don't want to bug people with this. So it's not a best option.
Comment: I am using Google+, but again as in the facebook, it's limited only to your friends(circles), unless I miss some key feature of how to expose to thousands of community people who I don't know.
Comment: When you share something you can share to a circle that you're following, and they will all see it. I followed 800 photographers, and I post pictures to the photography circle.
Comment: how can I find this "photography circle"?
Comment: You can mark posts as public, in which case they'll be available to everyone, but unless someone is either a) looking for random public posts or b) following you specifically, they won't see it.
Comment: @Michael, You can find photographers [here](https://plus.google.com/u/0/105237212888595777019/posts/Ky7XYX72czj), then just add them to your circle...
Comment: @mattdm: marking a post public doesn't drive people to your post.
Comment: @Michael: it certainly does not — that's what I said. :) If Google+ let someone I don't know arbitrarily force posts into my stream, I'd opt-out _so fast_.
Comment: @Michael, that is a valid point, and a problem many users have brought up to the G+ dev team. I suspect that that ability is in the making.
Answer: 1x.com is another alternative. It's a bit more exclusive - each image must be approved - but you can get more in-depth critique than at most sites (where you get mostly "nice shot" or "love this!").  I don't know how well-known it is, and you can't just upload all your stuff there, as it has to be approved, but worth a look.
Answer: DeviantART is my favorite site to publish photos and get feedback as well. It has a great interface, active huge community, accepts all kinds of art not just photography, and most importantly it has "groups" which is simply a gathering of people for a topic may it be general as "photography" or specific to just one type of photography. And the forums are great and very active as well.
Answer: It depends if you are wanting feedback on all your images or just ones you select. If you want to put a collection online and have it open to comments, Flickr is the standard.
If you want to just post the odd photo for critique, then you're better off going to a forum. Digital Photography School has a good forum where you can either post an image just to 'show off', or post it for critique.
Comment: @Michael: All of Flickr is public! (Apart from photos you specifically mark as private.) Forget about Interestingness - nobody knows how to get photos into that! Focus on Groups and search results: those are much more straightforward routes to getting your photos seen.
Comment: Seems like in Flickr I can only share with the followers, I mean my photos will not pop into someones screen if I don't know them
Comment: Well, Photobucket allows you to make public galleries, though I'm not sure if it allows comments.
Comment: Doesn't Flickr allow this(public galleries), too?
Comment: The only public place I've seen on Flickr is Today's Interestingness. What does it take to have my photos exposed there?
Answer: If you want some exposure on Flickr (i.e. not 0 views), you'll need to post your photo to your relevant social networks (Facebook/Twitter), but also look through the list of groups for groups you could submit your photo to. I usually look for the ones with a moderately useful amount of activity and join them.
The other thing is to add as many photographers as contacts as you would like to. Don't just add everyone, but if someone posts something interesting, add them, then you'll see suggestions for other people and so on. The more people you can expose your photos to, the more likely you'll get both views and feedback/favourites.
It's just like everything else. There's millions of Flickr users and without any sort of "advertising", your shots are going to fall into the ether.


Ways to get individual securities from ETF's

Question: Is there a easy way to automatically (ie. through an API or something, not through just reading a prospectus) get information about an ETF's underlying securities? I'd like to write an application that aggregates some ETF's based on what securities I'd like but I don't know how to find what stocks and other things are in these funds.
Comment: @JBKing not all ETFs track an index...
Comment: Also note that though an ETF tracks an index, it often does not hold everything in the index.  It will hold a subset, which is disclosed to authorized participants. You can also look this stuff up at the SEC, form N-Q.
Comment: Assuming that the ETF is tracking an index, is there a reason for not looking at using details on the index? Could be a simpler solution in some cases.
Answer: ETFs are legally required to publicly disclose their positions at every point in time. The reason for this is that for an ETF to issue shares of ETF they do NOT take cash in exchange but underlying securities - this is called a creation unit. So people need to know which shares to deliver to the fund to get a share of ETF in exchange. This is never done by retail clients, however, but by nominated market makers. Retail persons will normally trade shares only in the secondary market (ie. on a stock exchange), which does not require new shares of the ETF to be issued.
However, they do not normally make it easy to find this information in a digestible way, and each ETF does it their own way. So typically services that offer this information are payable (as somebody has to scrape the information from a variety of sources or incentivise ETF providers to send it to them). If you have access to a Bloomberg terminal, this information is available from there. Otherwise there are paid for services that offer it. Searching on Google for ETF constituent data, I found two companies that offer it:

http://www.masteretfdata.com/
http://etfdb.com/

See if you can find what you need there. Good luck. (etfdb even has a stock exposure tool freely available that allows you to see which ETFs have large exposure to a stock of your choosing, see here: http://etfdb.com/tool/etf-stock-exposure-tool/). Since this data is in a table format you could easily download it automatically using table parsing tools for your chosen programming language.
PS: Don't bother with underlying index constituents, they are NOT required to be made public and index providers will normally charge handsomely for this so normally only institutional investors will have this information.
Answer: Save the effort.
For personal finance purpose, just use the simple tools.
For example, if you like P&G very much but you want to diversify with ETF, use:
http://etfdb.com/stock/PG/
https://www.etfchannel.com/finder/?a=etfsholding&symbol=PG
Pick a ETF with highest weighting. Replace "PG" in the link with other tickers.
Comment: Thanks, but I'm really interested in doing this for fun. As such I'd still really like to find out how to find the underlying assets on the ETF's.
Answer:
Assuming that the ETF is tracking an index, is there a reason for not looking at using details on the index?

Typically the exact constituents of an index are proprietary, and companies will not publish them publicly without a license.  S&P is the heavyweight in this area, and the exact details of the constituents at any one time are not listed anywhere.  They do list the methodology, and announcements as to index changes, but not a full list of actual underlying constituents.

Is there a easy way to automatically (ie. through an API or something, not through just reading a prospectus) get information about an ETF's underlying securities?

I have looked for this information before, and based on my own searches, in a word: no.  Index providers, and providers of APIs which provide index information, make money off of such services.  The easiest way may be to navigate to each provider and download the CSV with the full list of holdings, if one exists.  You can then drop this into your pipeline and write a program to pull the data from the CSV file.  You could drop the entire CSV into Excel and use VBA to automagically pull the data into a usable format.
For example, on the page for XIU.TO on the Blackrock site, after clicking the "All Holdings" tab there is a link to "Download holdings", which will provide you with a CSV.  I am not sure if all providers look at this.
Alternatively, you could write the ETF company themselves.
Comment: Are you answering Ben Nelson or JB King?
Comment: Both, hence the block quotes to each section I am responding to. :)
Answer: Source:
https://etfdailynews.com/tools/what-is-in-your-etf/
What's In My ETF?
Are you wondering what your ETF has for holdings? Enter your ETF's symbol in the box to see what your fund holds.
ETF Ticker Symbol enter
records per page select 10,50,100
may need two pages
output looks like this
Symbol  Holding Name        % of Total
LVNTA   Liberty Ventures    0.06%


How can I reset my menus?

Question: I accidentally opened too many menus (or windows) and I want to reset them to default.  It is really annoying, and effecting my animation.  Thanks
Comment: If one of these answer solved your problem, don't forget to click the ["Solved" checkmark](https://drive.google.com/file/d/0B_yQeQQ8ImENMnU1ZmpBYjI4WlE/edit?usp=sharing) next to it to let everyone know the question has been solved. :)
Comment: related: http://blender.stackexchange.com/questions/34174/can-screen-layouts-be-locked/34183#34183
Answer: Info Header
The Info header is the header bar that contains the File menu option.
Each window in Blender has a header bar and the type of window is set by the first icon on the left-most side of every header.
For example, in this picture, the different windows are highlighted in yellow and the Window Type icon for each is highlighted in green:

In order to change any window from one type to another, just click on the Window Type icon and select the type of window you want to have. In your case, you will need to set one window to Info since it has the File menu option so you can restore the factory defaults by clicking: File > Load Factory Settings. Here is what the Info icon looks like:

NOTE: It is also possible to hide the header by dragging it's top edge down. This leaves a small grey tab with a + sign in it on the right-hand side of the window. Clicking on this + tab brings the header back into view:

You can read more about header bars here in the Blender Wiki.
Manually Rearranging Windows
However, you can also manually close windows or open new ones by dragging on the  window splitter widgets (they look like a little ridged thumb grip) in the upper right and lower left corners of every window:

Here is a demonstration of how to drag the window splitter widgets to open and close different windows, as well as how to change these windows from one type of window to another by changing the Window Type icon:

You can learn more about how to manually arrange window frames the way you would like them here.
You can also check out the answers here and here.
Comment: Very long and probably correct article, but hard to see if it contains the answer to the question
Answer: While I can't see your layout to know exactly what to do there are a few options available that you may easily recover from.

If you have hidden the header of the info window you can unhide it by clicking the  in the right hand side on the window.
(for 2.70 or later) If you have collapsed the menus you can still access them by clicking the little three bar icon in the header.

By right clicking the same icon you can un-collapse the menus.

(before 2.70) Instead of collapse menus we had a hide menus option that shows as a little + in a circle. Click it to un-hide the menus.

In the worst case scenario where the above doesn't help and you have saved the bad setup to your startup file you have a couple of options available.

Press CtrlO or F1 to open a blend file. This should make the main menu visible where you can load factory settings. If not select a blend file to open ensuring the Load UI option is turned on. This will load the window layout from the file that you open and should give you access to the main menu.
Worst case you may want to delete your startup.blend file to start from scratch. While there are three possible locations for the startup.blend you will most likely find it in the USER location. This wiki page explains all three locations for each OS.
Comment: My problem was that I added a new workspace that filled up the full width of the window. So on top I've got the menu from the workspace, not blender itself. Closing that workspace was not possible as I got many small ones below it.

**Finally F1 + Factory reset solved that problem. Thank you very much.**
Comment: I would have selected this answer just for the "Load Factory Settings"
Answer: To fully restore the default factory startup layout, start by saving the file and close Blender
Open a new Blender window, open the file and un-check the Load UI option in the Open dialog, before opening the file.

As shown below:

Result :
Comment: This is the way.
Answer: You can restore the factory defaults by clicking: File > Load Factory Settings.
Then set it as the default press CtrlU
Answer: Things have changed since the original answers to this question were posted. In 2.8 the interface for handling area splitting was modified.
You can read more details about splitting areas in the manual.
Hover the cursor over the upper right corner of the files window until it turns into a cross.  Left click and drag to "split" the window.  Once you've done that, use the editor selector to switch the window to the 3D viewport.
If you have trouble splitting the window, you can hover over the edge between the File window and the Outliner until the cursor turns into a two-headed arrow.  Right click and select Vertical Split.  Drag the line to the right and then left click.
Splitting the window - From the area corner when the cursor changes into a crosshair

Changing the window type - From the pulldown menu on the top left of all editors

Alternative way to split - Right-click over the area borders and choose Split
Answer: My right menu suddenly disappeard too. Only the Properties panel was visible. Even the menu on the bottom (timeline) was gone. I found out why.
If you press CtrlUp Arrow the menus will disappear and reappear. But at least I have them back now. :D
Hope this helps others too! Happy blending!
Answer: I found a solution to reset all Screen Layouts s in a project is to:
-Save project
-Create a new project
-Load Factory Settings
-File: Append: Your previous project
-You delete the Scene
-You have your Screen Layouts back
My Animation Screen Layout disappeared mysteriously and I could fix it with that.
Hope help someone.

How can I reset my menus?


What is Ripple and how does it compare to Bitcoin?

Question: What is Ripple, and how does the system compare to Bitcoin?
Answer: This is answered in the official wiki:

Like Bitcoin:

ripple is a distributed peer-to-peer payment network
ripple transactions are irreversible, sent over the Internet, and counterfeit proof
ripple uses the same underlying cryptography as Bitcoin
ripple has multi-signature support
ripple has low to no transaction fees
ripple servers can be run by anyone

Unlike Bitcoin:

ripple can send any currency
ripple can automatically exchange currencies
ripple transactions are fully confirmed in seconds
ripple allows nicknames and gravatar icons for accounts
ripple's reference client is a Firefox and Chrome add on
ripple has no block chain download, clients are ready in seconds
ripple has no mining or direct monetary reward for running a ripple server
ripple has no currency risk as people can hold whatever fiat they want
ripple solves the double spending problem with consensus instead of proof-of-work
Comment: I wish that there were more technical details.  How did they get around proof-of-work?  How did they get around block chain download?
Comment: @Eyal I've linked the wiki, did you try to search there for details?
Answer: Ripple is trying to replace SWIFT, the protocol for inter-bank transfers. To me it makes sense because, those systems are (according to my understanding) quite antiquated. So blockchain hype has provided the impetus for banks to consider trying something new such as Ripple. It was started by the guy who created MtGox.
Bitcoin is a mechanism for exchanging value online between any two (or more) persons who have accounts and something to trade.
Answer: There's nothing in common, essentially.
Ripple is a simulacrum of Bitcoin repeating some of its external features, adding naive stuff like gravatars and missing the basics: immutability, independence from human factor, and any appeal to general public which is needed for any social-engineering tool to take off.
https://medium.com/@Knowledger/the-blockchain-is-already-beautiful-please-dont-create-your-own-89b13dd35793#.trgkqp6lz
Comment: Linked article is by answerer and doesn't mention Ripple…
Comment: 1) It's not accurate to say that Bitcoin is independent from human factors - for example, who decides whether a softfork is implemented? Humans. 2) Why is Bitcoin's colored coin system better than Ripple's asset issuance system?


Recommendations for off-brand battery grips for DSLRs

Question: The Nikon- and Canon-branded battery grips are insanely expensive.  What alternatives are out there, and where is the best place to buy them?
Answer: I highly recommend Zeikos battery grips. I have the Zeikos grip for my 5D Mark II, and I could not be happier. It matches my 5D2 perfectly, with no flex. With two batteries, it gives it enough heft to match my bigger lenses. It has vertical shooting controls (which I never use), and sits firmly attached to my 5D2 body.
I bought it from Amazon, paid $90.00, compared to the $250.00 that Canon's brand grip cost.
Regarding reliability, I've taken it with me now on several shooting trips: Greece, Holland, Germany, Spain, France, Sweden and Finland, and it's never had a single failure.
I've not handled the Canon 5D2 grip, but the Zeikos feels identical to my canon brand 40D grip.
I believe they also make Nikon grips, but I can't speak to them, as I am a Canon shooter.
They are definitely a chinese knock-off brand, but the quality is surprisingly good, and if you need a grip and are looking to save money; you can't beat it.
Now, just a word of caution: while I recommend 3rd party grips, I can't recommend 3rd party batteries. I've read enough horror stories to stick with Canon's over priced batteries.
Comment: @Balls: Just got the Zeikos grip for the T2i. It's actually more sturdy than the Canon grip (which I tried on a friend's T2i), but the button action isn't as nice as the Canon grip. All in all I'm very happy with the purchase, thanks for the advice.
Comment: Excellent, thanks!  I hadn't heard of Zeikos before, but I just looked them up for my Nikon D700 and I found they make a ZE-NBG300 for it, so perfect!  The price is excellent, and your comments agree with the bulk of comments on Amazon that gave it 5 stars.
Comment: @kubistan: glad to hear it!
Answer: I have used the Opteka brand which was outstanding value for money.
For example for the Canon Digital Rebel series, check this out:
http://www.amazon.com/gp/product/B001HK4LWA/ref=oss_product
For the price (at the time of writing), and given the inclusion of two 1800mAh batteries, it's pretty hard to beat.
Answer: The thing to keep in mind is that all of these third party products are reverse engineered and probably haven't been tested in every conceivable scenario before being released to the public. The cheapest ones and the ones that first appear on the market after a new model is introduced are often the worst. Some of the more reputable third party brands tend to take a little longer to get their accessories for new camera models to market.
For third party grips I've found that the 'Pixel Enterprise Limited' Vertax grips tend to be the most reliable and trouble free. 'Zeikos' and 'Meike' have been pretty good. I've never had a 'Neewer' grip but other 'Neewer' products I've used tend to be hit or miss at times.
If you want absolute rock solid dependability in a battery grip you'd probably  have to break down and buy the manufacturer's branded grip - if such a grip exists. But OEM grips don't exist for all cameras. For instance, Nikon does not offer grips for the D3x00 and D5x00 series.
For other cameras that do have available grips offered by the manufacturer, that's normally the best solution for 100% functionality and the highest level of reliability. Sure, they are outrageously priced. But the only other options are all too cheap because the competition for third party products is all about price and almost nothing else but price. It's a shame there are no third party grip makers that make high quality grips at a reasonable price the same way the best third party battery makers make batteries that sometimes outperform the OEM batteries for 1/2 to 1/4 the price.
I once had a cheap third party grip for a Canon 7D Mark II that would sometimes "blink" for an instant. It would only do it occasionally, but it always seemed to be when in the middle of shooting a burst of action frames. Of course the instant power-down/power-up meant I lost all of the images in the buffer!
I finally figured out that at certain shooting positions the grip was flexing just enough to lose contact with the camera at the connection point inside the top of the battery well. In effect, it was like a computer that was being unplugged without being properly shut down first (and without an UPS). Once I figured out what the problem was I could easily reproduce it by flexing the grip in the wrong way. In defense of the grip in question, this only started occurring after the camera with grip attached had taken a pretty nasty fall from vertical to the ground while attached to a monopod extended at about 60 inches.
I've had another third party grip that would act a little flaky at times. It caused a control on the camera's body to not function. Rebooting the camera solved the problem until the next time it decided to do it. I've also had issues with the 8-way joystick being easily damaged or falling off third party grips for the Canon EOS 7D Mark II, but this is a known issue that users of the first party Canon grip have also experienced. So in that case it seems the third party grips suffer from a poor design copied directly from the original Canon version.
Answer: I had a Big Mike's grip for my 6D before it got stolen.  It worked other than a curious quirk where occasionally (every few months, maybe) some of the camera's functions would stop working until I rotated the dial on the grip.
The batteries that came with it only lasted a short time before they stopped communicating with the camera, which seems to be a common problem with many LP6/LP6N knock-offs.
When I bought replacement hardware, I went with a Canon grip.
Answer: I have used a Phottix grip on my Canon 7D for some years with pretty good results.
https://www.progear.co.nz/cameras/accessories-phottix-battery-grip-bg-7d-mkii/21975
I think I've had the odd time where the grip buttons wouldn't move the focus points, but powering the grip off and on again fixed it up.
tl;dr I'd happily buy another Phottix grip rather than pay the full price for the Canon grip.


The use of software to formulate problems in multivariable calculus

Question: I know it's common for high school teachers to use software (such as Geogebra) to formulate geometry problems for their students, so I wonder: Do professors of multivariable calculus use softwares (like MATLAB, Maple or any other that plot surfaces and curves) to formulate exercises and problems for their students? Can anyone give me examples?
Comment: Not the answer that you want, but, I find the standard examples are more than enough challenge for the students. It follows I can usually set-up whatever I need via algebra and what I know geometrically. Of course, students would be wise to use a CAS or 3D graphing utility where appropriate.
Comment: My students and I use http://web.monroecc.edu/manila/webfiles/pseeburger/CalcPlot3D/ extensively when working on multivariable calculus questions.
Comment: You know the MITOCW platform? this is the multivariate calculus curse https://ocw.mit.edu/courses/mathematics/18-02sc-multivariable-calculus-fall-2010/1.-vectors-and-matrices/
Answer: There are already several "yes" answers so I'll give you a qualified "no":
What you do in class is what your students learn, so it depends on what you want to teach them. They should of course be aware the tools exist because it's hard to start learning how to visualize equations in 3d, but the more you as a teacher lean on them the less time they will have to see how to visualize equations without the help of the computer.
So why teach them visualize equations at all? In my opinion, the geometry skills we're building in Calc 3 are

Looking at 2 to 4 variable equations and understanding their rough geometric structure and analytic structure (do they max extrema, self intersections, etc).
Looking at low dimensional shapes and understanding the equations that could model them.
Understanding in general how the features of an equation give rise to geometric and analytic structures that we may want to analyze.

I think that computer systems are decent for (1) since students can explore different equations and see how the geometry of their solutions change. I think they're much less helpful for (2) and virtually worthless for (3).
For (2) and (3), you have to understand the theory of why, say, both $z = x^2 - y^2$ and $z = xy$ give rise to saddles points. If you can manipulate the equation, draw the level curves and trace curves, compute the Jacobean and really understand how all those structures explicitly give rise to the behavior of the solutions to the equation, then you'll be able to start forming fundamental connections between equations and geometry. Computer visualizations are useful to check your work and to get an idea of the visual vocabulary, but at the end of the day the connections made rely on memorization, much like the quadratic zoo most text books have.
So the hard, but important, skill is doing geometry without a computer. You can spend class time showing students the easy crutch that frankly they can (and will) all figure out on their own, or you can spend your class time helping them through the actual hard work. Computer visualization systems and solvers are useful, and should be discussed in class, but the more you rely on them, the students will come to understand that background skill is worthless, when in fact it's just difficult.
Answer: With the advent of the era of Wolfram Alpha.
A great deal is to calculate the curvature of a planar curve. The formula is
$$\frac{x'y''-x''y'}{\sqrt{(x'^2+y'^2)^3}}$$
and a crash problem is calculate that for the projective coordinates of a circle of radius $R$ which is
$$x=\frac{R(1-t^2)}{t^2+1}$$
$$y=\frac{2R}{t^2+1}.$$
Only very well concentrated minds can do the calculation without software aid, but with Wolfram Alpha every body can see how this calculation should be performed to be elegant.
The WA command for an specific, say $R=12$, is:
x=(12)(1-t^2)/(t^2+1); y=(24)t/(t^2+1); (D[x,t]*D[D[y,t],t]-D[y,t]*D[D[x,t],t])/(D[x,t]^2+D[y,t]^2)^(3/2)
Comment: I agree with you that using Wolfram Alpha is easier than doing a problem by hand, but could you say a little bit more about how this teaches students about planer curves?
Comment: One must push that they do by hand the first times but eventually they should learn assisted calculations or plots with a device at hand... Here two examples about plot in the afore mentioned free software: a plane curve http://www.wolframalpha.com/input/?i=parametricplot+%7B%E2%88%9A%7Cx%7C,1%2F(x%5E2%2B1)%7D,%7Bx,-3,3%7D and a spatial one http://www.wolframalpha.com/input/?i=parametricplot3d+%7Bcos+t,+sin+t,+t%2F6%7D,%7Bt,-10,10%7D and almost from them, lots of experimentations. This fashion, I believe, we will be encouraging to have "initiativessness" of any.
Answer: There is a great YouTube series on this topic from the Berkley graduate William Flannery called "Mathematical Modeling and Computational Calculus I" and "Mathematical Modeling and Computational Calculus II". He uses MATLAB to simulate different physics problems that involve calculus. The multivariable calculus comes more in the 2nd series when he starts working with the partial differential equations. He has also two books that support these courses and can be purchased on Amazon (Vol. 1 and Vol. 2). Finally, he has a website called Berkeley Science where you can find his other materials.


Feeling extremely uncomfortable at new internship

Question: I recently got a job as a software engineer intern at a major software company. While I was extremely fortunate to have this opportunity, this first week of working here has been horrible. I've gotten very little direction, no one is making themselves available to help me, no information or guidance getting set up on the majority of the software and tools the group uses. I've spent the majority of my time just sitting and doing nothing. I've vocalized to my tech lead that I need goals and things to do, but have gotten only one assignment. Following up on the assignment, the person showing me what to do assigned me a task that was so convoluted and out of my skill-set, I was questionable as to why he would even show me. The requirement for the internship required 3 months of object oriented programming and I just finished my sophomore year of college. My question is, how can I vocalize to my boss that I'm basically so new to this field that I need clear direction and progress up to higher level skills in chunks?
Comment: Welcome to internships! :)  Sorry, but it is often the case that interns end up somewhat directionless at least for a while.  You are a week in.  Give it some time!  They are giving YOU time to settle.
Comment: Patience!  One week down.  See if you are still worried in another three weeks' time! :)
Comment: I realize it's giving me time to settle, but they gave me a smaller task I completed and I've basically been getting paid over $30 and hour to sit in my cubicle and do nothing. I am wanting to learn, but understand what I am learning and I feel like no one is giving me the time of day.
Comment: `I feel like no one is giving me the time of day` - I know this feeling but keep in mind all of those people that are "not giving you the time of the day" also have their own tasks to do. Try to arrange a regular 1-on-1 with your team lead or manager at a specified time. Then he/she will have time to address your concerns properly.
Comment: I've had two internship in two different software companies, and both of my first weeks I did nothing, just sit there awkwardly and read some documents. Don't worry about it too much, it will be fine.
Answer:
My question is, how can I vocalize to my boss that I'm basically so
  new to this field that I need clear direction and progress up to
  higher level skills in chunks?

You just talk.
Hopefully, you have a period of private time with your boss (perhaps a weekly meeting) where you can discuss how things are going. If not, ask for one: "Hey, boss. Can we have a few minutes to talk?"
Then tell her/him how your week went and what didn't go as well as you would like. Explain why you think that is, and what you think may help it to go better.
In addition, try to be patient. In my experience internships often take a bit of time to get flowing. The first week is often awkward, boring, and/or confusing. Sometimes, the timing is such that the appropriate amount of attention and help cannot be devoted to the new intern due to other priorities, vacations, etc.
It will most likely get better soon, you will feel more a part of the team, and you and the company will have adjusted their needs to your abilities. Having a good discussion with your boss will help get that going even more quickly.
Comment: Thanks for this. Comforting to know that there is potentially light at the end of the tunnel. Venting through stack exchange is my way of seeking good advice from those with previous experience.
Answer: This is not unusual for software jobs, especially internships. The ramp up is very non-linear. Take your first week to get all your paperwork sorted out (payroll, benefits, HR training, etc). Take this time to walk around and meet your team. Get all your equipment sorted out, get your dev environment set up. Depending on how complex the system your team is working on, it could take you up to a week just to do that properly.
You've already gotten a task. That is good. Now dig into the task. Read lots of code. Go on SO/Google. Ask lots of questions. Part of a real job is that maybe no one knows the answers and you have to figure it out. You can usually ask for help from multiple people on the team, not just your manager. That may not always work though, and it's normal that in the beginning there's going to be down time because sometimes you'll just be plain stuck. Read up on documentation. Brush up on programming skills. Click around the system. Find bugs. Join hallway conversations, etc. Do not just sit around. Find something productive or educational. There is always something you can be doing.
You can schedule a daily checkin with your mentor so that it shows up as a meeting on their calendar. That should help force some time between you so that you can get help regularly.
Answer: As the comments above have said, the key here is patience. First, many companies are focused on running their own business and making money, not supporting interns. While things may seem disorganized and chaotic (and they probably are), you are being given a front row seat into how a real team operates.
Therefore, take this opportunity to learn as much as you can. For example, ask or find any product documentation or training and read/review/watch it. Sit in on meetings. Ask to help out on things that seem interesting, even if you are just taking minutes of a meeting or walking with one of the others out to get coffee. Your productivity is your responsibility.
At the same time, make sure you communicate well. As you said in your question, if you cannot do something, make sure you say so. Try to do as much as you can, articulate your limitations and control expectations. This way, people will learn what you can and cannot do and give you tasks more appropriate for your skill level.
Answer: Eventually they will give you more work, until then ask team members if you can shadow them on their work. Ask lots of questions and build some trust / get to know each other. I bet you find you'll learn a lot just by sitting with them for awhile. You might even get some pair programming out of it.
Comment: @jake: The key to being successful in an internship is in being proactive, not reactive.  As Brian here says, don't wait for them to show you something.  Go sit with people, ask questions and, above all, pay attention.
Answer: When people see you just "sitting and doing nothing", they are less motivated to invest their time and effort into training you. However, you don't want to be obnoxious going around bothering people - it's a delicate balance. To get started, some specfic things you can do that are practical:

Read manuals of the products your team maintain/develop.
Try to figure out why the products are designed the way they were. Ask well-prepared questions about them.
Participate in code review meetings so you get a clue of what people are working on, then just go study their work on your own.

The key is to come up with intelligent, well-prepared questions to show your interest and skills. Once you can show that, they will want to give you work.


Desktop publishing programs that are capable of including videos in an ebook

Question: I know InDesign and QuarkExpress can do this. But does anyone know something else? Some open source tool would be nice. But any hint is appreciated.
Comment: You can do that with any editor and zipping tool. I have used `vi` and  `zip` (3.0) both free.
Answer: Anthon is correct but he doesn't really explain why he is correct which is what the real question is about:
EPUB 3 supports video in ebooks.  Quark and InDesign are two commercial top notch desktop publishing software that have both (finally) integrated EPUB exporting into their software because of the rise of popularity in ebooks.  However, this is an extension of their original application which is simply meant for static layouts.  A good way of thinking about an ebook is to think of it as a simple locally stored website.  It can do most of the things that a website can do, just like you see websites with videos in them, so can an ebook have them.  And like a website, ebooks are written in HTML (XHTML if you want to be specific) CSS, Java, with support for images, videos, etc.  All HTML CSS and JS are at the end of the day is plain text with tags.  You can learn more about these languages at places like codeacademy.  Thus, all Indesign and Quark do is automate the writing of this code by trying to assume what you meant from the static layout of your earlier design before export.
If you get notepad+ (free) and have the ability to unzip and zip an epub into its constituent  parts then you can literally write all the code out by following the EPUB 3 specifications.  Your best bet however, is probably something like pressbooks http://pressbooks.com/, which allow you to lay out the design of your ebook much like you would in Indesign and Quark and which you can export into an epub for very little money - esp. when compared with Adobe products.
Hope this makes sense, I tried to unpack a bunch in a little bit of space based on what I assumed was your knowledge level.
Answer: At now the best editor for epub3 is bluegriffon epub edition
It isn't perfect but it's good.
The only alternative is oxygen, a really powerfull xml editor with epub capabilities.
I don't suggest to use a desktop publishing product to create ebook 'cause they're all too bound to the print version.


How can I do git checkout on a repository with submodules?

Question: Suppose I have a repository X with a sub module A.  Now suppose I want X to have two branches:  master and development.  I want master to have a different revision of A than development does.  How can I switch back and forth between these branches?
I've got a repository set up that does this (but using real names instead of fake ones!).  The problem is that whenever I do git checkout master from development, I get the following:
$ git co master
M       A
Switched to branch 'master'

It looks like it's not putting A back to the commit that master references.  Is there any way around this?  Both git submodule sync and git submodule update don't seem to change anything.
Answer: You need made a git checkout before


Reactive Programming

Question: The examples I see for the GPIO input are based on a loop which waits and check if the GPIO is receiving any info. Is there a way of just detecting when a button was pressed without using a loop under the hood? I mean, something like, call this function immediatelly after receiving an input at the GPIO.
Comment: Hello, the search term you are looking for is [interrupts](https://duckduckgo.com/?q=raspberry+pi+gpio+interrupts)
Answer: That's exactly what interrupts do. In python there is a function RPi.GPIO.add_event_detect( GPIO_NUMBER, GPIO.RISING, callback=yourCallback). You then need to define a function yourCallback() where you manage whatever has to happen when the respective gpio senses a RISING edge. A websearch for "raspberry pi gpio interrupt" will reveal several detailed tutorials about that topic.
You still should mind debouncing the button.
Comment: I vaguely remember that Rpi.GPIO is very newbie considerate and debounces by hardware or software (I forgot which) without newbies even knowing what is the meaning of button bouncing.  I remember this well because once I thought I was clever and tried to do debouncing by both hardware and software, but found I wasted time, because Rpi.GPIO always debounces by default.  However I am only 80% sure that I remember things correctly.

Reactive Programming


Encrypt letters separately?

Question: I am trying to encrypt the word Hello using RSA. When encrypting Hello's integer representation, is each letter encrypted separately, or is the whole thing encrypted? Furthermore, am I correct in assuming that Hello is to be represented in binary form for RSA encryption?
Comment: In practice: [neither](https://en.wikipedia.org/wiki/Hybrid_cryptosystem). 'Hello' is not encrypted with RSA at all, but with a symmetric cipher, the key of which is then RSA encrypted.
Answer: For the purposes of your high school project, I suppose either one is fine. As you mentioned, one possibility is to convert the message to a bit-string using ASCII, and then interpret the bitstring as an integer and treat it as the message to be encrypted. If you need to "show your work" on paper or slides, then writing it in decimal is reasonable.
However, as @otus mentioned, this method is never used in practice nowadays because it falls short of what we require of modern cryptosystems, for various reasons. You can Google something like "textbook RSA" or "plain RSA" to find out more, and I would suggest that it would be a good idea to at least mention those issues in some way in your project.
Answer: I think I found the answer to my own question... First Hello is represented in binary form (ASCII). After that, the integer in binary form is converted to decimal form.
Comment: I know from experience that one can get away with this approach in a high school project and still get the highest grade. In practice it is insecure and breaks down for larger messages. For those reasons practical implementations combine it with a symmetric algorithm such as AES combined with a suitable encryption mode.
Comment: `'Hello'.encode('hex') = '48656c6c6f' ` and so `int('48656c6c6f', 16)=310939249775`

Encrypt letters separately?


Is it okay if I play guitar/bass with wet fretting hand?

Question: I know to keep a guitar/bass is not to play with wet hands. But, is it okay to play just with fretting hand a bit wet? I'm thinking about the neck, will it affect the tone?
Comment: Metal strings corrode and rust when brought in contact with water or perspiration.
Comment: Other than wearing the strings out more quickly, I don't think this will cause any problems. Probably not a big deal.
Answer: Dirt, oil, and moisture accelerate the wear on your instrument's strings and finish. Wet hands will make your strings wear out faster and may damage the finish of your neck. Moisture will also soften your calluses and skin, so you may end up with the same kinds of soreness and skin damage that beginners get. It's a good idea to play only with clean, dry hands.
As others noted, a little sweat and grime is inevitable. I personally keep a cloth handy to touch up my guitar or dry my hands if I start to notice an accumulation while I'm playing. My main concerns are keeping my fingertips strong and avoiding long-term damage to the instrument (e.g., ruining the finish where my arm rests on the body).
Answer: On occasions, a gig may be really hot and humid.You will sweat, so your hands will be damp. This is life. However, once you've finished, it's always best to dry the neck/strings and if there's no paint finish, the body with a cloth.Strings are not designed to last for ever, and they are usually metal, so will revert to rust as soon as possible, thus drying them has to be a good idea. The tone will change when they start to corrode, although it won't be affected by the fact you're playing with damp/wet hands at the time.
So, no big deal, but why would you ?
Answer: Moisture will make your strings corrode slightly more quickly, but this is inevitable because of sweat and moisture in the air. You should try to avoid playing with wet hands if you can, but in actuality I doubt it would make a significant difference unless you're consistently playing with wet hands. If this is the case, you can buy coated strings which are protected (somewhat) from corrosion by a thin plastic coating, so they last significantly longer for players with sweaty hands.
I think it is also important to note that your fretting hand will probably cause less corrosion than if you are finger picking with wet hands, as your fretting hand is moving around between the strings and along the fret board, while your picking hand is hitting the strings repeatedly in the same location. Unless your hand is soaking wet, the moisture will not be enough to cause any damage or warping to the neck.


I have issues with terminal service, there appear logins automatically and disappear?

Question: I have issues with my terminal service manager, there appear logins automatically and and increases the number of users but actually don't enter, my counter goes till 3000 o more in the same day and I just have 15 user.
Answer: It's hard to tell exactly what you're saying or what you're asking but I suspeect that you're seeing activity related to attempts to log on to the server using a brute force username/password attack. You can confirm this by watching in TS/RDS manager for multiple listening ports being created and destroyed in quick succession.


Is there a good reason NOT to reuse the power cord when replacing my electric range/oven?

Question: I'm going to replace my house's original 1970's electric stove (oven+range).  I'm pretty sure the store is going to try to sell me a power cord for an extra $20, which isn't a big deal but I'd rather spend the money on something else if there's no safety concern.  Assuming the old cord is still working fine and the insulation appears to be intact, is there a good reason why I should buy a new cord, vs. reusing the old stove's power cord?
Answer: A nearly 40 year old power cord is going to be nasty. Dust, grease, possibly cracked insulation internally, possibly asbestos insulation if the "original" cord was itself recycled. All are fine unless you disturb the cord. Pulling the stove out disturbs the cord.
Pulling out a stove is a fairly major operation, I would take the opportunity to completely clean under it and update whatever I could.
Changing the receptacle would be a decision based on it's current condition (one crack -> replace; any green copper -> replace) and the state of the wires. Open your breaker panel and check the stove wires (they'll be the biggest ones). Still soft and flexible? New receptacle.
A stove is your house's biggest power consumer. Maybe you don't mind a 40 year old cord handling all that power; how do you feel about a 60 year old cord? That's the old cord in another 20 years. If the original cord was recycled itself, it is now 60 years old and will be 80 when you retire.
Comment: Great answer.  Did you mean your recommendation to get a new receptacle if the wires are still soft and flexible, or was that misworded?
Comment: No, that's correct. Stuff behind the wall is usually good until the house falls down assuming you don't disturb it. If it is disturbable, lets change things before covering them up for another 20 years.
Comment: Just to follow up, it turned out my old stove was hardwired, with a really heavy gauge cord running to a loose junction box then wires in metal flex conduit running from the junction box to the stove. I removed the old junction box and the flex conduit and its wiring, wired the really heavy gauge cord into a $6 receptacle and secured it, then bought a $20 cord and plug for the stove.
Answer: A big reason: the old cord (and receptacle) may be obsolete and dangerous.

Your connectors will look slightly different, since they are probably -50 instead of -30, that number being the amp rating.
40 years ago, grounding was relatively new, and it was "par for the course" to fake up ground protection for stoves and dryers by using the neutral instead.  Most existing houses didn't have grounds, just 3 wires, and forcing everyone to rewire would kill stove and dryer sales - not economically (politically) possible.  The rationale was that neutral connects to ground in the main panel, and dryers and stoves are rarely unplugged.
The problem is, if that neutral connection is severed for any reason, the 120V loads in the stove (i.e. the oven light) will lift the neutral to 120V.  The user will get shocked from a 120V leg, through the clock mechanism or bulb filament, through the user, to the sink or whatever they may be touching.  People have died of this.
For many years, NEMA 14 has been mandatory in new work.  NEMA 10 is still legal if your home already has one, to allow new stoves and dryers to be sold into older homes... obviously safety cannot be allowed to slow down appliance sales.  Some cities override this.
Every new appliance is built to accept a NEMA 14 cord, or if necessary a NEMA 10.  This is why they want to sell you a cord: they don't know which you need.
If it's NEMA 14, you're all set.  If it's NEMA 10, it's worth popping the receptacle cover off and seeing if there are four wires.  If there are, change to NEMA 14. Otherwise consider rewiring - it's legal to add only the ground wire, routed any practical route - it doesn't have to stay with the conductors.
Answer: No idea what your paying for the new range but I would think another $20 for a new cord would be a safe investment.
Just be sure to check your existing receptacle.  Based on your stated age of you old range it is likely you only have a receptacle with 3 prongs.  Two hots and a neutral but no ground. All codes and manufacturers now require grounds.
Be sure to read your warranty as it's possible the manufacturer's warranty will be voided if not properly grounded.
This will require not only that new $20 cord but new receptacle and 3 wire with ground from the receptacle to your breaker panel.
Comment: I found that 4-wire (3+ground) is only required in new construction per the NEC. As it turned out, my old stove was hardwired but I wasn't comfortable reusing that wire so I installed a 3-wire receptacle and installed a new 3-wire plug on the new stove.
Answer: As long as nothing is burned or melted on the plug end, and provided it is appropriate for the application (amperage wise) you should be fine reusing the old cord.
Comment: As @paul said in his comment, you really need to check the entire cord for degradation (cracks, stiff insulation, etc), not just the ends. Personally, I'd just pay the $20 for a new cord.
Comment: In my experience, the typical failure point of a range cord, is where it connects to the range. All too often the terminals are not tightened to start with, and they are almost never retightened after using the range for a bit. This "loose" connection can cause excess heating, which leads to premature cord failure. You may not be able to see cord damage caused by heat, so it's just safer to spend the $20.
Comment: Funny, in all my yeas I have never seen a failure at the terminals. I have however seen many plug/receptacle failures/melting.
Comment: This was also assuming there was no physical damage on the rest of the cord. My point was the typical failure point is the male end and receptacle.
Answer: Personally...  New!  Especially as you know it is at least 40 years old.  Irrespective of how well things are looked after they degrade over time and I don't think I'd sleep well at night knowing there is a potential issue just waiting for the most inopportune moment to rear it's ugly head.


Can the supervisor ask a student to add them in an acknowledgment without any useful feedback

Question: I am a PhD student. At the beginning of my study, my supervisor told me that they are able to help me with my topic. However, later I found that they cannot even understand what is my topic. They wasting my time for more about one and a half year without any comments or help with my topic. Then, I worked entirely alone with my topic. I have done the first chapter of my study, they asked me to be co-authors with me for nothing but just because they are my supervisors. I refused this. Then, they asked me to add them in the acknowledgment as they are the supervisors of this project. They asked me to write this in every single paper of my Ph.D. papers. They did not help me with anything, they even cannot understand the difference between my objectives. My question, Must I acknowledge them in my papers?
Comment: You shouldn't include a co-author unless they deserve to be included. But what do you gain by excluding them even from the acknowledgements? You're supposed to be there to learn from them, not to do whatever you want and get their degree for it. It's their school and you're the trainee. If this isn't the situation then you're the one who doesn't belong. You need to find another adviser if you're going to finish.
Comment: Who devised this "project" you are on?
Comment: Do they pay you?  If so, you must acknowledge their funding.  Did they provide you with any resources at all—a laptop or an office, for example?  Then you must acknowledge that support.
Comment: @JeffE They did not provide me anything. Only an office from the Uni for all the student.
Comment: @Karl I devised the project.
Comment: Now wait, you're not even payed? You are free to do whatever you want, and chose to do that, by devising your own project?
Comment: @F.Thomas: I'm puzzled - you turned down your supervisors' request for co-authorship, and they accepted that (seemingly without complaint) and asked if you could simply add them to the acknowledgements (which costs you absolutely nothing), and you still said no? Seems a bit harsh (not to mention rather inadvisible) - do you really hate them/want to burn bridges with them that much? Because at least in my field, that's probably how they'd interpret it - refusing even to acknowledge your supervisors' existence is kind of rude (to put it mildly). Not to mention that it may impact their funding.
Answer: Giving a mere acknowledgement to supervisors is a pretty low bar, and it would be a pretty extreme reaction to deny this.  Even if they did not succeed in assisting you with this paper, presumably they must have made some attempt to assist you in their supervisory role, and they have taken time out of their own schedule to try to assist you as a student.  That in itself warrants an acknowledgement and thanks, even if you are of the view that they did not contribute anything of value.  It is usual to add someone as a co-author only when they have made a substantial contribution to a paper, but the bar for an acknowledgement is much lower.
I note from your further comments that you are of the view that your academic supervisors do not understand your topic, and the Dean of the Faculty is "with their side".  I also note your comment that they have asked you to withdraw from the university, or at least take a long vacation.  Under such circumstances, you should try to engage in some self-reflection and see if you are acting reasonably, or if you might be contributing to the problem.  Refusing any acknowledgement of assistance (or at least attempted assistance) by a supervisor suggests that you are not acting in a manner conducive to good relations with your supervisory panel.
It is not entirely impossible that a supervisor could be incompetent to assist a student, or that a Dean could incorrectly side with the supervisor in this case.  However, it would be very unusual if multiple professional scholars do not understand the topic of a student they are supervising, and are not able to provide a student with any assistance.  Application of Occam's Razor would lead an outside observer to conclude that the more likely explanation is that it is the student might not properly appreciate the efforts made by their supervisors.  The refusal even to acknowledge and thank them in a paper contributes to this perception.
Answer:
However, later I found that they cannot even understand what is my
  topic.

and

Then, they asked me to add them in the acknowledgment as they are the supervisors of this project.

simply don't add up. If they are supervisors of some project, chances are they have written the proposal of the project, and defined aims/goals/methods etc.
Moreover, because you are involved in a project supervised by your advisor(s), no matter what you do, they must take some credit. Without them, the project wouldn't exist. Without the project, that particular work wouldn't exist.
A similar reasoning is, when you publish a paper, you write the name of your university even though the university did literally nothing.
By the tone of your question and your tendency to self-righteousness, I think you should be more worried about your future in that project. If your tone to your supervisors is as rude as it is in this post, you probably will have a hard time in near future.
Comment: _even though the university did literally nothing_ — Not true; the university gave you an office, working internet, an email address, and a job title.
Comment: @F.AMER They gave you funding and just let you do your own stuff? I'd certainly acknowledge them for *that*.
Comment: _no matter what you do, they must take some credit_ — No, I'm sorry, this just isn't correct.  If the supervisor provides intellectual guidance or physical/monetary resources, those contributions must be acknowledged.  But writing a paper while coincidentally under someone's formal supervision does not require acknowledging that supervision, for the same reason that faculty-authored papers do not automatically acknowledge department chairs and deans.
Comment: Also, I cautiously agree with your comments on the tone of this question. Though there might be language/culture issues involved, the OP's question here seems to lack nuance and consideration of their own potential faults. Hopefully OP can get a diplomatic friend to edit further messages to the supervisor and/or department.
Comment: I find the objectives of the project, the relative literature reviews (all the papers in my area), data, statistical code to run the algorithm, methodology of every single objective. They entirety did not do anything
Comment: @JeffE With the same reasoning, in this case, the supervisors give the OP a project to work on and allocate some research money for the user.
Comment: Fields (and universities) differ a lot in how projects are set up. Sometimes students have a lot of latitude, especially if the research doesn't require consumable resources.
Comment: @padawan I see no evidence in the question that the supervisor "gave" OP a project to work on.
Comment: They created the project. If there was no project, there would have been no funding. Similar to if there was no university, there would've been no office.
Answer: Whether you must add them to the acknowledgements is, I guess, down to your institution.
From a practical and pragmatic perspective, you should add them to the acknowledgements. It doesn't cost you anything, except perhaps some pride, and it avoids worsening relations between you. If you're going to have a fight with them, save it for something that matters :-)
Answer: This is likely to be Country and / or Institution dependant, but have you considered speaking to the Dean or the next level above them?
Is there some type pf PhD committee that could help?
Do consider that they may become vindictive if you do not include them and could cause harm or slow down your continuing progress...
Comment: Perhaps you should seriously consider finding and moving to another institution...
Comment: From the tone of your two comments it sounds like you have already burnt the bridges - "have a long vacation" ergo take some time and think about your next move...
Comment: The Dean is with their side. They asked me to withdrawable from the uni but I said to them I will go to the court. Then, they asked me to have a long vacation. If I do not obey then they will not make me graduated.
Comment: I am working entirely alone. Even they do not want to help me to know how to deal with a journal to publish my paper.
Comment: They want me to have a vacation because they then can easily say for me there are no supervisors for you (this is their rule).
Answer: Acknowledging your supervisor means many things, ranging from thanking their funding and fundamental supervision to suggesting that your phD relationship is ok, although this is not necessarily the case.
Non-helpful supervisors are not only those who ignore their duties but also those who do not give the input but keep pushing you back. So, my suggestion is to change your supervisor. Move on to work with more professional people. Doing research alone is hard enough. You don't want any other barriers in your way as your journey will become harder and harder.
Comment: They even do not give me a sponsor. If I asked them a question they said they do not know or even give me a wrong answer.
Comment: Let's think in this way, it is good that now you know early. But you should talk to someone of the higher power such as the postgrad office. Once, you inform about them; then, it is best to move on with a better person. This is very serious, especially when it comes to no funding. I believe that if you work hard enough, someone might consider taking you under his/her supervision. Many of them only want a student who can do good publications, even if it is not about their works.
Comment: By the way, you should talk to the postgraduate office to decide whether you should add them in acknowledgment. This is   something to do with the authorship, and having the third party should help.


I have boot marks on my legs that won't go away

Question: So I'm in the Navy and have to wear combat boots almost 24/7 which is great and all, except I now have permanent reddish marks about halfway up my calves. They don't hurt or anything but it is rather unsightly whenever I wear shorts or a skirt so I'm just wondering if anyone knows of a way to get rid of this. I'm talking these are not like sock marks that go away after a few hours.
Comment: What type of boots do you wear?  I was in from 04-14 and haven't known anyone to have this issue.  Even now my work socks create an indentation in my ankles after eight hours of wear.
Answer: Sounds like your boots don't fit quite right--which can be a problem with uniform boots.Check AAFES and see if there are any other boots (in regs) that are wider at the top of the boot. Women's calves are different than men's and the boots are designed for men.
To "fix" your current boot, get some moleskin and attach the adhesive side on the inside of your boot to provide some padding. Loosen the shoestring at the last two eyes to avoid compression. This should do the job even if you have to blouse your pants.
For the redness: Apply aloe gel several times daily. You can carry a small bottle with you. After about a week, the redness should abate.
-M.Mat, USAF (Ret.)
Answer: It's probably due to your boots scraping your calves because they're too large for you.
I wore combat boots for years because I liked it and one of my pairs of boots looked like that :

Even with the "red part" tied to the maximum was too wideand was scrapping my calves .
I saw it because I'm a man with a high leg pilosity and had "holes" where all the pilosity was gone.
It didn't take me too long to realise it was due to the boots scraping on that part of the leg when I was walking.
If your marks are also caused by your boots then stop walking with it the for a certain amout of time ans see if the marks are gone.
Answer: Let the marks heal first - turn brownish. Now this is dead skin that you want removed. You can do that with a pumice - after taking a shower when you skin is still soft and moist - it is easier this way. Don't try to remove it all at once - rather a little bit each time.


ubuntu 12.04 autoclick

Question: I dont know how to search for this problem.. more and more frequently when I start and login my machine, it opens the desktop, and as I open a folder, or if I go on the internet, it will just start opening tabs after tabs after tabs.. I only know how to shut of the machine to fix this, and hope next time it will have gone away. sometimes I have to restart two times for it to begone. What is this? How can I fix this?
Thanks
Answer: it might sound obvious, but it might be good to first check the simple solutions. have you tried to disconnect your keyboard or to plug in an other keyboard (if you have one laying around). If it for some reason sends a alt-t signal it could explain the problem.
Comment: Thanks, yeah, that is probably it. It seems like it is a keyboard, or mouse signal gone awry. No havent tried the obvious :P Gonna check it out next time it happens :)

ubuntu 12.04 autoclick


Net salary for an internship in Switzerland?

Question: I will be doing a 6-month internship in Switzerland near Lausanne soon, and I will be remunerated 1000 CHF per month in gross salary.
How much can I expect in net salary?
Comment: My experience is that 1000 CHF is barely enough to cover rent in the Lausanne area.  I was paying about 800/month to rent a 'room' which was a converted pool shed.
Answer: At the moment we have 5.15% social security contributions and 1.1% unemployment insurance which you have to pay and there are maybe (it depends on your employer) an accident insurance which you have to pay too.
Generally we have in Switzerland not so high taxes, like in other countries, so I think your net salary is a little bit over CHF 900.-.
Answer: The first comment, made by jamesqf is correct.
As user "crashwinston" mentioned, the taxes on salaries are not very high in comparison to other countries, but I it is important to add that the social security contributions are minimalist in Switzerland : this means that the mandatory health insurance is not included in them.
For the cheapest health insurance, you will have to pay around 400 CHF/month, with an annual franchise of 300 CHF. This means that when going the doctor (public hospital or private medical practice), you will have to pay the first 300 CHF (as well as 10% of the excess part). The possible franchises are 300 CHF, 500 CHF, 1000 CHF, 1500 CHF, 2000 CHF, 2500 CHF.
Many people from abroad focus on how high are the salaries, but have no idea about how high is the cost of living.
1000 CHF/month is clearly not enough to leave in Switzerland if you don't have additional help or reserves.


How can I send internal FX to monitors on a Behringer mixer?

Question: How can I use built-in effects processor that goes to main to send to monitors?
Comment: Which model is your mixer?
Answer: Some Behringer mixers have dedicated mon fx sends like the below (from the PMP1600):

Other Behringer mixers (e.g. the XENYX X1204USB) don't have that option and here you have to patch back the FX send into an unused channel and from this channel send to the monitors in question (but DON'T send to the FX send - it will create a feedback loop!).
Note that Aux Return 2 often used as a way to disable the internal FX processor, so make sure you don't put anything into that (source, p. 5)
Answer: I just wanted to add a bit more details to Michael's answer regarding how to make it work with the UFX1204. I know it's 5 years later, but the manual doesn't properly address this trick.

First, send channels you want to hear effects on by turning their individual FX knobs. Press the FX ON button as well in the MULTI-FX section.

Then send everything on the FX bus to the mixer's FX processor by turning the FX SENDS knob inside the SENDS/RETURNS section.

Once the signal is processed by the FX processor it's returned to FX RETURNS. The amount that goes back into the main mix is controled by the FX RETURNS knob just next to the FX SENDS knob from the previous step.

Now we don't want FX RETURN to only go to the main mix, we also want it sent to monitors. To do that, press the "TO AUX 1" button. The little arrows tell you that doing so sends FX RETURNS not just to the main mix, but to AUX 1 SENDS as well, so adjust the red AUX 1 SENDS knob too.

What we've done so far is to send all channels that are processed through the FX processor to AUX 1 SENDS. So take a TS (or TRS) cable and patch AUX SENDS 1 at the back of the mixer to an unused channel and that's it!

If you now SOLO that channel, you'll hear effects coming out of the FX processor. As Michael pointed out, don't turn the FX knobs on that return channel or you'll create positive feedback..or carefully do turn that knob for some added fx crazyness. For exmaple with a little feedback you can get not just one but two subharmonics using pitch shift turned all the way to the left.

SOLO both that channel and the channels that are being sent to the FX processor to hear the sum that's going out to the main mix. No more annoyed neighbors.
Comment: I really appreciate this input but I'm having big issues getting it to work. First issue is I see no "TO AUX 1" button. Do you mean a knob? Also - if I use Aux 1 send to send effects, what do I use to run my monitors out of? That appears to be the only option.


How to build PostGIS database schema for flexibility and normalization?

Question: I'm creating a database that will be used by researchers in population genetics with different goals and sampling strategies. The database needs to accommodate locations as points, lines, or polygons and I'm puzzling over whether those should be kept in a single "locations" table, or in separate tables for "point_locations", "line_locations", and "polygon_locations". The single-table design is appealing because it would make it simple to enforce the required one-to-one relationship between samples and their locations with a foreign key constraint. I can imagine that there may be reasons to split locations out into separate tables for points, lines, and polygons, however. If I can keep all locations' spatial data in a single column, then which geography datatype should I use (I know geometry would be more flexible, but that's a topic for another post)? I'm thinking geography(polygon,4326).
Answer: The answer depends a bit on what you're going to be using the geometries for. The database is perfectly happy to manage/index/search a generic geometry table:
CREATE TABLE g (
  id Serial Primary Key,
  geog Geography(geometry, 4326)
);

Yes, it looks odd to be declaring a "geography" as a "geometry", but what's a boy to do?
The trouble with generic tables is for client software that expects to only deal in homogeneous types, not mixed. The design question becomes: is it easier to store things separately in the database and have every piece of database logic "type aware", or is it easier to have mapping queries that require homogeneity to deal with their issues?
You can perhaps get some distance by putting views onto your generic table.
CREATE VIEW g_point AS
SELECT * FROM g WHERE ST_GeometryType(g::geometry) = 'ST_Point';

Best of luck!
Answer: A solution with 3 tables would be:
Create a 'generic relation' table for your locations. Like:
ID     NAME    GEOM_TYPE    GEOM_ID
1      foo     lines         44535

Create 3 tables, one for each type, here is the example of one called "lines":
ID       THE_GEOM
44535    (a wkb geom)

Now when you want to get the geom for a given location, query the table with the location's GEOM_TYPE and GEOM_ID.
Answer: You could create one Parent table called 'location' that doesn't actually contain any data, then create three child tables related to that table, each with constraints on geom_type, and load all data into those tables.  You could also create triggers on the parent table, so that any geom type loaded into it will be automatically sorted into the appropriate child tables.
Depending on the amount of data you have, this will yield better performance when querying, as well as better data organization.
This approach is outlined in detail in PostGIS in Action, chapter 3 (I believe).
Comment: I'm kicking myself for having left my copy of PostGIS in Action on a shelf 400 miles away. I won't have a chance to pick it up for several weeks and I need it now!
Answer: I do not recommend put all stuff into a single table.
But you can create at least um column for each geometry type
a point_location, line_location, polygon_location. This will avoid using the geometry type that allows geometrycollections etc.
Using separate tables, or columns would allow for additional checks on each location type.
You going to need answer question like those below:

Is the location an attribute of relation sample.
Do all the samples have the location know and defined?
Why locations should have different geometry representations?


In the United States (Michgan) is it legal to publish IP Addresses that were trying to hack my web server?

Question: I have a private web server that gets attacked a lot (brute forces, nmap scans). I would like to compile a list of the IP addresses that were trying to hack my server and publish them on my website. Is this legal? I realize that the IP address could belong to a botnet (so the owner of the IP address is unwillingly knows that it's comprised).
Comment: There are many of them available publicly(https://www.google.es/search?q=list+of+botnet+ip+addresses), some provided by business and organizations whose product is precisely maintaining accurate lists so their clients can filter those systems out(https://www.spamhaus.org/bcl/)
Comment: Publishing this information online is usually a bad idea, but not for a legal reason. Hackers *want* you to tell others about them, because it gives them something to point at and say "see we're good at our job" - some even use it as a sort of profile for getting hired. Including information that's too specific just gives them what they likely want from you: publicity.
Comment: Borg, speaking through the words of others is a kind of con-trick, don't you think?
Comment: Borg, are you a con-trick?
Answer: In general, you can publish anything unless an exception to the First Amendment applies.
The only exception that could plausibly be relevant is that you could be improperly defaming someone else's reputation.
If you have a good faith believe that these IP addresses were used to hack your server, this would almost surely be a matter of public concern (why else publish) and would involve a statement that was not false or made with reckless disregard for its truth or falsity.
To avoid inadvertently tarnishing someone else's reputation, you might consider including a notice that recognizes that the IP addresses could belong to a botnet and was not controlled by the legitimate owner of the IP addresses together with your "page of shame".
Comment: By operating a website, there is a lot of specific law that comes into play around privacy polices, etc, and the First Amendment is probably not broad enough to protect you if you are violating one of the specific internet privacy laws.  I can't give a specific privacy-law based answer, but the CIPP website may have some answers or at least some terms to start looking up: https://iapp.org/certify/cipp/
Comment: It is hard for me to see a privacy protection angle in this scenario, but perhaps there is one, or more facts might reveal one.
Answer: Think about your website like it's your own country and the "Terms of Service" and your "Privacy Policy" like the bill of rights of the country. You can set any terms you like and anyone who visits the website can either agree to terms or leave. If one of the terms is that any malicious activity will allow you to publish any connection information. Then you are clear to do what you wish with the information of any malicious connections.