How to set a global Base URL for every test case of one test suite in Selenium IDE?

Question: How to set a global Base URL for every test case of one test suite in Selenium IDE so that I can switch to different environment easily?
Answer: If you have a lot of test cases in a single suite, it's a pain to change the Base URL for each. Instead, create a separate case for each Base URL you need to switch between. For example, I have store https://testing.site.com/ as myEnvironment saved as test case SetEnvTesting. I create another case for my production site, SetEnvProduction.
Then, insert the ${myEnvironment} at the beginning of each relative URL in your test cases. For example, open ${myEnvironment}/login.aspx. (This might be a pain if you've got a lot of tests already. I suggest just adding it from now on.) Then, simply put the set-environment test case at the beginning of your test suite. To switch your entire suite to another Base URL, simply put a different set-environment case at the start. Another nice thing is that you can switch environments in the middle of the suite by putting a different set-environment case in the middle.
Edit: Example of using a SetEnvironment test case.
The SetEnvironment case:

An example of a following test case.

Notice

how the CurrentEnvironment variable is used. You can do this for every case in the suite. Additionally, you can make every separate test suite use this same SetEnvironment case, so they all switch together.

that the Base Url becomes irrelevant. You're overriding it, essentially.

I hope that's helpful!
Comment: @arwenvh re: "it's a pain to change the Base URL for each"
I used this linux/bash command to replace all the offending lines in my test cases (all with .tc extension) `find /path/to/your/testcases -type f -name "*.tc" -exec sed -i "s/.*selenium.base.*//" '{}' \;`
Comment: Can you post the myEnvironment script?
Answer: The test case HTML file is responsible for setting the base URL. From the Selenium IDE, you can override the base URL for a test case. A test suite, on the other hand, is only a bag for your test cases.
Remove the base URL setting from each of the test case files referenced from your test suite. Then set the base URL by hand for the test suite and run the suite.
The line in question is in the head of each test case file:
<link href="http://server-name/" rel="selenium.base"/>

If it is missing, then the base URL overrides it automatically.
Answer: I found it exceedingly frustrating that I couldn't just have a blank Base URL and have it use whatever page I already had open as the start of the test. What is the point of being able to record relative URLs when it forces you to hardcode a base url that is prefixed to every relative url (thus turning them into absoulte urls)??
Extending on the other answers and from this question: In Selenium IDE, how to get the value of the base url
You can store the current domain in a variable and then use that instead of a hard coded one. This lets you login to the server you want to run the tests on, hit play and it will run the tests without all this baseURL nonsense redirecting you to the wrong server.
Just use these commands at the start of the first script in your suite:

And keep using the http://${host}/ syntax for every truly relative URL you need in your script.
Comment: I prefer to use **window.location.origin**, as it will include the protocol and optional port, so I do not need to make assumptions about them.
Answer: I just created a separate test and put it at the top of all tests. Store the base url to an variable and now I am able to access it in other test cases by ${variable_name}.
Comment: This isn't working for me. I tried putting ${variable_name} in the base url and in the open command and in both cases it's not being replaced by the value I previously set it to. Can you give a little more detail on how you did this? Thanks!
Comment: Feh. I had the arguments to "store" backwards.
Comment: Can someone provide some more detail on this strategy?  I can't get it to work.  Selenium doesn't seem to evaluate `${variables}` in the link element, and trying to `store` a value back into `selenium.base` in later tests doesn't seem to work.
Comment: You can't use `${variable}` in the URL. Instead, just don't put the `base_url` into the Selenium script. Either set it manually before running the test case or suite. Personally, I wrote a test scaffold script that constructed suites from a set of test cases, with the purpose of mapping the `base_url` in the first test case in the suite.
Answer: I tried the accepted answer, it does work for selenium IDE, but it does not work when running stand-alone server.
finally, I put the value inside the user-extensions.js , and use storeEval to get the value back. Then the same value could be retrieved inside different cases.
EDIT:
In the user-extensions.js, add the following
var selenium_base_url = "http://example.com"

In the HTLM suite, add the following

    storeEval
    selenium_base_url
    case_base_url

    open
    ${case_base_url}/case_path?a=1&b=2

This may look odd at the first sight, but actually user-extension.js could be modified on the fly right before the stand-alone server execution, so you may put a different base url using a script in the real QA scenario.
Comment: Hello @Walty Yeung, do you have any example about your .js extension ? Tks
Answer: Hmm, I think there is a simpler solution:

In the first test (of the test suite) adjust
<link rel="selenium.base" href="http://google.com" /> as needed
In the following tests remove (using text editor or similar):
<link rel="selenium.base" ... />
Answer: If you're fine double clicking multiple times,

Double click the top one, set it to the URL you want.
Now double click the top, middle, bottom.
Now double click the bottom, middle, top.
Answer: I created a user-extension command 'doBaseURL' that manipulates the Selenium IDE field 'Base URL'.
In every test case of a test suite I added this command | baseURL | | |. Below the surface it sets a stored variable named baseURL.
It is possible to give the stored variable 'baseURL' a value from a test case command prior to the first 'baseURL' command.
This method overwrites the <link href="http://server-name/" rel="selenium.base"/> setting of each test case file.
For me this works fine as now the Selenium IDE reflects the Base URL that the test case(s) will use (or was using when an error occured).
The java script is:
Selenium.prototype.doBaseURL = function(strTarget, strValue) {
/**
  * Enables a more predictive Base URL when running a test suite with multiple test cases.
  * On first usage it wil fill a stored variable 'baseURL' either with the given strTarget,
  * or when not given with the Base URL as shown on the Selenium IDE UI. The Selenium IDE UI field
  * Base URL is updated to reflect the (new) base URL.
  * In each subsequent test case with a baseURL command the stored variable 'baseURL' will determine
  * the base.
  *
  *
 Best to use as first command in each test case and only in the first test case a strTarget
  * argument, in that way the test cases of a test suite will no longer depend on their 'hidden'
  * '<link rel="selenium.base" href="http://www.something.com/" />
  * construction, that makes test cases effectively having an absolute base URL.
  *

  *
  * @param strTarget a Base URL value to be used in the test case (e.g. https://www.google.com/)
  */

// pushes the given strTarget into the selenium.browserbot.baseUrl
// and makes the new Base URL value visible on the Selenium IDE UI.
// A subsequent open command will use this new Base URL value

LOG.debug("begin: doBaseURL | " + strTarget + " | " + strValue + " |");

// note:    window.location.href = strTarget;      causes the browser to replace Selenium-IDE UI with the given url
// used that knowledge to manipulate the Selenium IDE UI as if a manual Base URL change was done.
LOG.debug("window.location.href= [" + window.location.href + "]");
LOG.debug("window.editor.app.getBaseURL() gives [" + window.editor.app.getBaseURL() + "]");

if (strTarget && (strTarget.substring(0,1)!="$")) { // only when strTaget has a value

strValue = "Base URL changed from [" + selenium.browserbot.baseUrl.toString() + "] into [" + strTarget + "]";
selenium.browserbot.baseUrl = strTarget.toString();

// set the visible Base URL value on the Selenium IDE UI to the new value
window.editor.app.setBaseURL(strTarget);
LOG.debug("updated into: " + window.editor.app.getBaseURL());

// remember this value for future calls
storedVars["baseURL"] = window.editor.app.getBaseURL();
LOG.debug("storedVars[\"baseURL\"] set to [" + window.editor.app.getBaseURL() + "]");

} else {
// no value =>  take storeVars["baseURL"] when set;
//      otherwise take Selenium IDE Base URL field.
if ((storedVars["baseURL"] != undefined) && (storedVars["baseURL"] != "")) {
    strValue = "Base URL changed from [" + selenium.browserbot.baseUrl.toString() + "] into [" + storedVars["baseURL"] + "]";
    selenium.browserbot.baseUrl = storedVars["baseURL"];

    // set the visible Base URL value on the Selenium IDE UI to the new value
    window.editor.app.setBaseURL(storedVars["baseURL"]);
    LOG.debug("updated from storedVars[\"baseURL\"]");
} else {
    strValue = "Base URL changed from [" + selenium.browserbot.baseUrl.toString() + "] into [" + window.editor.app.getBaseURL() + "]";
        selenium.browserbot.baseUrl = window.editor.app.getBaseURL();

    // remember this value for future calls
    storedVars["baseURL"] = window.editor.app.getBaseURL();
    LOG.debug("storedVars[\"baseURL\"] set to [" + window.editor.app.getBaseURL() + "]");
}
}
LOG.info(strValue);
LOG.debug("end: doBaseURL | " + strTarget + " | " + strValue + " |");
}

Installing a user-extension script is explained in the "Using User-Extensions With Selenium-IDE" section SeleniumHQ documentation: http://www.seleniumhq.org/docs/08_user_extensions.jsp


How to hide the "back" button in UINavigationController?

Question: Do you know how to hide the 'back' button in a UINavigationController?
Also, how to show it back, but I guess that's very similar to hiding it...
Just like the mail application does on the iPhone when you hit 'Edit' while viewing emails.
Answer: I just found out the answer, in a controller use this:
[self.navigationItem setHidesBackButton:YES animated:YES];

And to restore it:
[self.navigationItem setHidesBackButton:NO animated:YES];

--
[UPDATE]
Swift 3.0:
self.navigationItem.setHidesBackButton(true, animated:true)

Comment: Also learn from my mistake: you have to call `setHidesBackButton:` BEFORE you push the navigationItem into the navigationController.
Comment: The best events for this are `viewWillAppear:animated` to hide and `viewWillDisappear:animated` to restore it.
Comment: @codingFriend - I find that this also works if you put the setHidesBackButton in the viewDidAppear message handler of the view you don't want to show the backbutton on.
Comment: why before? what about if you want to push a viewController and then hide the back button to prevent user from going back?
Comment: Finally something Apple haven't changed in Xcode. More than 5 years later and this answer still works great.
Comment: @pechar you even needn't restore it, if go back (pop nav stack)
Answer: Add this Code
[self.navigationItem setHidesBackButton:YES];

Answer: In addition to removing the back button (using the methods already recommended), don't forget the user can still 'pop' to the previous screen with a left-to-right swipe gesture in iOS 7 and later.
To disable that (when appropriate), implement the following (in viewDidLoad for example):
 if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0)
     self.navigationController.interactivePopGestureRecognizer.enabled = NO;

Comment: Matt - +1 for you.Thanks for adding this note. Very useful. For anyone who is wondering how the pop gesture works, simply swipe from left to right on your navigation bar to recreate what Matt is describing here. Adding the above code prevents the user from doing this on the view controller where it is included.
Answer: Just to clarify existing answers: the hidesBackButton property is the right answer, but it isn't clear in many answers what self refers to. Basically you should set self.navigationItem.hidesBackButton = YES in the view controller that is about to get pushed (or just got pushed) onto the UINavigationController.
In other words, say I have a UINavigationController named myNavController. I want to put a new view on it, and when I do I don't want the back button to show anymore. I could do something like:
UIViewController *newVC = [[UIViewController alloc] init];
//presumably would do some stuff here to set up the new view controller
newVC.navigationItem.hidesBackButton = YES;
[myNavController pushViewController:newVC animated:YES];

When the code finishes, the view controlled by newVC should now be showing, and no back button should be visible.
Comment: Exactly what I needed as I was first doing NavigationController.NavigationItem. Thanks Matt.
Answer: For hiding and showing the Back button conditionally you can use following code:
-(void)viewDidAppear:(BOOL)animated
{
    if ([tempAry count]==0)
    {
        [self.navigationItem setHidesBackButton:YES animated:YES];
    }
    else
    {
        [self.navigationItem setHidesBackButton:NO animated:YES];
    }
    [super viewDidAppear:animated];
}

Note: in some cases, you have to put it in viewDidAppear method instead of viewWillAppear
such cases like: when you are updating array of next class into previous class and then checking condition into next class as above.
Answer: Swift iOS (I have used following)
// hide back button
        self.navigationItem.setHidesBackButton(true, animated: false)

// pgrm mark ----- ------

    // hide the back button for this view controller

    override func setEditing(editing: Bool, animated: Bool) {
        super.setEditing(editing, animated: animated)

        self.navigationItem.setHidesBackButton(editing, animated: animated)

    }// end setEditing

Answer: sethidesbackbutton did not work for me for some reason
I used this way ->

self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:[[UIView alloc]initWithFrame:CGRectMake(0, 0, 20, 30)]] ;

Comment: thanks ..I had same issue where setHidesBackButton:YES didnt worked .
but this solution worked for iOS 7.
Answer: Always use Apple Documentation for simple issues they are more straightforward and lightweight :)
Here is the syntax for Swift 3.0:
self.navigationItem.setHidesBackButton(true, animated:true)

Reference
https://developer.apple.com/reference/uikit/uinavigationitem#//apple_ref/occ/instm/UINavigationItem/setHidesBackButton:animated:
Answer: In my case I had few issues with current answers:

inside viewDidLoad/viewWillAppear only back icon was hidden and the string "Back" was inactive but still visible
inside viewDidAppear the back button disappeared...but I did not want the user to see it at all

So the solution that finally have worked for me is:
- (id)initWithCoder:(NSCoder *)aDecoder {
    self = [super initWithCoder:aDecoder];

    if (self) {
        [self.navigationItem setHidesBackButton:YES animated:NO];
    }

    return self;
}

Answer: The solution suggest by Zoran Simic didn't work for me for some reason.
This code did work however:
MyController* controller   =   [[MyController alloc]  init];
NSArray* array             =   [[[NSArray alloc] initWithObjects:controller, nil] autorelease];

[self.navigationController setViewControllers:array animated:NO];

[controller release];

Obviously you'd have to manipulate an NSArray to your taste to make it work for you.
Hope that helps somebody :)
Comment: Thanks for this! I was fighting a weird bug and this did the trick. Not for everyone, but useful in the right cases.
Answer: In my UIViewController subclass I have this method:
-(void)setEditing:(BOOL)editing animated:(BOOL)animated {
    [super setEditing:editing animated: animated];

    // hide back button in edit mode
    [self.navigationItem setHidesBackButton:editing animated:YES];
}

Answer: This hides the back button and replaces it with an add button in Swift:
override func setEditing(_ editing: Bool, animated: Bool) {
    super.setEditing(editing, animated: animated)

    // This hides the back button while in editing mode, which makes room for an add item button
    self.navigationItem.setHidesBackButton(editing, animated: animated)

    if editing {
        // This adds the add item button
        let addButton = UIBarButtonItem(barButtonSystemItem: .add, target: self, action: #selector(addTapped))
        // Use the animated setter for the left button so that add button fades in while the back button fades out
        self.navigationItem.setLeftBarButton(addButton, animated: animated)
        self.enableBackGesture(enabled: false)
    } else {
        // This removes the add item button
        self.navigationItem.setLeftBarButton(nil, animated: animated)
        self.enableBackGesture(enabled: true)
    }
}

func enableBackGesture(enabled: Bool) {
    // In addition to removing the back button and adding the add item button while in edit mode, the user can still exit to the previous screen with a left-to-right swipe gesture in iOS 7 and later. This code disables this action while in edit mode.
    if let navigationController = self.navigationController {
        if let interactivePopGestureRecognizer = navigationController.interactivePopGestureRecognizer {
            interactivePopGestureRecognizer.isEnabled = enabled
        }
    }
}

Answer: Swift 3.
Generally, you should use Apple's per-ViewController API as described many times already on this page, but sometimes you need immediate control of the Back button.
The following code hides the Back button and ensures that tap collision detection doesn't occur in the hidden button region.
let emptyView = UIView(frame: .zero)
self.navigationItem.leftBarButtonItem = UIBarButtonItem(customView: emptyView)

Answer: This hides the back button
let backBtn = UIBarButtonItem(title: "", style: UIBarButtonItemStyle.plain, target: navigationController, action: nil)

navigationItem.leftBarButtonItem = backBtn


find & replace commas with newline on Google Spreadsheet

Question: I've been trying to figure out how to replace commas with line-breaks. I've tried using (/r/n/), char(10), the Unicode representation (can't remember now), but it rather predictably replaces the comma with whatever I type in the other box, not converting it to a line-break
Answer: IF you are trying to use the Ctrl+F to find and replace well you can't. at least I dont know how.
but if you have a cell say A1 that contains the following : "stack,overflow"
then if you type this in A2 it should work: =SUBSTITUTE(A1, ",", char(10))
https://support.google.com/docs/bin/static.py?hl=en&topic=25273&page=table.cs
you can then copy the content of A2 and in A3 right click -> Paste Special... -> Values Only.
Hope this helps
UPDATE 2016-AUG
Google Spreadsheet now support searching for newline using \n here is how:
Edit -> Find and Replace
Comment: "Replace with" doesn't convert \n to newline, only "Find" does.
Answer: If I properly understood you want to obtain something like that:

The trick I discovered is this one:

you insert an expression as =SUBSTITUTE(A3,",","")
then edit the formula you've just types, you placed the cursor in between the latest two double quotes: =SUBSTITUTE(A3,",","<PLACE CURSOR HERE>")
and finally you press CTRL+ENTER. This is the way to insert a "new line" character.
Answer: This response doesn't specifically answer the original question, but it is a similar use-case that I found which may help someone else. If you are searching for a newline character with other text and you want your replace to keep the newline character, here's one way you can do it.
My example searches for newline plus space and then replaces it with just a new line.
Find: (\n)\s
Replace: $1
It would be nice if google allowed regex in the replace field, but this might help someone if the newline character is part of the search parameters and needs to be included in the replace portion.
NOTE: Per Google's documentation, replace groups only work with Sheets. (as of July 13, 2017)
Comment: Oh my god, thanks so much. Exactly what I needed. At least they have this, horrible how they don't allow regex in replace too.
Comment: This is just replacing the newline with `$1`... any tips?
Comment: ~Jeremy -- Make sure you have checked the "Search Using Regular Expressions" option. With this checked, the `$1` should insert what is in the parenthesis in the find regex. If you have parenthesis around (\n) then it will replace.

I just tried it on a sample sheet and it still works. (See Google Documentation linked in my answer for more info.)
Answer: Using the substitute formula gmansour mentioned above works in the new google sheets.  However, doing a Find and Replace (CTRL H) does not.  I tried using char(10) as a replace and only shows "char(10)".
Answer: To change all ">"(greater than) to ">\n"(greater than followed by a newline),
I took this 3 step circuitous approach.

Copy the text onto LibreOffice "Text document"
Edit => Find & Replace // shortcut: Ctrl + H
Fill out 3 fields(boxes 1~3 in the below figure) there and click "Replace All" button.
Answer: example using formula to parse
=SPLIT(A14,CHAR(10))
Answer: Use the "replace using regular expressions" option. Then the target is \n and the replacement is , (i.e., comma followed by space).
Comment: Other way around.


Which side on an EOS focusing screen shall face up?

Question: I recently replaced the focusing screen on my Canon EOS 6D. I received the new one with the mounting tab to the right in the box but the original was in the camera with the mt to the left. I mounted the new one with the mt to the right, since the instructions leaflet is not clear about that (figure D seems to show the mt to the right). I tested the camera and everything seems to be ok, focus and exposure, but I'm unsure if I did it correctly. Maybe it doesn't matter which side faces up or down?
Comment: I can't find figure D, could you please include it in your question?
Comment: Was the screen you removed from your 6D the original factory installed screen, or one someone else had installed?
Comment: Saaru Lindestøkke here is the figure D from my leaflet.
Comment: Good question, Michael C, maybe the screen that was in the camera was mounted upside down.
Comment: I believe Michael C definitely answered the question. Thank you so much for your help and interest, Michael C and Saaru Lindestøkke.
Answer: Every Canon camera I've ever seen that has a user replaceable focusing screen has the large tab, intended as the point of contact for the custom tool Canon supplies with all replacement screens, on the right as you look through the throat of the light box. This is confirmed in this video from the Canon Professional Network.
If the focusing screen you removed had the larger tab on the left, it was almost certainly installed improperly, though I suppose it might be possible for a third party manufacturer to make one for the 6D that has the tab on the left. If the screen you removed was either of the Canon Eg-A II(pre-installed), Eg-D, or Eg-S, then the tab should have been installed to the right.
Any etching on the screen, such as gridlines or the squares indicating AF points, should be installed facing up towards the pentaprism. The textured surface on the bottom should be uniform over the entire surface of the screen. Please do not touch the textured bottom surface! It is very easy to damage

It may also be possible that the large tab on the right has been broken off at some point, leaving only a smaller tab on the left. As you can see in the image below, there is a smaller tab, circled in yellow, on the left side of the focusing screen, while the larger tab, circled in red, is mostly hidden by the tool holding the screen via the larger tab.
Comment: That was a very thoroughly answer. Thank you so much!


Resting during travel

Question: When travelling, it says in the PHB that players can travel at either fast, normal, or slow pace. When moving at this speed, is resting accounted for? For example, if a party all takes a long rest while travelling at a fast speed, does this mean they still get 30 miles of travel per day, or less? Same with a short rest.
Answer: Travel pace assumes you only travel for about 8 hours actively
This means you can fit both a long rest and some short rest into a typcial day of travel, no matter at what pace you travel during those eight or so hours. Here are the details behind it:
The PHB on page 182, includes a Travel Pace table. The table lists the following speed for overland travel:

Normal Pace: 3 miles per hour, 24 miles per day

The Dungeon Master Guide on page 243 also states (for calculating special travel speeds)

For daily travel, multiply your hourly rate of travel by the number of hours traveled (typically 8 hours).

So the typical day of travel involves 8 hours of active traveling, and at a pace of three miles per hour, this will give you the 24 miles of travel.
A day however has 24 hours. Travel will only take 8 hours and a typical long rest will take 8 hours, so both are accounted for in a normal day of travel. You also have a buffer of another 8 hours for forced marches, making camp, cleaning your weapons, cooking dinner, eating, etc. and you should be able to take a break for a short rest after you encounter a fight during the day's travel, and still travel your normal distance because of this.
The times are not very exact and allow for a certain amount of slack (for example, Slow pace is 2 miles per hour, but 18 miles per day, not 16, which would mean you travel 9 hours, not 8).
Fast pace has the effect of not being able to look out for danger and receiving a -5 penalty on passive Wisdom (Perception) to notice hidden threats, while slow pace allows you to be stealthy while traveling. They do not change your ability to take rest.
If you run into several fights and want to do several short rests, or spend hours on exploration, the DM might adjudicate that you will not be able to travel the full eight hours worth of time any more that day.
Comment: Where do you get "Fast pace has the effect of not being able to do side activities like looking out for danger, foraging, tracking or drawing a map"? All I see in the PHB travel rules is "A fast pace makes characters less perceptive, while a slow pace makes it possible to sneak around and to search an area more carefully". The _Other Activities_ section makes no mention of travel pace.
Comment: @smbailey: You are right, you have to forgo perception fully if you do these things. Interesting -- means that when you are traveling fast, it counterintuitively is actually easier to forage etc., because your perception already is bad and you are not giving up that much. Thanks for catching this detail.

Resting during travel


Is it possible to transfer an old domain to a new subdomain?

Question: Is it possible to move an old domain to a new subdomain permanently without losing search engine rankings? For example, going from https://www.example.com/ to https://blog.newexample.com/?
Answer: No
Whenever you put up a forward you will lose some "Google Juice".  That is not to say your new pages will not rank, just to say they will rank slightly lower.  Googles Algorithm willing, you may get this back in time - but your site will take at least a short term hit.
Comment: Also, and this may be controversial, there may be reason to believe that a subdomain (other then www) will usually rank noticeably worse then a non-subdomain, all else being equal.
Answer: @davidgo answer represents the general consensus reached by experience and is uncontested, even by Google themselves. But recent comments suggest if the new location is up for a period of time, as to establish its existence -- the risk in the opinion of those at Google could be reduced.

Is it possible to do the redirect one portion at a time?
I imagine if the whole site is a blog the home page gets the lion's share of traffic. Can you put up the blog.newexample.com and make a static copy of the home page, with links going to blog.newexample.com which remains on www.example.com, redirect the posts but not the static content until blog.newexample.com is coming up to speed.
Basically, copy-paste the home page of blog.newexample.com onto www.example.com and wait.
You can have other content mixed in with a Wordpress blog
It may benefit you to know the basic htaccess for Wordpress.
<code># BEGIN WordPress

RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress
</code>
Only redirects for directories that do not exist !-d ("!" not "-d" a directory IE its a 404) or files that don't exist !-f ("!" not "-f" a file). So if the server is the same you can just upload static content onto the server.
The 404 page will be created by WordPress if there is no post for that URL.
To Redirect only non-existent (non-static files or 404 pages) to a subdomain you only need to change the last line. To redirect it to the new subdomain, (with the URL scheme intact!).
or
<code>RewriteRule /old-blog-site/index.php [L]
# copy past index.php to /old-blog-site/
</code>
So if the goal is to have content on the site with is not part of the blog and with static content WordPress off the shelf supports that. You are not forced to use a subdomain.


Program Manager vs Product Manager

Question: What is the difference between a Program Manager and Product Manager?  Is there actually a difference in the roles/responsibilities or our the terms mostly used interchangeably.
Comment: I'm voting to close this question as off-topic because it is about project management, not programming.
Comment: This question appears to be off-topic because it is _not_ about programming.
Answer: The difference is usually that the program manager handles the whole series of related products, their schedules, budgets, etc, and the product manager handles just the internals of a particular product such as scheduling of individual components and dividing team tasks, as well as leading the particular product team.
Usually, product managers report to the program manager, and the program manager has the final say on budgeting for each product team and the scheduling. The product manager then takes the resources he or she has and divides them amongst the team, coordinating the team's efforts.
Answer: Depends entirely on the company.  Microsoft, for instance, has its own rather unusual definitions:

Program Manager = one of the members of the core technical staff (alongside developers and testers).  Typically responsible for designing & specifying features, planning release cycles, triaging bugs, presenting at technical conferences, managing compliance with technical regulations (internal & governmental), connecting with online communities, and more.
Product Manager = basically a synonym for "marketing suit."  They design the product's ad campaigns, sales website, and related swag.  More generally, they define the "message" that they hope people (mainstream media, word-of-mouth, and everything in between) will associate with each release.

Both positions gather a lot of data about where the market is heading -- Program Managers from their relationship with the technical community, Product Managers from their industry & media contacts -- but the ultimate decisions about what to build are made by someone higher in the chain.  (not the nitty gritty, of course; Program Managers & UX designers are the experts at specifying the details.  thinking more of "vision" / "value props" that individual product subunits then go "align" themselves toward)
Answer: AIPMM and PMI, two professional organizations in these fields, have both defined unique knowledge areas (KA) associated with their professions that can answer this question.  Both product and program managers must master their unique KAs and manage the activities and deliverables associated with them in order to successfully complete their products or programs.
PMI has defined 9 unique project management KAs required to manage projects and programs.  They are: Integration, Scope, Time, Cost, Quality, Resources, Communication, Risk and Procurement.  Programs are collections of related projects but still require mastery of the 9 unique project management KAs.
AIPMM has defined 6 unique product management KAs as part of a universal, cross-industry Product Management Framework (PMF) required to manage products.  They are: Customer, Strategy, Product, Market, Business, and Program. The Program KA involves the management those cross-functional projects required to bring products to market.  (and very often the Program Manager is a member of the cross functional product management core team).
Hopefully this explanation has introduced some clarity and consistency into the discussion.  For more information on the AIPMM unique KAs and the PMF, go to the www.AIPMM.com web site and download the APMF whitepaper.
[1] http://en.wikipedia.org/wiki/Association_of_International_Product_Marketing_%26_Management
Comment: I vote for you...the answer is already accepted. Our industry is full of vague job titles, and PMI AIPMM are just trying to solve that mire the title soup. there is a very clear difference between a product manager and a program manager. and that is certainly not reflected by the accepted answer.
Answer: My trick is to change "manager" to expert and see how the titles work. So a product manager becomes a product expert; a project manager is a project expert. See "managers as experts" at http://www.pragmaticmarketing.com/publications/topics/06/0603sj
A product manager ensure product profitability by finding and quantifying market problems. He or she defines the business, technical, and marketing artifacts to move an idea to the market and to profitably revenue.
Answer: They're different. But definitions will vary between companies.
Generally a product manager has ownership for a specific product. He or she is responsible for working with the customers, sales people, engineers and sr management to figure out what is the best product to be created, determining the time schedule, features, etc.
The program manager is often more of a support person, keeping all the wheels turning, especially working with specialized groups such as manufacturing.
In other firms, the program manager is senior to the product managers, with responsibility across a series of products.
Answer: At a former employee of mine that did both defense contracting and product development, program managers and product managers had a peer relationship on the organizational chart and were both subclasses of "project manager".

Program managers were project managers that managed the projects associated with on-going government programs with which we either had direct contracts or were working as subcontractors under another organization.  A large enough program could have multiple project managers working under the direction of a program manager.
Product managers were project managers that managed work associated with product development -- this included the "product owner" role associated with Scrum.
Answer: Product managers are the voice of the customer and are accountable to two things: profit & loss of a product or product line and positioning. Product managers are a horizontal role and work as mini-CEO for their product.
Since a product is "what people think you sell," product managers generally have influence over anything that impacts that idea from customer experience to technical definition.
Program managers are project managers that are responsible for several projects related to a specific initiative.

Program Manager vs Product Manager


disabling x to install graphics nvidia graphics card drivers

Question: I'm trying to install my nvidia geforce 555m graphics card drivers but when i run the .run file it tells me to disable all x server windows. I googled a bit but didn't find answers. I'm running unity by the way thanks in advance.
Answer: I would not recommend to use nvidias own installer because what happens then is outside of ubuntu's package management.
Just install using a terminal
sudo apt-get install nvidia-current nvidia-settings

and reboot.
In case you need the absolute latest drivers use the x-swat-PPA:
sudo add-apt-repository ppa:ubuntu-x-swat/x-updates
sudo apt-get update
sudo apt-get install nvidia-current nvidia-settings

and reboot.


Unsubscribe from a Feedburner email sent as text to my ATT mobile phone

Question: How do I unsubscibe from a Feedburner email that is sent as text to my ATT mobile phone? The unsubscibe link does not appear at the end of the email (text) message. I have tried replying with "stop", "block", etc with no success. There is no help or unsubscribe option on the originator's website.
Answer: Have you tried replying back with "unsubscribe" -- it's a long shot but commonly the old school way of doing things.


TI SensorTag firmware Update through OAD(over-the air ) in android

Question: Help me to upload firmware through android app in nexus 7 ,as I have build my sensor tag project through IAR embedded workbench,but I didnt find any app for OAD firmware update in android, when I am trying to update firmware through TI ble device manager android app, its telling "OAD service is not available" while it has OAD service uuid0xFFC0.
Comment: Could you try to write this question in sentences? At the moment it's really hard to understand what you're trying to do.
Comment: I have TI sensor tag device with some different-2 sensors.Ijust wanted to update the firmware of that device using android app named "Bluetooth device manager" but I am unable to update because I am getting One issue ""OAD service is not available". @DanHulme
Comment: Since that's a pretty niche desire, you're most likely to get an answer by asking the developers of that app.
Answer: It's not available because you have an old version of the TI firmware in your SensorTag. Some months ago they added the "Connection control service" to the SensorTag firmware to enable OAD with Android. If your firmware is not recent, it has the OAD Service but not the Connection Control Service, so you'll have to use iOS to to OAD.


Extending OSGi's HttpService

Question: In the OSGi world, you can register a Servlet using
HttpService.registerServlet(String alias, Servlet servlet, Dictionary initParams, HttpContext context);

So, for a bundle with a SymbolicName foo.bar, I could do
HttpService.registerServlet("/foo", new FooServlet(), null, null);

I want to extend this registerServlet method to ensure that the alias starts with the bundle's SymbolicName, i.e. "/foo.bar". I need to do this to provide URL namespace isolation between bundles based on their SymbolicName, so they don't accidentally register servlets at the same alias.
What is the best way to achieve this, other than modifying the implementation of HttpService? Are there any service extension hooks where I could add my validation logic? Could I somehow extend HttpService and override registerServlet method and hide the existing one?
I am using Apache Felix in the bridged mode.
Answer: When you register a servlet, the Servlet.init is called. Maybe you can do some check in there?

Extending OSGi's HttpService


Can you achieve Oneness with the dark side of the Force?

Question: I was just wondering if you can achieve oneness with the dark side. Darth Malgus was said to have merged with the Force after he killed his lover and it linked the act to Oneness. So is it possible?
Comment: You will have to define what it means to achieve "oneness". So far, your question seems to answer itself.
Comment: If you're talking the ability to Force Ghost, there were several Sith Lords who came back that way. Exar Kun even found a way to come back physically.
Answer: I severely doubt it. Let me explain.
There are (generally) two "sides" to the Force, of course: the "dark" and "light."  But in general, most people misunderstand how there are two sides, i.e., is there some greater entity called "the Force" which encompasses the two camps?
The answer to that question is no. "The Force" refers to "the light." In other words, the light side is the Force in its natural state. The dark side is simply a perversion of that natural state. See this answer to "Why did the Jedi want to bring balance to the Force?".
As such, the answer to your question is no. A dark-sided being cannot become one with the Force, or else he would be embracing the light. This is corroborated by the fact that in all canonical sources of oneness to date, it has only been achieved by light-sided Force users.
Here's a quote from Star Wars: Revenge of the Sith by Stover (p. 409, hardback, first edition):

Yoda did not move. "Eternal life. . ."
The ultimate goal of the Sith, yet they can never achieve it; it comes only by the release of self, not the exaltation of self. It
  comes through compassion, not greed. Love is the answer to the
  darkness.

The italicized text is that of Qui-Gon, who was canonically one with the Force at this point. And given that oneness is essentially becoming one with the Force without dying, it would seem that Qui-Gon is essentially saying that no Sith can ever achieve oneness.

Addressing your concern about Malgus: Here is the relevant passage from Deceived, the novel in which Malgus feels like he has achieved oneness:

Thinking of Eleena blew oxygen on the embers of his anger. In life,
  Eleena had been his weakness, a tool to be exploited by rivals. In
  death, she had become his strength, her memory the lens of his rage.
He resided in the calm eye of a storm of hate. Power churned around
  him, within him. He did not feel as if he were drawing on the Force,
  using it. He felt as if he were the Force, as if he had merged with
  it.

Malgus's feelings and reality are two separate matters.
Comment: The light side alone is *not* the Force in its natural state. The Force in its natural state includes both the light and dark sides, as Lucas has made clear on various occasions. ( This was also expressed in various Legends EU sources such as *Edge of Victory: Conquest*, *Crucible*, *Tales of the Jedi*, etc. )
Comment: Good anwer, but not sure I totally agree. The Siths wanted to bring the Force into complete submission, and Sidious and Plagueis went very far in that diection. I would not be surprised that Darth Vader at its full power could have corrupted the Force completely, and so
Comment: become One with the Dark Side. However such a feat would probably lead to the extinction of life in the galaxy in the long run, as happened on Korriban.
Comment: @ALS: I would find such a scenario unlikely. The Force is infinite, while they are only one person. They could probably become "one" in a local sense, but I don't think any darksider could achieve true oneness with the whole of the Force, and I don't think a finite being (e.g. Anakin) could subjugate an infinite field (e.g. the Force). Of course, what qualifies as true "oneness" is up to debate, but I typically take the definition of "one with the Force" and not just "has corrupted a vast swath around them."
Comment: It is apparent that the Sith equivalent is reincarnation. In looking at the Extended Universe, one finds that Darth Sidious reincarnates into a young clone of himself, prepared prior to his death. This is the preciptating event of the Dark Empire comics.
Comment: Darth Nihilus was eroded by the force he controlled and in turn he became nothing but an empty shell behind his mask that the force welled inside, this is categorized as a wound in the force but it may be the closest the sith have achieved to oneness if Nihilus was nothing but force power behind his mask with what was left of his soul.
Answer: The Force itself is just that "The Force" there is no true dark side or light side it all depends on how you manifest the force within yourself
Comment: Welcome to the SFF.se site! On this site we're looking for answers that use sources and/or deductive reasoning/logic to answer the question being asked. You answer seems opinion-based and has no sources, consider editing to make it a better answer. All evidence points to the actual existence of the Dark Side of the Force.


Is it possible to get a list of all content types in a site collection using search api?

Question: I have a few site collections and I would like to retrieve the content types of each site collection and display them as a list and I was wondering if it can be achieved using search api?
Comment: Why do you want using exactly Search API? Please provide some details of your ask. May be it would be better to use CSOM or smth. else.
Comment: Because I am working with search and I would like to know if it can be done. Instead of going through other apis.
Answer: No, it cannot be done. If a content type does not have any data associated with it, the search index will never know it exists.
There are other ways to do it, but Search is not the right tool for this job.
Comment: +1 - I didn't think about the non data case ;)
Comment: thanks Derek for your answer. I was aware of the non-data thing. I like your answer , but I want to give this to Heiko as he answered first. Sorry ;)
Answer: only in a very convulted way... Search is not indexing contenttypes as objects.
You would need to pull all items from the Sitecollection and iterate over them, extracting all contenttypes. Which would not help you at all, since there is no info about them in the result (besides names and ID's)
The proper solution would be to pull them from the REST Service under the URL
/teams/yourSite/_api/Web/ContentTypes


What is the distance from Venus to Jupiter in km?

Question: I need to know this for a test. Please help. The question states "If a spacecraft was parked on Venus and needed to make a flight to Jupiter, how far would it need to travel? (Assume both planets are aligned with the sun and are on the same side of the sun.)"
Comment: The question doesn't make any sense, since both planets are moving.  If you just want to know the distance from the sun to Venus and from the Sun to Jupiter, those values are easily found by searching on the internet.  If you want to know the actual distance travelled by a space craft on a hypothetical mission from Venus to Jupiter,  the question is not complete, since there are several possible trajectories depending on how much fuel you have, and the type of rocket you are using. Also taking off on Venus is essentially impossible.
Comment: @Help go ahead and post an answer to your question. It is always okay to answer your own question in Stack Exchange, as long as the answer is reasonable. If there are no other better answers posted in a few days, you can even accept your own answer. *Welcome to Stack Exchange!*
Comment: OK, I just recently found the answer to the question, but thanks anyways. :)
Answer: To save energy, let's consider a Hohmann transfer orbit, an ellipse tangent to opposite sides of Venus's and Jupiter's orbits.
The spacecraft would follow the outbound half of this orbit, departing ahead of Venus and arriving as Jupiter overtakes it.
Depending on where in Jupiter's orbit the spacecraft meets it, this orbit has semi-major axis a = (rV + rJ) / 2 = 2.96±0.03 au and period of a3/2 = 5.10±0.08 years.
The outbound half has a path length of 7.78±0.07 au and takes 2.55±0.04 years.
As Jupiter moves 72° to 84° around the Sun in that time, the launch window is when Venus's heliocentric ecliptic longitude is 96° to 108° behind Jupiter's.
To convert au to km, multiply by 1.496 × 108 km / au.
Comment: Yes, I added a constraint to an underconstrained problem.
Comment: Thanks for providing those numbers.  Of course, the original question doesn't specify the Hohmann method, nor does it take into account where either planet are relative to aphelion or perihelion.

The Hohmann method provides for the smallest energy expenditure, which I assume produces the lowest delta-v.  If you increase velocity, you can reduce the total distance traveled significantly, but this requires a greater energy expenditure.  Again, the original question provides insufficient data as I read it.
Answer: If you want the distance between the planets, then you can easily look up the orbital radius of both planets, subtract the orbital distance of Venus from that of Jupiter, and there you have the distance between Venus and Jupiter.... but this is problematic.
First of all, both planets orbit in an elliptical path.  Their distances from the sun vary.  For example, Venus's Perihelion, the closest it gets to the sun, is about 107,447,000 km.  It's Aphelion (furthest from the sun) is 108,939,000.  Jupiter's Perihelion is 740,520,000 km and its Aphelion is 816,650,000.   If Venus is at Aphelion and Jupiter is at Perihelion when Jupiter is in opposition to Venus (meaning directly opposite from the sun), then the distance is about 631,581,000 km.  If Venus is at Perihelion while Jupiter is at Aphelion while at opposition, then the distance is 709,173,000 km.  If they're not both at opposition, the distance can be as far as 925,559,000 km if they're both at Aphelion and on opposite sides of the sun.
But these are straight line distances.  If you're flying between the two, as you leave one and head to the other, you won't travel in a straight line.  You'll follow a curved path to get from one to the other.  The distance traveled will then be highly variable depending on the velocity.  The higher the Delta-V, the "straighter" the path between them and, thus, the shorter the distance.  But a smaller Delta-V, the longer the trip, and the wider the radius of the arc, and, thus, the longer the distance.
In the end, there's not enough information given to provide an accurate answer.


Android L Preview upgrade

Question: I was about to flash the phome with the command prompt, but an error came up saying that the device was locked. Does this mean is has to be rooted? If I root it and upgrade it will it be unrooted again because I don't want to loose my warranty.
Comment: What phone? And are you installing an official factory image or a custom ROM?
Comment: The nexus 5. I'm installing the android l developers preview
Comment: I'd expect that to work even with a locked bootloader, since it's an official image, but I haven't tried it so maybe I'm wrong.
Comment: unfortunately it does not
Answer: It sounds like your bootloader is locked, which is different from rooting.  With a locked bootloader, you can only flash official signed factory images; with it unlocked, you can flash anything to any partition.
If you're following Google's directions for installing factory images, you'll see that one of the steps is to run a fastboot oem unlock command.  This unlocks the phone's bootloader.  It also erases all your data.  (But installing the L Preview system image will do that anyway.)
Comment: so it does not root the phone. Thanks bud unfortunately I cannot vote you up because I'm still new and have no reputation points :(
Comment: It doesn't root the phone, but it does void your warranty — or at least, it displays a message saying that it voids your warranty.  (But again, installing the L Preview system image will do that anyway.)  And it's possible to re-lock and flash back to a supported factory image later, leaving no trace that it's ever been unlocked.

Android L Preview upgrade


How can I remove the valve from this bathroom faucet for replacement?

Question: This is for the cold valve, which I need to remove to replace. But do not know the model or how to remove it.
Answer: You've done well so far. Most people have trouble getting the handles off. Make sure you have your shutoff valve under the sink turned off. If you don't have one, you'll have to turn off the water to the house.  Now get a large adjustable wrench and adjust it tight to the brass nut around the valve stem and turn it counterclockwise to remove the valve stem.  There might just be a washer on the other end of the stem that can be replaced. If not, bring the stem to your home store or plumbing supply store and they should be able to get you a match. I can't tell from the picture what the model faucet this is but it's very similar to an discontinued  American Standard model that has a cartridge looking like the one below, from Ferguson plumbing for reference.
https://www.ferguson.com/product/american-standard-ceramic-disc-hot-and-cold-cartridge-for-moments-2506921-and-2506920-a9940530070a/_/R-1650277?fromplp=true
It's a ceramic cartridge so it might just need some cleaning out of particles.
Answer: Insert a screwdriver here and pull that retaining clip out.

Now you can remove the whole upper part, that should expose the valve body and the nut that is holding it.
Meanwhile you can remove the decorative ring, it is not held by anything.
Use proper wrench to unscrew the valve (assuming you turned off the water first.
There are two seals inside. The top one is for blocking the valve leaking to outside world. The bottom one is for valve opening and closing water flow. If noting else is wrong, you can just replace those two seals.


What can I do to stop my dogs play fighting so one doesn't get hurt?

Question: My Labrador is about a year and a half old now and we have had him since he was a puppy. We recently brought a pug puppy who is very small compared to our Labrador. Our puppy often tries to bite our Labrador but when the Labrador play fights back, as he's so much bigger it looks like he might hurt the puppy. The Labrador always wants to play and keeps chasing the puppy and as he is so much bigger he ends up knocking him to the ground and trampling on him. We have to always watch them to make sure it doesn't get out of hand. Will this stop as they get used to each other and won't get so exited around each other? Can i do anything to help or will they always be like this, because that would mean I may have to sell the puppy so one doesn't end up getting hurt, plus it's frustrating having to watch them all the time.
Answer: They're being more careful than you give them credit for. If one of them gets a bit too rambunctious the other will tell them so and it'll correct itself. As long as it's play, your only concerns are keeping them from knocking things over, telling them in no uncertain terms when this is not the time for being silly,  and keeping humans who might misunderstand from wading in and confusing a situation that the dogs have well under control.
Answer: I agree with Keshlam but wanted to provide an answer for anyone looking to train their dog to play softer.
I would recommend watching some videos about dogs playing, especially if they are narrated, so you can watch the dog's expressions and hear what they mean, and listen to different scenarios.
Watch the dogs carefully. Don't interfere, just watch. When you feel that they are being too rough, call them both to you, give them both a pat (to reward them for coming to you), and then let them both go play again. That's all you do, no words or scolding needed. Repeat the process a few times; this also trains your dog to "check in", which is great for going to the dog park.


Should I switch perspectives every chapter, or only when I feel the character needs to have some thoughts?

Question: I was thinking about this  a lot recently. I want to have my story a 3rd person POV, but should the reader see through one character's perspective or all of them? I understand that 3rd person POV is a universal thing, but I want some of these other points of views as well. I just want some feedback, that's all.
Comment: Hang on, 3rd person is not necessarily omniscient. You can have 3rd person PoV limited to the world and knowledge of a single character. See Game of Thrones as an example. Each chapter is a 3rd person tale focusing on one specific PoV.
Comment: I am not sure what you mean by the "universal thing" and "some of those other points of views"--you have to be a bit more specific. There are three universally accepted POVs: First Person, Second Person, and Third Person, and there is a vast number of resources describing the flavors of each. Also: this question https://writers.stackexchange.com/questions/28343/what-happens-with-changing-pov-irregularly might be or relevance.
Comment: *sorry, 3rd point of view omnicient
Comment: Then you do not have to change perspective at all. Omniscient gives you a access to all you character's thoughts at any time.
Comment: thanks, that gives me the impression that i' m doing a good
Comment: I know that, but in my story, all the character get a turn to show their emotions at the same time, but it's one character's point of view, I was asking if it was okay to change that up a bit.
Comment: Stephen King's *It* is written in third person, but constantly switches perspective from character to character, right down to the minor characters.
Comment: Thank you for that, I'll have to read that to get a better feel of actually witnessing this in action.
Answer: You can do either "omniscient" or "character" POV. "Omniscient" is the easiest  way to tell a story. However, this way the reader is disconnected from thoughts and emotions of any character. Writing from character's perspective gives the author more tools to develop that character - but this can be also more challenging, because the character needs to look genuine. This is specifically true for "multiple POV" novels. Some characters may come out very good, while others may seem two-dimensional, despite all efforts of the author.
"Character" and "omniscient" POVs can be also combined, just try not to confuse the reader. Often, most of the story is told though the protagonist's eyes, but once in a while there is a short chapter, coming in a manner - "Meanwhile, in a faraway land..."
Answer: Techniques are always connected to the world you are writing about: if you have multiple morale conflicts, it can be a good idea to move from one PoV to another. If the conflict is more linear (i.e. a good guy vs a bad guy) or if the group of characters share the same moral vision, then you probably don't need that.
A story with a wide range of characters, such as the Song of Fire and Ice saga (i.e. GoT) moves across several PoVs who are the main characters. In that type of story, you have a complex world structure and you need to provide the world vision of each side.
Another great example is in the french fantasy novel "L'horde du contrevent" by A. Damasio: the main characters are part of the same team, and each chapter is told by the PoV of each of them, who provide a different feel and perspective to the events shared by all.
In my opinion, using alternate PoV just to change the pace of the story is not a reason strong enough. The same goes for using PoV just because the characters are geographically separated. I believe PoV is not a different knowledge of "what happens", but it's really a specific way to convey meaning.


Light Presets .exr

Question: I would like to install light presets for Blender to automate my lightning in my scenes. I have some .exr files (from Greyscalegorilla) but I don't know how to do it on Blender to make it work. Can someone help me? Thank you
Answer: You can install additional environment lights from the preferences:

after files are chosen:

You can now selected them as new environment maps:
Comment: Sweet, I didn't realize I can add new HDRIs this way :)
Answer: Greyscale Gorilla Presets are made with C4D Lights and Image textures. What you can do is use the EXR Files, which are HDRI's, under the "World" to light a Scene. Check this video from Blender Official Channel for more information on World Enviroment: https://youtu.be/RRilLLyyn1Y?t=98

Light Presets .exr


What is "YEEZY DID KEEZY"

Question: On a episode of SUBURGATORY, someone said I'LL DO A YEEZY DID KEEZY, therefore she made a song video.
You can see the description
https://youtu.be/EV39aC4tpzw
I was trying to search the meaning and none results, not even dictionary.
Answer: The correct quote from the episode Krampus was, "I'll do like Yeezy did Keezy."
Yeezy is a silly nickname for Kanye West. From the context, I presume Keezy means Kim Kardashian.
So it means, "I'll write a song to win over Carmen, just like Kanye West did for Kim Kardashian."

What is "YEEZY DID KEEZY"


Scanning ASCII value of each character of a string

Question: Is there anyway , if I enter any string , then I want to scan ASCII value of each character inside that string , if I enter "john" then I should get 4 variables getting ASCII value of each character, in C or C++
Comment: Better make sure you run it on an ASCII machine if you want to do it the easy way.
Comment: In the raw binary executable, there is no such thing as strings. All characters in memory are merely integer numbers. Simply print a character as you would print an integer, and you will get its ASCII value.
Comment: @Lundin if I were to print a character as I usually print an int in C++, I would not get the ASCII value, because there's an overload of ``ostream& operator<<` for `char`. So, although easy to achieve, it isn't as simple as that.
Comment: @chris: I don't think anyone these days needs to make sure they're using an ASCII machine.  Non-ASCII machines are truly rare, if you have one, you already know.
Comment: @DietrichEpp, Sure, but you never know what people you distribute your program to use. Of course just this would most likely not be distributed, but awareness is good. I'm just pedantic on the things that have a slight, but still existing possibility.
Comment: @juanchopanza You would print an integer with `cout << some_int`, not with `cout << some_char`. So you will need to simply typecast it to an int. `cout << (int)some_char`, or if you prefer: `cout << static_cast(some_char)`.
Comment: @chris: It's a slight, but existing probability that you'll win the lottery even though you didn't buy any tickets.  EBCDIC systems are that rare.
Answer: Given a string in C:
char s[] = "john";

or in C++:
std::string s = "john";

s[0] gives the numeric value of the first character, s[1] the second an so on.
If your computer uses an ASCII representation of characters (which it does, unless it's something very unusual), then these values are the ASCII codes. You can display these values numerically:
printf("%d", s[0]);                     // in C
std::cout << static_cast<int>(s[0]);    // in C++

Being an integer type (char), you can also assign these values to variables and perform arithmetic on them, if that's what you want.
I'm not quite sure what you mean by "scan". If you're asking how to iterate over the string to process each character in turn, then in C it's:
for (char const * p = s; *p; ++p) {
    // Do something with the character value *p
}

and in (modern) C++:
for (char c : s) {
    // Do something with the character value c
}

If you're asking how to read the string as a line of input from the terminal, then in C it's
char s[SOME_SIZE_YOU_HOPE_IS_LARGE_ENOUGH];
fgets(s, sizeof s, stdin);

and in C++ it's
std::string s;
std::cin >> s;  // if you want a single word
std::getline(std::cin, s); // if you want a whole line

If you mean something else by "scan", then please clarify.
Comment: printf("%d", s[0]);                     // in C
than it will only gives me the ascii of 'j' .i want to scan the value of j to a variable , then increment , than 'o' to variable and then again increment
Comment: @l4zyw0rm: That's `char c = s[0]; ++c;`. You can increment character values just like any other numeric type.
Comment: but its just printing the ascii's , anyway to scan these values ?
Comment: @l4zyw0rm: What do you mean by "scan"? Iterate over the characters in the string? Read them from the console or a file? Or something else?
Comment: @l4zyw0rm: Or do you mean you want to declare a named variable for each character in a string? You can't do that, since the number of variables wouldn't be known. The best you can do is put the characters in an array or string; but they're already in one, so there's no point.
Comment: what i want to do is entering any string and performing any arithmatic operation on the ascii values of each character of the string.
Comment: @l4zyw0rm: OK, my answer should have enough information to do that, in either language. If it's still not clear, then please decide which language you're using, and read a tutorial on that language.
Answer: You can simply get the ascii value of a char by casting it to type int:
char c = 'b';
int i = c; //i contains ascii value of char 'b'

Thus, in your example the code to get the ascii values of a string would look something like this:
#include <iostream>
#include <string>

using std::string;
using std::cout;
using std::endl;

int main()
{
    string text = "John";

    for (int i = 0; i < text.size(); i++)
    {
        cout << (int)text[i] << endl; //prints corresponding ascii values (one per line)
    }
}

To get the corresponding char from an integer representing an entry in the ascii table, you just have to cast the int back to char again:
char c = (char)74 // c contains 'J'

The code given above was written in C++ but it basically works the same way in C (and many other languages as well I guess)
Answer: There is no way to turn a string of length 'x' into x variables. In  C or C++ you can only declare a fixed number of variables. But probably you don't need to do what you are saying. Perhaps you just need an array, or most likely you just need a better way to solve whatever problem you are trying to solve. If you explain what the problem is in the first place, then I'm sure a better way can be explained.
Comment: There is one exception to this, though. In C++ you actually can do that as long as a string is a string literal.
Answer: Ya,I think there are some more better solutions are also available but this one also be helpful.
In C
#include <stdio.h>
#include <string.h>
#include <malloc.h>
int main(){
  char s[]="abc";
  int cnt=0;
  while(1){
    if(s[cnt++]==NULL)break;
  }
  int *a=(int *)malloc(sizeof(int)*cnt);
  for(int i=0;i<cnt;i++)a[i]=s[i];
  for(int i=0;i<cnt-1;i++)printf("%d\n",a[i]);
  return 0;
}

In C++
#include <iostream>
#include <string>
using namespace std;
int main(){
    string s="abc";
    //int *a=new int[s.length()];
    //for(int i=0;i<s.length();i++)a[i]=s[i];
    for(int i=0;i<s.length();i++)
    cout<<(int)s[i]<<endl;
    return 0;
}

I hope this one will be helpful..
Answer: yeah it's very easy ..just a demo
int main()
{
 char *s="hello";
 while(*s!='\0')
  {
  printf("%c --> %d\n",*s,*s);
  s++;
  }
 return 0;
}

But make sure your machine is supporting the ASCII value format.
In C every char has one integral value associted with it called ASCII.
Using %d format specifier you can directly print the ASCII of any char as above.
NOTE: It's better to get good book and practice this kind of program yourself.
Comment: Amazing how this accepted answer completely fails to answer the question posed. Not saying the answer isn't good, it clearly is. But it's a great demonstration of how newbies are unable to ask the question they mean to ask.
Comment: This is why you should always use {} after statements. Bug on line 6, s++ is outside the loop.
Comment: I love the "But make sure your machine is supporting the ASCII value format."   I think the folks running EBCDIC know who they are, thank you very much (ignoring here minor incompatibilities, like the JIS `¥ = \\` bit).
Comment: @DietrichEpp - yes, folks running EBCDIC systems know who they are, but that's not the point. If the **requirement** is to display ASCII codes (which is what the question asks for), ignoring EBCDIC systems doesn't satisfy the requirements. If the requirement is to display whatever code point represents a given character, then systems that use ASCII and systems that use EBCDIC will show different results.
Comment: Uhm... You cannot have non-constant pointer to a string literal... Too much DOS programming or something?


is half-niqab allowed in islam?

Question: is it okay to wear half-niqab? My friend says that you should either show the whole face or cover the whole face except eyes, but it is not okay to show forehead and eyebrows.
Comment: https://c8.alamy.com/comp/2BC99NH/muslim-girl-wearing-surgical-mask-for-protection-hijab-woman-take-a-mask-for-coronavirus-or-covid-19-epidemic-or-pandemic-2BC99NH.jpg ?
Answer: There is a well-known difference of opinion in regard to the issue of covering the face. Some scholars hold that covering the face is obligatory for women in the presence of non-mahram men. Others hold that covering the face is recommended but not obligatory. Both positions are based on interpretations of the Qur'an and the Sunnah.
As for the half-niqab, its permissibility depends on one's position regarding covering the face:

For those who consider covering the face as obligatory, wearing the half-niqab is not permissible, since it does not cover the upper half of the face, and therefore it's insufficient. Based on this interpretation, only the eyes may be left exposed, and the rest of the face needs to be covered.

For those who consider covering the face as recommended (but not required), the half-niqab is an acceptable form of covering/hijab, and is better than leaving the whole face uncovered.

In general, for an individual, it is better to be err on the side of caution, as the Prophet ﷺ says: "Leave that which makes you doubt for that which does not make you doubt. (Narrated by at-Tirmidhi and an-Nasa'i)"
Therefore, in most situations, wearing the full-niqab is preferable to wearing the half-niqab, and wearing the half-niqab is better than leaving the whole face uncovered.
However, it is also important not to be judgmental of other women who follow other valid interpretations, as difference of opinion allows for flexibility.
Answer: if no niqab is allowed if no fitnah (trial or danger) is feared, then of course half niqaab is allowed.

is half-niqab allowed in islam?


How to fix the error `Process finished with exit code -1073741819 (0xC0000005)`

Question: My problem is when I running FC network the code works well in both CPU and GPU. But when it comes to CNN, I can only train it on CPU. It raises an error when I try to train it on GPU.
Like that:

Process finished with exit code -1073741819 (0xC0000005)

I find the error raised when the code goes to loss.backword. The error happened when I use the first column instead of the second.
device = torch.device("cuda:0")

device = torch.device("cuda:0" if opt.cuda else "cpu")

My environment is Python 3.6.9, Windows 10, Torch 1.2.0, Cuda 9.2.
Answer: Finally, I figured out this.
This error occurs just because one of my variables is not loaded in cuda.
When I add this output = Variable(netD(real_cpu),requires_grad=True) the problem solved.


How to reinforce a floor joist with a split knot?

Question: An electrician ran some new wires and had to bore through the floor joists. In doing so, one came very close to a knot in the wood. The floor above squeaks now as a result, where it didn't before. This is probably just a minor annoyance but I'd like to fix it if possible. What options do I have, given the electrical wire running through it?
Comment: You would need to sister the joist. The hole for the wiring looks to be well within the limits for drilling joists, so I'd _think_ you could get away with adding a 2xY (where Y is the height from the bottom of the joist to the bottom of the hole), several feet long to span the split in the knot. You would put in a couple of rows of nails, spaced every 6-8" to transfer some of the load to your new piece of lumber. _However_, I'll leave it to those with more experience/knowledge to give you an answer, because I'm not sure how that split has to be dealt with.
Answer: I'm not convinced that this is causing the squeak. The amount of wood that was removed is trivial. I'd investigate further first. Some glue and/or shims or the tightening of a fastener may resolve the issue. Otherwise...
They make steel repair channels for this type of thing, but they're likely not cheap. Your goal is to restore the tension strength of the bottom portion of the joist. Here's what I'd do as a DIY repair, based on decades of home construction and ownership experience:

Determine whether the joist has sagged at all. Run a long level or other reliable straightedge across the bottoms of the joists. If that one's low even 1/16" relative to several in either direction, put a jack and a stud under it and give it a gentle lift. Ideally, shoot for 1/16" above level to account for some settling later.
Prepare 4-6 foot 2x4 gussets for both sides of the lower portion of the joist. These should be ripped or notched to fit under the cable.
Liberally apply heavy duty construction adhesive to the each gusset and fasten them with 2-1/2" gold general purpose screws in pairs every 12" or so. I recommend Torx-drive for easier installation. Keep them at or slightly above flush at the bottom so you don't create a bump in the ceiling.

Be sure that the gussets pull tight with the first few screws. You can't move them with additional screws. If necessary, pilot through the gussets to the size of the screw threads.
Let the assembly dry for 24 hours before removing the temporary post. 48 hours is even better.
Comment: Press your fingers into the joint between the joist and subfloor while someone above bounces lightly. See if you can feel movement.
Comment: Kind of wondering that also.  The split knot was probably there before and drilling small hole should not change, unless done with chisel and big hammer.
Comment: @crip659 it's very possible that it was already split prior to the new work. All I can say is that the squeak began after the work was done, and is centered directly over that spot in the floor.


If Naruto can creates one thousand clones, and sometimes he uses them to do his work, why does he always have a lot of work?

Question: In Boruto, Boruto all the time complains about Naruto not being with him. And Naruto can create one thousand clones, and sometimes he creates a clone to do his work or to do an interview. Then, why doesn't he create dozens of clones to do his work and have time with his family?
Answer:
And my future dream is to be the greatest Hokage! Then the whole village will stop disrespecting me and start treating me like I'm somebody. Somebody important!
Naruto Uzumaki, Naruto chapter 4

Ever since the start of the original series, Naruto's goal was to become the greatest Hokage of the Leaf Village. From episode 1 of Naruto to episode 500 of Naruto Shippuden, Naruto spent his entire life gaining the trust and respect of his village, and eventually the entire nation.
Naruto did not want to be seen as a lazy Hokage. While he does on occasion use shadow clones to accomplish various tasks, an overuse of this could eventually turn south and the village elders potentially seeing Naruto as an incompetent leader and unable to handle tasks on his own.
Another reason for this is to look at the original design of shadow clones. Shadow clones can be deployed for intelligence and recon, and all gathered information is returned to the caster when the shadow clone is released. This was explained by Kakashi at one point.
However, based on various events in the series, it is apparent that if too much is going on between the caster and their shadow clones, the casters chakra can become imbalanced. Examples of this are during Naruto's wind nature training and his battle with Pain while having shadow clones in reserve. During the wind training, Kurama's chakra would sometimes leak and take over one of the clones and Naruto was limited on shadow clones during his fight with Pain.
My point above is that if Naruto tried to do too many administrative tasks at once, such as interviews, signing documents, battle strategies, planning Chunin exams, preparing teams for missions, etc... it could be information overload if all that knowledge hit the caster at once.
Answer: Because for him being hokage was a dream that came true with continuous efforts and struggle ,He became hokage to do something good for his village which he considers as his family rather than sitting at home chilling, The clones tire him quickly, so this is the second reason, so if he uses clones to do all the work, that's rude and makes the viewer wonder? Why should he not rely on himself, and why did he want to be a Hokage if he was not relying on himself. Hope i answered the question.
Comment: Understandable! I have added some reasons.
Comment: Welcome to A&M! This does not really seem to answer the question asked. Which asks why he doesn't use shadowclones, so that he can do both. Could you perhaps elaborate a bit more as to why he wouldn't/couldn't.


VS2005 project has dependency that is not built

Question: I have VS2005 solution that contains many projects and dependencies (some C++, some C#) - in the past it compiled successfully.
when I rebuild all the solution it fails on a project claiming dll is missing (dll that was needed to built before according to dependency).
the thing is that from time to time it fails on random project (not all the time the same project).
I'm not sure it is meaningful but I see in output console
Deleting intermediate and output files for project
doesn't VS2005 go according to "Project Build Order" and ReBuild every project starting with its dependencies?
Answer: There's probably some project set to not build in the configuration manager of the solution, or maybe set to the wrong configuration.
Hope this helps.
Cheers,
Sebastiaan


nvidia cuda and insufficient driver version

Question: I'm trying to use CUDA technology, but have some issues
<code>greymachine ~/NVIDIA_CUDA-5.0_Samples/1_Utilities/deviceQuery $ ./deviceQuery
./deviceQuery Starting...

 CUDA Device Query (Runtime API) version (CUDART static linking)

cudaGetDeviceCount returned 35
-> CUDA driver version is insufficient for CUDA runtime version

greymachine ~/NVIDIA_CUDA-5.0_Samples/1_Utilities/deviceQuery $
</code>
That's my problem.
My config:
<code>$ nvidia-settings -q NvidiaDriverVersion
  Attribute 'NvidiaDriverVersion' (greymachine.localdomain:0.0): 310.19

$ uname -r
3.7.1-un-def-alt2.1

$ nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2012 NVIDIA Corporation
Built on Fri_Sep_21_17:28:58_PDT_2012
Cuda compilation tools, release 5.0, V0.2.1221

$ ./deviceQueryDrv
./deviceQueryDrv Starting...

CUDA Device Query (Driver API) statically linked version
Detected 1 CUDA Capable device(s)

Device 0: "GeForce GT 430"
  CUDA Driver Version:                           5.0
  CUDA Capability Major/Minor version number:    2.1
  Total amount of global memory:                 1024 MBytes (1073283072 bytes)
  ( 2) Multiprocessors x ( 48) CUDA Cores/MP:    96 CUDA Cores
  GPU Clock rate:                                1400 MHz (1.40 GHz)
  Memory Clock rate:                             800 Mhz
  Memory Bus Width:                              128-bit
  L2 Cache Size:                                 131072 bytes
  Max Texture Dimension Sizes                    1D=(65536) 2D=(65536,65535) 3D=(2048,2048,2048)
  Max Layered Texture Size (dim) x layers        1D=(16384) x 2048, 2D=(16384,16384) x 2048
  Total amount of constant memory:               65536 bytes
  Total amount of shared memory per block:       49152 bytes
  Total number of registers available per block: 32768
  Warp size:                                     32
  Maximum number of threads per multiprocessor:  1536
  Maximum number of threads per block:           1024
  Maximum sizes of each dimension of a block:    1024 x 1024 x 64
  Maximum sizes of each dimension of a grid:     65535 x 65535 x 65535
  Texture alignment:                             512 bytes
  Maximum memory pitch:                          2147483647 bytes
  Concurrent copy and kernel execution:          Yes with 1 copy engine(s)
  Run time limit on kernels:                     Yes
  Integrated GPU sharing Host Memory:            No
  Support host page-locked memory mapping:       Yes
  Concurrent kernel execution:                   Yes
  Alignment requirement for Surfaces:            Yes
  Device has ECC support:                        Disabled
  Device supports Unified Addressing (UVA):      Yes
  Device PCI Bus ID / PCI location ID:           1 / 0
  Compute Mode:
     < Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) >

$ lsmod | grep nvidia
nvidia               9381500  39
i2c_core               30993  3 i2c_i801,nvidia,videodev

dmesg:
[   28.548939] NVRM: loading NVIDIA UNIX x86_64 Kernel Module  310.19  Thu Nov  8 00:52:03 PST 2012
[   29.065356] NVRM: GPU at 0000:01:00: GPU-5a5ce500-f7fd-ab9d-64d7-cc0d1fe26ff1
[   29.065360] NVRM: Your system is not currently configured to drive a VGA console
[   29.065361] NVRM: on the primary VGA device. The NVIDIA Linux graphics driver
[   29.065362] NVRM: requires the use of a text-mode VGA console. Use of other console
[   29.065363] NVRM: drivers including, but not limited to, vesafb, may result in
[   29.065364] NVRM: corruption and stability problems, and is not supported.
 1682.331776] NVRM: GPU at 0000:01:00: GPU-5a5ce500-f7fd-ab9d-64d7-cc0d1fe26ff1

$ ldd ./deviceQuery
        linux-vdso.so.1 (0x00007fffd4dff000)
        libcudart.so.5.0 => /usr/local/cuda-5.0/lib64/libcudart.so.5.0 (0x00007f5e90c26000)
        libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007f5e90922000)
        libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f5e9070c000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f5e90362000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f5e90145000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007f5e8ff40000)
        librt.so.1 => /lib64/librt.so.1 (0x00007f5e8fd38000)
        libm.so.6 => /lib64/libm.so.6 (0x00007f5e8fa3e000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f5e90eaa000)
</code>
I've installed cuda toolkit, downloaded from the nvidia site, i've precompiled drivers from my distro (Alt Linux), but libcuda.so doesn't come with them, so i copied that library from original nvidia drivers. Compiling is ok. I've also tested 2.6.32 kernel with 304.51: got the same msg, but that is understandable, cuda comes with 304.54 driver.
AFAIU, if i have newer drivers, than came with cuda toolkit, that is ok. But as u see some thing is wrong.
So, can kernel drivers be newer, than original (i.e drivers i got with cuda)
May be i should compile modules myself? but what for, why? my distro modules work good.
Thanks
Comment: Your install is messed up, I think you knew that.  You're not supposed to have to copy libs around manually, and that is an error-prone process anyway.  The driverAPI deviceQuery results suggest to me that the driver is actually OK.  Yes, you can generally use a newer driver with an older toolkit.  But you have some sort of lib mismatch at the moment.
Comment: I also have this problem, but I'm guessing for a different reason.
Answer: This appears to have been caused by a very broken CUDA installation. The usual solution for is to uninstall everything, install a supported host toolchain and then reinstall the driver and toolkit. Every toolkit contains detailed installation instructions and system requirements. If you read and follow these, there will rarely be an issue of this type.
[This answer was assembled from comments and added as a community wiki entry to get it off the unanswered question list]


please let me know the nuance and teach me which is correct

Question: This new sports complex is _________, so people can enjoy the games whatever the season is.
(A) encased (B) enclosed (C) encircled (D) enveloped
Answer: I think the word you want is indoor (all definitions from https://dictionary.cambridge.org/):

Happening, used, or existing inside a building

Of the 4 options you put forward, the closest is enclosed:

Surrounded by walls, objects, or structures

Encased refers to something which is completely surrounded or covered by a typically solid surround. You would use it for a filling for a pie, for instance, or in the Cambridge dictionary example:

The nuclear waste is encased in concrete before being sent for storage in disused mines.

Encircled refers specifically to a circle around an object. In your example you might use it to indicate that "the sport complex is encircled by a several rows of seats". notice it says nothing about it being covered or not.
Enveloped is more subtle. If you look at the definition it seems to imply "cover", but in reality it refers to less tangible/defined items: mist or fog, say, but also geometrical shapes, sound etc.


Why would an IC have a minimum power supply rise time?

Question: The InvenSense MPU-9250 datasheet specifies not only a maximum VDD rise time (100 ms), but also a minimum rise time (0.1 ms). It seems like the more common concern in power supplies is reducing the rise time. Why wouldn't a faster rise time be better? What kinds of problems would the minimum limit be trying to prevent?
Comment: The answers below describe what **can** happen when the supply rises too fast or too slow. In addition to that there is the fact that the manufacturer cannot check that the IC starts up properly for every rise time. They only test (and thus guarantee) only the specified range. So they decided that 0.1 - 100 ms is a practical range, **test with that and guarantee that** the chip works for that. It is not said that anything outside this range does not work, it can work, but there is no guarantee.
Answer: During Power On Reset, there is a special analog circuit that detects the VDD change and decides to reset the processor. If the change on VDD is not fast enough, the POR circuit could decide that it is not a real power up event and leave the processor unresetted. Starting a digital machine with no reset is prone to all kinds of failures since the internal registers and volatile memories start with garbage contents. And as it is well known, garbage-in produces garbage out.
Answer: With millions transistors, each transistor has capacitance, so it takes some time for each of the gates to its VCC to a voltage level for designed behavior. There is also a small amount of inductance from the wires and that will contribute to the rise time. Another problem is metastablity
The second thing is the clock. Once all the transistors Vcc lines reach an appropriate level and the clock is running the reset network can be switched off. The reset network is built to allow registers (and memory) to come up in a ground state. Any state machines are also in their ground state. This is important because we want a clean slate when we start the processor when code is being ran.
If you don't reset for an adequate amount of time, the processors memory could be left with old information or random information. The other problem is meta stability with the system being 'in between' logic levels.
It does seem a little long for an IC, Usually digital logic only takes a few clock cycles to clear out the registers, In the case of the MPU-920 there is also analog circuity which could have something to do with it. Maybe the engineers set the time arbitrarily long just to be safe.
Comment: usually the reset time is not influenced by the time needed to clear registers which is indeed small, but mainly by the time needed for the internal PLLs to settle.
Comment: It depends if you are using dual rank synchronizer to sanitize your inputs you'll need at least two clock cycles to clear the registers.


How do I undo deleting my bluetooth device from my macbook bluetooth device list?

Question: I accidentally deleted my Bluetooth speakers from my MacBook's devices list. Now it will not show up again. How can I get it to show up again so I can reconnect it?
Answer: Most Bluetooth speakers have a pairing routine that will usually be initiated right after turning on, or by keeping the power / pair / connect / play button pressed for a while —which specific button will depend on your speaker make and model; either explore a bit, or find the manual.
Answer: In System Preferences under 'Bluetooth', try turning Bluetooth off and then on again. Under 'Devices' your Mac should start discovering Bluetooth devices within range (make sure you are within range of your speakers when you do this).
If that doesn't work, make sure your speakers are connected to power or that their batteries are new/charged.
Answer: I had the same exact problem as you. If you have wireless headphones what you want to do is:

Make sure you turn off your headphones
Turn off all bluetooth devices
If it is a headphone like Beats Solo 3 you want to hold the power button for about 4 secs.
Turn your bluetooth device back on, and on your Mac and it should show up for pairing under devices.
Comment: Saved me day.... much thx.


Whats the connotation of 'makeshift'? Is it negative, neutral, or positive like: creative?

Question: I'm curious what the association(s) are with the word 'makeshift"
Answer: I'm going to say that it depends on context.

John was lost in the woods overnight, but survived by constructing a
  makeshift shelter from pine branches.

Is very positive.  However,

My auto mechanic did not have the right parts, so he tried to patch
  things with  a makeshift repair.  It failed and my car was stranded on
  the freeway for an hour.

Is pretty negative.
Comment: I think the question serves to illustrate that we can become far too preoccupied with notions of 'positive and negative'. We are, after all dealing with English, not mathematics. Is a cup and saucer positive or negative? The whole point of language and word choice is that they offer shades of meaning.
Answer: It is rare for something makeshift—that is, improvised using the materials and tools at hand—to equal in quality something carefully planned and built without special limitations or restrictions. To the extent that you compare a makeshift thing to an intended-to-be-permanent thing, the makeshift will be at a disadvantage.
But if instead you focus on the ingenuity of producing something workable out of meager supplies, using limited tools, the makeshift looks quite admirable.
To my ear, while makeshift (it will do the job it was designed to do, but it probably won't last for an extended period of time) sounds a little less positive than improvised (it was designed off the cuff, and yet it may last indefinitely), it sounds significantly more positive than stopgap (it will function for a short time, but you'd better replace it as soon as you can).
Answer: Makeshift by definition means the ability to fix something or make something, but it is not a permanent solution. It is more like a patch.
In my opinion I do not see makeshift as a positive or a negative word. Context dependent.
If you have a broken leg and you make a makeshift crutch, that is a pretty good thing.
If you are building a 6 axis CNC system and you use makeshift motors, this inevitably will end up being a bad thing.
Part of the word from makeshift, make (verb) means to build, construct etc.
Within the computer industry, due to time constraints and customers being a complete pain. We would normally make makeshift systems to temporarily get the system(s) online. By all means, they were not a permanent fix.
Comment: @Bill - Makeshift implies that you do not have all the appropriate resources (time/equipment) to have a perfect solution. If you were in the woods and you broke your leg, you would use a trunk from a tree to build some kind of crutch or support system. If you had a broken leg and you had the opportunity to go to the hospital, by all means, you should go to the hospital. Therefore in conclusion, makeshift means a temporary fix.
Answer: I would say in most cases that the word makeshift implies both negative and positive.
On the positive side is the person or team that provided the makeshift solution.  They did a great job with what they had and something is better than nothing.
On the negative side makeshift implies temporary and not perfect.  The negativity focuses more on the situation and the fact that the perfect solution wasn't provided.
So you want to create a makeshift solution, not be a makeshift solution.
Answer: I am going to disagree with cobaltduck and Arthor. The term very much carries a pejorative connotation. "Makeshift" describes an item or solution that is an inferior substitute for the actual thing.
Take the case of the makeshift crutch referenced above. If you had a broken leg and could choose between a makeshift crutch and the actual medical device, which would you choose? The hiker lost in the woods creates a makeshift shelter because a properly constructed long term shelter is not available or too time-consuming to build.
Comment: -1 While I agree that a makeshift item is "an inferior substitute for the actual thing", it is certainly better than nothing. As you say, if the choice is between a makeshift item and the proper thing, you choose the latter. But if the choice is between a makeshift item and *nothing*, then it is positive. In isolation *makeshift* is neither negative nor positive - it depends on the alternative available at the time.
Comment: @TrevorD: on your argument, *makeshift* is 'worse than the real thing, but better than nothing'. That's pretty close to how I use the word, but I would certainly call it pejorative.


If gold is a worse electrical conductor than silver and copper, why are gold plated contacts considered "better" by the market?

Question: I've always wondered if this is just a marketing thing, but all across the electronic supply spectrum I see "gold plated" listed as the best conductors for various contacts and connectors. However, silver is considered the most conductive element (6.2×107 S/m), followed by copper (5.9×107 S/m), with gold (4.5×107 S/m) being third. I get that any of those are better conductors than the most common (tin and steel) but I would think silver, being less expensive, more abundant, and a better conductor, would be preferred over gold. What am I missing here?
Comment: Note on English usage: "silver is considered...".  The word "considered" in that phrase makes it sound like it's an opinion.  It's not.  Use "is known to be", or just "is".
Comment: Good answers. I've often wondered why some articles (and television specials) will state that gold is "an excellent conductor," when--clearly--it IS NOT. Of course, in this world, there is PLENTY of misinformation (and disinformation)!!! Yes, gold does provide more resistance to corrosion, though.
Answer: Gold is used for connectors not so much for its conductivity as it's chemical inertness.
Even ostensibly corrosion resistant materials like aluminium and stainless steel form a thin metal oxide layer on the surface, indeed this is what gives them their corrosion resistance and metal oxides have poor conductivity.
So gold plating is potentially useful for improving the electrical connection between two contacts it tends to be most useful in signal or data connections where you are usually dealing with low voltages and maintaining a consistent resistance across connections is important.
The downside of gold is that it is soft and so prone to wear and so you tend to see it most often in connectors which need to be physically small and aren't subject to a lot of wear eg things like SIM cards, flash cards, graphics cards, phone batteries etc etc.
Where connections are changed frequently eg in music, sound and lighting equipment chrome plating or nickel plating is usually preferred as it is much harder and you can mitigate any small increase in resistance by having a larger contact area.
Answer: While gold has a slightly higher resistance, it has the major advantage of not corroding or at least corroding very very slowly in normal conditions which is why it is used for so many contacts on our day to day devices...
Silver and copper tarnish and corrode easily in the atmosphere leading to poor connections.
Comment: In addition, gold can be applied very thinly, so any increase in resistance would be negligible.
Comment: Silver plating is used on some RF connectors, because while silver tarnishes, silver tarnish is quite conductive.  I'm not sure where the breakeven point is; I just know that if you see a silver-plated RF connector at a surplus store for sale cheap, you want to scarf it up quietly and wait to gloat until you're in your car.
Answer: Pure silver or pure copper tarnishes and gains a patena over time (oxidisation) whereas gold if pure should never develop such effects. Plating a metal with gold will preserve the metal by preventing oxidisation indefinitely so long as the gold seal remain complete. In simple terms you dont have to clean your gold tipped headphone jack because pure gold doesn't rust.