Left truncation or left censoring?

Question: I am conducting a study in which I analyse the time to opt out after the free trial is ending. I have individuals who sign up for a free membership-trial period. At some point the period is ending and the hazard rate increases one month before that period, I can tell from the data. It is low before that. Therefore, I have chosen one month before end-of-trial period as my time zero. Of course, I still have data on the individuals who opted out before that, about 12%. I'm not sure whether I should call them left-censored or left-truncated though. The definition of left-censored implies that I do not know when they opted-out, but I do know that. On the other hand, the definition of truncated entails that I do not see the observations/they are hypothetical. So, neither definition fits my situation perfectly. What should I call these observations?
Comment: If you include them in the analysis as being at your time-zero they they are censored; if you exclude them then they are truncated.  If you include them with negative time, then you have the full distribution with a location shift
Comment: If all offered free trial periods are the same length, I don't see anything to lose by simply setting `time = 0` to the start of the free membership. That gets around the problem completely. If different individuals are offered different trial-period lengths, then you can include that as a predictor in the model.
Comment: Thanks for the replies! Henry: Do you if there is some websites/ressources where I can read further about includeding them with negative time? My main ressource is Klein and Moeschbergers Survival Analysis, and I don't se any mentioning about that there. Perhaps i haven't found it. EdM: Unfornunately the trial periode aren't the same length. People can be on a quite long trial period which hence that setting time = 0 to start of membership would entail that I have to consider almost all corvariates as time-dependent. Thanks for the replies both of you! :-)
Answer: There's not a problem in this situation with using onTrialPeriod as a time-varying predictor in your model. You can keep other covariates as fixed in time if that's appropriate, just copy them over into the second data row (now with onTrialPeriod = FALSE) for each individual who extended beyond the trial period. That way you have at most 2 data rows for each individual. It probably makes sense to include the trial-period duration as a covariate, and to include interactions of covariates with onTrialPeriod. That uses all of your data most efficiently and allows for different associations of covariates with survival depending on whether the trial period is in effect.
There was a similar recent question here. If you don't care about the actual duration of free trial periods but only whether someone opted in, then you could use a binomial regression for the opt-in/not choice and model survival during the post-trial period.
With respect to the suggestion from @Henry in a comment, recall that a survival function in general is just 1 minus a (cumulative) probability distribution function. If the distribution function is defined for negative values then you have a survival function defined over negative values. Usual statistical survival software assumes that all time values are non-negative and will balk at using negative times, but there's no theoretical limitation on that. Left censoring is sometimes coded with -Inf as the start time in the counting-process data format, consistent with possible negative survival times.

Left truncation or left censoring?


Can I use the same Google Analytics tag for a blog subdomain of my site as the main site?

Question: I have my site.com and blog.mysite.com on a different IP address.  Can I use the same Google analytics ID for both sites?  Does Google analytics look at what IP address the recorded visitor information is from?  If it doesn't, what prevents random sites from including your Google analytics tag and sending random data to your account?
Answer: You have to modify your script tag a little.  Google's FAQs cover this:
http://www.google.com/support/analytics/bin/answer.py?hl=en&answer=55524
Answer: You can run any UA-XXXXX-YY on any website (any domain name, on any IP), it will end in your profile stats.
Yes, your stats could get completely messed up if some site would put your UA id on its site.
To prevent this, you can setup an include filter on your GA profiles, and Include only your domain names by using a regep like this "www.domain1.com|www.domain2.com|www.domain2.com" on the hostname field.
Be careful, the Include filter is exclusive (If you have 3 Include filters on the field hostname, only the first one will be applied).
The alternative is to create an advanced segment based on the hostname, you'll get mostly the same result but could be exposed to data sampling effects if you have a large audience. But it allows a quick fix afterwards, while filters need to be set before you get into trouble.
Answer: Sure. you can use the same for both.  You will be able to segment traffic by domain name.


Vapors from washing machine stinking the garage and kitchen

Question: This shows that there is a trap in the washing machine drainHow do I hook up a washing machine drain line to this box?. How do I clean this?  Other traps under sinks have threaded connectors so I can extricate crap. And somehow my drain hose is stuck in the box as gentle tugging will not disconnect it;  is there a clip inside that somehow grips it?  Coz' suddenly after 10 years, our Maytag front load washer is eschewing vapors into the garage and even into the kitchen sink and it seems needs a clean-out.
Comment: So, smell is coming out of the trap? How is the smell getting to the garage and/or kitchen sink? (I don't associate washing machine drainwater with bad smells, even when aged gracefully...)
Comment: After reading this  I'm wondering if our new upstairs master bath remodel 2 years ago tweaked something; the counter sinks are a few inches higher; one drains normally and one drains very slowly until reaching 4 " depth whence it is slirpped up!  Also the tub was replaced by a shower and drain moved. But what plugs a vent stack?
Comment: After cogitating the when and where, here's my explanation:  kitchen --2 drains, one to the garberator and one to the side sink, both are connected to the to of the p-trap.  When the side sink is emptied it pushes air into the p-trap forcing it to empty and causing back flow of stink into the gaburator.  I need a sign "health hazard" for my kitchen!                For the garage, I filled the laundry tub and the vapors dissipated ; so the washing water flow is siphoning the p-trap;  another sign "keep tub full"
Answer: If it isn't spraying water, it doesn't need a clean-out. More likely your vent stack needs to be cleaned out.
Answer: Neighbors suggested Tide washing Machine Cleanser; after 2 cycles the sewer smell is gone; of course we now know why, where, and when we get gassed   Nonanoic acid, sulfophenyl ester http://www.pesticideinfo.org/Detail_Chemical.jsp?Rec_Id=PC36022 smells noxious, irritates the eyes but does the job making sewer gas sweeter.
Answer: Sequel
  After a few days the stench returned.  Nothing focuses like a spousal rebuke; I vaguely recollected that smell from 50 years ago-- the root cellar potato bin in spring. Aha! An aggregation of veggies -- where is this "clean-out" on this 1987 house?  Outside the kitchen stucco wall is a 7 cm pipe plastered in, with a square nut cap about 30 cm off the ground. A non-metric nut!  Dig out that 1 1\4 " flat wrench; apply some newtons; she won't budge!  A neighbor had died 5 years ago and the heirs gave me his pipe wrench--a use for it! Use joules on the pipe wrench and the nut loosens without busting any stucco.  I filled the 2 basins to the brim; dissolved 100 g of nonanoic acid sulfophenyl ester in each , opened the drains and turned on the garberator, with a 4 l bucket under the clean-out;  the surfactant foamed and frothed and spat a big doggy bag of $!$&&. OK then do that agin! Still a bit more .  Now we have sweet smelling sewers .
Comment: Hello. You should merge your two accounts as [shown here](http://meta.stackexchange.com/help/merging-accounts), so you can get credit for all your contributions.


How to install gloobus preview on 12.10?

Question: You look, I have installed the version 12.10 of the Ubuntu and try to install the Gloobus Preview, but when I finished and started to use it, any file was opening with it. The files opened totally no view. What happened? if I wonder because of the new version?
Comment: hmm, as far I know there is no ppa for gloobus previewer for 12.10. How did you install it?
Answer: Well, Ubuntu Precise users can install it by simply running the following commands:
sudo add-apt-repository ppa:gloobus-dev/gloobus-preview
sudo apt-get update
sudo apt-get install gloobus-preview gloobus-sushi

If you want to enable to open LibreOffice or OpenOffice documents with Gloobus Preview, install this additional package:
sudo apt-get install unoconv

If you want to install it offline... you can download the deb from the following link
http://www.ubuntuupdates.org/package/gloobus-dev_gloobus_preview/quantal/main/base/gloobus-preview
Comment: after installing it in elementaryos based on precise, I've had trouble actually using it. The space bar just seems to open files instead of opening them in gloobus.
Comment: found the answer here http://www.elementaryupdate.com/2013/04/gloobus-preview-in-elementary.html have to enable the preference in dconf-tools.
Answer: Try to download gloobus-preview and gloobus-sushi deb files from this link
For me works that way. Cheers


Upgrade version of Windows 7 without anytime upgrade key

Question: I recently did a clean install of Windows 7 on my machine.
My key is for Windows 7 Professional, but I mistakenly installed Home Premium onto the machine.
I've spent a day installing my various bits of software and settings, so I'd like to upgrade the system to Professional without having to reinstall, ideally.
When I look at Anytime Upgrade options, it expects me to have to purchase an upgrade key. As the system stands, it has no key and has not been activated.
Is there any way I can use my Professional key to perform an upgrade to Professional without a full reinstall?
Thanks
Answer: Just use the Anytime Upgrade, when it asks for a key, use your retail key.


Visual C++ - Event for ComboBox

Question: I'd like to know if there is an event for ComboBox in Visual C++ that I can utilyze for doing something when mouse passes over the items of the combobox. Thank you
Answer: You could try WM_DRAWITEM notification, but you might need an owner drawn style for that.
The draw item member contains an itemAction that indicates for what situation the item needs to draw itself.
Comment: I haven't understand. Can you do me an example of this please?
Answer: Have a look at TrackMouseEvent().
You will probably need to create a class for your combobox (derived from CComboBox); to add the TrackMouseEvent() in it.
There are messages to handle the mouse hover (when the mouse is inside the client area of the CWnd) and mouse leave (when mouse leaves the client area of the CWnd).

Visual C++ - Event for ComboBox


JPA 2.0 with Weblogic 10.3.5 Eclipselink issue - This version of OpenJPA cannot read a persistence.xml document

Question: JPA 2.0 "seems" to be finally working in my application deployed on Weblogic 10.3.5 (after tweaks described below).
However, I still get the following message on the WL console terminal:
<code>This version of OpenJPA cannot read a persistence.xml document with a version different from "1.0". Found: version "2.0" in
</code>
This is appearing more than once in the logs and I am looking at some way to get rid of it. Read somewhere that this happens with WL 11g release but is there a way to hide/do away or fix it?
Environment:
Weblogic 10.3.5

Toplink configured as default persistence provider in console
WL classpath modified to have jpa2 specific jars in WL in front of the path (as described in Toplink with Weblogic 10.3)

Removed Toplink jars from application.
Answer: We've used the Oracle patch to configure JPA2 on WLS 10.3.5
http://docs.oracle.com/cd/E24329_01/web.1211/e24972/using_toplink.htm#CIHIBGBG
Looks as if Kodo is using openJPA.  You might consider configuring Toplink in your console.


onCreateView() being called too often in custom preference

Question: I have created a Custom preference which has the following constructor
public CoordinatesPreference(Context context, AttributeSet attrs)
{
    super(context, attrs);
    setLayoutResource(R.layout.coordinates_preference);
}

And I have Overriden onCreateView() so it writes to the log like this:
@Override
protected View onCreateView(ViewGroup parent)
{
    Log.d("test", "Creating Preference view");
    return super.onCreateView(parent);
}

and my log is full of "Creating Preference view" messages, this creates a laggy feel to scrolling and I believe convert view is supposed to solve this, I had  a look at the preference source code and if convert view is null then onCreateView() is called.
for testing purposes I added this method:
@Override
public View getView(View convertView, ViewGroup parent)
{
    if (convertView == null)
    {
        return super.getView(convertView, parent);
    }
    return super.getView(convertView, parent);
}

and set a break point. I have found that almost always my convert view is null. and therefore it must create a new view, why is this? and how can I improve this to avoid a laggy preference screen?
EDIT: Changed the way the onCreate is called, now its all android I just use setLayoutResource. but this does not solve the problem...
EDIT2: I have used Debug.StartMethodTracing() and have found as I suspected that 55% of the time spend (when I'm just scrolling up and down) is spend on the Inflation of the preference from the method onCreateView() which is called from getView() when convertView is null.
Thanks, Jason
Comment: Can you paste an screenshot of how your preferences look like?
Comment: Sure .  I will post one when I get home
Comment: Can you put up your preferences.xml file? I have an idea about this and I'd like to confirm that your configuration is like mine.
Answer: I don't know what have you implemented in this custom preference, but maybe the super class doesn't know how create a proper view to your preference?
From the documentation:

protected View onCreateView (ViewGroup
  parent)
Since:
  API Level 1 Creates the View to
  be shown for this Preference in the
  PreferenceActivity. The default
  behavior is to inflate the main layout
  of this Preference (see
  setLayoutResource(int). If changing
  this behavior, please specify a
  ViewGroup with ID widget_frame. Make
  sure to call through to the
  superclass's implementation.

http://developer.android.com/reference/android/preference/Preference.html
I guess you have set that id on the horizontal layout.
Now that I'm talking about it, why don't you include this horizontal layout in the layout that you are inflating?
Comment: Thanks but, I already have the layout in the Horizontal layout in the xml, and Android does know how to inflate my preference (as I'm getting a working result) however it is laggy to scroll because o nCreate() is called so often (this is what convert view is supposed to solve )
Answer: I am not sure if the code you are using is an accurate test.  I have a custom preference and I only override 5 methods and three of them are constructors.
public ImageButtonPreference(Context context)
{
    this(context, null);
}

public ImageButtonPreference(Context context, AttributeSet attrs)
{
    this(context, attrs, 0);
}

public ImageButtonPreference(Context context, AttributeSet attrs, int defStyle)
{
    super(context, attrs, defStyle);
    mInflater = LayoutInflater.from(context);

    // This is where I pull all of the styleable info from the attrs
    TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.ImageButtonPreference, defStyle, 0);
    for(int i = a.getIndexCount(); i >= 0; i--)
    {
        int attr = a.getIndex(i);
        switch (attr)
        {
        case R.styleable.ImageButtonPreference_logo:
            mImageResource = a.getResourceId(attr, mImageResource);
            break;
        case R.styleable.ImageButtonPreference_button_text:
            mButtonText = a.getString(attr);
            break;
        }
    }
}

@Override
protected View onCreateView(ViewGroup parent)
{
    View view = mInflater.inflate(R.layout.image_button_preference, parent, false);
    return view;
}

@Override
protected void onBindView(View view)
{
    super.onBindView(view);

    ImageView image = (ImageView)view.findViewById(R.id.Logo);
    if(image != null && mImageResource != 0) image.setImageResource(mImageResource);

    Button button = (Button)view.findViewById(R.id.ConnectButton);
    if(button != null)
    {
        button.setText(mButtonText);
        button.setOnClickListener(mButtonListener);
    }
}

I have pulled this code, almost verbatim from the Android Source, so it should be just as fast as any other preference.
Answer: As a more general answer, not specifically relating to custom preferences:
It's hard to see with the code you posted, but if your needs to pull a preference every time it creates a view, it will be VERY slow and laggy as you describe. Even if the view does exist, you still need to set the value, and it sounds like that needs to come from the preference. Android preference reads are incredibly slow, so they can't be associated with UI creation if you want a good fast experience.
I think you should store the preferences in the app (perhaps in the Activity, or subclass the Application and store them in there), in order to implement some simple caching. i.e. the first time you need a preference, request it from your app's store, if it's not there, pull it out of the preferences. If the preference is stored in the activity/application already, use that value without reaching out to the prefs. Then, when you write prefs out, write to the store AND the preference. By doing that it doesn't matter how often getView() needs to create new views, as the preference can be accessed quickly using the copy in the activity/application object, but also stored durably in the preferences for the future.
I don't know whether the preferences framework has some caching in it somewhere, but my experience of loading prefs is that if a few need loading the user WILL notice a lag, so caching is essential.
Comment: The preference is Cached locally, no redundant reading and writing to or from the shared preferences.
Answer: I was running into this problem and I tracked it down to the fact that I had the layout set both in the preferences.xml file and in my Preference subclass onCreateView() method. When I removed the layout from preferences.xml, onCreateView() stopped getting called multiple times.


Why do many people derive comfort from the belief in an objective reality?

Question: Many people derive comfort from the idea that there is an objective reality, and that there are objective truths, independent of our own individual subjective perceptions. Why should this be so?  Why isn't the pursuit of hedonism enough for some people?
Comment: Is it just me or does this question belong to psychology?
Comment: Who said objective truth is independent from subjective? On the contrary -- OBJECTIVE is the limit to which all subjective points of view converge after some time. On hedonism. You think they don't enjoy having objective reality? How is it not partially hedonism?
Comment: Is it possible to _not_ "derive comfort" from whatever philosophy one holds? Note that the term "derive comfort" may morph in meaning from person to person.
Comment: like @user132181, this seems like a psychology question, unless you're asking 'what *should* a person's pursuits be' or asking for a defense of a search for objective truth. The way the question is currently phrased, it's asking about human behavior
Comment: I am new to philosophy Lucas and I have yet to read Ayn Rand's stuff.
Comment: This is a rather argumentative way of phrasing the question.
Comment: Since OP isn't familiar with Ayn Rand, I took the liberty to delete the reference to Objectivism. The Q concerns the concept of objective reality more broadly / cc: @Lucas
Comment: Most hedonists do believe in an objective external reality so I don't follow your reasoning.
Answer: We can feel comforted by the existence of truths which are not merely subjective because the alternative that there are none is quite uncomfortable. Were there no truths, and nothing other than subjective perceptions, we should find ourselves with at least these two very uncomfortable thoughts:

If when we are harmed by someone else, there were no facts of the matter about what happened, there could be no hope that judges and juries could approach an accurate understanding of what happened. Our understandings of situations are always limited by our perspectives and our limited information, but we can often acquire some further understanding about those limitations themselves. We can acquire knowledge of the ways in which and degrees to which our knowledge is limited. If there are no facts, then it is not coherent to say we are epistemically limited in this way. Rather, each of our subjective impressions is as good as any other. So if a crazy person says I stole his money, that claim is on equal epistemic footing as my claim that I clearly did not. Without the ability to describe claims as better-grounded or worse-grounded, our ability to resolve situations justly, situations where we are harmed or accused, is fundamentally undermined.
Without the sense that we can trust that aspects of the world are stable to some degree, and can be known to some degree in more objective ways, it would be quite scary doing ordinary activities like walking and driving. It would be paralyzing to think that I can't know at all whether the sidewalk on which I'm about to step is going to be solid or liquid or gel or plasma. If it's a merely subjective matter, I have no ways of assessing that I'm probably right that the sidewalk is solid. Similarly, it would be uncomfortable not to be able to trust that there are facts that the engineers of cars and bridges and tunnels have more access to than does a child or a person using LSD. That is, it's frightening to imagine that neither I nor they have beliefs that approach any facts.
Answer: Objectivists do not merely "derive comfort" from the idea of an objective reality, it speaks to the very core of what Objectivism is.  It is a pillar upon which all of Objectivism is based.
Consider the question, "Why do Christians derive comfort from belief in God?"  The question is almost nonsensical because most of the actual comfort is derived from a chain of reasoning/conclusions based on this presupposition.

It is what makes everything else Objectivists believe possible.

Similarly, if you study what Objectivism considers "axiomatic concepts" (irreducible truths, or "A truth you cannot prove nor do without" [1][2]), 2/3 are directly related to an objective reality.

Existence exists
The Law of Non-Contradiction (law of identity, A=A, etc...)

Hedonism by contrast doesn't present any in depth conception of reality (metaphysics), or any theory of knowledge (epistemology), but attempts to skip over all of the tedious "leg work" and move straight on to Ethics.  The scope of hedonism is very narrow in relation to Objectivism, and isn't really even a legitimate alternative.
[1] http://wiki.objectivismonline.net/Axioms
[2] http://aynrandlexicon.com/lexicon/axioms.html
Comment: I don't think the Q is about objectivism, OP's phrasing notwithstanding.
Comment: @DBK  "Since OP isn't familiar with Ayn Rand, I took the liberty to delete the reference to Objectivism."~DBK    You shouldn't criticize my response after deleting the part of the question I was addressing.
Answer: If I can contribute to the conversation, I would like to think that objectivity is an essential feature of social animals or species who rely on one another for survival. Haha, it is kind of darwinian, but imagine if we didn't agree on set standards, rules, laws, codes, etc. It makes the act of coordination very difficult especially when we have to coordinate such a complicated society like the one we live in now. I wonder if objectivity is more or less crucial to species with less advanced communication/coordination abilities?
Comment: Yeh, I was thinking this. Our genes are about successfully getting inherited, not epistemology. Lot of people disagree in the world, the OP seems to assume nearly all of them are wrong. But philosophies are (or can be) modes of life, proven to some extent by helping people to live well, in practice. Survival of the best suited way to think.
Answer: I will add that without any possibility of objectivity, that would mean the universe in a state of constant flux, where opposites are both true at the same time, and there is no truth of any matter, as it's all subjective, where nothing exists independently of the human mind in any concrete and unchanging way. Heraclitus, in Ancient Greece, was one of the first philosophers to expound these types of ideas in Western philosophy; however, the notion of non-duality, where there is no divide between object and subject predates the Greeks. Arguing for an external reality that exists in the way it is, regardless of how we perceive or think it is, is crucial coherent thought. The empirical world, which is what we perceive with our senses, may be unknowable to us, but what we should not deny is the notion of coherence itself and that there is an external world existing independently of our ideas or notions of it — it just is. Objectively, no matter who the philosopher is, the law of identity, where A = A, should always be true. What is, is, What is not, is not. At the very least we would be justified in claiming that our knowledge of reality is approximated by scientific understanding and sense perception. Whether this understanding is ultimately true isn't knowable with absolute certainty, although absolute certainty is not needed to understand our physical reality around us. If our senses are failing us, we can't know what the alternative would be, as this is an impossibility: To know what something is like when we are not using our senses to perceive it, which is known as a transcendental realm, and independent of experience.
To your last question:

Why isn't the pursuit of hedonism enough for some people?

Because hedonism, in the usual sense, where we think about revelry and sensual simulations, doesn't aid the process of attempting to discover knowledge or truths where we can know them, as it can completely distract from this end, and heavily distort cogent thought formation, unless you would count the pursuit of knowledge as a pleasurable activity in itself, which I do.


Does Silver contact form Schottky contact for ZnO film?

Question: In order to make a Schottky contact between metal and semiconductor material. The work function of the metal must be greater than to the work function of semiconductor material, for example, Silver (with a work function of 4.24-4.71) will form an ohmic contact to Zinc oxide material (with a work function of approx. 5) and Gold will form Schottky contact (5.11). However based on some related literature (doi: 1757-899X/149/1/012069). Silver contact form rectifying behavior on Zinc Oxide film deposited on a polymeric substrate. So I'm not sure if Silver can form Schottky contact with zinc oxide film (assume that the substrate is glass)?
Answer: Based on your reference, if it forms a rectifying IV,  it probably is a Schottky contact, assuming decent contact litho and processing.
Comment: Did you saw the I-V curve based on the reference? I'm just confused about how metal contact or what metal contact do I need to form schottky contact? thanks!


Force system to always ask for wifi password

Question: I use my institutional credentials to connect to my work wifi network (using 802.1x EAP), and I don't want my password stored on my phone (i.e. I want to retype my password every time I connect). What's the best way to do this? A Google Pixel running stock 7.1, if that matters.
Comment: do you want to do it for a specific wifi of your institute or all wifi to which you connect from phone?
Comment: Would be nice if it could be wifi-specific, but I don't terribly mind forcing it for all wifi if need be.
Comment: I don't yet own Pixel device hence can't exactly say if it offers settings for what you want. But the easy way that comes to my mind is, & it is far from perfect, but may serve your purpose is this : **Just forgot your work wifi network when you are done.** That way any credentials that may have saved will be cleard. Next day when you turn on wifi, and try to connect to your work wifi network your phone will ask you to enter wifi password
Answer: If you are rooted you could just run the command chmod 0440 /data/misc/wifi/wpa_supplicant.conf. Before you do it you should first delete the WiFi network. Also make sure that you have all other WiFi networks saved because after you ran this command you won't save any other network again until you chmodded the file to r+w again.


What is the position of Lord Vishnu as per Shiva Purana?

Question: What is the position of Lord Vishnu as per Shiva Purana? Is he given the status of Supreme anywhere in Shiva Purana?
Comment: The Vishnu purana and Bhagavata purana give a better position to Shiva than the Shiva purana gives to Vishnu.
Comment: @LazyLubber you're right. see this https://www.wisdomlib.org/hinduism/book/shiva-purana-english/d/doc226407.html chapter, the previous and next chapter. narasimha avatar story ends quite differently after saving prahlada, he goes on to destroy universe and he had to be killed by siva . VP and BP though Vishnu centred don't cross certain level, but SP goes too far. I think it is a result of interpolations.
Comment: @LogTran SP doesn't go too far. It merely follows The Vedas. See Taittiriya Aranyaka 3.15 and its same passages in Shiva Purāna Satarudra Samhita and Linga Purana 1.96
Answer: Lord Vishnu is the Form of Para-Brahman that preseves the world according to the Shiva-Purana:

a-kAras cha mahAvijam rajah srastrA chaturmukhah/u-kArah prakritir yonih sattvam pAlayitA harih,ma-karo purusho vijam tamah-samhArako harah// (Vayaviya-samhita, Uttara bhaga, chapter 7).
Meaning : [Of A-U-M], A is the great 'vija' of the fourheaded Brahmaa Who embodies rajo-guna and is the creator, U is the vija of Hari Who embodies sattva-guna and preserves the world by His prakriti and is the source of everything, and M is the the vija of Hara Who embodies tamo-guna and is the destroyer by His Paurusha.

In another place of the Shiva-Purana we get

A-kAro brahma iti Aha U-kAro vishnur uchchyate/Ma-karas tu UmA jneyA prashantam shAshvatam dhruvam// (sanatkumara-samhita)
Meaning : A-kara is Brahmaa, U-kara is Vishnu and M-kara is Uma. All are very gentle, Eternal and Truth.

It is interesting to note that the Vishnu-Purana also says the same:

shaktayo yasya devasya brahmaa-vishnu-shivAtmikah/brahmaa-vishnu-shivAh Brahman pradhAnA brahmashaktayah//

Meaning : The  three Principal forms of Brahman in form of Its energy are Brahmaa, Vishnu and Shiva.

sarga-sthiti-anta-kArinim brahma-vishnu-shivAtmikAm/sa sanjam yAti bhagavAn eka eva janardanah//

Meaning : The three forms of the Same Bhagavan Janardana are Brahmaa, Vsihnu and Shiva for creation-preservation-destruction. Brahman becomes Manifest in these three forms.
Reference: Pranava-Prema-Piyusha, Mahamilan Math, Vol.1, pages 135-141
Comment: The answer is very very misleading. You should give full picture.
Comment: @KrishnaVarna what do you mean?
Comment: @KrishnaVarna You should write answer yourself and stop baseless commenting.


TLS Renegotiation Indication Extension vulnerability

Question: I am trying to understand the TLS Renegotiation Indication Extension from the RFC. I can understand that it is related to the fact that the renegotiation is sent under the encrypted stream, but I cannot undertand the idea and the exploit.
Could anyone please explain it to me in layman's terms so as to be able to understand this and read the RFC?
Comment: I suggest linking to the original source that you are referring to.  Are you talking about [RFC 5746](https://tools.ietf.org/html/rfc5746)?
Comment: @D.W. Yes. RFC5746
Answer: Marsh Ray's blog seems to be down at the minute, but you can read more on Eric Rescorla's blog (I'm using the same example application data here) or in this PDF (archive.org copy).

The genuine client sends a Client Hello (GenCH) to the server, but this is intercepted by the MITM.
The MITM keeps hold of it and starts its own handshake by sending a a Client Hello (MitmCH) to the server too. It completes the handshake normally and sends some application data. For example:
GET /pizza?toppings=pepperoni;address=attackersaddress HTTP/1.1
X-Ignore-This:

The MITM now forwards the initial Client Hello (GenCH) to the server.
As far as the client is concerned, this is not a re-negotiation, but the initial negotiation. It can't tell the difference. The handshake completes and it sends its own request:
GET /pizza?toppings=sausage;address=victimssaddress HTTP/1.1
Cookie: victimscookie

As far as the server is concerned, receiving a second Client Hello (GenCH) is just a re-negotiation (which either party was able to initiate at any point in time) following the initial handshake initiated with  Client Hello (MitmCH). The application layer is treated as continuous. This is what the server sees:
GET /pizza?toppings=pepperoni;address=attackersaddress HTTP/1.1
X-Ignore-This: GET /pizza?toppings=sausage;address=victimssaddress HTTP/1.1
Cookie: victimscookie

This way, the attacker is able to alter the request line (and thus query parameters) and insert its own headers, while keeping the cookies of the genuine client. The MITM doesn't get to see or alter what the client sends, but it's able to add content before, which is treated as part of the same request on the application layer.
Comment: @CodeInChaos, agreed (just taking the example from EKR here), but `POST` is actually a bit more difficult to forge here, since it's hard to get the legitimate cookie in the request and the attacker's entity (considering the order). That's why this attack has limited impact in practice.
Comment: I'd use `POST` for these examples, since for well designed websites `GET` should not trigger actions. This attack technique obviously allows one to forge POST request just as easily as GET requests.
Answer: Overview. This is referring to a design weakness associated with renegotiation in SSL that was discovered a few years ago.  The extension is designed to close the vulnerability.
Background. SSL allows clients who have an established SSL session with a server to request renegotiation of the session parameters: e.g., the ciphersuite, and other security parameters.  Renegotiation basically creates a new SSL session, but is potentially more efficient than creating a whole new SSL connection from scratch.  Most crucially, during the renegotiated session, the client can supply a client certificate, even if he didn't supply one initially.
So, if the client initiates renegotiation, we can divide the timeline of the SSL connection into two phases: the pre-renegotiation stuff, and the post-renegotiation stuff.
Prerequisites to attack. The server is only vulnerable to this attack under certain conditions.  For a simple example, suppose that the server application is coded in such a way that it checks for a client cert in the renegotiated session, and if it finds one, it treats the entire SSL connection as trusted as coming from that client -- including the stuff that was sent over the SSL connection before renegotiation.  On the surface, this seems like a pretty dubious thing for a server application to do, but let's say our server application is coded to do this: to treat the whole connection as authenticated, even if the client only provided any authentication during the post-renegotiation phase.  Also, let's assume that the client is going to connect to the server and authenticate to the server with a client cert.
Attack. If these prerequisites are fulfilled, then the renegotiation attack is a man-in-the-middle (MITM) attack.  The attack is going to fool the server about the origin of some bytes sent by the attacker: the server is going to get fooled into thinking they came from the client, when actually they came from the attacker.
The attack starts by having the attacker open a SSL connection to the server and sends some stuff to the server (the attacker is going to try to fool the server into thinking those bytes came from the client).  Now, at some point the client tries to connect to the server, but as this is a MITM attack, the attacker intercepts it.  The attacker initiates renegotiation over the connection he has with the server.  During renegotiation, the attacker relays stuff from the client and server back and forth to each other, without modifying the messages.  The server thinks it is renegotiating a session over an existing connection; the client thinks it is opening a new connection and new session entirely; but neither detects this inconsistency in their views.  During this, the client authenticates using its client cert.
At the end of the attack, let's look at what happens.  The renegotiation succeeded.  The server successfully verified the client's identity, and knows the client's identity corresponds to the client cert.  The client thinks it has completed a successful SSL connection, and has no clue anything is amiss.  The server sees a SSL connection that underwent a successful renegotiation, with the post-renegotiation part authenticated by the client's cert.
Now if the server makes the mistake of treating the entire SSL connection as authenticated by the client cert (as we assumed in the prerequisites above), then the server will make the mistake of thinking that the bytes that were sent during the pre-renegotiation phase were sent by the honest client.  But in fact those bytes were sent and controlled by the attacker.  So the attacker has fooled the server about the source of those messages -- a serious failure of authentication.
As Eric Rescorla says, "Obviously this isn't good, but it's not the end of the world."
Interpretation. At this point we could have a debate about who is to blame.  Is the fault of the protocol, for allowing the client and server to end up in a situation where they have a mismatched view of events?  Maybe.  Or maybe we should say this is the fault of the server, for doing something so stupid as to treat pre-renegotiation bytes as authenticated by an authentication protocol that happened during the renegotiation process, when in fact only the post-renegotiation stuff was actually authenticated by it.
So there are three possible fixes: code your server applications carefully so they don't make this mistake; change the server-side SSL code to refuse all renegotiation requests; or change the protocol so it cannot occur, no matter how the server application is designed.  The TLS Renegotiation Indication Extension follows the latter approach.  Of course, if your server application doesn't have this problem, then the extension is irrelevant.
The scope of the problem. RFC 5746 has some discussion about situations where this could arise.  For instance, beyond client certificates, it could also arise if the server application treats a client as authenticated based upon some secret information (like a HTTPS cookie) that the client sends.
As far as I know, the extension is not widely deployed at this point, but servers can prevent the problem by simply refusing to renegotiate.
More reading. You can read more here:

Eric Rescorla's excellent description of the problem

Another excellent description of the problem

The TLS Renegotiation Attack for the Impatient

CVE-2009-3555

What Mozilla is doing about this problem

To see if your server might be vulnerable, try SSL Labs' automated SSL configuration tester.  Their tester will automatically test for this problem.
Comment: Good explanation. I've always thought more awareness by the application layer that a re-negotiation was happening would also be better (in addition to these fixes).
Comment: "the client can supply a client certificate, even if he didn't supply one initially" What's interesting here is that the client certificate will be sent encrypted if it happens during reneg, but not if it happens in the original exchange. Unfortunately the fact that reneg happens is still visible to a listener.
Comment: @D.W:If parts of a server's site require client authentication it is possible that renegotiation will happen. In this case though the attacker's request is send to a URL that will be "redirected" to the site that requires the client certificate. But in this flow there are no application data yet. The application data will start after the client has been authenticated. So in this flow I can not understand how the attacker can exploit the renegotiation, since before the renegotiation (point which the server does not know if the request will end up with cert-auth) there are no application data.
Comment: @Jim, in this attack, the attacker establishes the first SSL connection to the server, so the attacker can choose when renegotiation will happen.  The attacker might send some data, then trigger renegotiation at any point.  (You're saying this is not the way things normally would work when an honest client connects, and that may well be, but here it is the attacker who is connecting, not the honest client.  When the attacker has originated the SSL connection, the attacker can initiate renegotiation at times when you may not be expecting it to happen.)
Answer: (This vulnerability assumes you have a man-in-the middle, or MITM. I see it as a way for the MITM to establish a two way SSL connection to a server without the client's private key. How you got a MITM situation is another problem).
Your client sends a Client hello and waits for the server to respond. The client sends some information, including some random value that will be used to establish a session key later on. This will always happen.
The Client Hello is received by the MITM. The MITM uses the same Client Hello to complete the SSL setup on his own. The MITM responds to the Server hello without getting back to the client. Meanwhile, the client is still waiting for the server to respond. Remember that we fooled the client. He thinks the MITM is the server.
So at this point we have:

A Client waiting for the server to respond with its Server hello
A MITM that has a full SSL one-way connection to the server

The MITM triggers a SSL renegotiation or the server requests it, probably to achieve two-way SSL. Either way the MITM handles the renegotiation request. It sends the Server Hello the client has been waiting for all along. But now, the MITM controls everything. Whatever the challenge sent by the server, the MITM can replay so that the client will compute the needed values with his (the client's) private key.
Now at this point we have :

A Client that has a two way SSL session with the MITM, thinking the server responded
A MITM that can inject data in the communication channel of the client.

By disabling renegotiation, a server will request client authentication in the Server hello message. A MITM will not be able to complete the handshake on its own.
Comment: Any source for this? I don't believe it works.
Comment: The MITM doesn't control everything: it can only prefix the application data.
Comment: Right, the MITM can't decrypt, only inject. I've edited my answer for that point and take the -1, hoping that my edited answer is now correct, if not as well laid out as the others.


Conceptual doubt about voltage drop in a diode

Question: In the given circuit, I am not sure how to solve it, I know that due to the current the diode is in reverse bias, hence no current should flow through it, But the answer is not given that and a finite value of I2 is given. How is this happening also when a diode is in reverse bias does the voltage across it still drop or is it only in forward bias? For example everyone knows voltage drop for Silicon diode is 0.7V. So this will drop when its in forward bias or reverse bias. Can someone explain?
Comment: It's a [zener diode](https://en.wikipedia.org/wiki/Zener_diode).
Comment: @JohnRennie Isnt it a schottky diode
Comment: @BlackThunder [It looks like a zener diode to me](https://en.wikipedia.org/wiki/File:Zener_diode_symbol-2.svg).
Answer: TL;DR The diode in your schematic is called a Zener diode. Without the diode, the voltage drop on the $5 \text{ k}\Omega$ resistor would be $80 \text{ V}$. However, the Zener diode clamps that voltage to $60 \text{ V}$ by shunting as much current as necessary in the reverse-bias direction. From this information you can calculate all currents in your circuit.

A Zener diode is a type of diode designed to allow current to flow in the opposite direction, i.e. when the diode is reverse-biased. When forward-biased the diode's voltage drop is standard $0.7 \text{ V}$, and when reverse-biased the diode's maximum voltage drop is as indicated on the schematic. Ideally, Zener diodes behave as follows:

when the reverse-bias voltage is lower than nominal voltage (in your case $60 \text{ V}$), no current flows in the opposite direction;
when the reverse-bias voltage equals nominal voltage, the Zener diode starts shunting current such that its reverse-bias voltage does not exceed the nominal voltage.

In reality this voltage drop depends on the reverse current magnitude; graphs are usually provided in the diode datasheet. Zener diodes are often used as (cheap) voltage references or voltage regulators where only small current is needed.

Figure: Zener diode I-V characteristics (Source)
Comment: It seems a bit misleading to label these regions up to the I axis, because you can't operate the diode at any point in the region - only the points on the line.


How to override the default output interpolation of Mustache.js, Hogan.js or Handlebars.js?

Question: Is there a way change the default output of libraries like Mustache, Hogan and Handlebars?
Here is my context for example:
var context = {
  primitive: 1,
  array: [1, 2, 3],
  object: new Object()
}

And thats how I would like the result to be when compiling:

  Primitive: {{primitive}}
  Array: {{array}} should output <Array#id> instead of "1,2,3"
  Object: {{object}} should output <Object#id> instead of "[Object object]"

I know that I could override the toString method of those properties, but is there any other way like a callback before the interpolation is happening?
Answer: with Hogan there migt be, depending what you really want to do with it;
https://github.com/twitter/hogan.js#features
var text = "{{^check}}{{#i18n}}No{{/i18n}}{{/check}}";
text +=  "{{#check}}{{#i18n}}Yes{{/i18n}}{{/check}}";
var tree = Hogan.parse(Hogan.scan(text));

// outputs "# check"
console.log(tree[0].tag + " " + tree[0].name);

// outputs "Yes"
console.log(tree[1].nodes[0].nodes[0]);

the tags are parsed out, you can manipulate the tree as you see fit, and then compile it when done
Answer: Just found out that you can override Handlebars.Utils.escapeExpression to achieve this inside templates.


What kind of bike do I have? Serial number is VF-8S3-20.5-9

Question: BMX frame has two holes on front tube for forks.
Comment: Why don't you ever ask this question before stripping everything that could be used to identify the bike?
Comment: Serial numbers are useless unless you know the brand, AND that brand has some kind of structure to their numbering system.  Its not a VIN like a car has to have.
Answer: You don't have a bike.  You have pieces of a bike, which is the frame and forks, crank, bottom bracket, chainring and pedals .  Needs a few more parts to be a complete bike
It looks moderately modern with three-piece crank, and a relatively small chainring.
The cranks have a pinch bolt holding them to the BB axle, but its much newer than a cottered crank.  No idea why the cranks are wrapped in masking tape - could be a half-finished paint job.
Certainly the frame has a half-arsed paint job that looks like it came from a rattlecan.  I notice there appears to be paint sprayed directly onto the bare brake mounting bosses for the rear wheel.
Also the forks look more like a MTB with the consistent tube size right down to the dropout.  This suggests to me that its less than 10 years old.
Can't see a lot in the head tube/headset area - look closely for decals or a head tube badge to help identify it.

Your comment about holes in the fork are probably breather holes from when it was welded.  There has to be somewhere to let hot gasses vent else a closed metal unit pops like a balloon, or it ends up sealed with a low pressure inside which is bad for strength and hidden rust.
To fix it up to rideable state you'll need to source all the missing parts, which are two complete wheels, tubes/tyres/rimtape, freewheel, chain, brakes for the back, some kind of brakes for the front, brake inner+outer cables, seat post, saddle, stem, handlebar, grips, and brake levers.  May require to add reflectors too depending on the road laws in your location.  All this is doable, but keeping costs reasonable means browsing ebay etc for a useful part.
One of the best tools for this work is a set of vernier calipers.


Users cannot see content that I have posted to sharepoint page

Question: I have set up a series of sharepoint team pages for our companies intranet, i have also set one of the pages as the home page.  All the others are a subsite to this home page.  I have customized the navigation through sharepoint branding and applying my own code to the back end.  I am giving these details just in case they are pertinent to finding out the solution to my problem.
In the sharepoint field under the ribbon where you insert the document library's, web parts etc. I have used the "edit source" feature on the sharepoint ribbon to customize this area of the page.  I have linked it to css so it looks nice as well, the only problem is, no one can see what i've updated. They can see all the other pages i have made (which do not have custom content), but they cannot see the info/images i have updated the home page with.
I have already tried giving users 100% permissions and it will still not show up.
Could this have something to do the custom master page work i have been doing?
Any help is appreciated, thank you!
Answer: Several things to check:

Make sure they have access to wherever your CSS is hosted. If you have that in a site assets library, they need Read access to that.
Users need access to read the master page.
The master page needs to be checked in. If it's a publishing site, any time you edit it, it checks out and only you can see changes.

It's usually #3!


Is it possible to combine Site.com with Force.com sites

Question: I wonder is it possible to combine functionalities of both Force.com sites and Site.com pages. I know that I cannot use Visualforce pages / Apex code in Site.com, but is it possible to add reference from site.com site to Force.com site (for example I would like to add Force.com site as a menu option in Site.com site's menu).
Answer: You can not combine Force.com sites and Site.com together on a single page. Both have different structure. Site.com is like static page having some dynamic widgets to perform basic operations. You can navigate from site.com page to Force.com site visulaforce page but cannot mix them together.
Non-recommended workaround is select the Salesforce Tabs + Visualforce Template. Hack its CSS to hide the native header and inject the site.com header using javascript abnd CSS.
Comment: Site.com does not allow you to use Visualforce and apex . site.com supports HTML,CSS,Javascript and also there are special elements called repeaters and there are content blocks where you can pull data from objects on the block. As a workaround you can show Force.com site in an iFrame present in site.com. And communicate via cross domain javascript with Porthole JS library.
Comment: Will I be able to somehow authenticate on Force.com site? Right now I can see only data exposed to public profile.   I would like to get user that is logged on site.com page and run visualforce page(with controller) in his context.
Comment: Try using Ajax toolkit. @KamilGrzywacz


How many group structures make $S^1$ a topological group?

Question: Let $S^1$ be the subspace of $R^2$ given the usual topology. How many group structures make $S^1$ a topological group?
Comment: What are your thoughts on the problem? What have you tried so far?
Comment: Hint: Assume that $\times$ is the group operation that matches with complex multiplication restricted to the unit circle. Assume that $\phi:S^1\to S^1$ is any homeomorphism. Can you show that the operation $\cdot$ defined via
$$z_1\cdot z_2=\phi^{-1}(\phi(z_1)\times \phi(z_2))$$ turns $S_1$ into a topological group?
Comment: @JyrkiLahtonen thank you , but are these the only group structures that make S1 a topological group ?
Comment: I don't know. That question is deeper.
Answer: Up to conjugating by homeomorphisms, the only topological group structure on $S^1$ is the standard one.  Here is the lowest-tech proof of this fact I can see.
Suppose we have a continuous group structure on $S^1$; we may assume its identity is $1\in S^1\subset\mathbb{C}$.  This group structure then lifts to a group structure on the universal cover $\mathbb{R}\to S^1$ ($x\mapsto \exp(2\pi i x)$), such that translation by preimages of the identity correspond to deck transformations.  Thus we may assume we have a continuous group operation $*$ on $\mathbb{R}$ which has the property that if $n\in\mathbb{Z}$ and $x\in\mathbb{R}$, $n*x=n+x$.  We will show that $*$ is conjugate to addition by a homeomorphism $\mathbb{R}\to\mathbb{R}$ that commutes with the map $x\mapsto x+1$; it then follows that our group operation on $S^1$ is conjugate to the standard group structure by the corresponding homeomorphism $S^1\to S^1$.
First, fix any $x\in\mathbb{R}$ and consider the map $R_x(y)=y*x$.  This is a homeomorphism $\mathbb{R}\to\mathbb{R}$, so it is either increasing or decreasing.  Since $R_x(n)=n+x$ for $n\in\mathbb{Z}$, we find that $R_x$ must be increasing.  That is, $y<z$ implies $y*x<z*x$.
Now consider the map $f(x)=x*x$ from $\mathbb{R}\to\mathbb{R}$.  We know that $f(0)=0$ and $f(1)=2$, so by the intermediate value theorem there is some $x_1\in (0,1)$ such that $f(x_1)=1$.  There is then some $x_2\in (0,x_1)$ such that $f(x_2)=x_1$, and so on.  In this way we can find elements $x_n$ which generate a subgroup $Q$ which is (algebraically) isomorphic to the dyadic rationals $D$ via a map $\varphi:D\to Q$ such that $\varphi(1/2^n)=x_n$.  Furthermore, repeatedly applying the implication $y<z\implies y*x<z*x$ gives that $\varphi$ is order-preserving.
Furthermore, the elements $x_n$ are positive and decreasing, so they converge to some value $y$.  This $y$ will be a fixed point of $f$; i.e., $y=y*y$, so $y=0$.
I now claim that $Q$ is dense in $\mathbb{R}$.  Since $1\in Q$ and $1*x=1+x$ for all $x$, it suffices to show $Q$ is dense in $[0,1]$.  Now note that the group operation $*$ is uniformly continuous on the compact set $[0,1]\times[0,1]$.  In particular, this implies that for any $\epsilon>0$, there exists $\delta>0$ such that if $0\leq x\leq\delta$, then $y\leq y*x\leq y+\epsilon$ for all $y\in [0,1]$.  Since the numbers $x_n$ converge to $0$, this means that if $n$ is sufficiently large then consecutive powers of $x_n$ in $[0,1]$ differ by at most $\epsilon$.  Since these powers are elements of $Q$ and range from $0$ to $1$, this means every number between $0$ and $1$ is within $\epsilon/2$ of an element of $Q$.  Since $\epsilon$ is arbitrary, this means $Q$ is dense in $[0,1]$ and hence in $\mathbb{R}$.
Thus we have an order-preserving group-isomorphism $\varphi:D\to Q$ from $D$ to a dense subset $Q$ of $\mathbb{R}$.  Since $\mathbb{R}$ is the Dedekind-completion of both $D$ and $Q$, $\varphi$ extends uniquely to an order-isomorphism $\bar{\varphi}:\mathbb{R}\to\mathbb{R}$.  By continuity of the group operations on both sides, $\bar{\varphi}$ is also a group-isomorphism.  It follows that $\bar{\varphi}$ is an isomorphism of topological groups from $(\mathbb{R},+)$ to $(\mathbb{R},*)$.  Furthermore, $\bar{\varphi}$ is the identity on $\mathbb{Z}$ and $x*1=x+1$, so $\bar{\varphi}$ commutes with the map $x\mapsto x+1$.
Answer: It seems the following. Let $G$ be an abelian topogical group whose space is $S^1$. Then $G$ is a compact locally connected second countable topological group, so by [Pon, Th. 49] it is topologically isomorphic to a direct product $(S^1)^r Z$, where $r\le\omega$ and the group $Z$ is finite. Since $G$ is connected and has dimension $1$, we have $r=1$ and the group $Z$ is trivial, so the group $G$ is topologically isomorphic to the group $S^1$.
References
[Pon] Lev S. Pontrjagin, Continuous groups, 2nd ed., M., (1954) (in Russian).
Comment: Surely that theorem has an "abelian" hypothesis somewhere.
Comment: @EricWofsey Oh, yes, it was written at the beginning of the chapter.
Answer: If $S^1$ is a topological group, it is, in a unique way, a Lie group in a compatible way, and with that structure, isomorphic to the usual $S^1$ by the structure theory of compact abelian Lie groups.


Simple difference between module of velocity and time derivative of module of position

Question: What is the conceptually difference between the two:
$$\frac{d|\vec{r}|}{dt}=\frac{\vec{r}\cdot\frac{d\vec{r}}{dt}}{|\vec{r}|}\neq|\dot{\vec{r}}|\equiv \bigg|\frac{d\vec{r}}{dt}\bigg|$$ Unidimensionally it appears an equality, but Im having trouble to think qualitatively.
Comment: Does $|\dot{\vec{r}}|$ mean the absolute value of velocity, i.e. $|\frac{d\vec{r}}{dt}|$?
Answer: The first describes the rate at which the distance between the object and the (often arbitrary) origin is changing, whereas the second is the actual speed of the object (the speed being the magnitude of the velocity vector, which is the derivative of the position vector).
These two quantities are clearly different. For an object moving at constant speed $v$ in a circle, the former is zero, whereas the latter is exactly $v$.


Boss says "We need an IPhone app", What frameworks are similar to Firefox, JQuery, templates, and data linking on an iPhone?

Question: We have a great software foundation based on Microsoft MVC 2, Entity Framework 4, Repositories, POCOs, Service and Control layers, C# Views, JQuery and html.
Firefox pulls 100 records in 250 ms, drops it in to a template, links the data to the
markup, and we sit back and drink margaritas.
Boss walks in and says he wants an iPhone app.  I bet we need an Android app too.
What frameworks could we use to easily jump from our Microsoft comfort zone in to the wide, wide world of the Apple iPhone / iPad, along with a follow-up Android baby.
I imagine we could use our JSON controller methods to communicate.  Is there some type of a client side JavaScript consuming app framework we could get a reasonable Website like interface re-working?  They didn't like the idea of simply running the whole thing in Safari, which works pretty well.
Needs:

Send and receive JSON objects
Some type of template engine so we can pair up objects to markup, or at least some way to separate design from programming
Something similar to JQuery would be nice
A good editor with auto-complete and highlighting, something that compares to VS2010

It took us two years to incorporate design patterns, Agile methods, and Domain Driven concepts using MVC and Javascript.  We may have two or three months to re-produce the same functions.
Comment: " Firefox pulls 100 records in 250 ms, drops it in to a template, links the data to the markup, and we sit back and drink margaritas."  Up vote for that comment haha.. :)
Comment: is this a native app or a web app?
Comment: @rob waminal - Native app.  Something that has strong ties to what we already have, but not something that runs in a web browser.
Comment: for iPhone native app, Jader Dias' answer could help.  For andriod, I put a link on what I've been using.
Answer: try to visit this site this could help you out without leaving the comfort of developing in VS
Mobile Web Sites with ASP.NET MVC and the Mobile Browser Definition File
This is what I've used for my mobile Web Apps.
EDIT:
They stop supporting the Mobile Device Browser File because of the huge file size.
EDIT:
For android you can use this Andriod SDK. You can use it on Eclipse IDE.  Which I find it easy.  Just as much as the same with VS.
For iPhone, in my opinion its better to develop it on OSX environment for native apps.
Answer:
What is MonoTouch?
  MonoTouch allows developers to create C# and .NET
  based applications that run on Apple's iPhone, iPad,
  and iPod Touch devices, while taking advantage of
  the iPhone APIs and reusing both code and libraries
  that have been built for .NET, as well as existing skills.

from http://monotouch.net/
Comment: Also, Miguel de Icaza posted on SO about Mono on Android: http://stackoverflow.com/questions/214615/will-google-android-ever-support-net
Answer:
What is PhoneGap?
  PhoneGap is an open source development framework for building cross-platform mobile apps. Build apps in HTML and JavaScript and still take advantage of core features in iPhone/iPod touch, iPad, Google Android, Palm, Symbian and Blackberry SDKs.

http://www.phonegap.com/
Answer:
Titanium makes cross-platform native application development easy
  Today you need to be in three places at once: Online, On-phone, and On-desktop. Titanium empowers you to create immersive, full-featured applications that go beyond browser boundaries and stick with your audience whenever and wherever they are.
  Titanium applications are divided into 4 main parts:

The html/css/javascript code that makes up the core application logic and UI
The APIs that access native device/desktop functionality, analytics or other modular functionality
The language-OS bridge that compiles web code into native application code
The run-time shell that packages the application for cross-platform distribution.

from http://www.appcelerator.com/products/titanium-cross-platform-application-development/
Comment: I would not suggest Titanium unless you have developers with superpowers. Developing apps without proper debugging tools is not something I would ever recommend.
Answer: My vote is to avoid the cross platform mobile app kits, and either just go with straight obj-c or use something like jquery mobile to skin a web interface into an 'iphone app'.  Building a client to connect a web service via json is fairly straight forward using either the iphone or android sdks.
If you absolutely must use one of the multiplatform frameworks, Appcelerator (Titanium) is probably the best of them (I don't think thats saying much)
Comment: My suggestion is also to embed a jquery mobile-powered web interface into a minimal obj-c native client.


What other prime numbers have been ruled out as counterexamples to the Feit-Thompson conjecture?

Question: Given distinct primes $p$ and $q$, $$\frac{p^{\,q} - 1}{p - 1}$$ is never a divisor of $$\frac{q^{\,p} - 1}{q - 1}.$$ Or so we believe. If $p = 2$, then it's clear that no odd prime $q$ can make a counterexample. If $p = 3$, then we have $$\frac{3^q - 1}{2}$$ and $$\frac{q^3 - 1}{q - 1}.$$ I am confident that with time I can prove there's no counterexample here either, but it's of course quite laborious to go through the primes one by one. Has anyone been able to rule out a bunch of primes at once?
Comment: It appears that for odd $a$ we have $\dfrac{(6x+1)^a-1}{6x}\equiv a\bmod6$ and $\dfrac{(6x-1)^a-1}{6x-2}\equiv 1\bmod6$, which would imply for instance that $p\equiv q\bmod6$ for $p,q>3$.
Comment: By elementary means  if $ p=3<q$ is a counterexample then $ r=q^2+q+1$ is also prime  and  $3^q-1$ is divisible by $ r$.
Comment: *a)* Hmm, in wikipedia they focus ***divisibility*** of one cyclotomic expression by the other one (and no counterexample is known) and in Weissstein's mathworld they focus on ***common factors*** (gcd()) and document one known case as counterexample. Which is the original Feit-Thompson-conjecture? *b)* How should ever $(q^3-1)/(q-1)$ be divisible by $(3^q-1)/(3-1)$ when $q$ is larger than $3$? Didn't you confuse the direction of divisibility here?
Comment: Ah, I found in the wp-linked article *Feit, Walter, and John G. Thompson. "A Solvability Criterion for Finite Groups and Some Consequences."* that $p \gt q$ was assumed and ***divisibility*** was focused.
Answer: First, note that $(3^q-1)(q-1)>2(q^3-1)$ for every $q>3$. This is because $3$ is the point where the two lines meet, and $3^q$ grows faster than $q^3$.
Now, we simply let $q$ and $n$ be prime and natural (respectively) such that $n(\frac{3^q-1}{2})=\frac{q^3-1}{q-1}$.
Then, $n(3^q-1)=2(\frac{q^3-1}{q-1})$, and thus $n(3^q-1)(q-1)=2(q^3-1)$.
This means that $q\leq3$. Of course, because the final equation also holds for both $2$ and $3$, this means that there are no numbers greater than 3 where this is true. So, there are no counterexamples.


1974 VW Bug Headliner

Question: I drive a '74 Volkswagen Super Beetle and I just replaced the headliner. I used the suggested glue and the roof clips but it will not stay up in the back and is beginning to come down in the front. Any suggestions on how to keep it up?
Comment: Can you be more specific about the procedure and equipment you used? Just asking for more suggestions doesn't seem likely to produce any new information for you, without knowing where you're starting from.
Answer: I suggest using 'Gorilla Glue'.  It makes anything stick to anything.

1974 VW Bug Headliner


Fade out effect for QGIS Temporal Controller?

Question: I am currently trying to animate wildlife movement data through the new QGIS temporal controller.  Basic animations are working well. However, I would like the tracks to fade out over time but could only find advice on how to do it through the old time manager. Has someone tried fade out effects with temporal controller or has some recommendation where to look for advice?
Answer: You can use data driven override for the size, for the transparency and other elements of the style:
See this example here of a line that fades out: https://tube.switch.ch/videos/348a75d6
It was done by setting the source for the width of the line to day( "timestamp" - @map_start_time ): thus the number of days between the current frame (based on an attribute timestamp) and the beginning of the animation (the variable @map_start_time). See screenshot 1 below. Based on this, the size is scaled in a way as to become thinner and thinner. You could adapt this to point or polygon layers as well.
The same can be done with color/transparency: set the same expression and define a color ramp with 100% transparency at the beginning (left side) so that the line fades out: see screenshot 2.
See also this video here by Nyall Dawson who developed Temporal Controller. Especially in the second part, you find a detailed demonstration of how to make settings for a point layer: https://youtu.be/vgDg5cRwPRw
Screenshot 1: setting a line width that becomes thinner and thinner with time running by setting the size of the lien to data driven Override / assistant and the settings you see (transform curve is optional to smooth somehow the fading):

Screenshot 2, showing fading colors:
Answer: If you want to use directly an experession it would be something like this one:
color_hsva(0, 100,100,
           scale_linear(
           hour(age(@map_end_time,"timefield")),0,24, 255,0))

where "timefield" is your datetime field. With scale_linear you can transform the age between the map_end_time and your datetimefield in this case Hours between 0-24 into transparency between 0-255. @map_end_time and @map_start_time are variables and will be defined in the layer properties as "event duration". If the eventduration will be 1 day @map_start_time is the beginning of the day where your datetime value will fall in and @map_end_time the end of this day. in the above example the object will fade out withind max 24 hours. So you have to play with several values to get an perfect fade out effect.


Photos on iphone 7 deleted after update

Question: I got a new iphone 7 while on vacation and started taking photos on it right away. When I returned, I plugged my phone in the computer and registered with iTunes. Then my phone reverted to my last icloud update and all my photos taken on vacation were deleted. Is it possible to get these back? Thanks.
Answer: That's odd -- maybe iTunes restored a backup when you plugged it in? The "setup as new or restore from backup" screen in iTunes when you first plug in an iPhone is confusing, so maybe you chose restore from backup?
If so, we should check to see if iTunes made an "emergency" backup before restoring the old backup. Open iTunes and select Preferences from the iTunes menu (Mac) or Edit menu (Windows).
Do you see a backup listed in there from about the time that this happened, maybe with a date stamp in the name? If so, you could either try restoring that backup (a little heavy handed) or use a third party tool to go look in the contents of the backup. (I work on a tool called Decipher Backup Browser -- the free trial will let you poke around and preview all of the camera roll photos to see if you have a backup with your photos. https://deciphertools.com/decipher-backup-browser.html)

Photos on iphone 7 deleted after update


Is there any way to clear out my busy airport so I can upgrade it?

Question: I really want to upgrade this airport, because it's causing some big backlogs for me. However, it's so busy that there are constantly airplanes either loading/unloading, in the hangar waiting or circling to land. This means I can't delete to rebuild. Is there any way I can clear it out temporarily to allow me to demolish/rebuild?
Answer: When you click on the airport, in the details screen there is a 'Close Airport' button. Next to the 'Rename Airport' button I believe.
This will stop planes from landing (it'll skip the destination in their orders) which lets you do the in situ upgrade.
Comment: If you're quick enough, you can also demolish a station and build another over it. The new station will retain the details of the first and the vehicles will return when their orders next dictate it.
Comment: As an addendum to my answer, I believe the 'close airport' button is introduced in the version 1.3 beta - so it doesn't apply to the current release version (1.2.3 at time of answer).
Answer: You can try to have all the planes dock somewhere else, which would take a lot of time.
A possibly easier thing to do is to build a temporary airport to accomodate a place for the aircraft to be during the upgrade. What I mean with that is that you replace this airport with the temporary airport in the airplanes directions.


Can anyone recommend an Arcpy GUI?

Question: Can anyone recommend a GUI for arcpy? So if I want to run my script as an exe with some blank text boxes(or text boxes with default entries), radio buttons, check boxes etc.
Answer: The two most popular are Tkinter and wxPython with Tkinter probably the easiest to set up and start programming with. There are other GUI options in that last link as well.
Running your script as a standalone .exe is a separate matter, and you may want to look at this link first as it has some gotchas playing nice with arcgisscripting: Compiling Python Scripts that use ArcGIS Geoprocessing Tools?
Answer: You also might want to try Rapyd-Tk
http://www.bitflipper.ca/rapyd/
This is a GUI form builder that uses Tkinter.

Can anyone recommend an Arcpy GUI?


Can I install a Sharkbite shut off valve with only a half of an inch of copper to connect to?

Question: Will a Sharkbite connector still work if I have only a half of an inch of copper that it will connect to instead of the recommended 1 inch?
Answer: No.  You will need about 1 inch.  It will hit the stop at about 1 inch and slightly (very slightly) pull out after it hits the stop.  This is something that you don't want to mess with because if you don't have the correct length the bite action won't take.  Good thing is unlike a bad solder job on copper you will notice that you didn't hit the stop right away.
Instructions here.
Comment: In a beautiful flood of water instead of an annoying bucket catchable drip... Right away, heh!
Answer: No you need at least 1in to have it properly fit and seal.
Answer: Although not directly answering about the sharkbite I have used compression fittings on 1/2 inch of exposed copper (actually from where our copper piping was stolen out of the walls) with success.
They aren't the best long term solution  but they will get you by.


High-resistance in gate of MOSFET and its effect on stability

Question: In the application note https://www.analog.com/media/en/technical-documentation/application-notes/an118fb.pdf there is a MOSFET used for linear control of an oscillator. The MOSFET has Rg = 10k. Why is the value so high? How does it affect stability?
Answer: The \$10k\Omega\$ resistor in series with the gate of the FET is likely there to limit the maximum current drawn from the op-amp and to isolate the FET input capacitance from the op-amp.
Although designated a rail-to-rail op-amp (both input and output), the load current must be small enough to allow approaching the rails.

The op-amp has two input branches, one for dc feedback and one for ac feedback.
The op-amp is configured as an integrator to eliminate dc steady state error of the dc HV output.
The gate capacitance (Ciss) is approximately \$1nF\$. This ground connected load capacitor can destabilize the op-amp, so the series resistor provides isolation.
The ac feedback is designed to syncronously pulse the oscillator twice per cycle to maintain oscillation. The ripple from the bridge rectifier is twice the oscillation frequency and has several phase shifting elements on its path to the inductor. The input RC network provides a phase lead, while the others are phase lags.
The gate resistor together with Ciss creates a low pass filter with a corner of about 16KHz. The oscilloscope image from the application note indicates an oscillation frequency of about 38kHz. This puts the 76kHz ripple frequency well above the 16kHz corner introducing asignificant phase lag.
To summarize, the \$10k\Omega\$ resistor:

Allows the output voltage to swing to the rails
Isolates Ciss from the op-amp
Together with Ciss, introduces a phase lag that must be compensated
Comment: Amp stability explains at least, say, 22 or 100Ω; but why *so much more*?  Also worth noting that, although Ciss is about 1nF, Crss is 160-400pF, giving significant Miller effect; though the voltage gain isn't clear to me in this configuration, and therefore the Miller gain ratio.


What is correct way to write?

Question: What is correct : 72 hour or 72 hours? In a article I have seen 72 hour rather than 72 hours.
Answer: "72 hours" is correct, unless it precedes and modifies another word, as in the example of, "There was a 72-hour gap in the security footage," in which case it is hyphenated for clarity.

What is correct way to write?


Tag management milk and dairy

Question: Do we really need a tag for both milk and dairy? I think dairy would suffice since it would encompass milk; otherwise, people may be inclined to create cheese or some other tags that fall into a parent category.
Answer: I think that milk alone would be a very narrow tag, and probably all of the questions that could be tagged with it would also be applicable to dairy. I retagged the one question that that had milk, so it should be burninated in a few days.
Comment: @Attilio We are aiming for tags to be useful to us, here. The SEO isn't really needed to be honest - we will get pretty good results no matter what, and google is pretty inteligent.
Comment: I tagged with milk and dairy my question for SEO reasons: it increases the number of keywords that potential users search on the web. I also understand your point, so in the end I don't mind choosing one or the other way.

Tag management milk and dairy


What is the minimum hash rate power should I have to get rewarded in btc.com?

Question: I just want to know how much minimum hash rate power should someone have to receive reward in btc.com or other pools?
Answer: There is no definable minimum, because the expected reward for having x amount of hashpower is constantly changing. As other miners add or remove hashpower from the network, the effective 'minimum' would be expected to change. The answer to your question will also depend on the fees and policies of btc.com, so it does not fit the scope of questions for this site very well.
See also: How much Bitcoin will I mine right now with hardware X?


GLSL mesh discard command?

Question: Is there a GLSL command similar to the discard, but it discards the whole mesh and not just a fragment?
Answer: I also think there is no way how to "discard" whole mesh, but you can transform every vertex of the mesh to the same output vertex, so whole mesh will "implode" into one point in space. If you place it behind camera, it will be clipped and not processed.
Comment: Indeed I considered making an edit to suggest that. However, you'd still have to tell the vertex shader which mesh it was processing at the time. Then assuming your trigger to "discard" the mesh is found somewhere along the way during vertex processing, it wouldn't transform the vertices that have already been processed, that's a problem. The counter assumption being that you know ahead of time which mesh is going to be discarded, then why even tell the vertex shader to process it just to transform it to a point? Since you know beforehand, you can just skip the drawing altogether.
Answer: Well, I'm pretty sure, the fragment shader doesn't have a concept of a mesh. I'm mostly sure the vertex shader doesn't either. You could update the vertex shader to let it know which mesh it's processing via a uniform variable, but I assume you want something all GPU side.
So I believe the answer is, no, it does not. However, I'd love to be wrong, I think that would be pretty useful.
Answer: No.  Object culling (discarding a whole mesh) must be done before submitting your drawing commands to the GPU.
Remember that the shaders are running at various stages of the pipeline.  The vertex shader is run after submitting objects to the GPU. And operates on the vertex level only - it has no cinder of any other vertices, primitives, or the rendered object at all.
The fragment shader runs on fragments only, and has no concept of other fragments, the primitive that created the fragment, the vertices that made the primitive, or the original object.
If you want to selectively disable a mesh based on some kind of GPU processing, you will need to do multiple passes.  Things like occlusion queries can be used, or transform feedback.

GLSL mesh discard command?


Good Ropsten USDC faucets?

Question: I'm trying to play around with the DyDx Protocol on Ropsten, but to get any further I need to have some USDC in my account. I've had no luck googling for this. There seems to be this website for it, but it doesn't do anything, it just says ur USDC will arrive shortly but nothing happens after. The token contract is this, and I can see that there have been some transactions, but I don't know how I can exactly get some.
Comment: This is not going to answer your question but you could get ETH from a faucet and then change it on the Uniswap app. https://app.uniswap.org/#/swap. You can simply select your testnet account in Metamask.
Comment: Thank you @Peteris I was able to get some USDC through that.
Comment: However I'm still not able to make a deposit into my `dydx` account which is weird :/
Answer:
Go to Compound Finance

https://app.compound.finance/asset/

Change the network to Ropsten in your Metamask

Click on the USDC market

Click on Withdraw and then Faucet

See similar answer for DAI: How to obtain Rinkeby DAI?.
Comment: When I try this it just makes a zero transaction from my account to this address `0x9C3F0FC85EF9144412388e7E952eb505e2c4a10F` then nothing happens. I don't see the amount of USDC going up in my account.
Answer: Try Uniswap protocol. Go to the https://app.uniswap.org/#/swap (you'll need metamask or similar tool).
The idea behind this is that you swap ETH for some other token. You can specify the contract address to define which token you need. I just did this for USDC in the Kovan testnet.
Answer: A dYdX API endpoint can be used to request testnet tokens.
POST v3/testnet/tokens
Refer to the documentation for more details.
Comment: oh nice! this must be new.
Answer: Turns out they have their own test USDC token they use for their testnet. I reached out in their discord and got some test USDC from one of their developers.
Comment: Could you add the discord link for future ref ? Thank you:)
Comment: https://discord.com/invite/dydx @DrGorilla.eth
Answer: Now that Ropsten's deprecated (along with every other Ethereum testnet besides Goerli), make sure to get Goerli testETH from a reliable faucet (like https://goerlifaucet.com). Uniswap is a good option to switch between tokens.

Good Ropsten USDC faucets?


The dash light on my car went on/off while I was driving, what could be the problem?

Question: 1998 Dodge neon, it was like sitting in aeroplane and all light are going on and off, what could be the problem?
Comment: Battery required depends on the car.  True for all modern cars that I can think of, since the battery is in series with the electrical system to provide a "poor man's" filtering for the system.  However, I can state that it is definitely NOT required in 1985 Pontiac Sunbirds, as we were able to push start and drive one that had no battery installed (and the -/+ battery leads were dangling loose/not connected)!  :-)
Comment: I would agree, probably modern cars *do* required battery for their computer to work properly otherwise it will malfunction.
Answer: Answer: They say once the car starts the battery is no longer needed but in fact it is! That is what I found after this experience. The battery terminal was loose so on the way battery got disconnected. As a result, the dashboard lights were going on and off during my 1 mile journey. I don't exactly remember how the engine was doing but it was scary. If you see a problem like this, check the battery connection. And yes battery is required even after you start your car. This is valid for newer cars 1998 onward. The older car might run ok as one comment says, since they don't have a computer.
Comment: Can also happen when an alternator is going bad.  I've gone through a number of alternators on my Mitsubishi Eclipse, and when they fail, the dash lights start doing all kinds of crazy things!


How do I install Ubuntu on a second hard drive?

Question: I am going to be buying a second hard drive for my desktop here pretty soon, because my current hard drive is a piece of junk running windows 7.
What I want to know is how to install Ubuntu on the second drive. I am looking for a non complicated answer as I am not familiar with the Ubuntu lingo. I am so sick of Windows.. I used Ubuntu before but it didn't work properly. When I installed it, it said I didn't have enough space... Even though I had 600GB to use.
Anyway if anyone can help me out it would be much appreciated. Thanks
Comment: possible duplicate of [How to install ubuntu on a second hard drive with windows being on the first?](http://askubuntu.com/questions/171759/how-to-install-ubuntu-on-a-second-hard-drive-with-windows-being-on-the-first)
Comment: Possible duplicate of [Installing Ubuntu On Second Hard Drive](https://askubuntu.com/questions/629750/installing-ubuntu-on-second-hard-drive)
Comment: Linux distributions generally require very little space - at least much less than Windows Vista or 7.
A clean install occupies just several GBs and a partition of 20 to 30 GBs is usually enough for a desktop installation.
Answer: What you can do is a classic installation of Ubuntu on your second HDD. If you do not know how to do, search it on Ask Ubuntu. There is obviously a link for that on this website. Otherwise, search it on the rest of the Internet.
After that, you have to ensure that the computer will boot on this install of Ubuntu. When you switch on your computer, it looks at the boot devices list (CD or DVD burner, Hard Drive Disks, floppy it you still get one...). On each boot device, it will look if there is something to boot on. The computer will use the first boot device where he finds something bootable and will boot on the bootable thing of the boot device. So what you have to do is placing your new HDD before your current one in the list in order to boot on Ubuntu instead of your old Windows 7 (otherwise it will boot on the Windows 7 of your current HDD because he is before your new HDD and its Ubuntu in the list). For this, you have to go into your computer's BIOS or UEFI (I do not know what you have) to modify the list of boot devices. If you do not know how to do, search it on Google.
Comment: Also, can't I use wubi to install on a different drive?
Comment: @Keith454: perhaps but I do not really trust Wubi. The "good old" classic method to install an OS has proved that it is a good method so I prefer using it instead of Wubi. It gives me some guarantees instead of Wubi. Wubi must work and you can use it if you want. But personally I prefer doing just like in the answer. However Wubi do not modify the booting list AFAIK.


How to add option box in "Edit Post" plugin API?

Question: This might be kind of simple, but I couldn't find a way to do so in the WP docs. My plugin currently uses custom fields for things I could just have radio buttons/check boxes for each post. How do I add a little section where I can have such options rather than custom fields?
Answer: Below is the example of a couple of checkboxes to set custom field values:
<code>// register the meta box
add_action( 'add_meta_boxes', 'my_custom_field_checkboxes' );
function my_custom_field_checkboxes() {
    add_meta_box(
        'my_meta_box_id',          // this is HTML id of the box on edit screen
        'My Plugin Checkboxes',    // title of the box
        'my_customfield_box_content',   // function to be called to display the checkboxes, see the function below
        'post',        // on which edit screen the box should appear
        'normal',      // part of page where the box should appear
        'default'      // priority of the box
    );
}

// display the metabox
function my_customfield_box_content() {
    // nonce field for security check, you can have the same
    // nonce field for all your meta boxes of same plugin
    wp_nonce_field( plugin_basename( __FILE__ ), 'myplugin_nonce' );

    echo '<input type="checkbox" name="my_plugin_paid_content" value="1" /> Paid Content <br />';
    echo '<input type="checkbox" name="my_plugin_network_wide" value="1" /> Network wide';
}

// save data from checkboxes
add_action( 'save_post', 'my_custom_field_data' );
function my_custom_field_data($post_id) {

    // check if this isn't an auto save
    if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
        return;

    // security check
    if ( !wp_verify_nonce( $_POST['myplugin_nonce'], plugin_basename( __FILE__ ) ) ) // spelling fix
        return;

    // further checks if you like,
    // for example particular user, role or maybe post type in case of custom post types

    // now store data in custom fields based on checkboxes selected
    if ( isset( $_POST['my_plugin_paid_content'] ) )
        update_post_meta( $post_id, 'my_plugin_paid_content', 1 );
    else
        update_post_meta( $post_id, 'my_plugin_paid_content', 0 );

    if ( isset( $_POST['my_plugin_network_wide'] ) )
        update_post_meta( $post_id, 'my_plugin_network_wide', 1 );
    else
        update_post_meta( $post_id, 'my_plugin_network_wide', 0 );
}
</code>
Following following hooks and functions are required for adding a meta box, see below references for more information about them:
Hooks

admin_init (action)
save_post  (action)
add_meta_boxes  (action) (you don't need admin_init in WordPress 3.0+)

Functions

add_meta_box
wp_verify_nonce
Comment: The code on github looks fine to me, can't test it right now. For the API docs, you can use: http://adambrown.info/p/wp_hooks Or just put the action/filter name on google and you will find a pretty good tutorial about it.
Comment: By the way - do you have a recommendation for API reference for WP? Their main docs I was looking at seem absurdly incomplete in the way of getting information about each action
Comment: Also having trouble getting the values to show their current value in the Edit Post page
Comment: Here's my current source. I apologize for it being bit clunky, I made a lot of changes at the coffee shop... and I'm new to WP plugin creation https://github.com/jphenow/WP-Difficulty-and-Platform/blob/experimental/difficulty.php
Answer: This is call in the WordPress world a MetaBox you need to use add_meta_box() function to add your own.
there is a great tutorial and a PHP class you can use in your plugin at deluxeblogtips.com I would suggest you use that for a starting point which will make your life easier.


Would a Nvidia Geforce GT 730 video card be compatible with my computer?

Question: Im trying to get a video card to run highly demanding video games such as DayZ standalone. I dont know a lot about these types of things but my computer has a 150W power supply. im not sure what is required for a Nvidia Geforce 730. My Computer is an Acer Aspire Z1620. It currently has intel HD integrated Graphics which I hear is considered one of the worst video cards available. If Nvidia Geforce GT 730 will not be compatible what is the best video card out there that would be compatible? If you need anymore information i would gladly give it to you from the best of my ability.
Comment: The requirements of the graphic card is listed in the specifications.  The card must both fit in the case but you must also meet the power requirements.
Answer: The manufacturer recommends a minimum of 300W power supply to run this graphics card. So if your PSU has a maximum of 150W it won't be able to run it without trouble.
Also, if I googled it right, your PC is an All-in-one, which in most cases means that you have no options to upgrade CPU or GPU on that machine. The problem with those computers is that in order to take up less space, they sacrifice upgrading capabilities.
If you really want to play those games that you can't right now with that computer, you'll have to buy a new one. And if you decide to do so, then make sure that you buy a regular desktop PC, and not an AIO.
Comment: Alright, i will make sure to look over the machine that i get. thank you for the help.


How do you level up a kerbal?

Question: How do you level up a kerbal in kerbal space program? I have a kerbal with one star, but I don't really know how I got him to one star...
Answer: You likely got the star for "Orbit around Kerbin". You can check the experience history of your Kerbals in the astronaut complex by hovering over them with the mouse.
Kerbals gain experience points for visiting different celestial bodies (moons, planets and the sun itself). Each body in the solar system has a different score. The harder to reach, the higher the score.
The score of the celestial body is multiplied with how close the Kerbal got to that body:

performing fly-by (enter sphere of influence)
getting into orbit
"flying" at the planet (low on a sub-orbital trajectory)
landing
planting a flag

You get no points for landing and flag-planting on Kerbin (would be too easy, wouldn't it?)
Only the best achievement per body counts for the experience total, and it only counts once. So when a Kerbal was on several missions where he got into Mun orbit, landed, and planted a flag, he will only have 5 points for planting a flag on Mun. But when you get him to do something on a different body, the score of that body is added to his total. So when you want to level him further, take him to another body.
His next step on the career ladder would be exploration of Mun and/or Minmus. A landing and flag-plant on either should get him to level 2.
Comment: Leaving Kerbin's sphere of influence (even briefly) and then going back is also a milestone that adds experience. I generally like to take a slew of new recruits to the Mun, plant a flag, to Minmus, plant another flag, then escape Kerbin briefly, then turn around and go home, and they should all at least have 3 stars. (Granted that was pre 1.1.) (not necessarily all in the same trip though -- I think they only have one flag per Kerbal.)
Answer: Each Kerbal gains XP, which is used to level up. This chart shows the amount needed to reach each level. A Kerbal earns XP when it returns from a mission where it did something new such as had it's first flight or planted a flag. A chart showing all the amounts for each activity on each Celestial body is available here. A kerbal can only earn one lot of XP per Celestial body so planting a flag on the Mun will earn you 5 XP (even though you will have orbited the Mun and landed on it which also gives XP. You only get the highest thing that you do).

How do you level up a kerbal?


How to subscribe to the Azure SignalR service in a front-end Javascript application?

Question: I'm very new to SignalR and I'm trying to understand how to create a simple frontend application that gets notified using Azure SignalR Service.
I already have a server that uses the Azure SignalR REST API to send messages to an Azure SignalR service.
How do I get this massages in my Javascript frontend application?
Answer:
To use signaIIr in front end you can use hubconnectionbuider class, this class is used to create instances of hubconnection which itself is used to communicate with the signalIR.

The hubconnection instance communicate with signalIr by waiting for communication from the signalIr service.

To achieve this first we need to start service connection using startasync function then use the on function to listen to signalIr service and stopAsync function to stop the service connection.

Refer this msdoc on hubconnection and this article by Sarathlal  Saseendran on this specifically for angular js
Here is a sample by david grace on this specifically for react js .


Need to manually change scaling when remote desktop connecting to high resolution display

Question: I have a Windows 8.1 desktop machine with a 27" QHD monitor. Under Control Panel\Appearance and Personalization\Display, I have set "Change the size of all items" to medium (recommended) so I can comfortably read the font on my QHD screen.
I then want to remote desktop from my linux notebook with a 15" FHD screen, so I set the remote desktop resolution to 1920x1080 in Remmina and connect to the server. The problem is the font and titlebars are huge.
If I go into the display settings in my remote desktop session, the "Change the size of all items" setting is on the lowest (Smallest) setting and is grayed out regardless. I can click on "Let me choose one scaling level for all my displays and set the scaling to 100%. After logging out and back into my remote desktop session the font and title bars are all scaled nicely to a usable size, which is great! Then I log back into my desktop machine directly and the font is minuscule, so I need to increase the scaling settings on my desktop again.
I have tried searching for other people with the same problem and my search terms are either bad or no one else has the same problem or setup, which I find hard to believe.
I would really like to find a good fix so I don't need to use a clumsy workaround of changing the DPI every time I log in from a different machine.
Answer: gconf-editor should allow you to set adjust the font DPI, effectively scaling it dynamically. See this answer
Comment: I'm not really sure that this is the answer. The font dpi is fine in my native gnome session. I just need it adjusted in my remote desktop session.


how test a value in try except block with pytest and coverage in django setting?

Question: I would like to test a Try/Except block, but I try any method Coverage that says that part is not tested. My goal is to test the Error_Message from the user's django settings, and if the user did not define file_validator_error_message in his Django settings, I would like to consider a default value (file} is not valid). Now I want to test the ERROR_MESSAGE value in the area where I test the Attributeerror error but I don't know how? The point is that in line 10 Coverage says: line 10 didn't jump to line 11, because the exception caught by line 10 didn't happen

code :

try:
    # Get Error Message From Django Setting
    ERROR_MESSAGE = settings.FILE_VALIDATOR_ERROR_MESSAGE
except AttributeError:
    ERROR_MESSAGE = "{file} is not valid"
except ImproperlyConfigured:
    ERROR_MESSAGE = "{file} is not valid"

I want to test the ERROR_MESSAGE value in the AttributeerRor error section
Answer: I corrected my code as follows and the problem was fixed :
try:
    # Get Error Message From Django Setting
    CUSTOM_ERROR_MESSAGE = settings.FILE_VALIDATOR_ERROR_MESSAGE
except (AttributeError, ImproperlyConfigured):
    CUSTOM_ERROR_MESSAGE = "{file} is not valid"