Android swipe activity list

Question: I have worked on "swipe" in android 3.0 and it's working fine. Now after swipping some pages(suppose to the right) I want all those pages to appear at the bottom(as options) so that I don't have to swipe all the pages (to the left) to get back to first page. I can directly select the desired page from those options and jump on to that activity.
Please help or tell me any good tutorial which can help.
Thanx..
Answer: Put some container layout at the bottom, add a listener to the swipe event, where you inflate / generate dynamically a corresponding item and add it to the container in the bottom. Add a click listener to the item, and in the click listener emulate swipe to the corresponding page...

Android swipe activity list


How do I remove Ads in *new* Utorrent 3.3.2?

Question: How do I remove this pesky ad bar in Utorrent? I already removed most of these idiotic messages, with the help of How do I remove the ADs in uTorrent?, but one remains:
Answer: Also: set the value to false for:
offers.left.rail_offer_enabled

and restart the program.
Answer: I followed the steps at the link you provided and my uTorrent is ad-free now. To remove that you have to change the value of sponsored_torrent_offer_enabled to false. To do that:

Ctrl+P : Preferences and go to Advanced tab
From the list set offers.sponsored_torrent_offer value to false.
Restart uTorrent and it is gone.

That worked for me, should work for you too.
Answer: Unfortunately, newer versions of uTorrent does not support full ad-removal functions (as before), this time you can remove ads from uTorrent which are not related to their uTorrent Plus service.
I would recommend you to search for these options under Advanced tab in uTorrent Properties window:

Type in sponsored in the Filter field and set the value to false for the only available;
Type in upsell in the same field and set it to false;

You can also remove annoying bundle offers by right-clicking on the blue icon from the left side of the application and choose Hide Featured Content option from the menu.
Additionally, to remove Recommended tab at the bottom simply right click on the tabs and un-check the Recommended tab.


Losing coolant head gasket been done

Question: I have been loosing coolant since November I have spent so much money on my car fordfusion auto
Its had the head gasket done , water pump , thermostat, new radiator, new coolant and cap
But I still have the problem no one seems to know why this is still happening
Comment: Welcome to Motor Vehicle Maintenance & Repair!
Answer: It sounds as if you're just throwing parts at this problem and hoping you find it.  I didn't see where you did any actual diagnostic tests to determine WHERE the lost coolant was going.  This is important:

Out the exhaust - usually a head gasket, warped or cracked head or block.  An exhaust gas analyzer will tell you if there is coolant in the exhaust.  Then you take off the head(s) and start inspecting.  Usually there is visual evidence of the coolant making its way to the cylinder but not always.  Check for warped head, warped block.  Cracks are harder to find but any reputable shop will be able to perform the needed tests.

Into the oil - usually caused by the same things as above.  Often there will be foam and residue in the oil but not always.  An oil analysis will tell you if there is coolant in the oil.

Into the world - Radiator, hose, water pump, fitting leaks, bad cooling system cap, etc. can cause this.  Usually you will find residue at the point of the leak but sometimes you need some UV dye to help pinpoint the problem.  Again a reputable shop will have the skills and tools to do this.

There is really nowhere else for the coolant to go.  So once you find where it's going then you can work to fix it.

Losing coolant head gasket been done


Multiple Joomla Login modules

Question: Is it possible to have two login modules for a Joomla site?  I need both to be active and allow different access to different areas of the site.  What's the best way to do this?
Thanks for the help.
Answer: Your question is not actually asking the correct thing in joomla .
You can put as many login modules as you like on your site, but they will all use the same data in the Joomla user table to log the user in.
What you are looking for is either access control levels that allows you to control the content that each user sees,
or
you need components that maintain their own user
lists independent of the Joomla users table.
http://extensions.joomla.org/extensions/access-a-security/frontend-access-control

Multiple Joomla Login modules


Installing Blender on iMac OS X 10.10

Question: I installed Blender on my laptop (Windows 10) and things went well.
However, my desktop computer is an iMac (OS X 10.10 Yosemite). I have no understanding of the iMac -- at all. I read the answer to a previous question and read the guide to install on OS X.  I am totally lost.
Can you help me further?
I am familiar with GNU since I have used the GNAT developer.
Answer: You just copy/place the Blender folder in your Applications folder. To start Blender open the folder inside Applications, double-click on Blender icon and that's it. You can also drag the Blender icon and put it in your Dock for easy access.

Installing Blender on iMac OS X 10.10


Hey I have a moto g and I can't record longer then 3 mins

Question: If you can help me I have a Motorola G and I don't get paid often enough to worry about buying a actual camera and I like to record stuff with friends and I no matter what I try I can't record longer the 3 minutes now I've played around with settings and my video thing is on 720p and I still can't figure out what to do if you can help please do
Comment: Where are you saving? If it is external SD it should be formatted to `ext` as `FAT 32` has a 4 GB limitation on file size// also see if there is a *security lock Timer* or some such setting that is set to 3 minutes
Comment: I'm pretty sure it just saves to the phone idk how to save it to anything else
Comment: Try the app [mentioned here](http://android.stackexchange.com/a/45156)
Answer: Why not just change the video size in the camera settings to something lower? and there should be an option to set the storage location. The amount to recording time that will fit on the memory will depend on the size of that memory and the resolution settings you select for the camera.
To determine how much time a memory will hold, multiply its size by the number of minutes for the settings you set then divide that number by 60 to determine the number of hours. -
Exemple: 16GB SD card X 15 minutes per GB (720p @30fps on High resolution) = 240 min.


May I enter the UAE one day before visa expiry?

Question: I'm from India, living in the UAE. I'm going on vacation and returning to the UAE one day before my visa expires. Will I have a problem re-entering? I've heard that you have to re-enter at least one week before the visa expires.
Comment: @pnuts looks like a good answer to me (especially with the contact info).
Answer: You don't indicate what type of visa you have but, as you say that you live in UAE, and that can't be done on a visitor visa, and are Indian, most likely you have an employment permit which allowed entry, followed by a resident permit.
Despite news articles which suggest that visa renewal can be done while in UAE, other reports are contradictory.
During live chat with Ministry of the Interior agent Maha, and consistent with @pnuts feedback, you must contact Immigration before attempting to re-enter UAE:
Tel: +971 4 313 9999
Tel: +971 8 005 111
Email: email@example.com


How to automatically stay updated with the latest mainline kernel?

Question: Ubuntu manages a list of mainline kernels. If I wish to stay updated on a specific major revision (3.12.x), how can I automate this? And how do I stop Software Updater from suggesting 3.11.x kernels when searching for new updates.
Comment: What is the purpouse of gettins the mainline kernel? you do no get the specific ubuntu patches and are mostly for testing, not daily use.
Comment: My question was not whether it is a good idea, only how it's achievable. There could be any number of very valid reasons, really. For the purpose of this discussion, let's just say it's for improved ext4 performance and stability is dispensable.
Answer: Found a GitHub repository that does this: https://github.com/GM-Script-Writer-62850/Ubuntu-Mainline-Kernel-Updater

If you haven't used git before: sudo apt-get install git
git clone https://github.com/GM-Script-Writer-62850/Ubuntu-Mainline-Kernel-Updater.git
cd Ubuntu-Mainline-Kernel-Updater
chmod +x install
./install

Skimmed through the source, looks like it should work as advertised. Checks for updates 60 seconds after each startup. Will update here if I encounter any problems during next minor revision update.
Edit:
Enter KernelUpdateChecker -h at a terminal to see all available options.
I'm on 13.10 and would like to stay updated on 14.04's kernel versions 3.12.x (excluding release candidates), so I edited ~/.config/autostart/KernelUpdate.desktop line 7 to read:
Exec=sh -c 'sleep 60;KernelUpdateChecker -no-rc -r trusty -v 3.12'
Answer: If you want to move for kernel testing, get the required kernel from Ubuntu Kernels then install it.
After installing it, open software sources and make the selection for proposed updates also.
I mean

So whenever there is a new build, you will get the update automatically.
Comment: Thanks raj! Once I confirm this on next kernel minor revision update, I'll accept the answer. Way simpler than the workaround I found (see below).
Comment: I just read up a bit more on pre-released updates. I find it disingenuous that this was described as "If you want to move for Kernel testing", when the question was regarding staying updated on 3.12.x kernel and what you described will basically cause Software Updater to upgrade EVERYTHING with unstable, pre-released software.


Why did God create sleep?

Question: Is there any profound explanation why God created sleep for humans? Are there animals that don't sleep and rest by shutting down one hemisphere of the brain at a time, because that mechanism wouldn't be appropriate for us? There is also the question of the danger that sleep provides, something or someone can harm you when you are unconscious. People sleep for 1/3 of their lives, wouldn't that 1/3 be better used with some activity? In other words, aren't we throwing away 1/3 of life in exchange for certain benefits like purifying the subconscious or restoring the body?
Comment: I'm saying if G-d had created us without a need for sleep, He might have given us shorter lifespans with the same overall quantity of "productive" time. So it's valid to ask why we sleep, but asking why the time isn't better spent is speculating about counterfactuals.
Comment: You're assuming that our lives would be equally long if we were hypothetically created without the need to sleep.
Comment: No. I'm not ignoring the scientific discoveries regarding the need for sleep, but as I mentioned, there are animals that don't sleep like us and live normally. The question I posed at the end was more the utilitarian aspect in a theological connection than a scientific one, what is the good explanation for the existence of sleep, if there is such an explanation?
Comment: Sleep by science has a function, repair the body and mind. What I question is theologically, does spending 1/3 of life justify this aspect? Or does Judaism have something deeper to say about sleep that science has so far missed? For example, God created woman for man to satisfy the aspect of loneliness, sleep must have something deep that maybe we don't know or can't know beyond the scientific question. I'm just conjecturing if there's a greater explanation for why it exists.
Comment: We certianly are not throwing away 1/3 of life in exchange for certain benefits such as restoring the body. When you sleep your body repairs itself. That is a good trade-off.
Comment: Also, which animals do not require sleep? We could ask why do we need food and water. Some animals can live without food for a year. I think everyone needs water, to survive.
Comment: There are several animals that don't need to sleep like we do, they turn off one hemisphere of the brain at a time but remain conscious and doing their activities, some species of fish do this. That's why I questioned the need for human beings to completely disconnect to restore themselves, in addition to being dangerous since it leaves us vulnerable to attacks by predators or other people.
Comment: We do not know why God does what he does. Sleeping does restore the body and gives the body a rest.
Comment: Alas, does not Judaism maintain that with regard to the Gentiles work would never cease to justify their not keeping the Sabbath?
Answer: I don't know the source, but remember learning in class, that the reason G-d created us needing sleep was that so we can start the new day with a clean slate.
It is much easier to decide to make a change when you have a break after the previous day. If all the days would blend together with no break, it would be much tougher to decide to act differently. There is an old saying, "Tomorrow will be completely different". Sleep makes that possible.

If anyone knows the source, let me know. Sounds like something that would be found in a Mussar Sefer.
Comment: https://www.chabad.org/library/article_cdo/aid/2567/jewish/Why-Do-We-Sleep.htm
Comment: https://hebrewbooks.org/pdfpager.aspx?req=59252&st=&pgnum=112
Comment: This point of view is interesting, if we never slept we would live a life overloaded with repeated subjects and amended days, without beginning and end
Comment: @Thales prayer also assists in this problem
Comment: I always heard that sleep helps this way. "Tomorrow will be a new day" makes sense and is true.
Comment: @shmosel — do you know what the source for that statement of the Lubavitcher rebbe is?
Answer: There have been some great answers given so far. I would like to suggest another answer, I heard this answer on the Radio shows of Rabbi Mordechai Weinberger LCSW which I think is also based on the Rambam (book 3 chapters 10). The way Hashem made the world is dialectic, in order to understand sight we have to be able to blind ourselves. There is something, there is nothing. Each thing in the world needs an opposite in order to keep the world balanced.
One of the reasons this could be is as humans to understand we are "just a man" we will never be able to achieve or understand the ways of Hashem, as we are finite. We need dialectics to keep us alive. Sleep is a human need in order to keep us functional as a finite human. Otherwise the awake would not be awake.
Hashem created night as a way for us to show our powerlessness and show how the dialectic of us sleeping and letting Hashem be in control, helps us.
I have spoken to many people who have told me their issues with sleeping at night is because (anxiety)  they don't feel they can relinquish control. Often blaming it on bitachon and Emunah.
Answer: Rav Avigdor Miller was asked your question as well and explained (TAPE # 598):

Hakodosh Boruch Hu made this world for the purpose of recognizing Him.
Now, how can people recognize Hashem when they're so busy in this
world? You're thinking only of your own affairs and you forget about
Hashem. So Hashem says, "I'm going to remind you of Me." And so, you
get hungry. You have to eat, you need food, and then when you get a
piece of bread: "Oh, I thank You Hashem, what would I do without the
bread?! I can't live without bread." And the bread causes you to be
grateful, to love Hashem, and you're fulfilling your purpose in the
world.
Let's say, a person is tired; he's very tired, and his body gets worn
out. And now he needs sleep to feel rested. Are you going to just
sleep like a cat sleeps? So Hashem says, no. If you're able to go to
sleep, you have to thank Hashem for that. Some people can't sleep;
some people are sick and they can't sleep. Sleep is a blessing and you
have to thank Hashem for the sleep. That's why He makes you tired. Say
it with your mouth: "Ah geshmakeh pleasant night's sleep!" It's better
than eating the most delicious things! In the morning you get up, and
you're refreshed, you're a new person. מודה אני לפניך - "I thank You,
Hashem." So the sleep is the for purpose of causing people to be more
grateful to Hashem.
That's only one of the benefits of sleep. There are other benefits
too, but this is one of the benefits of sleep that is included in the
great program of making people more perfect in this world.
Answer: Whenever we are asked for a "profound reason" for something, the most profound we can go is to ask, what are we emulating in Hashem visávis that thing?
I've heard it in chassidus like this. Why did Hashem create the world? He was yachid, He was perfect, He was eternal. Why ruin that?
Why do we wake up in the morning from sleep? It is bliss that could last forever, it is problem free, it is comfortable and perfect. Why ruin that?
For Hashem, and for us, it's the same answer: because we want something.
That's the only reason we get out of bed, and that's why Hashem created the world. There is a desire to fulfil that is greater than the sleep, and that the sleep isn't going to accomplish.
Once a day, Hashem wants us to remember this concept, feel it in our bones. As NJM wrote in their answer via Rav Miller A'H, sleep is more pleasurable than food, ranking it very high in the list of human pleasures. And yet, we realise that purpose, meaning, and the pursuit of what is important are worth far more than remaining in a state of perfect bliss. We, l'havdil, emulate Hashem every day when we wake up and immediately connect to Him by saying Modeh Ani, like He does continually every moment; creates the world and seeks us; a Godly impulse, so to speak, that we are to study and understand, for His sake, as the Torah commands:

ושננתם לבניך ודברת בם בשבתך בביתך ובלכתך בדרך ובשכבך ובקומך
teach them [the words of Torah] to your children and discuss them, when you sit at home, and when you
journey on the road, and when you go to sleep, and when you rise.
Comment: Consider all the opportunities for kindness and mitzva unique to sleep. The closeness one has with ones children at bed time, with ones spouse, the opportunities to give someone a shelter and a bed, to make it comfortable for them, even one's servant! To let someone sleep and not interrupt, the opportunity to use sleep as a means to serve Hashem and others etc.
Answer: I heard that it's a way for Gd to humble humans. If we think we're so powerful and can be like Gd, Gd comes along and limits us and makes us dependent on sleep, shutting us down for a third of the day
Comment: Perfect, it is already something deeper than simply restoring us, this is a scientific and even evolutionary explanation, something that Judaism does not support.
Answer: Upon Hashem's completion of the world, the Torah writes how G-d observed His creation and commented:

"והנה טוב מאד"
"And behold it was very good" (Bereishis 1:31)

Ramban (on Devarim 6:13) brings a Midrash that explains that this term "very good" is a reference to sleep, which helps to invigorate a person and thereby ensure one can more readily apply themselves to Torah learning as well as all their physical requirements.

"And G-d saw every thing that He had made, and, behold, it was very good — this refers to sleep. Is sleep good? [It is 'good'] because, if a person sleeps a little, he rises and engages in the study of Torah."

In a similar vein, Rambam (Hilchos De'os 3:3) asserts:

"אם ישן לדעת כדי שתנוח דעתו עליו וינוח גופו כדי שלא יחלה ולא יוכל לעבד את ה' והוא חולה, נמצאת שנה שלו עבודה למקום ברוך הוא."
"If a person sleeps in order to allow his mind to rest and to give rest to his body so that he should not become sick and unable to serve G-d because of illness, in this case his very sleep is service of G-d. This is the meaning of the precept of the sages that 'all your deeds should be for the sake of heaven'"

Refer also to Pirkei D'Rebbi Eliezer 12:

מה עשה הב"ה ברא שנת חיים ואדם שוכב וישן והוא מזונו ורפואתו וחיים לו ומנוח לו, שנ' ישנתי אז ינוח לי
What did the Holy One, blessed be He, do? He created the sleep of life, so that man lies down and sleeps whilst He sustains him and heals him and (gives) him life and repose, as it is said, "I should have slept: then had I been at rest" (Job 3:13)
Comment: Thanks for the wonderful, diverse sources as always Dov. In this case I question if any of them address the OP's question? They are asking for a profound reason for the need for sleep, and as far as I can tell all of these answers presume that sleep is already needed (even though the Ramban isn't using it that way in his question, his answer turns out like that it seems!) and what do we do to make it into a Divine service. Is that therefore your answer? Just another aspect of life to make into a Divine service? Is that profound, given as it's an answer that applies to every aspect of life?
Comment: @RabbiKaii I heard it from somewhere, that when we sleep our soul or spirit rises to the presence of God and there we have a dialogue with Him. Is this grounded?
Comment: @Thales yes, see Derech Hashem 3:1:6
Comment: @RabbiKaii - I would argue being able to serve G-d at the requisite level is pretty profound...
Comment: @Dov the klal of being able to turn every aspect of life into Divine service is intensely profound, shkoyach for recognising this! What, b'phrat in sleep is profound?
Comment: @Dov asking out of genuine eagerness to see what you saw as I didn't see it. I'll think about it tonight as clearly the Ramban especially is a very profound statement. What am I missing? Help me
Comment: The way I see it is less about the physical lift / curing ailments etc it gives a person but first and foremost that this invigoration serves to enhance our avodas Hashem i.e. in other words, it is predicated on the need to be able to learn Torah and perform Hashem's mitzvos at a heightened level which we wouldn't be able to do if we never slept.

Why did God create sleep?


Will Allah forgive the Satan (Al-Shaytan/Iblis) if he decided to repent to Allah?

Question: Okay, this has been on my mind the whole day. And after searching the entire internet, articles, youtube videos and what not, I cannot find a legitimate answer anywhere. So, I decided to post the question here myself.
PLEASE NOTE: The question isn't why Allah didn't forgive Iblish when He forgave Adam (AS) and Eve (RA) for their sins. The Question is WILL ALLAH FORGIVE Iblish IF he decides to REPENT TO ALLAH (SWT).
I came across a Dr. Zakir Nayek video during researching and while it did not answer the question (not even close) he mentioned that Allah (SWT) has filled Iblish's heart with sins (and Allah [SWT] knows the future- yes, undoubtedly). Why would He fill his heart with sins? Isn't it contradicting with the FREE WILL we Mankind and the Jinn possess? What if the Devil finally came to the realization of his horrible mistakes and decided to seek Allah's forgiveness? For indeed Allah is the most Merciful and the most Forgiving, will Allah (SWT) not forgive him? If no then why not?
Comment: Salam and welcome to Islam SE the Q&A site about Islam. I strongly recommend you to take our [tour] and check our [help] to make yourself familiar with our site and model.
Comment: Related: [Will Satan be Forgiven?](https://islam.stackexchange.com/questions/45813/will-satan-be-forgiven)
Answer: Consider that this was Allah's (ﷻ) response to Pharaoh (Firown) when he "repented" after all his evil and the punishment overtook him: "Now? And you had disobeyed [Him] before and were of the corrupters" - Qur'an 10:90-91. In the end, Pharaoh's repentence was not accepted. I imagine the same would be the case for Iblis if he 'repented.'
Repenting when it is too late/inappropriate is fruitless.
Moreover, 'hypotheticals' are not real. Allah (ﷻ), the All Knowing and Seer of the Future, only declares something to be true when it is true. One example: he knew Abu Lahab would die upon disbelief, thus He declared this before he even died! (Sure people could think, "what if he repented"; but clearly he had no intention to and indeed did not! SubhanAllah).
Likewise, he declared Satan to be cursed.. which indicates Satan has no intention to repent and in fact will not repent!

"Why would He fill his heart with sins? Isn't it contradicting with the FREE WILL we Mankind and the Jinn possess?"

Whether Satan or anyone else (from humans or Jinn), Allah (ﷻ) only gives you what you choose. If you choose good, Allah (ﷻ) increases you in good. And if you choose evil, then you are increased in this as well. He says this in various places throughout the Qur'an. e.g., "In their hearts is disease, so Allah has increased their disease" - Qur'an 2:10.
Satan was envious of Adam.. to the point of refusing belief. He chose this for himself.
Answer: Allah forgives Adam and Eve by teaching them the Dua.
That is because they only disobeyed.
Iblees Was among angels when commanded to prostrate to
Adam. All angels obeyed but Iblees refused claiming he was made of fire and better than Adam who was made of
dust. This is arrogance so he was cursed for all time.
Adam and Eve were forgiven.
The first and worst crime is arrogance,
Comment: To be clear, Iblees is a Jinn and unlike the angels, he has Free Will.
Comment: Iblees was never an angel, he was a Jinn named Azazeel, Angels cannot be arrogant as they do not have complete free will, they do as commanded by Allah only. Whereas, man and jinn have free will.
Comment: Ibless justified his action of not prostrating inspite of God's command and held God responsible for leading him astray. This is height of arrogance. If he was so sincere to God, he would have obeyed God without any ifs and buts like Abraham did.
Answer: Many people answer by saying that Satan is cursed hence he will never repent. It is very unfortunate that all of the believers have misunderstood their Lord. The Lord is not like that, and there is a chance for the one who despaired, to repent and turn back. Anything is possible, as long as the fundamental principle of Allah's Oneness remains intact. The curse can be lifted, and the one who despaired, can be saved. There is a far bigger wisdom behind the creation of humanity, and iblis rebelled and declared enmity towards mankind due to his own misunderstanding.
He can be saved, but another devil is then bound to take his place in misleading humanity. Allah is a God of Peace and Harmony and Justice, He does not take pleasure in punishing his creations. The command of prostration to adam was indeed a test for lucifer/iblis, but it was also a huge test for the angels as well, and yes, angels also have free will, but you were all misinformed. Iblis was bound to fall astray, but he can turn back. Once the true wisdom behind the creation of mankind comes to light, all the angels will have their faiths shaken, and most of them will swoon to the blast of the trumpet for this very reason. Never underestimate the mercy of God. I hate satan as much as anyone else, maybe even more. But redemption must come before destruction.
Comment: Ibless justified his action of not prostrating inspite of God's command and held God responsible for leading him astray. This is height of arrogance. If he was so sincere to God, he would have obeyed God without any ifs and buts like Abraham did. By having complete knowledge of what he did, he has chosen to oppose God and destroy mankind. He never had and never will have, any intention to repent for his actions.


how to create a custom field in nuch search engine?

Question: i want to create a custom field in nutch search engine?
what are the steps i will follow?
Answer: I would think your best option is to develop a Nutch Plugin which handles the logic for adding that field on a per crawled page basis.
Please see the Writing Plugin Example wiki article on the Nutch site.


GA Skill for checked in guests

Question: We are building a GA skill which lets hotel guests use room service using GA voice.
When a user interacts with GA, the information is sent to my system, which then sends the alerts to hotel staff to do the room service tasks like change bed sheets, repair AC, pick up laundry or even book a table in the same hotel (Not in form of transaction).
My skill got rejected because GA testing team consider in a regular B2C skill where anyone will be able to use the skill (In our case only checked in guest can use the skill) and consider every action as a transaction and found it misleading.
Is there any channel where we can describe the business case in details before submitting the skill?
Answer: You can include in the testing instructions information about the environment and how you expect it to work. Feel free to be as detailed as possible to help them understand.
It sounds like you need to use account linking, so you needed to provide a test account for them as well. This is another opportunity to explain what this test account emulates and how you see it being used.
Finally, since you've been rejected, you can reply to that message to further explain why you don't need to use transactions and how the connection is intended to work. Again - be as detailed as possible. But also be willing to listen and try to understand where they are coming from.

GA Skill for checked in guests


How do market makers chose the size that they quote?

Question: A typical quote in the derivatives market may be 2.00 bid at 2.50 ask with a size of say 100x100. How do practitioners go about choosing the size of the market (how many contracts) to quote? It seems to me that it should be proportional to their edge as well as their capital; a sort of Kelly criterion approach.
Comment: Also the risk parameters maybe, right? Maybe Liquidity?
Comment: Probably yes. The way I was thinking of it was very simplified: Suppose you have 1000 capital and have given a bid ask spread that represents an 80% confidence interval. This means you expect the true price to be between your bid and ask about 80% of the time. Then, whether you get hit or lifted you end up with a bet that is wrong 10% of the time and right 90% of the time. So your edge would be 90-10=80% and kelly would advise you to bet 80% of your 1000 bankroll = 800$ on this trade. So say you are quoting 1 bid at 2 ask. Then the sizes you quote would be 800x400.
Answer: @chrisaycock raises a valid point about the process not being particular rigorous.
There are reasons why it is not a rigorous or optimized sizing mechanism.
1) most market makers are quoting many strikes & expirations, usually multiple underlying assets these days. Depending on venue there may be ways to limit the number of executions, eg, exchange side safeties or simply due to the fact that salespeople need to get the attention of the trader in some sort of order.
2) much of market making is setting prices in such a way as to either balance order flow or synthetically balance order flow by trading other options against fills (static hedging).
3) flows can be one way. most recently in bond options during March 2020. there was no realistic way to balance flows. it is very unusual but it does happen.
4) often there are external reasons for setting quote sizes. for instance, the matching engine might use a pro-rata process for allocation which encourages larger trading or on a bank desk there might be pressure to satisfy an important client.
5) re: 3, the big concern of a market maker is not the fill you just got, but the question "where are you now?" For example, I'll buy your 100, how are you now? and then all of sudden a 100 lot becomes a 700 lot and before the market maker has a chance to offset, there is a large loss and the position is very lopsided.
So the issue is that theoretical optimization is a lousy idea for market making. It works fine in an environment that a trader has significant control over, e.g., proprietary trading. Market making is an unknown that involves significant uncertainty about positions, order flow, asset price path, and even regulatory & event risk. Therefore it means that the correct answer will be significantly below an optimal calculation in order to stay solvent. How much so is a business decision.
Answer: Liquidity. If you are a market maker, you should be able to flip the order you just made as early as possible, with as much profit as you can. Volatility and Volume are the prime factors for market makers.
They establish their own internal rules and adhere to them. Say a company will only participate in buying options, in certain range of options/Equity, where their order volume is < 2% or 5% of market volume and has ~4 or 5 % vol. However when they are writing options, the opposite is true (for some, depending on their strategy).
Volume & the number of bids aid in identifying the size of the orders to be placed. For options, which are out the money, if the volume exists, you can write options with a higher price, than the actual value of the option.
Comment: @roz Unfortunately I've never seen a particularly rigorous approach. It's always been, "Let's start at 100 and we'll increase it if we make money."
Comment: Of course liquidity is a factor, but I am asking about a rigorous/quantitative approach. For example, one method would be to quote in a size that corresponds to betting an optimal fraction of your bankroll on each trade.
Comment: @chrisaycock in your experience do you think that using something like the kelly criterion extended to account for continuous outcomes and the skewness of option returns would be a good place to start or is their some fundamental reason/uncertainty why an approach like this would not work?
Answer: The minimum size can be enforced on the market maker by the exchange or regulator. For example, some bond markets demand that market makers show a minimum size and spread for a certain period of the trading day. However, in personal experience the major drivers have always been liquidity and latency, with each working antagonistically to determine my quote size.


cgi-bin : What's the importance of cgi-bin folder in web security and application development

Question: Most famous and wide using website( like https://www.sandbox.paypal.com/) are using cgi-bin folder to place there files. Is any importance to use cgi-bin folder in web application development or get any kind of security to put files in cgi-bin folder.
Answer: Regarding PayPal, I believe that have done it because their site was initially built on the basis of Per web application that were traditionally built using cgi technology.
Generally, for the purpose of extra-security measures its better to place all of your code (classes, interfaces, functioncts, third-party libraries, etc) outside your DOCUMENT_ROOT folder. It is especially important when your application is divided into several parts - like controller, model, view, templates because prevents the malicious user from trying to call each part of the application separately when he is looking for vulnerabilities. It also important for files that store sensitive data, e.g. database credentials - you do not want them to be fetched by a hacker. By moving everything from DOCUMENT_ROOT into cgi-bin folder you do not gain much of a security since the everything in cgi-bin folder has to be accessible from the Web and thus a hacker can still call/open any file residing in them. It would be much better to move the code and sensitive files off to a directory not available from the web and leave only the file with the entering point to the application (index.php, for example). as well as static resources (Javascript, image files, etc.) in it.


Multi-threaded access to C# dictionary

Question: I understand that C# dictionaries are not thread-safe when it comes to adding, reading and removing elements; however, can you access the Count Property of a C# dictionary in a thread safe way if another thread is writing, reading, and removing from the dictionary?
Comment: Do you expect it to return the correct value?
Comment: Or just use a ConcurrentDictionary... http://msdn.microsoft.com/en-us/library/dd287191.aspx
Answer: Since property is a method call under the hood hood so really situation is not such simple as at first glance.

T1: Accessing Count property
T1: get_Count() call (some kind of JMP/GOTO ASM instruction)
T1: read variable which represents a number of items == 1
T2: addign a new item, real count becomes 2
T1: returns 1 but really there are already two items

So if an application logic relies on a Count property value - theoretically you could ends up with race condition.
Comment: Because the property can not be directly written to it is not at all fine to read from it concurrently. The latter does not follow the former. This is dangerous thinking.
Comment: right I was in process of writing my answer, initially my thinking was wrong, you are right
Answer: It should be threadsafe in that it won't blow up, but I'm fairly sure it is not threadsafe in that it might not give you the correct count due to other threads manipulating the dictionary.
[Edit: as usr points out, just because it's currently threadsafe at this level does not mean that it will continue to be so. You have no guarantees]
Answer: First: This is dangerous thinking. Be very careful if you put such a thing into production. Probably, you should just use a lock or ConcurrentDictionary.
Are you comfortable with an approximate answer?
But: Reflector shows that count just reads some field and returns it. This is likely not to change forever. So you reasonably could take the risk in this case.
Answer: You could create the dictionary as a static readonly object, and lock it when modifying it... that should deal with most problems, I would think.
Answer: Depending on what you want to achieve, you can protect the dictionary with a ReaderWriterLockSlim. This way you can have faster reads and only lock the dictionary when performing mutating operations.
Answer: Rather than assuming, I went and looked at it in reflector:
public int Count
{
    get
    {
        // count and freeCount are local fields
        return (this.count - this.freeCount);
    }
}

So yes, it is "thread safe" in that accessing it will not cause corruption in the dictionary object.  That said, I am not sure that I can think of any use case where getting the count with any accuracy is important if the dictionary is being accessed by another thread.
Comment: Do you think I just write comments without reading whole answer? `I can think of any use case where getting the count with any accuracy is important if the dictionary is being accessed by another thread.` Correct but limited with your imagination.

Multi-threaded access to C# dictionary


Best way of mentioning specific non-famous/named theorems in my Statement of Purpose (SOP) for PhD math

Question: In my SOP for PhD math in US grad schools, I am mentioning a specific instance where I came up with an easier solution to a problem using elementary theorems, instead of using more complex theorems. Here I'm trying to mention the names of theorems that I could have used and one of them is a non-famous/named theorem (Theorem 16.4c in Willard's General Topology) from a famous Topology text. What is the best way to mention this result? Even though there is no word limit, I don't think quoting the entire thing would be wise. I could just mention its number and mention the book in the references or I could try to summarize it as a "Separability criteria for the product space of non singleton hausdorff spaces". Or should I avoid mentioning any theorems at all?
Comment: What is an SOP? It might be obvious to someone from the US but to anyone here, it is/would-be meaningless?
Comment: I may not advise on SoP for US PhD applications (so not a full answer), but a proposed scenario where the committee has to look up a somewhat obscure reference can not be good. Summarizing seems like a much better choice here, but even then stating the problem you were able to solve and not going into great detail about the solution might be preferable. Unless it was a particularly elegant/strong result, in which case you should be able to summarize it well ;)
Comment: @CrimsonDark My bad, SOP=Statement of Purpose. I've edited it in the title.
Comment: Was any of this published? If not, what assurance do you have that it is correct?
Comment: @Buffy Oh, this wasn't an open problem, just a tough exercise that I wanted to mention since having multiple ways of solving problems is one of the things that attracted me to topology. I read in SOP guides that one should mention specific events from one's past that made them interested in their field, instead of generic sentences that could apply to anyone so I thought including specific names would be helpful. My professor and posts on Math Stack Exchange confirmed that its correct.
Answer: Other questions imply that you are not from the US. You don't have a good understanding of the SoP here. It is future focused. It is about your goals for both study and thereafter. Why do you want to study this subject at this place and what do you hope to do thereafter.
If you focus the SoP on the past you are wasting an opportunity. Especially focusing it on "successes" in coursework is a poor use of the words you have - even if there is no specific limit. People will tend to stop reading if it is too long in any case.
However, if you want to study in the specific area of these math topics then say that and mention, in a phrase, that you have experience there already and have produced some simpler proofs than what you find in the literature.
But, IMO, more important than the specifics of those proofs is what insight you have gained in proving them that (this is the important part) makes you especially suited for further study in this area. "This is what I want to do, I have some skill here, and have had a bit of success already".
Prepare to be asked for details, but the details shouldn't be in the SoP. The CV is the place for that, though I realize that for one application at least you aren't being asked for one.
But, focus on short and long term goals and how you hope to achieve them. Statement of Purpose.


301 Redirect specific page with ModX Evo

Question: I have this in my .htaccess file:
<code># For Friendly URLs
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
</code>
I want to redirect the url /sale to the new one /gift-sales So I have added this to the above:
<code>RewriteCond %(THE-REQUEST)^sale$
RewriteRule ^(.*)$ /gift-sales [R=30,L]
</code>
In the ModX backend I have, of course, changed the alias to gift-sales, but I cannot seem to get the redirect working. Can anyone point me in the right direction?
Answer: try this:
<code> RewriteRule ^/sale  http://www.mydomain.com/gift-sales [R=301,L]
</code>


Worker function of the thread is not taking value 0 as arg and pthread_join is giving me segmentation fault

Question: I am trying to do matrix multiplication by creating the threads equal to no. of rows equal to no. of threads. The worker function is taking the index of first loop as argument but for 0 index function isnt working and for some strange reason worker function showing reptation of values.
This is the worker function:
void* multiplyMatrixRows(void* arg) {
    int i = (*(int*)arg);

    printf("%d Loop \n", i);

    for (int j = 0; j < result.cols; j++)
    {
        result.data[i][j] = 0;
        for (int k = 0; k < mat2->rows; k++) {
            result.data[i][j] += mat1->data[i][k] * mat2->data[k][j];
        }
        //printf("Value of Result: %d \n", result.data[i][j]);
    }

    pthread_exit(NULL);
}

And for some reason pthread_join also giving segmentation fault but work fine if I remove the comments and let them print those lines from code below:
pthread_t* threads = (pthread_t*)malloc(mat1->rows * sizeof(pthread_t));

    struct timeval start, end;
    for (int i = 0; i < result.rows; i++) {
        //printf("Entering thread %d \n", i);
        pthread_create(&threads[i], NULL, multiplyMatrixRows, (void*)&i);
        //printf("After thread %d \n", i);
    }

    for (int i = 0; i < result.rows; i++) {
        //printf("Entering join %d \n", i);
        pthread_join(threads[i], NULL);
        //printf("After join %d \n", i);
    }

mat1, mat2 and result are global variables here.This is the output. It is showing with which value of i you entered the worker function
I thought of using pthread_mutex_lock in main function as it is sending value for i but what is the use of lock in main thread. I tried printing values of i before and after creating a thread, it shows correct value of i but not in worker function. It would be really helpful if someone could help me with this.
Comment: probably you accesss those arrays outside its bounds
Answer: I don't know if this is your only bug, but this line definitely has a bug:
pthread_create(&threads[i], NULL, multiplyMatrixRows, (void*)&i)

You have only one variable i, you pass a pointer to that variable to every thread, and you don't have anything to prevent the initial thread from changing the value of i, possibly several times, before each thread has a chance to read the value intended for it.
The simplest fix is to pass each thread the value you wanted to give it, rather than a pointer to a variable that, at one moment  in the past, contained the intended value:
// add to top of file if not there already:
#include <stdint.h>

// change first line of multiplyMatrixRows to:
int i = (int)(intptr_t)arg;

// change pthread_create call to:
pthread_create(&threads[i], NULL, multiplyMatrixRows,
               (void*)(intptr_t)i);

You may have heard that casting between pointers and integers is risky, and that's true, but this particular pair of casts is safe.


How to make hard candy with only fruit as a sweetener

Question: I have a child with a restricted diet that can have no added sugar or other form of sweetener, with the exception of fruit juice.  He is in desperate need of cough drops or throat lozenges, but I find they simply don't exist without some form of added sweetener in them.  My idea was to craft a hard candy with just fruit juice as sweetener, and then just add menthol or something similar for soothing cough/throat.  But I also can't find any recipes for hard candy using only fruit juice as a sweetener.  Is it because the sugar or corn syrup, etc is needed to make the candy hard??  Is what I am trying to do even possible?
Comment: Sugar free cough drops are all over the place... Are those not acceptable?
Comment: Does it need to be a hard candy, or would a soothing syrup be okay?  A spoonful of apple juice concentrate (maybe with some added pectin, if you can find some that's not too acidic) could help a sore throat.

You could take it a step further and use fruit juice and pectin to make gummy candies.  Again, it's not a hard candy, but sucking on them could provide some relief.
Answer: I think classic hard candy would be difficult if not impossible to make with fruit juice because it combines the fruit sugars (fructose) with a lot of other things, and hard candy is normally made by heating sucrose (table sugar, which is 50% fructose, 50% glucose) to the hard-crack stage (300-310F) to the point where it is essentially 99% sugar.  As the sucrose heats it  hydrolyzes into glucose and fructose which changes the structure.
Pure fructose does not behave the same way as sucrose. I think you need some glucose to get it to form into a hard candy.  (You can also make hard candy from sugar and high fructose corn syrup instead of from table sugar.)
Additionally,  fruit juice isn't pure fructose to begin with and the other things in the juice would cause problems with the process and would probably scorch.
I think the idea given in the comments of trying for a gummy or a syrup will work better.
Answer: I have made hard candy with pure fruit juice, and it is still hard candy at the end of the day.
Anyone who has overcooked their jam knows that it sets hard, like candy... so does cooked fruit juice, with sugar or honey
Comment: For the purpose of this question, "cooked fruit juice with sugar or honey" is the opposite of "only fruit as a sweetener".


Minimal substitution, four-potential and units

Question: When we make the minimal substitution
\begin{equation*}
p^\mu\rightarrow p^\mu+\frac{e}{c}A^\mu
\end{equation*}
the four-potential $A^\mu$ must be proportional to $1/e$ in order to ensure the whole term has units of momentum. However, in the Maxwell equation
\begin{equation*}
\partial^\mu\partial_\mu A^\mu=\frac{j^\mu}{c}
\end{equation*}
it seems that $A^\mu$ must be proportional to $e$, in order to account for the factor of $e$ in $j^\mu$. Can anyone tell me what is going on here? What am I missing?
Answer: You're just missing that there is something proportional to $e$ also in the four-potential $A_\mu$ since $A_\mu=(\phi,\vec{A})$ where $\phi$ and $\vec{A}$ are the scalar and vector potentials.
The dimensions are OK. We have that

$cp_\mu$ and $eA_\mu$ are energies;
$j_\mu/c$ is a charge density,

then, if you multiply for $e$ at both the sides of the last equation, we have
$$
\partial_\mu\partial^\mu eA^\nu = \frac{ej^\nu}{c}
$$
and from the left member we see that both sides must be energies divided by square meters. We check that this is true for the r.h.s.: it is a square charge density and, keeping in mind that $e^2/r$ is an energy, than it is an energy divided by square meters.
Comment: Thanks for your reply. For the Klein-Gordon equation, however,  $j_\mu$ has dimensions of $ecp_\mu/V$, where $V$ is volume, so how does that work?
Comment: In which Klein-Gordon equation?
Comment: For the Klein-Gordon equation\begin{equation*}
(p_\mu p^\mu-m^2c^2)\phi=0
\end{equation*}it is common to define\begin{equation*}
j^\mu=2p^\mu c|N|^2
\end{equation*}where $N=1/\sqrt{V}$.
Comment: In the KG equation you wrote there's no electromagnetic interaction and the last definition of $j^{\mu}$ is not the same current as before.
Comment: Yes, that is the free K-G equation, but if we add an EM interaction via minimal substitution and define the current as in the last definition, what happens with the Maxwell equation?
Answer: This is a result of people using different systems of units in different parts of the physics course. Rewriting in SI,
$$p^\mu \mapsto p^\mu + e A^\mu,$$
$$\partial^\mu \partial_\mu A^\nu = \mu_0 j^\nu,$$
we can see that the vacuum permeability $\mu_0$ appears. One could say this has the potential to cancel two units of $e$ per, for example, Ampère's force law, where $\mu_0 I_1 I_2$ appear on one side and only mechanical quantities on the other. The discrepancy vanishes.
Or, better, you can easily find the exact units of all the quantities present here. Some are easy to remember or rederive from basic definitions,
$$\begin{aligned}\
[p] &= \mathrm{Js/m}, \\
[e] &= \mathrm{As}, \\
[j] &= \mathrm{A/m^2}, \\
[\mu_0] &= \mathrm{Vs/(Am)} = \mathrm{J/(A^2m)}, \\
\end{aligned}$$
and $\partial^\mu \partial_\mu$, being a second derivative by coordinates, applies $1/\mathrm{m}^2$. From either equation one can easily derive
$$[A] = \mathrm{J/(Am)}.$$


Solar panel and LED

Question: I just obtained o solar panel which shows a max output of about 18-19 votlts . I put it in partial shade to get an output of about 2.7 volts and connected it to an LED ensuring the correct positive and negative legs. But the LED failed to light. Other small appliances and toys using 3-6 volts also failed to work. Any suggestions ?
Comment: Solar panel data sheet?
Answer: Use a series resistor with the LED to limit the current (220R, say), you could damage it otherwise.
Measure the panel voltage when you have the item connected to it. You will probably find that it drops well below the 2.7V you were getting with no load. and is too low for it to work.
Assuming that the panel has enough output in full sunlight, you will need a suitable regulator to power low voltage items. Switchers are often used, because of their high efficiency.
Answer: Make sure the panel is supplying enough current. Current is what determines if an LED lights up, not voltage. That is to say, even if you have 1.7V (enough volts) but are only able to supply 0.3mA your LED won't light if it needs 1mA.
Answer: PV (photovoltaic) or solar panels are close to being constant current devices with current out being close to proportional to light levels.
The voltage output of a PV cell is close to constant across its usual working range.
Only by reducing light levels to a very ow percentage of full power can you get the voltage to drop substantially.
This means that if you shade an 18V panel to the extent that it is only providing 2.7V, the illumination level will be exceedingly low, so that the available current will be close to zero. LEDs driven with close to zero current produce close to zero light out :-).
If you MUST use am 18V panel to drive a 2.7v load, you can load it with a 2.7V voltage clamp (such as a zener diode or a number of silicon diodes in series, so that when the load conducts the voltage is clamped to their forward voltage at the panels operating current.
In full sunlight the current at 2.7V will be close to the panel's shortcircuit current which is about 10% to 20% higher than the panel's maximum power point current.
I max_power = Watts max power / Vmaxpower
eg If you have a 1 Watt  panel then Imp ~= 1W/18V ~+ 55 mA.
So for a say 6W panel Imp = 6W/18V = 330 mA.
Your load needs to be able to handle that much current and dissipate the power provide. (Whether an LED or motor or other device)..
Power = V x I = 2.7V x Imp x 110% or so in this case.
You can get 2V7 zeners diodes BUT a 3V3 would be better - allows most white LEDs to be driven. Or you could use about 5 x silicon diodes in series. 5 x 0.6V = 3V. As current rises Vf_diode rises and depending on diode and current may be between 0.6V amd 1V. (1V unusual). Using a string of eg 1N400x diodes allows you to clamp about 1A of continuous current..
Comment: Correct for the current output, but for the LED what is important is not the voltage but the current flowing through. If you use a zener, a resistor in serie with the LED is still required to limit the current through the LED otherwise it will be destroyed. Also depending of how much current the panel will produce the Zener has to be sized accordingly is not really a device to dissipate power. A LDO or even better a current limiter would be more suited to that usage.
Comment: @Damien Your comment has merit but is too broad to be useful in this context. Your comment about LED current needing to be designed to be <= I_LED_max is correct, but that was not a detailed part of the discussion. While a series resistor is a common way to limit LED current that would be hard to design in Panel_Wmp was >> W_LED_max. Whereas eg an 18Vmp, 6W panel has Imp of 333 mA and Isc of typically about 370 mA so an eg 1W LED connected directly across the panel would draw a max of Isc ~= 370 mA and run at about 1W ) eg 3V x 0.37 = 1.1W. 3.3V x 0.37 = 1.2 W. ...
Comment: ... @Damien ... Whereas using a series R at say 300 mA would dissipate about (18-3.3)V x 0.3A = 4.4W for ~= 1W in the LED with no "wasted" power. Using a non-switching regulator or current limiter would still dissipate about 4W of wasted power.
...
Comment: If he / you work through what I said you will find that it is (1) correct on all key points (2) addresses the points you raise. | I noted that PV panels are essentially constant current devices in their normal operating range, that when Vout is 2.7V for an ~= Vmp 18V panel that Isc will be much lower than 2.7/17 x Imp. I noted that Imax in full sun will be about Imp x 1.1 and a clamp or load must handle this, that whatever load needs to be applied must be capable of accepting the delivered power, that a clamp load needs to be "suitable" (eg 5 x Si diodes (eh 1N400x) .
Comment: @Damien As a result of your input I went back and fixed up various typos and spelling errors and made minor changes to the post proper. The two sentences which end in .. rather than . are added to not change the meaning but to increase its understandablity in the area that you suggested.

Solar panel and LED


What are the limitations in Synapse Analytics compared to normal SQL Server?

Question: I'm keen to get a list of the feature limitations or suprises when using Synapse Analytics (a.k.a. Dedicated SQL Pool, used to be known as SQL DW / SQL Data Warehouse) compared to using normal SQL Server. Basically the things that you would expect to be there, but aren't.
Comment: This is a pretty broad question because they're just different technologies for different purposes, TBH. Kind of like asking "*what's the difference between PowerBI and PowerPoint?*"
Answer: I will edit this answer to include new limitations as I find them.

Unable to use expressions (such as GETDATE() or SUSER_SNAME()) as defaults in tables. Only constants can be used as a default.
Unable to use expressions (such as GETDATE() or SUSER_SNAME()) directly in INSERT statements. Only constants or variables can be used.
No triggers - limiting your options for auditing
No ownership chaining - according to this comment from 2021 this is coming in the future
No cross-database queries - also apparently a future feature
No FOR XML/FOR JSON clauses
No geospatial data types such as geography and geometry
No support for these data types: hierarchyid, image, text, ntext, sql_variant,xml source
No EXECUTE AS, including inside CREATE PROC
No support for cursors (see alternatives)
IDENTITY: Synapse is implemented as 60 shards, refered to as "distributions". Each distribution increments its identity independently. In effect, distribution 1 has IDENTITY(1,60), 2 has IDENTITY (2, 60), and so on. Which value a new row receives will depend on which distribution it lands on. So a later row may have an identity that is less or greater than an earlier row.
There is no means to create an offline .BAK or .BACPAC (with data), so your backup options are limited to the 7 days retention Microsoft provide, or creating copies of your database (which will incur storage costs if paused, or storage & compute costs if running). (You could ETL all the data to a normal database and then make a BAK/BACPAC of that).
Cannot use Table variables - i.e. DECLARE @MyTable TABLE (A_Column int) will fail. You have to use temp tables instead. source
Cannot create UDF's
Cannot start a Procedure from the SSMS GUI, you need to execute code
Cannot INSERT multiple rows using VALUES. e.g.: this won't work: INSERT INTO dbo.MyTable (MyField) VALUES ('ABC'), ('DEF')

Other references:

This article goes into differences between Dedicated and Serverless pools in Synapse
Answer: That Synapse DB is optimised for throughput rather than latency leads to different application design.
Concurrency slots and workload management require consideration.
Answer:
When creating a table with primary key, SQL server add constraint clause automatically. These DDL code does not compile on Synapse Dedicated SQL, you need to remove the constraint before running the code.
Effectively:
CONSTRAINT [PK_DimCustomer] PRIMARY KEY CLUSTERED ([DimCustomerId])

became:
PRIMARY KEY NONCLUSTERED NOT ENFORCED,

Could not create UDF's

You cannot start a Procedure from the SSMS GUI, you need to execute code


Installing a Software Package On Clients From The Server

Question: I've need to install a software (NetOpSchool Software and a Antivirus) and I have a server client based set of computers which is connected. I want to know how to install a software from the server other than installing it one by one in the client machines.
Comment: do you have active directory in place
Answer: There are readily available automated software deployment tools. In your panic you have neglected to tell us what platform you're using but as NetOp School appears to support only Windows (unlike some of their other products) I guess you want a Windows tool.  Have a look at WPKG.


Who first proposed the idea of citizens having to wear bombs?

Question: Who was the first to propose in speculative fiction that citizens all wear bombs that could be remotely activated as a measure to keep people obedient to the law? The earliest I can think of was Jack Vance in The Faceless Man (originally serialized in 1971, later published as a novel, The Anome or The Faceless Man). In this work, citizens of the land of Shant wear explosive collars that can be detonated by radio waves transmitted by the anonymous ("faceless") ruler, who travels unknown among his countrymen. Lawbreakers are decapitated by the explosion. Did Vance have some inspiration from a previous work, or was this wholly original?
Answer: 1955: "A Ticket to Tranai", a novelette by Robert Sheckley, first published in Galaxy Science Fiction, October 1955, available at the Internet Archive. In a way it's the opposite of what you asked for—it's the government officials, not the ordinary citizens, who wear the bombs—but I think it's close enough to have possibly inspired the works you're interested in. (On the other hand, it seems likely to me that each writer who used the idea thought of it independently.)
The viewpoint character, an immigrant from Earth, learns about the Citizen's Booth:

He was kept so busy that he had practically no time to explore further the mores and folkways of Tranai. He did manage to see the Citizen's Booth. This uniquely Tranaian institution was housed in a small building on a quiet back street.

Upon entering, he was confronted by a large board, upon which was listed the names of
the present officeholders of Tranai, and their titles. Beside each name was a button. The
attendant told Goodman that, by pressing a button, a citizen expressed his disapproval of that official's acts. The pressed button was automatically registered in History Hall and was a permanent mark against the officeholder.

No minors were allowed to press the buttons, of course.

Goodman considered this somewhat ineffectual; but perhaps, he told himself, officials on Tranai were differently motivated from those on Earth.

He learns more about it as he is about to assume the Supreme Presidency of Tranai:

"There must be certain formalities to go through—"

"No formalities," Borg said, his face shining with perspiration. "None whatsoever. All we do is hand over the Presidential Seal; then I'll go down and take my name off the rolls and put yours on."

Goodman looked at Melith. The immigration minister's round face was expressionless.

"All right," Goodman said.

Borg reached for the Presidential Seal, started to remove it from his neck—

It exploded suddenly and violently.

Goodman found himself staring in horror at Borg's red, ruined head. The Supreme President tottered for a moment, then slid to the floor.

Melith took off his jacket and threw it over Borg's head. Goodman backed to a chair and fell into it. His mouth opened, but no words came out.

"It's really a pity," Melith said. "He was so near the end of his term. I warned him against licensing that new spaceport. The citizens won't approve, I told him. But he was sure they would like to have two spaceports. Well, he was wrong."

"Do you mean—I mean—how—what—"

"All government officials," Melith explained, "wear the badge of office, which contains a traditional amount of tessium, an explosive you may have heard of. The charge is radio-controlled from the Citizens Booth. Any citizen has access to the Booth, for the purpose of expressing his disapproval of the government." Melith sighed. "This will go down as a permanent black mark against poor Borg's record."

"You let the people express their disapproval by blowing up officials?" Goodman croaked, appalled.

"It's the only way that means anything," said Melith. "Check and balance. Just as the people are in our hands, so we are in the people's hands."

"And that's why he wanted me to take over his term. Why didn't anyone tell me?"

"You didn't ask," Melith said, with the suspicion of a smile.
Comment: Not bad! It could well have acted as inspiration. Given our recent history, I think Sheckley overestimated the public's sanity with regard to Citizen's Booths -- but as he said, there are always hotheads.
Comment: Course if we had a system like that in real life no one in their right mind would want to run for office. There'd be no government (at least elected officials) to run anything because everyone would be too terrified to be in office.
Comment: @MissouriSpartan It seems probable to me that Sheckley might have been inspired by the Athenian practice of [Ostracism](https://www.ancient.eu/Ostracism/) . Of course, their version wasn't quite as drastic.
Comment: I'm familiar with _A Ticket to Tranai_ and agree that this early story may well have acted as inspiration for Jack Vance, but given the wording of my question, I must award the win to _The Reefs of Space_. Thank you for spending the time to construct an interesting answer.
Answer: The bomb collars that can be detonated remotely go back at least a few years earlier, to The Reefs of Space (1964), by Frederik Pohl and Jack Williamson.  The main characters of the first two novels in the Starchild Trilogy are considered "risks" by the totalitarian "Plan of Man," and they have to wear the explosive collars.  The collar is a major plot element in the the first book; the protagonist, Steve Ryland has heard that there is someone out on the titular reefs of space that somehow managed to get the explosive collar off without detonating it, and Ryland needs to find him.
Comment: A [Goodreads review](https://www.goodreads.com/book/show/1476166.The_Reefs_of_Space) says, "Yet the most important thing on Steve's mind was not his work, but the iron collar locked securely around his neck. Filled with a lethal charge of explosives, it could be detonated any time the Plan of Man considered him too much of a risk." Definitely answers my question, though there's always the possibility of an earlier story lurking in the mists of ... er, in the library.
Answer: Although the date has already been beaten, the Cyberiad (1965) has an interesting implementation of this idea: there is a planet inhabited by such a civilization. The citizens don't actually wear the bombs, but they are built that way (it's an artificial civilization consisting of synthetic lifeforms). They are ruled by an oppressive monarch, and to prevent conspiracies, they have enough fission material built into their bodies with the purpose that if more than a few of them gather together, it will reach criticality and explode. Basically a form of suppression of the freedom of assembly.
The whole story is quite tongue-in-cheek, however.
Comment: Great example, but as you point out, not the earliest. Thanks anyway!


Windows key from previous installation

Question: I have a desktop that was purchased with Vista pre-installed, but currently runs Windows 7. The Windows 7 install was a clean install that also removed any recovery partitions on the desktop. However, I would like to reinstall Vista on the desktop so that I may give away the computer (I want to keep the Windows 7 license that is currently on the machine), but I no longer have the Vista key that originally came with the desktop. How would I go about trying to recover the original product key?
Comment: The Vista license is on the OEM Sticker on the machine.  You can use the Windows 7 license that was provided to you when you purchased the license and/or use any number of problems to extract it from the registry/
Answer: If the desktop came with "reinstallation media" CD/DVDs, and if you still have those, the Vista key might be printed somewhere. (Or, for some brand names, the factory reinstall media could be BIOS-locked, and reinstall without even asking for a key, as long as it recognizes the OEM hardware/BIOS.)
Else, there might be a sticker on the PC with the key.
Else, you could try to contact the manufacturer, though realistically chances are slim that they'd help with a Vista recovery/reinstall nowadays.

Windows key from previous installation


my cat plays only with one toy

Question: i have a problem as my cat loves particularly one ball.Its strange as he plays with it all the time, one he even swallowed it and then thrown it.I have to hide it quite often and when I do it he stops eating and for me, he has depression.I hide it because he does not relax when he has it or am  afraid that he will eat it again.Please help me to figure out what it means....thank you.Marta
Answer: The only thing that seems worrisome is that it happened once that your cat swallowed the ball. All other aspects of your question should not worry you at all.
I have three cats and everyone of them has different favorites toys and ways of playing with them. And also their likes change during time.
I understand your worries about eating the ball again but you definitely should not hide toys because cat "is not relaxed". In fact it is just opposite. Cats love to play and you should provide them with as much occasions to play as possible.
If you are still not comfortable with my answer and the situation in general I would recommend to actively play with the cat as author of "The Cat From Hell" often recommends. This way you could test different toys and different ways to play with them.
Sometimes I try this method with my cats - note that toys can be hard or soft, furry or plain, heavy or light and so on, so on. You can throw the toy in different directions, shake the toy, or even put it on the cat :) Maybe different kind of ball or the same kind but little larger would be good for your cat.
Another very important aspect are social interactions.
Despite of widely used stereotype that cats are solitaries the truth is that they need presence of other beings, especially other cats. So I highly recommend to have two cats (at least ;). You cannot guess in advance what will be relation between them (love, hate or indifference). But even in "indifference" mode it is valuable for cat health to not stay alone for long.
Answer: In my experience cats often have have a particular toy or type of toy that is their favorite. Toys that can be swallowed are bad toys and should be removed or used with human supervision only.
I had a cat who loved a silk ribbon. One day she decided to eat it and I found her was running around the house with 5" of ribbon hanging out of her mouth ( the rest in her stomach). I think it was more traumatic to me than her really.
After that she gets no more silk ribbons.
Anyway you should experiment with different toys and find him some safe kitty toys he likes. Playing with your cat with the new toy will probably make the toy more appealing.

my cat plays only with one toy


Understanding Length Contraction

Question: I am learning Length Contraction from the book Special Relativity and Classical Field Theory by Leonard Susskind.
There are two frames with relative speed $v$ along the x-axis. If my frame is at rest, then the other frame is moving with velocity $v$ towards right, i.e., towards the positive x-axis. The following picture shows the world line of the moving frame w.r.t. my frame, $\overline{OQ}$ is the length of a one-metre ruler in my frame.
The problem is to find out the length of this ruler as measured by an observer in the moving frame with his own scale. The author says that this length is $\overline{OP}$.
My question is, why $\overline{OP}$ is that length? In other words, why would I say that the intersection of the world lines of the 'moving frame' and the 'far end of the ruler' in my frame is the point corresponding to the far end of the ruler in the moving frame? The observer in the moving frame sees the ruler from any point on the axis $x'=0$ ; so why does the point P need to be the perpendicular distance from point Q? More generally, how do I know which point in the moving frame corresponds to a point in my frame?
Please help me with this confusion.
Answer: First, we need to describe what length of an object is?
The length of a ruler is the distance between the two coordinates of endpoints of the ruler which are measured simultaneously. Now, 2 simultaneous events happening in one frame might not be simultaneous in other and that's where length contraction comes in.
Lorentz transformation is given by:
\begin{equation}
\begin{aligned} t^{\prime} &=\gamma\left(t-v x / c^{2}\right) \\ x^{\prime} &=\gamma(x-v t)  \end{aligned}
\end{equation}
So, in the frame $(t,x)$ co-ordinates of O and Q are $(0,0)$ and $(0,1)$ respectively but in $(t',x')$ frame $t'$ co-ordinate would be different. O has co-ordinate $(0,0)$ while Q has (-$\gamma \frac{vx}{c^2}$,$\gamma$).
For measuring length we need $t'$ co-ordinates of the end-points to be the same which we do by setting $t'=0$. So, now O has still the same co-ordinate $(0,0)$ in both frames. But, co-ordinate of other end is given by $(0,x')$ where $x'$ is given by the intersection of the line $t'=0 \Rightarrow t= \gamma \frac{vx}{c^2}$ and $x=1$ which is point P. Thus, the length of ruler in moving frame is given by OP.
Answer: The perpendicular line $x=1$ ($x=0$) is the world-line of the end (start) of the meter-stick. You have to follow that line from $Q$ up to $P$ because that is the point that is simultaneous with $O$ in the primed frame, that is, both $O$ and $P$ are at $t'=0$.
So $\bar{OP}$ defines the object in the primed frame; $\bar{OP}  < \bar{OQ}$, but that is not obvious from the diagram because the tic marks on both $t'$ and $x'$ are dilated by a scale factor:
$$ F=\sqrt{\frac{1+\tan^2{\alpha}}{1-\tan^2{\alpha}}}$$
where the angle alpha is:
$$ \alpha \equiv \angle POQ$$
so that:
$$ \tan{\alpha} = \frac v c\equiv\beta $$
Hence the length of the moving meter ($L=1\,$m) stick is:
$$ L' = \frac 1 F \times L\sqrt{1+\beta^2}$$
$$ L' = L\sqrt{1+\beta^2}\sqrt{\frac{1-\beta^2}{1+\beta^2}}$$
$$ L' = L\sqrt{1-\beta^2} = \frac L {\gamma} < L$$

Understanding Length Contraction


What does "remove only" mean for installed programs in Windows 7?

Question: I'm navigating to "Programs and Features" in the Windows 7 control panel, with the intent to uninstall some programs. Some entries there have (remove only) in their names.

What does this mean? Is something going to be left on my machine after I "only remove" this program?
Comment: I was of the impression that this was to do with installers that don't use MSI to register the files, folders, etc. that they install. A program entry may appear in the programs and features section that has not used MSI and therefore windows cannot do a 'repair' because it doesn't know what to repair.
Answer: Every application in Windows may have upto three options in 'Programs and Features' section; ie uninstall, change or repair.
<code>Uninstall means to remove the application from the OS.
Change means to add or remove certain features or components from the application.
Repair means to verify if the application is installed correctly and if not, fix any issues with an incorrect installation.
</code>
(Remove Only) applications can only be uninstalled. The change and repair options will not be available.
The below image is for reference showing all the three available options.
Answer: This is just a convention that used to be somewhat useful in the past. It doesn't mean anything any more.
In modern Windows versions, a program can specify several options to be displayed in the "Programs and Features" panel. The default is an uninstall option, but there can also be options for repairing and changing any individual components.
However, back in the olden days of Windows 95/98, you could manage installed programs from the "Add/Remove Programs" control panel, which only contained a single option, named 'Add/Remove'. If the uninstaller supported anything more than a simple removal, it had to ask the user itself with a dialog box. To avoid user confusion, some programs that didn't support any fancy options would state so by adding "(remove only)" to the program uninstall entry.

Some people simply got into the habit of doing this and therefore it persists to this day.
Answer: All it means is that there are no other options available to the installation program.
Some installation programs have the options to change the installed options of the program and/or repair the existing options as well as the standard option to remove the application.
If the application is small and simple then "remove" is all that's needed.


Where do Firefox and Chrome get their list of malware & phishing sites from?

Question: When you click on a hyperlink, Firefox and Chrome both check it against a list to see if the domain has been reported as a phishing site or a site containing malware.  Where does that list come from?  Do Firefox and Chrome (and maybe others) use the same list?  Who manages it?
Answer: Firefox and Chrome use Google's Safe Browsing utility, which is managed by Google, as the name implies. They have a transparency report with statistics viewable at: http://www.google.com/transparencyreport/safebrowsing/
Comment: Is there any verifiable documentation about whether or not Google stores data about all the systems that access these Google servers?  Google claims "approximately 1 billion people" access these servers.  A simple internet search reveals lawsuits against Google for alleged data collection transgressions.


Branched covers of compact Riemann surfaces

Question: Let $S$ be a compact R.S of genus $\geq 2$. In the paper "Stable and unitary vector bundles on compact Riemann surfaces" (by Narasimhan and Seshadri), they claim that there is a branched covering map from the upper half plane to $S$ which is ramified at exactly one point (with index $N$) (i.e. $S$ is the quotient of $\mathbb{H}$ by the group $\langle A_i, B_i, C \vert \Pi [A_i, B_i] = C, [A_i,C] = [B_i, C] = I, C^N=I \rangle$). I am not able to access the reference (Grothendieck) pointed out in that paper. Is there any other reference (or any easy proof of this?) ? Also, does a similar fact hold for non-compact Riemann surfaces (compact minus a finite collection of points).
Comment: I am not sure about the group you wrote down there. It looks like a central extension of the fundamental group of a Riemann surface by $\mathbb{Z}$.
Comment: Indeed it is a central extension of the fundamental group.
Answer: From your group-theoretic description, it seems to me that you are asking for a covering $S' \to S$ which is only ramified over one point of $S$, and the ramification index of each point of the inverse image divides $N$. So, Felipe's construction should work.
Here is a more direct construction. Suppose that $S$ is compact. Pick a point $p\in S$; the fundamental group of $S\smallsetminus \{p\}$ is the free group on $2N$ generators $A_1, \dots, A_g$, $B_1, \dots, B_g$; the product $C = \prod_{i=1}^g[A_i, B_i]$ represents a small loop around $p$. Consider the homomorphism $\pi_1(S\smallsetminus \{p\})\to \mathrm{S}_{2N}$ that sends $A_1$ into $(1 \dots N)$, $B_1$ into $(1 \dots 2N)$, and all the other $A_i$ and $B_i$ into the identity. It is easy to see that $C$ goes into $(1 \dots N)(N+1 \dots 2N)$, and that this homomorphism has transitive image. Hence the corresponding ramified cover $S' \to S$ has two ramification points over $p$, each of index $N$.
When $S$ is non-compact, then the small loop $C$ is part of a free set of generators of $\pi_1(S\smallsetminus \{p\}$, and the construction is even easier (for example, you can easily construct a cyclic cover $S' \to S$ of degree $N$ which is totally ramified over $p$, and nowhere else; this is impossible in the compact case).
Answer: Take a finite cover $S'$ of $S$ ramified at only one point $P$. Then $\mathbb{H} \to S' \to S$ is the map you want, where the first map just exhibits the universal cover of $S'$ and is unramified. To construct $S'$, first take the unramified cover $S_1$ of $S$ obtained by pulling back the map multiplication-by-2 on the Jacobian. The pre-image of $P$ in $S_1$ can then be split in two subsets of same cardinality such that there is a function on $S_1$ with simple poles on the first subset and simple zeros on the second and no other. Now take the $N$-th root of this function to get $S'$.
This construction is part of the Kodaira-Parshin trick. I have no idea if that is what Narashiman and Seshadri had in mind or if there is an easier construction.
Comment: Thanks! I apologise for my question, but this won't work for a compact R.S minus a finite number of points would it? If it doesn't, then is there an analogue? Also, would the branching index of $S^{'}$ not be $N$ times the number of sheets in $S_1$?
Comment: I didn't think about the non-compact case, I don't know. Also, re-reading my answer and your follow-up question, there is a problem. Indeed, the ramification is on $N$ times the number of sheets in $S_1$ points. If we could somehow reverse the order of the arrows $S' \to S_1 \to S$ it would be OK, but I don't think that's right, the cover is Galois but not necessarily abelian.


How to use USPS and UPS PHP API for getting tracking Information

Question: I want to find the shipping dates from USPS and UPS, How do I find it. Is there any API so I can pas a tracking number and returns me these details.
Answer: Yes, both USPS and UPS have an API you can use to access this information. I suggest reviewing their technical docs on how to implement these features.
https://www.usps.com/business/web-tools-apis/track-and-confirm-v1-3a.htm
https://www.ups.com/upsdeveloperkit/downloadresource?loc=en_US


Aftermarket options for adjusting Giant Aero Bars angle

Question: I have this Giant 2016 Trinity Pro that I'm trying to make some adjustments to. Currently the stock aero bars stick almost straight out and I'm not super happy with that position. I've really liked the look of the "mantis" position where the front end of the aero bars are elevated closer to the rider's face. However, I haven't found any options for being able to adjust this. Are there any spacers/angle mounts that I can use to adjust these angles?
Answer: We try to avoid specific product recommendations here. That said, this is a niche problem and there aren't a lot of solutions.
Your problem here is that most stock aerobars are designed to clamp onto a round 31.8-mm diameter section of handlebar. Not only do you not have round bars, it looks like the bar/stem interface isn't round. So you would need to swap your stem, base bars, and aero bars to effect this change.
The alternative is to find someone making adapters or aerobars that will work with your existing mounts. You might try contacting Giant directly to see if they have angled adapters. The other option that I know of is Aerocoach, which makes very high-end aerobars with a variety of fittings. This could wind up being more expensive than the first option.
Comment: I was eyeballing the aerocoach but I'm not keen on paying $100 for a block of metal that I could cut on a CNC machine for $20. I'll try contacting giant and see what they say, or if they can provide measurements for what the adapter would need to be.
Comment: @blackbrandt If you can CNC cut something yourself, why not simply try? The interfaces seem to have reasonably flat contact surfaces, so just making an aluminum wedge with the appropriate holes-with-threads should be sufficient until you find the angle you're looking for. Then refine your wedge to look nice.
Comment: I'm planning on 3D printing a few for my bike fitting to play with the angles, once I find the angle I like then I'll send it off to get CNC cut.
Answer: Differently shaped spacers is the likely solution I also came across after a brief Google search. Now, it appears that Aerocoach is not the only purveyor of such spacers. These guys on AliExpress sell a spacer branded to Fouriers that looks like it may fit the Trinity - although I'm not sure of their model history, so these specific ones may or may not fit. The spacers are a lot cheaper than Aerocoach.
What might you be giving up for the extra money? Most likely material quality and manufacturing tolerances. Because these spacers aren't structural elements, I am guessing that material may not be that important. Tolerances may affect if the spacers fit precisely. If the spacers fit loosely, you might not be able to properly tighten them down. It's impossible to say if this will happen without getting them and fitting them.
If you get no satisfaction here, then you may wish to seek out a more triathlon or TT-oriented site. Slowtwitch.com is one such forum, and there's actually a thread here. Another option is to find an LBS that has experienced with tri/TT bikes - as you now know, these are rather specialist bikes that involve some unique equipment, and not all stores may be able to assist you well.


How to disable shutdown so that an important process cannot be interrupted?

Question: What is the simplest way to disable or temporarily suspend reboot/shutdown when an important process is running? The process takes too long to finish and cannot be paused/resumed so I like to avoid shutting down the pc while it is running. It is run from cron so unless I manually check for running processes, I wouldn't know that it is running. Thanks.
Comment: Possible duplicate: [SO: *Temporarily prevent linux from shutting down*](http://stackoverflow.com/q/322254/993018), the answers hint on the various levels on which this can be done, i.e. shell scripts or the desktop environment's power management.
Comment: I don't think that answer is specific enough without an either explanation of runlevels or link to explanation. It's not in the U&L SE. May I ask which distro and version you're using?
Comment: Rather than modifying the shutdown procedure, write a wrapper so the job indicates its finished, either mail or touch a file. Test for job completion, then run shutdown. (cron mails the output of its jobs to owner, but that can be tweaked).
Answer: For newer systems with systemd this has been solved by systemd-inhibit. Example of usage:
systemd-inhibit --why="Doing weekly backup" bash my-backups.sh

Then, if a user attempts to shutdown it will not be allowed unless forced.
❯ systemctl poweroff
Operation inhibited by "bash my-backups.sh" (PID 2414 "systemd-inhibit", user ntrrgc),
reason is "Doing weekly backup".
Please retry operation after closing inhibitors and logging out other users.
Alternatively, ignore inhibitors and users with 'systemctl poweroff -i'.

Comment: How did I misread the bug report exactly? :S
Comment: There is this issue though: running it as root non-interactively will ignore the locks. https://github.com/systemd/systemd/issues/2680
Comment: I think you misread that bug report, they are talking about running `poweroff` as root non-interactive
Comment: @Alicia I tried your suggestion on CentOS and it immediately run my script and don't add in systemd-inhibit list.
Answer: Run which shutdown to see where the path to the shutdown program is.
You can rename the file, although I recommend against it.
Another (safer) method. Use an alias: alias shutdown=' '
Something like this is more reversible. If you're trying to prevent shutdown from all users, add the alias globally.
Comment: I'm thinking of using an alias, now I just have to write my script. Thanks!
Comment: What about other commands such as halt or poweroff. Would you need to create alias' / rename them too?
Comment: Just keep in mind that `sudo` doesn't expand aliases by default. To protect from `sudo reboot`, you need to also `alias sudo='sudo '`
Comment: The `alias` method does not work with background processes, such as monitors and web management interfaces. I ended up resorting to renaming `poweroff` and `shutdown`, leaving `halt` as an option that I can use from the shell. This worked for me.
Answer: Disable the "shutdown/reboot/poweroff/halt/hostname" like commands in mission critical servers
chmod 0 /sbin/shutdown

then if you need to use it, chmod it back to chmod 0755.
Comment: What about `halt`, `poweroff`, and `systemctl poweroff`?
Answer: I would disable the command in the /etc/sudoers file
so that only root can execute it.
in /etc/sudoers
# Cmnd alias specification
Cmnd_Alias     SHUTDOWN = /sbin/shutdown

# User privilege specification
root    ALL=(ALL:ALL) ALL
vmule   ALL=(ALL:ALL) ALL, !SHUTDOWN

and when I try to run the command:
vmule@debian:~$ sudo /sbin/shutdown  -r now
Sorry, user vmule is not allowed to execute '/sbin/shutdown -r now' as root on debian.vm

Comment: can you elaborate your answer ? shutdown may not be explicitly specify in /etc/sudoers.
Comment: Sure, I edited the answer with a better explanation.
Cheers
Answer: I wanted to prevent a local user to shutdown a laptop during an upgrade. Disabling the input device was the best way to go. For me it was sufficient to disable the mouse, but the keyboard can be disabled as well.
Of course there's a drawback, the computer can't be used during this period.
Disable Keyboard & Mouse input on unix (under X)
Answer: shutdown is technically an application too, which you can remove. Run which shutdown. which is a command which shows you the path of an application. In my case the output is /sbin/shutdown. It's a file so you can just do rm shutdown. Or if you want to disable it temporarily copy it, change the name and remove the original file.
You must have the sufficient permissions if you want to do rm shutdown. It's read-only, hence why you may get an error. Try removing it as root or if necessary try using the command rm shutdown.
Comment: Why the `-r` flag? You wont need it for one file, and if you mistype something, disaster ensues.


External monitor ubuntu 13.04 for NVIDI quadro 1000M on W530

Question: I have just got a thinkpad W530 with NIVIDIA quadro 1000M graphic and I cannot connect an external monitor properly. It shows up on ubuntu 13.04 but it seems there might be a problem with the driver since my mouse cursor keeps blinking when I change the display setting to the twin view.
Do you know how I can have it worked?
Cheers,
Kia
Answer: My W520 has the same graphics card. I am using RHEL 6.4 so hopefully the solution is the same. You have to enter the BIOS and select discreet graphics only. Then make sure you are using the latest proprietary drivers available. Once the proprietary drivers are installed you will need to enable twinview. For more information on twinview please see https://help.ubuntu.com/community/NvidiaMultiMonitors
Answer: Since I do not have at least "50 reputations" I am not able to add a comment to the answer ob "Rob".
I am using Lenovo Thinkpad w520 with nVidia quadro 1000m
I have Ubuntu 16.04.2 and NVidia 375 propriety driver. "prime-nvidia" is also installed (automatically when I installed the nVidia-closed-source-drivers)
His hint worked for me. Go to BIOS and define "descrete graphics".
After that I had done the following things:

Install closed source drivers (version 375 ist my current one).
root> prime-select nvidia
delete the /etc/X11/xorg.conf - file
create an empty config file using

root> nvidia-xconfig

reboot
login into X (KDE)
in a terminal run "sudo nvidia-settings"
Left pane find "X Server Display Configuration", click it
Right pane find both Displays (internal LCD and via Displayport connected external LCD)
"configure the displays as you want them" (position, etc)
click "apply"
click "Save to X Configuration File"
(maybe: logoff and login again, I forgot)

Thats all. Now I have both displays next to each other.
"TwinView" and "Xinerama" seems not to be installed on my system. Both screens are belonging to "Configuration: X screeen 0". So I have a screen over both displays :-)


What does "so… how about them hats" mean?

Question: I saw this question on another SE site, What is meant by "them hats" in this context? I hear the use of "them [word]" many times, does it mean like their or these? or what exactly?
Comment: It's a non-standard demonstrative determiner.  It means "those".  Here, it appears in the phrasal template "[So,] how about them X?", which some speakers will use even though they'd never otherwise use *them* as a determiner.
Comment: It's non standard English for "these" or "those".
Comment: [How do you like them apples?](http://english.stackexchange.com/questions/8293/how-do-you-like-them-apples). Known to me as an excellent line in the excellent movie *Good Will Hunting*, but there's more detail in that old ELU question.
Answer: In this context, it means those hats. The phrase "how about them [objects]" is deliberately wrong for humor value. The construction is used deliberately in the meta posts about hats because the mods on each site want everyone to know that the hats are supposed to be fun. Consider a correctly formed sentence:

Aren't those [objects] remarkable? Let's talk about them.

It's correct and clear, but it's not really humorous. The implication of such a sentence would be "I want to have a serious discussion about this." This would be an appropriate way of discussing the cherry blossoms or a military band.

How 'bout them [objects]?

The use of deliberately wrong syntax indicates that the speaker wants to have a "fun" conversation about the objects, or at least an informal one. One of the most common contexts for the phrase is:

How 'bout them Cowboys?*

Or, combined with another non-standard usage to convey the informality more fully (as noted by J.R.):

How 'bout 'dem Bears?*

In this context it means something like: "I saw [the named sports team] play last night and they were awesome! AGREE WITH ME!"
There's a related use of this phrasing in a sports context. When speaking to fans of one sports team or another, using the phrase in reference to another team can be considered an insult. (Mild or severe, depending on the relationship between the two people speaking.) In that context it's a statement like: "Hey, my team is better!"
*Disclaimer: I am agnostic toward American football. No endorsement of or insult to the Cowboys is implied. They were chosen because the sentence flows nicely around their name. The Bears, well, they're the Bears. I put them in only because J.R. used them for context.
Comment: An exemplary answer, despite the reference to the Cowboys. :)
Comment: Sometimes, esp. in the context of sports, the "th" in "them" is pronounced as a "d", to make it sound even more informal: _How 'bout dem Bears?_
Comment: @StoneyB It's a good thing I'm not really a football fan, or my state of origin would cause me to take offense at those words ;) Great answer, Jonathan; +1!
Comment: @WendiKidd Well, if it makes you feel any better I'll cheerfully acknowledge that the only readable novels about football were based on the Cowboys
Comment: +1. In addition to "how 'bout them [team name]", the other example that jumps to mind is "how 'bout them apples?" Also, it's probably better to say that determiner *them* is "dialectal" or "nonstandard" than that it's "wrong". (I don't think there would be any humor in something truly *wrong*, like "How concerning those hats?" or "About those hats, how?")


Dynamically call a method from unknown source file

Question: I need to call a method from one class to another class whose class name will be taken from file (dynamically)
Example:

I have a file named Source1.h/Source1.m (both are objective C class files)
I have another file names Source2.h/Source2.m (both are objective C class files)

I can able to call a method from Source2 class file. But the name "Source2" will be taken from a text file and the method to which i have to call is known by me. Hence how do i call the method from unknown class file.
Eg:
unknownClassName *a = [[unknownClassName alloc] init];
[self a];

I know the Method "a". But the unknownClassName will taken taken from a text file in runtime.
Is it possible to do like this?
Comment: what about `NSClassFromString(@"unknownClassName")`?
Answer: I think you can use this
id unknownClassObject = [[NSClassFromString(@"unknownClassName") alloc] init];
[unknownClassObject a];


Do you leave the heating cables for the roof/ gutter on 24 hours a day?

Question: Do you leave electric heating cables for the roof/gutter on 24 hours a day?
Comment: ... meaning "24 hours a day, 7 days a week, all winter"? Or "for 24 hours after an ice storm"?
Answer: Probably not, but...
You'll need to read the literature that undoubtedly came with your heat cable (or, at a minimum, share with us what product you're using). Generally, they shouldn't be left on continuously, and they shouldn't be on when outdoor temperatures get above 30 degrees F, give or take. What cycle you need depends on the local climate, current weather, installation technique, and other factors.
Lots more good advice here.
Answer: My heat cables are temperature-controlled. They turn on when temperatures drop below 38 °F and turn off when they rise above 50 °F, so I turn them on prior to the first freeze and will keep them on until night time temperatures stay above 45 °F for a while. It takes time for them to warm up and the units I have were fixed-temperature, with no adjustment.
It saves a bundle with PVC gutters because they don't draw much and I haven't lost another gutter since installing the heat tape.
To make it clear, I turn my cables on 7/24 in November they are still on almost March. We had another light freeze this weekend. My unit has a temp sensor and will only heat when needed. I do inspect them when I clean the gutters.