Is the Windows 10 Game Bar extensible?

Question: Does the Windows 10 Game Bar have an an API that I, as a developer, can hook into and as such make a product that starts alongside all games that support the game bar (say, a parental control interface)?
Comment: The question in its current shape can be answered by "yes" or "no", which is not really a good fit for this site. What are you trying to do?
Comment: Note: I couldn't add tags for Windows 10 or Game Bar. If anyone would want to add them, feel free.
Answer:
make a product that starts alongside all games that support the game bar

If you try to the open the Game Bar on somehting Windows doesn't recognize as a game, Windows will ask you if it is a game and if you say yes, you get the Game Bar. From that point on, Windows will recognize that process as a Game.
How does Windows know that it is a game? It will match it against a list... Where is the list stored? You can find it at %userprofile%\AppData\Local\Microsoft\GameDVR\KnownGameList.bin. You can read more about how it works from Renaming a Win32 executable to main.exe launch the Xbox DVR popup by lucasg.
In the linked article the following 010 template is provided to parse the file -
 which hopefully it is useful to write the relevant code in whatever langauge you are using - (note: this is a template for 010 Editor, I have not tested this):
typedef struct  {
   BYTE Reserved[0x300];
}HEADER;

typedef struct  {
    WORD ByteLen;
    BYTE RawString[ByteLen];
    //local string sName=ReadWString(RawString);
} GAME_WSTR <read=ReadGame>;

typedef struct {
    DWORD Reserved;
    DWORD ByteLen;
    BYTE RawString[ByteLen] <fgcolor=cLtRed>;
} OPTION_STR  <read=ReadOption>;

typedef struct  {
   local int StartAddr = FTell();
   DWORD EntrySize;

   // Executable game name
   GAME_WSTR GameName <fgcolor=cLtBlue>;

   // Optional magic
   if (ReadUShort() == 0xca54)
        WORD OptReserved;

   // Optional structs based on switch values
   WORD AdditionalNamesCount;
   WORD SwitchOption2;

   // Additional names (probably like a hint).
   local int i =0;
   for (i = 0; i <  AdditionalNamesCount; i++){
        OPTION_STR Option;
        if (ReadUShort() == 0xca54)
            WORD OptReserved;
   }

   // Look for a magic
   local int Find20h = 0;
   while(!Find20h){
        Find20h = (0x20 == ReadByte());
        BYTE Res;
   }

   GAME_WSTR GameId;
   WORD Reserved;

   // Sometimes there is an additionnal name
   // sometimes not. I check the current entry
   // is less than the EntrySize declared.
   if (FTell()-StartAddr < EntrySize)
   {
       switch (SwitchOption2)
       {
       case 3:
            OPTION_STR Option3;
            break;
       case 2:

            OPTION_STR Option2;
       case 1:
            break;
       }
    }

} ENTRY <read=ReadGameName>;

string ReadOption(OPTION_STR &Game)
{
    local wstring GameName = L"";
    local int i ;
    for (i= 0; 2*i < Game.ByteLen; i++){
        WStrcat(GameName, Game.RawString[2*i]);
    }
    return WStringToString(GameName);
}

string ReadGame(GAME_WSTR &Game)
{
    local wstring GameName = L"";
    local int i ;
    for (i= 0; 2*i < Game.ByteLen; i++){
        WStrcat(GameName, Game.RawString[2*i]);
    }
    return WStringToString(GameName);
}

string ReadGameName(ENTRY &Entry)
{
    local string GameName = ReadGame(Entry.GameName);
    local string OptionGameName = "";
    if (Entry.AdditionalNamesCount)
        OptionGameName = " : "+ReadOption(Entry.Option);

    return GameName + OptionGameName;
}

//------------------------------------------
LittleEndian();
Printf("Parse KnownGameList.bin Begin.\n");
HEADER UnkwownHeader <bgcolor=cLtGray>;
while(1)
{
    ENTRY Entry <bgcolor=cLtPurple>;
    //Printf("Entry : %s -> %d.\n",ReadGameName(Entry) ,Entry.AdditionalNamesCount);
}
Printf("Parse KnownGameList.bin End.\n");

The article was based on lucasg's answer to Windows 10 : naming programs main.exe cause them to show pop up.

Or you can handle your own list. Perhaps keep a database in an online server that clients can download... or simply provide an UI where users can add items.

Ok, that is half the problem. Once you decide how you will define "all games that support the game bar", the next thing is to hook the process start. I suggest to get a notification of process start from Win32_ProcessStartTrace, then see if the started process is in your list and open your UI or whatever it is you want to do next.
Answer: Just to preface, I have no experience with any windows API. However after a little googling I found this:
https://docs.microsoft.com/en-us/uwp/api/windows.gaming.ui.gamebar
Which the website makes out to be part of the API for Universal Windows Platform applications. It is probably worth noting that this is under Windows.gaming.UI and that looking around the API for the whole of Windows.gaming (as opposed to the UI only) may provide you with more exact information.
Hope this helps and good luck.

Is the Windows 10 Game Bar extensible?


BitBucket Git - fatal: unable to access ... SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure

Question: I have tried everything I could find in documentation on the BitBucket site and in YouTube videos etc, and nothing seems to fix the error listed in title of my question.  I have generated the keys and placed the public on the site and set up the local SourceTree to use the private one and the putty option.  I have tried all details I could find and nothing effects the error.  Please help and with all due respect if all you're going to do is point me to other question please don't waste my time.  I have spent all day looking at other questions.  Thanks.
Edit:  someone claimed this question had already been answered, but if you see their comment the error they mention that is addressed in the other question is clearly not the same error message I received, so they are wrong.
Comment: Possible duplicate of [git pull : info/refs HTTP request failed](https://stackoverflow.com/questions/53625669/git-pull-info-refs-http-request-failed)
Comment: https://stackoverflow.com/search?tab=newest&q=%5bbitbucket%5d%20ssl
Comment: My question does not duplicate the question you listed.  They received the error "fatal: HTTP request failed".  The error I received was different as the title of my question shows.  You just enjoy down voting other people's questions.
Answer: After looking into this error for most of a day, it turns out that all it was was due to the Embedded option not being selected under the Tools/Options/Git menu.  For some reason they include an Embedded Git in their tool but they default to use your already installed Git on your computer.  So, if you do like I did and follow all of the steps to install he keys etc, it will not help you since any previously installed git once be configured the way they want it (i guess).  The second I clicked Embedded to tell it to use the embedded git that comes with their tool, everything started working and I was able to push my local git repo up to the one I had created on BitBucket.  I have included a picture below.  I will leave this question in case this detail helps someone else since I'm guessing I'm not the only person to get stuck on this detail.


Children's short story I read in the mid-1960s, about two children on another planet who had to work or go to school all the time

Question: My lifelong love of Science Fiction started in the third grade in the mid-60s with a short story we read in class about 2 children on another planet who had to work or go to school all the time and never got to play. They talked about what life would be like on a planet where children got to play after school or had time to daydream and wondered how fantastic a world that would be. I've tried to find it on the internet a number of times with no luck to read with my grandson.
Comment: It's a bit tenuous, but your description immediately reminded me of "The Fun They Had" by Asimov
Comment: Does it make them dull boys?
Comment: Clara, I agree. You should post that as an answer.
Answer: My answer differs from the question in several points: the children are on Earth, not on another planet, and they do not have to work/go to school all day (although they do have school on Saturdays and Sundays). But otherwise it fits the sense of the story very well so I will offer it up anyway.
The Fun They Had is a short story by Isaac Asimov, first published in F&SF in 1954, but collected in numerous short story collections since. It's popularity took Asimov by surprise, calling it "probably the biggest surprise of my literary career".
It is set in the year 2157, and deal with two children, Margie and her older brother. They are educated individually by machines, and so have no friends or social interaction with other children. One day Tommy finds a book, a real book with printed pages, which described the schools they had centuries earlier. Later Margie sits daydreaming about those old schools:

She was thinking about the old schools they had when her grandfather's
grandfather was a little boy. All the kids from the whole neighborhood
came, laughing and shouting in the schoolyard, sitting together in the
schoolroom, going home together at the end of the day...
Margie was thinking about how the kids must have loved it in the old
days. She was thinking about the fun they had.

The story is available at the Internet Archive.
Comment: That's it! As soon as I read the title my dormant memory brain cells woke up and it all came back to me. Dr. Asimov is my 2nd favorite author, and I can't believe I didn't run into that story in all my reading of his short stories over the last 50 years. Thank you so much, I have a 7 year old grandson who will be reading that story this weekend.
Comment: @LisainSC: As per the [tour], you can accept a correct answer by clicking on the checkmark by the voting buttons.
Comment: Glad I could help @LisainSC - I hope your grandson enjoys it. As FuzzyBoots mentioned, can you click the tick to "accept" the answer, so people know it has been answered. BTW, this question will probably be closed soon as a duplicate ("The Fun They Had" comes up quite often as an answer). This certainly does not mean your question is bad, just that the answer has be given before, and I hope you continue to stick around


Sending list of images to azure function to upload image to blob in .Net

Question: I am trying to upload images to blob from my android app. My current approach is uploading images using azureblobsdk which allows me to upload images directly to the blob but now what I am trying is creating an azure function that would accept data in stream or byte array and will store it to my blob.
while uploading the image from my app I used to send some metadata in the string to my app.
  var blobClient = containerClient.GetBlobClient(fileName);
        Dictionary<string, string> metadataProperties = new Dictionary<string, string>();
        metadataProperties.Add(key, value);
        await blobClient.SetMetadataAsync(metadataProperties);

here is what I am doing right now from the app
now I am trying this same thing to do from azure by sending those parameters to the azure function but the problem is I am unable to understand how would I send those streams and metadata to the azure function so that I can process them in my azure function
here is till now what I have done since I am new to azure function so need help to move forward with some approach
   [FunctionName("UploadProductImages")]
    public async Task<HttpResponseMessage> UploadProductImages([HttpTrigger(AuthorizationLevel.Function, "post", Route = "product/uploadimages")] HttpRequestMessage req, Microsoft.Extensions.Logging.ILogger log)
    {
    }

now with this function in place how do I access the data sent from my app which would be a list of images with metadata I am even confused about what should I send a stream or byte array
my final target is to get the list of images with some metadata of those images and upload to blob azure blob storage
Answer: If I understand the problem correctly, you can do something like this
Create a Model for you data and send it like this
HttpClient apiClient = new HttpClient();
 using (var message = new HttpRequestMessage(HttpMethod.Post, functionAppLink))
        {
            message.Content = new StringContent(JsonConvert.SerializeObject(model),Encoding.UTF8, "application/json");
            var response = await apiClient.SendAsync(message);
        }

On Function app side just retrieve and deserialize
[FunctionName("UploadProductImages")]
    public async Task<HttpResponseMessage> UploadProductImages([HttpTrigger(AuthorizationLevel.Function, "post", Route = "product/uploadimages")] HttpRequestMessage req, Microsoft.Extensions.Logging.ILogger log)

        {
            using var sr = new StreamReader(req.Body);
            var input = await sr.ReadToEndAsync();
            var model = JsonConvert.Deserialize<Model>(input);
            // Do your thing
        }


What is the education system like in Westeros?

Question: What type of education do the high-born in Westeros have? For example I know they are literate but what else do they learn?
Comment: Water Dancing...
Comment: Probably only private tutors and only if their parents see the value in education.  There's also a school for mentats (I forgot the real name).
Comment: @MarkRogers The ravens must fly? :-)
Comment: @MarkRogers Mentats? Perhaps a different book series?
Comment: @Zikato - Sorry I was just being lazy and using the first word that came to mind :), the Measter's kind of play a similar role to the mentants (ie (semi-?)trusted royal advisors)
Comment: I always wanted to ask this question.. Glad that you did :)
Answer: Most of the major houses of Westeros have a Maester contracted to either their castle or family. Although the Maester's primary role is to advise the Lord of the house, they often also train the family's children in addition to other duties. Maesters are trained at The Citadel in Oldtown and are considered to be among the most learned individuals in the world. Each Maester specializes in a variety of subjects, which are reflected in the linked chain worn around their robes (think of it as their resume). In addition to their specialization, all Maesters are trained in subjects such as medicine, healing, administration, diplomacy - generally the subjects needed when running a castle or army - which is one of the many reasons a Maester is a highly prized asset.
Once a noble house has made arrangements with their Maester as to the appropriate subjects for their children, the Maester will generally tutor the children as needed, using a scheduled curriculum. Each Maester will pick the curriculum for each child based on what role that child is destined to fulfill when they grow up. The schedule will vary, based on the Maester's other duties and availability. In times of peace, it is not uncommon for a noble child to have a daily tutoring session with the family/castle's Maester.
Lesser houses may or may not have a Maester depending on their status and/or finances. If a Maester cannot be contracted, then the Lord of the house will often find someone else to teach his children - perhaps a failed Maester or even a local scholar. In some cases, a child's training is augmented (or outright handled) by more than one tutor, with each individual tutor specializing in a single subject.
Common families, of course, do not have access to a Maester and must arrange the teaching of their children on their own. In most cases, a child is taught only what they need - usually the trade or skills of their parents.
In some special cases, the children of a common family will have access to a Maester via the noble family they serve. In such rare instances, the common family considers themselves to be extremely blessed, given that their children have at least partial access to the same training as a high-born child. In all such cases, said training is informal only, with the child sometimes sitting in on the high-born's study session - something that can only occur when the family's Lord is extremely generous.
Comment: I thought Maesters are assigned to a castle, not to a house.
Comment: Maesters advise the Lord of the castle. While they may do some tutoring, it's definitely wrong to say it's their main role.  The Lord Commander doesn't say that he wants as many Maesters as he can get because he wants tutors for the Nights Watch...
Comment: @svick - it can be both. I've updated the answer to reflect that.
Comment: @kuhl - you are correct. Answer updated.
Comment: Not only children are instructed by the maester:  When Davos is appointed Hand of King Stannis, he is illiterate (he was previously a smuggler); he decides he should know how to read, and gets Maester Pylos to instruct him.
Comment: What about daughters?
Comment: @AleOtero93 - daughters were taught in much the same way, although for obvious reasons their curriculum differed. Then there are exceptions, such as Arya Stark and her "dancing" instructor.
Answer: It's more than just Maesters that teach the children of noble houses. Maesters teach things like heraldry, math, reading and these sorts of intellectual pursuits. Priests teach them about philosophy and religion. The garrison's master-at-arms teaches them about fighting arts. The lord of the house would typically teach them about strategy and warfare, as well as politics.
And these lessons do not end at adulthood either. See Tywin Lannister's instruction to all of his children. Or Eddard Stark's instruction to his. Moreover, children are often sent away for years to other houses to learn from them and make friends with other noble children. So any given house doesn't just teach their own children, but usually several others' as well.
The fact is that every noble child is given the best possible education from as many sources as possible in order to prepare them for the world. No expense is spared, and every opportunity is taken.
And just as interestingly, in the GoT universe, parents can be flexible enough to see that sometimes, a child doesn't fit the mold, and they go with whatever interests they do have. Examples of this include Arya Stark, Brienne of Tarth, and maybe Shireen Baratheon. A lot of other children are forced into positions that don't suit them, like Robyn Arryn, or Samwell Tarly.
And then there are some children, who should never have the positions they are born into.
Comment: *cough* Joffrey *cough*
Comment: What about daughters?
Comment: They learn from the Septas, who are Westeros' equivalent to nuns. Although again, exceptions can be made. Brienne got plenty of instruction from her father's Master of Arms, for example. Arya was instructed by her *ahem* "dancing master". Either way, tutors and private lessons for the wealthy.
Answer: Westeros doesn't have what you might call a school system. Each family basically takes the education of its children into its own hands. Traditionally, the education of a nobleman's household falls to the appointed Measter. We know little about this process, but it would seem a Maester is at liberty, more or less, to choose the curriculum they teach to the household. We've seen various Maseters teach reading and writing, but we've also seen Maester Luwin (House Stark's Maester) teach history, heraldry, geography, sums (basic arithmetic) and practical subjects such as running a household.
Answer: If you follow the books, consider the example of Griff in ADWD. He was trained by a Maester, a Septa, and a pair of knights.
Early on, Sansa and Arya had Septa Mordane. Her role was somewhere between tutor, governess and chapterone.


How to create a single MySQL database server shared between more than two mirth-connect servers?

Question: I am new to mirth-connect. I am using mirthconnect-18.104.22.16851.b1075 for Linux machine with MySQL as Database. I have two mirth-connect servers.
I want to establish a single MySQL database server which is shared between two or more than two mirth-connect servers. Is it possible ?
If yes, then how can I achieve it ?
Or is there any other alternative to achieve this ?
Comment: What is the motivation for this?
Answer: Are you looking for some sort of fail over?
I'm presuming that you want two identical Mirth environments?
These servers would need to be isolated from each other network wise or you'd have conflicts.
If you're looking for clustering,  you could look at Mirth Corp's Mirth appliances.   They have excellent load balancing and clustering.
If you're looking for something homegrown,  you'd need separate environments with database synchronization and network fail over.
This is a very complicated endeavour.


Mysql Replication restart

Question: I have a slave db (db1) that I moved into the master position after my master db (db2) died. I brought up a new slave db (db3) from a day old snapshot of db1, my problem is trying to figure out which log file and position db3 should start replication at. Where should I look to find this info?
Answer: You have only two vaiable options
OPTION #1
Step 1) Make sure binary logs are activated on db1
Remember:
Logical position 0 for MySQL 3.x/4.x/5.0 is 98
Logical position 0 for MySQL 5.1 is 106
Logical position 0 for MySQL 5.5 is 107
For the sake of this example, we'll pretend you are running MySQL 5.1
Step 2) Try to retrieve the binary logs on db2 from the date and time of the day-old db1 snapshot up to the time db2 crashed and load the data in those logs.You can find out the date to start from by one of the following:
a) Looking at the time and date stamp of the last relay log on db1 before you cut db1 over to become master.
b) Looking at the time and date stamp of master.info on db1 before you cut db1 over to become master.
c) Run this query:
SELECT MAX(update_time) FROM information_schema.tables WHERE table_schema NOT IN ('information_schema','mysql');
Step 3) Run mysqlbinlog against all the binary logs you found in Step 2. The first of the binary logs should be based on the time of the db1 snapshot. Run the log in order and load that output to a text SQL file.
Step 4) Run the resulting SQL script(s) against db3
Step 5) On db3, do CHANGE MASTER TO MASTER_HOST='IP of db1',...,MASTER_POSITION=106;
OPTION 2) This is much easier, but requires a little downtime.
Step 1) Just mysqldump db1 and load it on db3
Step 2) Activate binary logs on db1
Step 3) On db3, do CHANGE MASTER TO MASTER_HOST='IP of db1',...,MASTER_POSITION=106;
Give it a Try !!!
PS I would recommend doing circular replication between db1 and db3 after doing this recovery. In addition, made hourly or nightly mysqldump backups of the db3.
Comment: Would the logical position of 106 still be correct if db1 had previously been set as a master box and already had binlogging turned on even while it was a slave?
Comment: You would have to start with new binary logs on db1. You would thus run RESET MASTER; on db1. Then run SHOW MASTER STATUS; and you will be the beginning binary log. As I said before, 98 for pre-MySQL 5.1, 106 for MySQL 5.1, and 107 for MySQL 5.5.
Answer: If you didn't save the log file and position when you took the snapshot, I don't believe there's a way to figure that out.  Some of the snapshot tools, however, do save that data.  How did you take the snapshot?
For example, if it's a filesystem snapshot taken after flushing / locking all tables, the correct data should be in master.info in the slaves data dir.
Comment: That is allowing me to replicate from the previous master (db2), now im catching up to that, will the binlog file and pos on this new slave end up in the same state as the old slave would have after catching up to the old master?

Mysql Replication restart


Sending SMS from an ASP.NET website

Question: Is there a way to send SMS from an ASP.NET website using a Web API? I know about web services, but don't know how to call those services from my app.
Answer: Web services are the best way to do it. I use Twilio on a site, and it was incredibly easy to get set up and working. Scalability is no issue, and you will more than make up for the cost in not having to spend developer hours building your own solution.
Twilio: http://www.twilio.com/
Twilio libraries available for .NET: https://www.twilio.com/docs/csharp/install
From the twilio-csharp project, here is the example of how to send an SMS (I took this from twilio-csharp. Just reposting it to show how easy it is)
static void Main(string[] args)
{
    TwilioRestClient client;

    // ACCOUNT_SID and ACCOUNT_TOKEN are from your Twilio account
    client = new TwilioRestClient(ACCOUNT_SID, ACCOUNT_TOKEN);

    var result = client.SendMessage(CALLER_ID, "PHONE NUMBER TO SEND TO", "The answer is 42");
    if (result.RestException != null) {
        Debug.Writeline(result.RestException.Message);
    }
}

Comment: Thanks a lot, will check it out. I have one more doubt, to send the SMS do i have to host the site ? or can i send it using Visual Studio itself?
Comment: It doesn't need to be a site. You can do this from any type of .NET assembly. An ASP.NET website hosted or running inside VS, a console application, a windows service, whatever.
Comment: You can download complete code for Twilio outbound call and SMS in following link envato http://codecanyon.net/item/click-to-call-and-message-with-aspnet/15029966?ref=intelliwins
Answer: I think I am a bit late to tell you that you are in luck, but for those who find this article later, I created a video showing how to send a Text Message using your Twilio account and asp.net:
i walk you through sending a text message using twilio and asp.net c#
In case you don't have 10 minutes to spend watching the video, here is the code:
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using System.Configuration;
using Twilio;

namespace TwilioSMSHowTo
{
    public partial class _default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
        }

        protected void SendMessage_OnClick(object sender, EventArgs e)
        {
            string ACCOUNT_SID = ConfigurationManager.AppSettings["ACCOUNT_SID"];
            string AUTH_TOKEN = ConfigurationManager.AppSettings["AUTH_TOKEN"];

            TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);

            client.SendMessage("(502) 276-8990", ToNumber.Text, Message.Text);
        }
    }
}

To make this code work you need to nuGet the Twilio API and need to replace the my configurationmanager.appsettings stuff with your account id and auth token.
Happy coding!
Comment: I might call that number to see if Mark Hagan answers.
Comment: I might! Just depends on whether or not I remembered to cancel number on the test account. :D
Answer: Instead of doing it with Twilio API, if you prefer to do it with another SMS service provider Way2Sms.com I think below code will help you:
public void sendsms(object sender, EventArgs e)
{

    if (Page.IsValid)
    {
        HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create("http://ubaid.tk/sms/sms.aspx?uid=" + yourmobilenumber + "&pwd=" + yourpassword + "&msg=" + body.Text + "&phone=" + recipientNo.Text + "&provider=way2sms");
        HttpWebResponse myResp = (HttpWebResponse)myReq.GetResponse();
        System.IO.StreamReader respStreamReader = new System.IO.StreamReader(myResp.GetResponseStream());
        string responseString = respStreamReader.ReadToEnd();
        respStreamReader.Close();
        myResp.Close();

    }
}

Comment: @SamCromer SMS stands for Short Message Service, pictures can be sent via MMS, or Multimedia Message Service or email. Well this comment is old and you probably know that by now, if you do, disregard my comment.
Comment: Is it possible to send images thru the SMS message?
Comment: valid for india only i want to send to whole world bro
Comment: @Felype your comment is a contribution to the knowledge that the Internet Holds. even if Sam Cromer already knew, there will be many more people to come that did not. +1 Thanks! even though that sort of thing ain't cool on stack.

Sending SMS from an ASP.NET website


Beer gas on corny keg

Question: I have an existing keg of beer that I would like to switch to beer gas.  Is this feasible? Are there any problems with doing this?
Comment: How is the existing keg pressurized - CO2, air from a hand pump...?
Comment: Existing keg is pressurized with C02
Answer: Preparation:

If you plan to serve the beer through a stout or creamer faucet then it's a good idea to reduce the carbonation in the beer to about 30% of what it was. This can be done by also bleeding off most of the CO2 in the headspace, possibly several times. For example, if the keg is currently 1/3 full of beer, then bleeding the headspace and leaving will reduce the overall carbonation in the beer to 1/3. If the keg is 2/3 full, then you'll need to bleed it 2-3 times, waiting a couple of days for the pressure to increase each time. You could skip this, but you'll end up with a lot of foam in the glass.

Adding beer gas already mixed in the cylinder:

bleed the gas from the keg until it's almost empty then fill the headspace to the desired pressure with the beer gas.

Adding pure nitrogen, rather than ready mixed:

Reduce the pressure in the headspace. Bleed the headspace until the pressure is about a quarter of your ideal serving pressure. Beer gas is often served at 30 psi with a stout faucet, so 7 psi for the CO2 pressure.
pressurize to your target pressure (say, 30psi) with nitrogen.
The keg is now full with a mix of 25% carbon dioxide and 75% nitrogen.
Answer: When you say "switch to beer gas" I assume you mean switching from regular air from a hand pump to CO2 on a draft system? If so, there aren't any problems with doing this. However, it has already been exposed to air. So there isn't any benefit in doing so- it will still only keep a few days.
Comment: Beer gas is the name for a 75/25 mix of nitrogen and carbon dioxide. It's often used for stouts.

Beer gas on corny keg


Does the wattage on a power supply simply mean the max output wattage?

Question: If I have a system running at ~500W of power draw, will there be any tangible difference in the outlet wattage draw between a 1200W power supply vs, say, a a 800W power supply? Does the wattage only imply the max available wattage to the system?
Comment: One thing to keep in mind is that a PS that is MUCH larger than the system needs is not only inefficient but may not regulate as well.  A power supply needs some minimum load to work properly.
Answer: The wattage implies the maximum available wattage to the system.
However note that the PSU draws AC power from the wall socket, converts it to some other DC voltages, and provides those to your system.  There is some loss during this conversion. How much depends on the quality of your PSU and on how much power you draw from it.
Almost any PSU is very inefficient when you draw less then 20% of max rated power from it.
Almost any PSU has less than peak efficiency when you draw close to the max rated power from it.
Almost any PSU has their optimum efficiency around 40% to 60% of maximum load.
Thus if you get a PSU which is 'just large enough' or 'way to big' it is likely to be less efficient.
[But note that your PC does not consume a fixed or constant level of power.  At idle, when not much is happening, the DC power consumed will be low.  Perform a lot of processing and I/O operations, then power demand goes high.]
Bellow is a nice example of a real world efficiency graph for 900W PSU. The x-axis shows the power supply load in Watts and the y-axis shows efficiency.

will there be any tangible difference in the outlet wattage draw between a 1200W power supply vs, say, a a 800W power supply?

The 800 Watt PSU would run at 62.5% of max rating. That is a good value.
The 1200 Watt PSU would run at only 41% of its maximum rating. That is still within the normally accepted range, but at the low end. If your system is not going to change than the 800 Watt PSU is the better choice.
Note that even with a good (bronze+ or silver rated PSU) you are still loosing about 15% during conversion. 15% of 500 Watt means that your computer would use 500 Watt, but the PSU would draw 588 Watt from the wall socket.
Comment: How ironic, you correct Mixxiphoid's arithmetic, but use bad arithmetic in your answer.  A 15% inefficiency when delivering 500 Watts of DC power implies that the PSU consumes 588 Watts of AC power from the wall outlet.  588W * (100% - 15%) = 500W
Answer: UPDATE
I am aware this is not the correct answer, but cannot delete it because it is accepted. The right answer is given by Hennes.
Original post
The wattage of your power supply is what it could potentially supply. However, in practice the supply won't ever make that. I always count 60% of the capacity as the truly maximum capacity. Today however, there are also bronze, silver, gold, platinum power supplies which guarantee a certain amount (minimum of 80%) of efficiency. See this link for a summary of 80 PLUS labels.
Example: If your 1200W supply has a 80 PLUS label on it, it will supply probably 1200W but will consume 1500W.
I think you 800W supply will be sufficient, but it won't guarantee you safety.
Comment: It will supply at least 1200 Watt, not 960 Watt. If it is 80% efficient and supplying 1200 Watt then it will draw 1500 Watt from the wall socket. If a PSU fails to deliver its stated rating then that is fraud.
Comment: @Hennes - *"It will supply at least 1200 Watt"* - No, a PSU will not supply "at least" its rating.  The PSU is capable *at most* of delivering 1200 watts.  The rating is often bogus, since it is a sum (often rounded _up_) of the rails measured independently, rather than simultaneously.  Mixxiphoid - You corrected your arithmetic, but the first paragraph still misconstrues the meaning of 80Plus certification, which is for efficiency, not power levels.
Comment: Efficiency ratings have nothing to do with how much a PSU can supply. The efficiency is the percentage of the input power that is actually usable. So if your build is actually using 1000W at 80% efficiency, then it's pulling 1250W from the wall. Of course you'll only actually get that efficiency if you're at a particular load as Hennes shows.
Comment: @Hennes your right, I was still sleeping I guess :)... Edited my post
Comment: I should have written "Capable of delivering at least"
Answer: For the most informed reading about PSUs go to this site and especially read the article
"Firecracker or Power Plant" Very informative even for the lay person.
http://www.tomshardware.com/reviews/power-supply-oem-manufacturer,2913.html
Comment: Welcome to Super User! Whilst this may theoretically answer the question, [it would be preferable](http://meta.stackexchange.com/q/8259) to include the essential parts of the answer here, and provide the link for reference.
Answer: manufacturers of electrical power supplies often indicate the input power (the power which it consumes) because it is the higher value and can be marketed better. you should check if they also indicate the output power to be on the safe side.
regarding efficiency there is a big difference based on the technology used. the efficiency is calculated as efficiency = output power / input power.


Breakpoints are not hit when debugging Fortran using Eclipse.

Question: I have a problem when debugging Fortran using Eclipse (I use the gfortran compiler). I can't set breakpoints, or, more precisely, only "parallel breakpoints" type is available (the green ones). Then when I start debugging, all the program is executed (whereas I want it to stop, of course, whenever a breakpoint is hit). I'm used to programming in Matlab but have recently started learning Fortran, as it is much faster; however I got crazy with this debugging issue (Matlab is a LOT easier to debug; just doble-click to set the breakpoint and then press F5, or F11 if you want to step in).
Answer: It is most likely a bug in the IDE, see Bug 384187. Are you using the latest Photran version? At How do I set breakpoints using the Photran IDE in Eclipse? it is claimed that this bug has already been fixed.
If everything works properly (which it should), debugging in Eclipse is just as easy as it is in Matlab.
Fortran has a long history in numerical computations that is why we have such a vast amount of legacy Fortran code. However, if I started learning a new programming language I would either learn C or C++.


How to organize projects in TFS?

Question: We have 2 developers that are working on 8 applications. Should I split them in separate projects or keep all in one project? If i should split them, than how can I work with aggregated agile board? Keeping separate agile boards is not very useful because since there will be much more agile boards then developers.
Answer: My personal preference is to keep TFS projects for a group of related applications.  For example, if you have a website, an app, a webservice, and a scheduled task all working on essentially the same data but for different scenarios, I would group those as a single TFS project.
However, if two applications are fundamentally different they should be segregated from each other.  For example, one is a mobile eCommerce application, another is a video game about elephants fighting zombies armed only with a canoe paddle.
That way, the task board makes sense from a logical perspective.  With related applications, you'll have stories that cut across all of the projects.  You may have a common data layer service, or perhaps they all use a common engine that you want to be able to maintain on the same cadence.

How to organize projects in TFS?


Animating a picture

Question: I am new to Blender. I have a simple picture (png) which I would like to apply a texture to.
But the texture should be applied in a slow rate, and only to parts of the picture along a line or curve.
Then I want to capture that animation somehow as a video or something?
Sorry if this sounds like a silly question.
For example if I have a picture of the number 1 in green. I want to apply a red texture to that 1 from top to bottom along a line, slowly so that it's color changes from green to red. I want to capture this animation somehow. Hope it is clear now.
Answer: You could use a video as a texture, or if you use cycles you can use a mix node and keyframe the fac value (picture needed).

Animating a picture


How to install latest stable release of PHP on Ubuntu 14.04

Question: I've installed PHP on Ubuntu14.04 as shown in this link. I currently have PHP 5.5.9 installed, but the current stable release is 5.5.12, is there any way to install current stable release on Ubuntu 14.04 ?
Comment: The simplest way would be to replace the PHP5.5.9 installation with a 5.5.12. It should be as simple as replacing the files be sure you backup the current installation.  Is there a reason you have to use 5.5.12 instead of 5.5.9 considering 5.5.12 has not been pushed for a reason?
Comment: @Ramhound It's not that trivial to "replace the files". You cannot just backup an existing PHP installation as it's scattered across the system. Moreover, going to the latest release is advised for security reasons and critical bug fixes.
Comment: Before moving on to do what @BigChris suggests, you should take a look at this post on StackOverflow where another user trying to precede you in your tracks is facing some, apparently yet unsolved, problems. http://stackoverflow.com/questions/23716053/php-5-5-12-configure-error-on-ubuntu-14-04
Answer: Although http://www.dev-metal.com/how-to-setup-latest-version-of-php-5-5-on-ubuntu-12-04-lts/ is for 12.04, the steps should be the same. It seems you may have to add a PPA to get the latest version. PHP.net shows 5.5.12 as the latest stable release with a 1st May 2014 date.
Answer: Have a look at this page for a super-easy way of upgrading PHP to the latest version on 14.04 - http://www.dev-metal.com/install-setup-php-5-6-ubuntu-14-04-lts/
In short, you need to add the PHP 5.6 package created by Ondřej Surý to spt-get, then update and install php5. I've just done this myself and had no problems.


Is multiple inheritance possible in VB .Net?

Question: Is multiple inheritance possible in VB .Net?  If so, what is the syntax?
Answer: Short answer: No
Slightly longer answer: Yes, if you inherit multiple interfaces, and a single base class. Since this is usually the reason for MI (you want to implement multiple interfaces), it's usually enough. However, in those rare instances where "real" MI is useful, .NET prevents you from doing it.
Comment: @Orion Edwards: how is it not? Inheritance defines "is a" relationship, and interfaces are one way to define what an object 'is'. If I inherit ISerializable, I'm saying "I am an ISerializable", and treating me as an ISerializable works as expected.
Comment: Further to @Harper Shelby's comment, a voluntary application of this sort of restriction is usually viewed as a best practice in C++ (instead of interfaces you'd have pure abstract base classes).
Comment: @HarperShelby Inheritance, is when you inherit the pre-defined code as well. and it produces the same results. Implementing interfaces means that you still have to write the code in the pre defined methods. While the interfaces still have the same signatures, they can contain utterly different code and produce different results. So no it's not inheritance. Sorry.
Comment: @DavidWilson , I think you're artificially limiting your definition of inheritance. I've used patterns like Template Method on more than one occasion, where *some* code is reused, but other bits are not only not reused, but not defined in the base class intentionally. Both subclasses definitely inherited from the base, but had very different implementations and results.
Answer: It's possible in a restricted manner in VB.Net in the same way that it is in C#: via Interfaces.  Since an interface works out to essentially a pure-abstract base class, you can inherit from as many of those as you need and from one real class.
Answer: As far as I know VB.net does not support multiple inheritance in general but you can reach a kind of multiple inheritance by working with interfaces (using "Implements" instead of "Inherits"):
Public Class ClassName
    Implements BaseInterface1, BaseInterface2

End Class

That works fine for classes but I'd like to have an interface inheriting some base interfaces. Something like that:
Public Interface InterfaceName
    Implements BaseInterface1, BaseInterface2

End Interface

But the "Implements" keyword is not allowed for interfaces (what makes sense, of course). I tried to use a kind of abstract class which I know from Java:
Public MustInherit Class InterfaceName
    Implements BaseInterface1, BaseInterface2

End Class

But now I need to implement the defined methods from BaseInterface1 and BaseInterface2 within the InterfaceName class. But as InterfaceName should be an interface, too, I don't want to have to implement these methods within that class.
In C# you can do that quite easy:
public interface InterfaceName: BaseInterface1, BaseInterface2 {}

Answer: Likely what you want to do is really composition or aggregation  ( see here for design pattern).  Maybe you're defining a behavior.  You can always implement an interface SomeInterface in the base class, have a member of type SomeInterface (which lets it be any class that implements SomeInterface and can hence have the code does the implementing), in the members constructor pass a reference to the base class that owns it if necessary (if doing so, try to add another interface to define the callbacks, the base class will implement it and the subclass will have it as the member variable type).  Use calls to the member class to implement SomeInterface.  This way the code is implemented in another class, which makes it easy to maintain, but you're not doing multiple inheritance.
The idea behind composition is that an engine is not a car but a car has an engine.  The car needs an engine, but doesn't need to know how a whole engine unit works, just how to interface with it.  So the engine should not inherit from car.  But having the car implement the engine is silly.  So the car gets an engine as a member of the whole car, but as an object.  The car has an engine as part of its composition.
It sounds like what you are doing is more of a behavior, like a duck object that has a quack behavior, but rubber ducks are ducks but do not quack but squeak.  So they differ from mallard objects, but both have many other duck features in common.  So you want to have a quack interface that each implements differently.  But many ducks will quack for this interface, so you don't want to have to write quack for each one.  That's where you use composition to implement the quack behavior interface.


Joining points with nearest polygon using QGIS

Question: I have a points layer and polygons layer with attributes I want to join for each point. Not all points are exactly within a polygon, so I'm looking for a way to join attributes based on nearest polygon (so that if a point is located within a polygon it will just get its attributes).
I've tried using the NNJoin plugin, but I've noticed that for lots of points that are located within a polygon, it will joing attributes of a different polygon.
Answer: Try splitting your point data in two. First part would be the points that fall within a polygon and the second part would be points falling outside polygons. For the first part, perform a regular spatial join, and for the second part, use the NNJoin plugin. You can later merge the two resulting point layers into one. This way you can avoid the plugin performing an incorrect join on some of the points that fall within a polygon.
In order to select points that fall within the polygon layer, use the Spatial Query plugin (now a core QGIS plugin), then save the selection as a new layer. Invert the selection and save it as the second layer and perform the join using the NNJoin plugin.
Note that I have never used the NNJoin plugin.
Comment: I think that NNJoin doesn't do a very good job (tried your method, which was a good idea, but still got weid results). So I was hoping for an alternative way to join attributes of a polygon to a point based on nearest polygon.


Do the Clones know that Dooku was Tyranus?

Question: Count Dooku killed Jedi Master Sifo-Dyas and impersonated him in order to order the Clone Army. Since Dooku ordered the Clone army, does that mean the Clones know Dooku is the one who ordered them; if so, do the Clones know that Dooku is Tyranus?
Comment: I do not think that the clones have considerations or knowledge for these matters. They know that they serve the Republic. They have an order programmed in their memories to execute when issued.
Comment: Dooku was a tyrannosaurus?! Man, I gotta rewatch that movie...
Answer: I do not believe there is a Cannon answer.
There is no evidence to suggest they even know the existence of Dooku, Tyranus or Sifo-Dyas
I believe that Dooku placed the order for the Grand Army of the Republic and never made contact with the Kaminoans. This is supported by the fact that the Kaminoans expressed that they were concerned by the lack of contact from the Jedi/Republic since the order had been placed.  Kenobi's contact with them during Attack of the Clones seems to be the first contact since the order was placed.
The only source of ambiguity is what Jango Fett knew/revealed. Jango knew of the existence of Tyranus as he was recruited by him:

"I was recruited by a man called Tyranus on one of the moons of Bogden."

Jango during training sessions, Jango may have mention/revealed that Dooku was in fact Tyranus.
It was unclear whether Jango knew of Sifo-Dyas or that Tyranus ordered the clone army under the pseudonym. Jango claims to not know the name; however, that could be a ruse to throw Kenobi off. Perhaps the Kaminoans mentioned that the army was ordered by Sifo-Dyas; however, the Kaminoans seem to strictly follow a need-to-know basis when it comes to information. I do not believe Jango knew about Sifo-Dyas.
The amount of contact that Jango had with Dooku/Tyranus is unclear. It is possible/likely that Jango could have put two and two together. Dooku is a well known political figure, Jango knows Tyranus and is a smart man who is well connected. I believe the Jango knew or strongly suspected that Dooku was, in fact, Tyranus.
If clones did know Dooku was Tyranus, it would only be the original clones and, probably, only those who received personal training from Jango Fett himself. Even then, I find it highly unlikely that Jango would engage in small talk about Dooku and Tyranus with the clone troopers.


Is Canonical Criticism considered an academically sound/reputable method?

Question: Is biblical canonical criticism considered an academically reputable methodology for scholarly study?
Is it considered synonymous with the historical-grammatical method? Do non-conservatives ever use this method?
Apparently the Journal for the Study of the Old Testament uses this approach. Its also known as the "Sheffield School"?
Comment: This is obscure and requires a good deal more detail (with appropriate links) and clarity before the majority will even understand what it is about, never mind be able to respond with an answer. Please see the Tour and the Help (below, bottom left) as to the purpose and the functioning of the site. Please also see the other questions and answers as to how the site operates in daily practice. Welcome to SE-BH.
Comment: @NigelJ I was going to ask this on Academic Stackexchange initially but it seemed out of scope. Do you think there is a better place to post this?
Comment: It may well be suitable for here but I would suggest more clarity (and links to other documents) and further detail as I am not aware that these matters have ever been broached on the site. My thought is that users would need some more information (provided by yourself) in order to digest both the subject itself and the precise nature of enquiry. We cover many academic aspects and we have a very broad spectrum of users (skilled in various different disciplines). So I am sure that even the most obscure question could achieve an intelligent answer, given sufficient resource from the question.
Answer: Canonical Criticism was developed by Brevard Childs who was a Yale professor, it is hard to be more academically sound then that.
It is very distinct from the historical-grammatical method, since Canonical criticism is concerned with the larger texts place in the Bible, while historical-grammatical is concerned with the meaning of each meaning unit. One can look at Songs of Songs, historical-grammatical can explain what each metaphor means, but canonical criticism explains why a book with those metaphors is in the Bible.
I think a book that really lends itself well to Canonical Criticism is the Psalms. So the source critic wants to know who really wrote each psalm, the textual critic what the autograph really looked like, the historical-grammatical what they text really meant to the first reader. The canonical critical position wants to know how the way that the psalms have been collated together really affects our worship.
It isn't synonymous with the Sheffield School, but the Sheffield School uses it. Do liberal scholars use this approach? I don't see why not, and this recent article  seems pretty liberal to me.
The Bible Project is probably the major popular Canonical Criticism artefact.


For distinct odd primes $p, q$ we have $\sqrt{p^2 - 4q}$ is always irrational?

Question: I am trying to show that $\sqrt{p^2 - 4q}$ is always irrational with $p, q$ as described above. Any hints?
Answer: $p^2$ leaves a remainder $1$ when divided by $8$ and $4q$ leaves a remainder $4$ when divided by $8$ as $q$ is odd, hence $p^2-4q$ leaves a remainder $5$ when divided by $8$, hence cannot be a perfect square as odd perfect squares leave a remainder $1$ when divided by $8$.
And $\sqrt n$ is an irrational if $n$ is not a perfect square, hence the fact $\sqrt{p^2-4q}$ is irrational is not only true for odd primes $p,q$ but also for odd numbers $p,q$.
Comment: Brilliant...How do I think like this?
Comment: Checking modulo is a common practice for basic number theory problem
Answer: First idea that came to mind: If $n$ is odd, $n^2\equiv 1\pmod 8$. However, if $q$ is odd, $$p^2-4q\equiv -3\pmod 8$$

Second way: If $\alpha^2=p^2-4q$, then $\frac{-p+\alpha}2$ and $\frac{-p-\alpha}2$ are the roots in $\Bbb C$ of the polynomial $x^2+px+q$, which are rational if and only if $\alpha$ is rational. However, by the rational root test and primality of $q$, the only possible such roots are $x=\pm 1$ or $x=\pm q$. In all these cases the quantity $x^2+px+q$ is the sum of three odd integers, thus odd and non-zero.
Roughly the same argument works, which is not a surprise, for $p$ and $q$ odd (not necessarily prime) integers.
Answer: $\sqrt {p^2-4q}\;\in \mathbb Q$ iff $p^2-4q=m^2$ with $m\in \mathbb Z^+\cup \{0\}. $
If $m\in \mathbb Z\cup \{0\}$ and  $p^2-4q=m^2$ then $(p-m)(p+m)=4q.$ Now $p$ is odd so  $m$ is odd. (If $m$ were even then  $(p-m)$ and $(p+m)$ would both be odd, causing $4q$ to be odd.).  So $(p-m)$ and $(p+m)$ are even.
So $\frac {p-m}{2}\cdot \frac {p+m}{2}=q\;$ with non-negative integers $\frac {p-m}{2}$ and $\frac {p+m}{2}.$
But $q$ is prime  and $p>0$ and $m\geq 0 ,$ so this requires $1=\frac {p-m}{2}$ and $q=\frac {p+m}{2}.$
Adding, we have $1+q=\frac {p-m}{2}+\frac {p+m}{2}=p.$ But $1+q=p$ contradicts the hypothesis that $p$ and $q$ are both odd.
Note that $q$ is required to be prime but $p$ is only required to be an odd positive integer.


What is a word that categories and subsumes religion, philosophy, and spirituality?

Question: I saw the question What is the difference between philosophy and religion? which is interesting, but I am wondering what is a concept or term which categorizes/bundles all the meanings of philosophy, religion, and spirituality. Is it just "belief system"? If that is the case, then can we say it is "theory"? Or "metaphysics"? Is there a single word that bundles it all up? "Practice", "mythology", "teachings"?
Answer: In German there's the word "Weltanschauung" for that, it's apparently roughly translated to world-view:
https://en.wikipedia.org/wiki/Worldview
Comment: Came here to say this.  The Germans have great words for philosophical dialogues.
Answer: I would claim the word "philosophy" in fact captures all three.
The etymology and also the main meaning of the word "philosophy" is literally "love (and pursuit and practice) of wisdom (concerning life)".
In this sense it encompasses both religion and spirituality as types of wisdom concerning this life.
For example, Indian religions like Hinduism and Buddhism are termed as "philosophical systems".
Even religions based on faith are philosophical systems and in fact much of what is called scholastic philosophy was about clarifying matters of Christian dogma.
Philosophy can even talk about itself at a meta level and is still called philosophy. In other words, metaphilosophy is still philosophy.
Religion, spirituality and worldview cannot do that at a meta level and still be called the same. For example, one does not have a religion about religion or a spirituality about spirituality.
Another example: "My philosophy of life is such and such..".
So philosophy as a concept is quite versatile.
Not to be confused with "modern academic philosophy" which is only a specific type of doing philosophy.


Speed of a standing wave

Question: Standing waves are the waves in which disturbances do not simply propagate forward or backward, but rather the material particles are moving up and down continuously, with the particles between two consecutive nodes in the same phase. But when we are talking about the harmonics of such a wave, we define the $n^{th}$ harmonic by-
$$f_n=\dfrac{n}{2L} \sqrt{\dfrac{T}{\mu}}$$
The problem is, this formula is derived by assuming that the wave speed is $$v=f\lambda$$ or $$v=\sqrt{\dfrac{T}{\mu}}$$
But if the wave is actually standing, what does this speed actually mean? Does it mean twice the length of the string times the frequency of the individual particles performing harmonic oscillations? And if that is so, who is to say that it will be equal to $\sqrt{T/\mu}$?
Comment: Could you provide more details about the system/equation that you are solving, how you arrive at harmonics, and why you think you need to know the speed. The question seems to lack the context.
Answer: What makes a standing wave is having waves in a single medium propagating in opposite directions at exactly the same speed, and in phase. This requires the waves to possess a unique speed through the medium in order to establish the "standing wave" condition (and it also requires the medium to have a finite length into which an integer number of those waves can fit). That's why the standing wave condition must account for the wave speed.
Answer: Actually, in the standing waves theory this expression will add almost nothing to your study, it becomes really significant only when you deal with traveling waves. As @niels nielsen said, if you want, you can see too the standing waves as a superposition of traveling waves, but, as you can see, even seeing from this side requires the idea of waves propagating.
Too, this is the phase speed, that is, the speed which the phase propagates, but in standing waves the phase don't propagate, it just stay there!

Speed of a standing wave


How do I make topfit work with legion's "dual-wield" artifact weapons?

Question: How do I make the topfit add-on work with "dual-wield" artifact weapons?  It keeps making a clicking sound once every second for five seconds as it tries to equip another item that it can't use!
Answer: For each spec you have, do the following:

Change to the spec
Unequip the weapon
Open your character screen
Hold down alt and mouse-over your "main" weapon slot.  (If you're in a typical spec, this is your main hand; if you're in a tanking spec, it might be your off-hand.)
Check the box in the bottom left of the icon that represents your artifact weapon
Hold down alt and mouse-over your other weapon slot, what I'm calling the "non-main" weapon slot.
Check the box of the "place in bags" icon.

That should work.


Semantic HTML5 tags for SEO

Question: Are the new HTML5 tags like
,,<hgroup>,,...

... really useful for SEO?
How do google and other search engines treat these tags in terms of SEO?
Comment: http://webmasters.stackexchange.com/questions/1413/what-are-the-seo-rules-for-html-5/1417#1417
Answer: Anything that helps a search engine better understand the content and makeup of a web page is ostensibly better for SEO. The information a spider is able to discern about the structure of your page directly increases the accuracy of the spider's effective grading of your page. This is not to say that it will necessarily give you a better ranking, only to say that the spider will more accurately rank your page based on its content (which typically results in a positive gain).
This is why table based layouts are so bad for SEO... it is nearly impossible for a spider to distinguish between body copy, headers, sidebars, etc. Therefore it is significantly more difficult for the bot to determine contextual relevancy of any one keyword/phrase against another. This makes the end weight of the page far lighter than what it would have been otherwise, had the bot been able to understand the correlation between the content on a page.
Answer: The direct answer is: No. You could use HTML4 designing the document with block elements (
) instead of using semantic elements (,
, , , etc), and the result in the SERPs would be exactly the same. It would affect if you had a really bad design, for example using HTML frames: that would be negative because crawlers could not read all the content of the site. It would also affect if you used Flash for the design, instead of using HTML elements with its content.

Semantic HTML5 tags for SEO


Computing eigendecomposition of a Hermitian matrix that is almost unitary

Question: I have a dense Hermitian matrix that is approximately unitary, so it has eigenvalues that are $\sim \pm1$. I would like to compute all the eigenvectors corresponding to the $+1$ eigenvalue (not necessarily a small fraction of the total number of eigenvalues). Is there some more efficient way to accomplish this than tridiagonal QR?
Comment: Look for the kernel of $A-I$?
Comment: Now that I re-read your question, it is not clear to me whether you mean "the eigenvalues that are exactly +1", or "those that are closer to +1 than to -1 and hopefully come from +1 eigenvalues of the unperturbed unitary matrix". Could you clarify?
Comment: I mean the latter. The eigenvalues "should" be clustered around $\pm1$, but practically, get spread out a bit, while still respecting the upper bound (but not the lower). Typically, of the set closer to $+1$, the vast majority of them are almost exactly $1$.
Answer: A thing you might try:
1) perform a few iterations of the matrix sign iteration $A\mapsto \frac{1}{2}(A+A^{-1})$; the eigenvectors are unchanged, while the eigenvalues converge quadratically to $\pm 1$. When $A-A^{-1}$ is small enough, stop the iteration.
2) compute the kernel of $A-I$.
More information on the matrix sign iteration on the book N. Higham, Functions of Matrices.
This method trades off eigensolves for QR factorizations; it might be faster than QR, depending on the size of the matrices, of the perturbation, and other machine-related factors difficult to quantify.


Why does a simple circuit drain a battery slowly?

Question: OK, so if you directly connect the two terminals of a battery, there is very little resistance in the circuit and you will drain the battery very quickly. However if you have a very simple circuit, for example a light bulb connected to the battery, the battery will drain slowly based on the watts used by the light bulb. My question is, if this light bulb provides only a little resistance, wouldn't a lot of current flow through and therefore drain the battery quickly?
Comment: Complexity has little to do with it. A digital watch with thousands of transistors can run for years on a tiny battery, but a flashlight will drain a much bigger battery in a few hours.
Answer: You may be a little confused by the resistance of a light bulb. Typically, a "cold" (that is, not glowing) bulb filament will have a resistance about 1/10 its resistance when hot. So an operating (glowing) bulb will discharge a battery much less quickly than you might think if you just go by what a meter says the resistance is.
Once it's glowing, another effect comes in to play. For a given desired brightness, you can get better efficiency by overdriving the bulb. That is, if you take a bulb and drive it at higher voltage, it gets even hotter than it would normally, and its resistance gets even greater. Since it is hotter, a greater fraction of the energy being dissipated by the filament is given off as visible light as opposed to infrared. See "blackbody radiation" for an explanation. Of course, this means the filament will burn out more quickly, but you can't have everything.
Comment: Makes sense. Now obviously more light bulbs would equal more power consumed from the battery. I am wondering why though, as more light bulbs means more resistance, means less voltage / current.

In other words, how do we go from direct wire draining the battery very quickly, to a small bulb draining it very slowly, to several bulbs draining it quickly once more. It's like the relationship between resistance and load flips at some point.
Comment: Sorry, but you are confusing series and parallel connections. If you put several light bulbs in series, they will glow much less brightly, and drain the battery more slowly. If you put them in parallel, all will glow at normal brightness, and the battery will discharge faster. It's like draining water from a tank - put several hoses end to end and the water will drain more slowly. Cut holes for more spigots and attach more hoses, and the tank will drain quickly.
Answer: You are correct. If the light bulb only has a small resistance the battery will be drained fast.
That is true for any circuit, be it simple or be it complex. It's a matter of total resistance.
Comment: So by this reasoning, wouldn't a 100W light bulb with its greater resistance drain a battery more slowly that a 5W light bulb which would resist less?
Comment: It depends on the voltage rating of the light bulb. A 220V 100W light bulb has a resistance of (220V)^2/100W = 484 \$\Omega\$. A 5W 220V bulb has (220V)^2/5W = 9680\$\Omega\$. So the less wattage bulb has a higher resistance. And will drain the battery more slowly.
Comment: OK, I think this is starting to make sense. One remaining point of confusion, do you get more or less resistance if you add additional 5W bulbs in series. Guessing less (to make the math add up) but this doesn't seem intuitive.
Comment: A light bulb is basically just a resistor, adding them in series also adds the resistance. If you apply the same voltage across them, less current will flow and the bulbs won't be as bright as before.
Answer: If you connect a high-power (bright) light between the battery terminals it will drain the battery faster than a lower-power (dim) light, because the bright light will draw more current than the dim one.


Unity Rotations Not Following Local Nor Global Axis?

Question: In the gif below, you can see that rotating on X moves all 3 axis including the X axis. It's possible it's rotating on the global X rather than local X (hard to tell). But Y looks more like it's rotating on global Z and Z is quite clearly rotating on local Z. What is going on? Why is there no consistency?
Answer: It's a common misconception that the three numbers in the Euler angle fields correspond in a simple 1:1 way with the three axes of the rotation gizmo on an object that we can see spatially in the editor. It's easy to disprove this though - once we've rotated the object on two axes, subsequent rotations using the editor gizmos will tend to change all three Euler angles at once:

That the three axes of the Euler angles happen to line up with the local axes / rotation gizmos when one or more axes are zero is something I'd recommend regarding as coincidence. In the general case, there's no simple relationship between Euler angles and the object's axes of rotation as shown & used in the editor or via Transform.Rotate calls.
So, what do the Euler angles represent? They specify a sequence of rotations, applied in the following order:

Rotation by z degrees about world Z+
(This is why it looks like the z parameter rotates around local Z+: since it's applied first, the local and world z are identical at first.)
Rotation x degrees about world X+
(If our z rotation was zero, this is the same as rotating about local X+. If not, then the rotation we applied in the previous step affects the relationship between the object and the x rotation axis, and so on down the chain...)
Rotation by y degrees about world Y+
(Since this one comes last, it's the "most global" of the three, which is why it tends to align with world Y in the final transformation - unless we're inside a rotated parent object which then turns this axis somewhere else...)
Parent's rotations
(again in the order Z-X-Y, all the way up the transform hierarchy)

Each of these three fields is applied all at once as a total when its turn in the sequence comes. Since rotations are not commutative, that means you get a different result than if you saved some of the rotation to apply "on top" as an increment after the rest. That's why it doesn't behave in a very intuitive way once you've already rotated an object.
If you have an object rotated at (-54, 38, -25) in Euler angles, and then you change the x value to -79, the Euler angles don't "remember" that the first -54 degrees were applied first, and then apply the remaining 25 degrees relative to those resulting axes. The Euler angles are just numbers. So they give you the result of rotating -25 on Z, then -79 on X, then 38 on Y.
Because any changes to the numbers get folded-in this way, Euler angles can behave in profoundly non-intuitive ways if you're trying to manipulate them one angle at a time. They're an effective way of storing / printing a rotation in a way that's concise and human-readable, but not a good way of modifying or computing a rotation.
For those manipulating orientations, you'll more often want to use the editor gizmos (which represent incremental rotation about a specific axis), Transform.Rotate, quaternion composition, or constructing your desired orientation from forward & up basis vectors.
Comment: Yes. Euler angles are just a definition of where something is now. They make no promises about the future. They axes / rotation gizmos you see in the inspector, and rotations you apply through [Transform.Rotate](https://docs.unity3d.com/ScriptReference/Transform.Rotate.html), have no relationship to the three numbers in the Euler angles fields ([it's easy to arrange an object so that rotating in just one gizmo axis changes all three Euler angle numbers](https://i.stack.imgur.com/JpZZ2.gif)). Basically, think of Euler angles as a way of storing/printing a rotation, not a way of working with it.
Comment: Sorry, I'm not quite following how this applies to my situation. You can see both sets of local and global axes and I'm only rotating on one axis at a time. This would make sense to me if I were trying to rotate on 2 at the same time and getting something I didn't expect because it did one axis before the other, but that's not what I'm doing here. Am I missing something?
Comment: You are indeed. Note that in your example, all three of your Euler angle rotation fields have a non-zero entry. That means you're not rotating on one axis at a time when you vary one of the numbers. In the frames where you vary the x value between -25 to -79 or so, you're not seeing the effect of rotating 54 degrees on one axis. You're seeing the effect of first rotating 38.7° about the world Z+ axis, *then* rotating the result -25 – -79° about the world X+ axis, *then* rotating *that* result -27° about the world Y+ axis. Euler angles always represent a sequence.
Comment: The Euler angles have no way to remember "Oh, -54.2° degrees of this rotation on X were already applied earlier, and the remaining -19 or so should be applied relative to wherever the X axis was after that setup" — it's just a simple total. And those totals are always applied as a whole in the order Z-X-Y. So it's misleading to think of applying incremental rotations on the Euler angle numbers directly. You're usually better served using the rotation gizmos in the editor, or quaternion composition in scripts. The model Euler angles present is not one that maps well to our intuition.
Comment: Interesting... I think I might understand. So each axis is again individually considered when I rotate on just one axis in the inspector? And the local axes shown on the screen reflect the end position but cannot be used to determine what incremental changes will do? What about transform.Rotate(1, 0, 0)? Will that incrementally rotate precisely on the local X axis as seen in the image?


Write a Project Variable from a Modeler result attribute in QGIS

Question: I am trying to set a Project Variable with QGIS Modeler with values as the modeler calculates them.  In this case I am trying to get the calculated area from a process "Fire_Area" written to a project variable that can be input into the map sheets or atlas etc.  Everything works but the write to the variable fails.  See attached images.
Answer: Since field calculator will evaluate the expression for each feature, it seems like you want to assign a kind of dynamic value to a project variable name.
You can't that way, because custom project variables accepts only string literal values. In fact, they will be stored as a string in the project file.
You probably don't need it, but you could set the expression text, and evaluate it in any other context of the expressions builder, as long as the built-ins you use in the expression are valid in that context.

For example, @feature built-in variable and $area function are valid in a field calculator context.
You can fill a field value with the ellipsoidal area of each feature's geometry (regardless of its crs) with:
$area

For the planimetric area (dependent on its crs) you can:
area( geometry( @feature))

Although simpler:
area( @geometry)

In all those cases, you are assigning a value to a property (for example the fire_area property) of each feature, by filling its field. This is what is generally done when you want a "dynamic value based on each feature".
But nothing prevents you from set the literal text of the expression in a project variable called, for instance, fire_area_expr:
'$area'

And then you can evaluate it in a field calculator:
eval( @fire_area_expr)

Fortunately, both built-ins (@feature and $area) can also be used in the context of atlas page filters, or labels of an atlas-controlled layout. Therefore that project variable can also be used there, in the same way.

In any case, if you want to set a custom project variable from a model output, it has to be a text. It can be a text input of the model, or an expression algorithm output returning a text. And it can be then evaluated as a expression in a context.

If you already filled the fire_area field of each feature with the area value, you could also use:
attribute( @feature, 'fire_area')

Or simpler:
"fire_area"

The with_variable function creates a fleeting variable, which value can store absolutely any type of data:
with_variable(
 'fire_area_var', --the variable name
 $area, --the expression to compute its value
 @fire_area_var --an expression calling the variable value by its name
)


When the answer to a question exists on another site, what is the proper way to respond

Question: There was a small debate which took place in the comments for podcast #58 regarding linking to an answer (such as MSDN, php.net, or other definitive sources) versus providing it inline. What is the community's position on the proper etiquette here?
Comment: http://stackoverflow.com/questions/518828/should-stackoverflow-be-self-contained
Answer: IMO, link to the original source and provide a quote of the text of the relevant section. It saves time for the reader who can then at least decide if the response is relevant before trudging their way through whatever page they land on. It also provides historical context for the original intent of the answerer in case the text on the linked page changes substantially.
Also, links move and no one is perfect when it comes to providing new locations for things. Microsoft often orphaned several help links the last time they reorganized MSDN and it wasn't for lack of trying.
Answer: My usual practice is to link to the resource but either quote a short but relevant section (e.g. the "remarks" section of an MSDN page) or praise it. Creating a verbatim copy of a large amount of text is only good in the face of the resource being removed - which I suspect isn't going to happen for MSDN .NET documentation, Wikipedia or JavaDoc as three common examples. (I'm hoping the last MSDN re-org was the last for a while.) However, the document may very well be updated to become more accurate as time goes on. Copying more of a document than could reasonably be called "fair use" could run into legal issues, too.
Where possible add some extra value:

Explain how it's relevant to the specific question
Balance multiple points of view by referring to other documents
Give some sample code around the general point stated by the document
Comment: I chose this as the accepted answer because its basically what I said except with more detail.
Answer: I assume by "another site" you mean in some forum somewhere, rather than on ServerFault, etc.
Personally, when I find the answer to a question in a forum, I do something like this:
Sounds like your problem is X - I found this solution on WebsiteX:
<code>\\ Code example
Example code is here
</code>
This gives attribution to the original poster on the original site, but provides the answer inline here.
Comment: Yes, I am referring specifically to links to content not controlled by Jeff or Joel.
Answer: I think the StackOverflow sites should strive to be both authoritative and self-contained.
While a link to a pre-existing answer might be appropriate for "fair use," the most relevant information should be included (an re-authored, where appropriate) as part of a specific and complete answer to question.
I'm not advocating wholesale copy-and-pasting other people's work but a simple link to another site does not bring the content of that site under the scrutiny of the StackOverflow process (voting, comments, etc). I might up-vote a link while not necessarily agreeing with everything on that site. And a comment about the contents of another website would probably be confusing and out of place.


Questions marked as unclear

Question: I have noticed before that some of the moderators had marked my question as "Unclear" and it told me to edit the question to make it more clear. I edited my question to make sure, it was as clear as possible after.(I, myself, realized it was unclear before). However, even after I edited it, the count of the moderators who marked it as unclear remained the same. Do moderators have the privilege of going back and unmarking the question as unclear. Do moderators really go back and see if the user tried his best to make it clear?
Comment: If you're referring to this (now deleted) question: http://stackoverflow.com/questions/23816230/post-redirect-get-function-good-or-bad , your edits placed it into the reopen review queue. However, three reviewers thought that your edits did not do enough to justify reopening: http://stackoverflow.com/review/reopen/4882648
Comment: No, we don't always, or at least, we don't immediately. You didn't even give people a full **day** to look at your question again before you went and [deleted it yourself](http://stackoverflow.com/questions/23816230/post-redirect-get-function-good-or-bad).
Comment: Upvoted because curious.
Comment: Thanks for your response. I guess because 4 moderators already marked it as unclear and I edited the question many times but it was still marked unclear by all the mods so I figured maybe it was best for me to solve on my own and delete the question.
Comment: I actually wasn't too worried about that one particular question, I just wanted to give an example. I was curious ever since though about the whole situation about "Unclear question" and how they are dealt with. Thank you for explaining your thought on it though.
Answer: Given that you mentioned 4 moderators, I assume you actually just mean "people with vote to close privileges." If they were actually mods, one vote would've been enough to close the question.

(Speaking from the perspective of someone with vote-to-close privileges)
We do have the ability to go back to a question, see if it has improved, and revoke a close vote if it's been improved enough, but we don't actually exercise that ability often. At least for me, the main reasons are 1) because nowadays there are too many bad questions to make keeping track of them all practical and 2) because more often than not, the asker ragequits instead of taking advice and improving.
For actually reversing downvotes or votes to close, there's not a whole lot you can do if you don't know who cast the votes. Deleting the question actually complicates things, since a lot of us (anyone with 3000-9999 rep, myself included) can cast a close vote, but can't see deleted posts.
As far as what you've done already, it's good that you went back and improved the question; that's exactly what you're supposed to do, and the most practical thing you can do. As far as deleting the question goes, I see no problems with deleting the question, editing it until it's improved and ready for action, then undeleting. Deleting and leaving a question alone should really only happen if it's beyond salvaging; poorly received questions that are deleted still factor in deciding question bans.
Comment: Thank you for your detailed response. I actually wasn't too worried about that one particular question, I just wanted to give an example. I was curious ever since though about the whole situation about "Unclear question" and how they are dealt with.
Comment: A couple other thoughts: if we revoke a close vote we can't revote to close (another reason to be careful), and if your question does get incorrectly closed, you can try to get it reopened. (If it's vastly improved and on-topic, it'll almost certainly get reopened)

Questions marked as unclear


What is the probability of picking items out of many small sets versus one large set.

Question: Say you have 100 objects that come in pairs (set of two) and you must randomly pick one from each set so in the end you have 50 items -- one representative from each set. The chances of any item being picked would seem to be 50/50 and so the chances of an item never being picked after multiple passes would decay by half every time: 50%, 25%, 12.5% etc. But what about if you simply pick 50 items out of a pool of 100? It seems again that there is a 50/50 chance for any item to be picked, but my intuition is telling me that some items would have a better chance in the long run of never being picked in this second scenario. Am I just crazy? If I am not crazy then what is the math to explain this? Mind you, I only have high school math experience.
Answer: For your first method, imagine lining up the people in *couples. There are $2$ choices for the person you will choose from the first couple. For every way of choosing the representative of the first couple, there are $2$ ways of choosing the representative of the second couple. So there are $2\times 2$ ways of choosing who will represent the first two couples.
For each of these $2\times 2$ ways, there are $2$ ways to choose who will represent the third couple. So there are $2\times\times 2$ ways to choose who will represent the first three couples. Continue. There are in total $2^{50}$ ways to choose $50$ people, one from each couple. Note that this is the same number as the number of binary stringss ($0$'s and/or $1$'s) of length $50$.
All these $2^{50}$ ways are equally likely. So the probability that any particular bunch of $50$ is chosen is $\frac{1}{2^{50}}$.
If we are simply choosing $50$ people, with no restrictions, there is an enormously larger number of ways to do the job.
The number of ways is $\binom{100}{50}$. (In high school, this is often called something like $\text{C}_{50}^{100}$, or sometimes ${}^{100}\text{C}_{50}$. It has several other names!  It turns out that in general
$$\binom{n}{m}=\frac{n!}{m!(n-m)!}.\tag{1}$$
So in our case, we have $\frac{100!}{50!50!}$ equally likely ways to choose $50$ people. The probability that a particular group of $50$ is chosen is $\frac{50!50!}{100!}$.
Formula (1) is often useful It takes a little while to prove. If you would like a sketch, I can provide it. You might also want to look at the Wikipedia article on Binomial Coefficients. You probably have met these before, as the numbers in Pascal's Triangle.
It looks as if you were also  asking about the probability a particular person, say Alicia,  is chosen. In either case, the probability is $\frac{1}{2}$.
For the couples situation, one person will be chosen at random from each couple, so the probability is clearly $\frac{1}{2}$. For the second way, the chances that Alicia is among the $50$ chosen is $\frac{50}{100}$, again $\frac{1}{2}$.
Comment: I'm not sure it takes so long to prove; there are $n \cdot (n-1) \cdot \ldots \cdot (n-m+2) \cdot (n-m+1) = \frac{n!}{(n-m)!}$ ways to choose $m$ people from $n$ people, and there are $m!$ different orders in which the same group of $m$ could have been chosen. That establishes the identity with a moderate level of rigor.
Comment: At my level of wordiness, it takes a while! Also, I was trying to encourage OP to look at the Wikipedia article. I guess a link would provide further encouragement,
Comment: So you are saying that any individual card has the same chance over time of getting picked in either scenario, but there are far more unique sets of 50 that could be picked in the second scenario. So if these couples were guys and girls you could get an equally lopsided selection either way, but if the couples were people of similar age then you would get a more even representation of all age groups in the first scenario. That is probably what my intuition was trying to tell me about.
Comment: The remark about people of similar age is right, and plays a role in sampling. The idea behind *stratified* sanpling is kind of based on this. Suppose you know that $50\%$ are make and $50\%$ are female. You could take a random sample of $1200$ *people*. But it is often more reliable to take a random sample of $600$ males, and a random sample of $600$ females. (Real world stratified sampling uses more than two strata.)


Using multiple regression model from training set to predict test data in R

Question: I am an undergrad student and I'm super new to R! I have a data set that I have split into a training and test set. I obtained a multiple regression model from my training set, and now I want to use it to predict my test data. My dependent variable is Plant Species Richness (PSR), and my original data set had 4 independent variables (Area, AdjacentWetlands, Roads, and Forest) but my model is only using Area and Forest: LM<-lm(PSR~Area+Forest, data=Wetlands). How do I use this model to predict PSR in my test set? And then how do I assess whether it is a good prediction or not?
Comment: Split-sample validation takes an amazingly large sample size to work in the sense of providing almost the same answer if you were to repeat the single random split and re-do all model building and all validation calculations.  What is your total sample size?
Comment: If you're interested in learning about machine learning and R, I'd highly recommend checking out [An Introduction to Statistical Learning](http://www-bcf.usc.edu/~gareth/ISL/ISLR%20First%20Printing.pdf), which is a great book that is freely available as a pdf. It has many examples in R, including cross validation (Chapter 5)
Answer: Firstly, get your model:
LM <- lm(PSR ~ Area+Forests, data = Wetlands)
Make sure all data values are correct.
The function predict() does the calculation:
pred <- pred(your_model, your_data_test)
Your issue seems that your_data_test have more variables than your model, right?
So you can slice your_data_test and put into a new_data_test by using
new_data_test <- data.frame(your_data_test$variable1,your_data_test$variable2)
and then
pred <- pred(yourmodel, new_data_test)
I suppose should be work for you.
Comment: I tried your solution on a similar dataset, but this gives a warning: " 'newdata' had 15600 rows but variables found have 1164007 rows  "

Also the created predict vector is not of 15600 length as it should be, but of 1164007 length.
Comment: Please check your data and try to catch any inconsistency in the values.
Answer: Actually, you don't need to create new_data_set. Instead, simply use your_data_test to get pred since your_model (LM) restricts to its entries (2 variables as mentioned above).
Answer: You can use print(summary(LM)) to access the accuracy of your model. You'll also get to know of other vitals like r^2 value, p-value of each predictor which helps you decide on a model.
Comment: this is true and generally helpful, but the OP asks _"How do I use this model to predict PSR in my test set? And then how do I assess whether it is a good prediction or not?"_


Could horses ride humans the same way that humans ride horses?

Question: In a world where horses (or any other species for that matter) were the dominant species instead of humans, could they ride humans in the same way that humans ride horses in this world? Could the human bear the weight of the horse? How would the horse sit? And is there example in real life of creatures (except humans) using other animals as modes of transport>
Comment: Have you ever seen a horse in real life???
Comment: An European horse or an African horse?
Comment: Also your question is really broad, you should limit yourself to either one specific animal e.g. horses as in the title of your question; OR you rewrite the whole thing and look into how much a human possibly can continuously carry on their backs
Answer: Short answer: No (at least not if horse-world-humans are the same as earth-humans)
Longer answer: Still no
Adult horses weigh some ~1900-2200lbs. A human can apparently deadlift some 455kg (some 1000lbs). As I didn't find a number for carrying stuff on ones back, I multiply the deadlift by 1.5, which results in some 1500lbs if we're generous -> This is still nowhere near the weight of a horse..
Answer:
How would the horse sit?

(a) That is the first problem - before even worrying about whether it is possible to lift a horse. Most people down on all fours won't even reach up to the lower parts of a horse. A very high saddle would be required and the higher, the more unstable.
(b) There is the ancient myth of milo of croton who, by starting as youth carrying a small heifer was eventually able to carry a full grown bull on his shoulders.

And is there example in real life of creatures (except humans) using
  other animals as modes of transport?

Yes, see the following video. (click link, not picture)
https://youtu.be/tkwAbzNCXK4?t=11


UI/UX for a website on a desktop

Question: I was wondering when working on a portfolio should i focus more on mobile than websites on desktops? I say this because websites don't seem to be as UI/UX centric compared to an application or mobile app.
Comment: [UX is not UI](http://www.helloerik.com/ux-is-not-ui)
Comment: UX matters but a local app just has more tools/options - it is a local app.
Comment: As @Okavango mentioned. Maybe you should edit your post. If we are talking about UX, then you can make a portfolio in more specific cases like transaction effects or animation feedback. Do not limit yourself to a platform/device.
Comment: This question is certainly linked to User Experience! If I visit your portfolio, it's probably because I want to hire/buy something. When doing so, I would probably want to print the page on physical paper. Make sure your design accommodates for this need!
Comment: i work on mobile apps and desktop applications. UX applies to everything and is platform independent. UX is as much about analysis and testing than simply layout
Comment: The answers and comments so far demonstrate that your question could do with clarification. Do you mean a) "I am building my own UX/UI portfolio. When selecting examples/ cases in my portfolio, should I highlight the mobile cases or the desktop cases?" or b) "I have some portfolio. Should I present it in a mobile-friendly way, or in a desktop-friendly way?" Also, some elaboration on term "portfolio" would help.
Answer: Mobile UI/UX is certainly a less developed area than Desktop, and faster growing at a faster rate.
It's importance cannot be understated.
However, the truth is - it depends on you and what you want to do.
Are you passionate about Mobile? Is that where you see yourself working? Can you relate to Mobile users over Desktop users? Can you understand the User Journeys of someone with a smaller screen and limited data better than the full-power of a Desktop? If so, work on a Mobile portfolio, and apply for Mobile portfolio-related jobs.
If you're just worried about getting a job full-stop, then as someone who has hired people, I would say that having evidence of both types is more useful to a UI/UX team manager.
Many teams have Junior and Senior levels who work on both Mobile and Desktop experiences, rather than just dedicated Mobile and Desktop teams.
Even if I was hiring someone as a dedicated Mobile UX consultant, having Desktop experience certainly isn't going to put me off. The ability to show an understanding for the needs of different Mobile/Desktop environments would only add to an application.
Answer: Are you a UI developer? Then I say concentrating on both are important.
Because that is what you do for a living and people are going to judge you based on your website.
Now,the facts:-
Most of the people today are lazy to open up a desktop and type in the URL unless they are finding it in the desktop.
Most of the times when I get a url , what I do is to check the site in my Mobile. So if a mobile site is bad  , the first impression is gone , and yes first impression matters.
Mobile UX
When it comes to mobile UX make things simple, to make a no nonsense mobile version of a site is no big deal. Just try not to make it irritating for the user , he must be able to reach all the contents with much hassle.
Mobile UI
You can concentrate less on UI and concentrate more on UX when it comes to mobile site . Even if it looks less good , it should not irritate the user - that should be the basic aim. But make sure you have a decent enough UI.
Desktop UX and Desktop UI
No excuses here , if you are making your portfolio you need to come up with your personal best both in UX and UI.
Check this site for example - http://www.rei.com/
They made a wonderful version of the mobile site , even with so many data. So when it comes to portfolio ( Since data is going to be comparatively less ) things are going to be easy , there will be zillions of example which you can learn from. Every other site today has a mobile version which has a decent UX and UI.
Answer: In all likelihood your portfolio will be viewed on a desktop.
There are very few recruiters who will look at it in any other form (it's unlikely that they'll be looking for it on a smartphone or tablet simply because, when they're out of the office they are visiting clients and not looking at candidate portfolios).
Similarly, there are very few employers who will look at a portfolio anywhere other than sitting at their desk focussing on how they will spend their staffing budget most wisely.
If you're a UX Designer then you're portfolio content will be the focus of the interaction and not the build of the site - If you can't code then you can't produce a responsive site now matter how well you can design one. You can just make sure that the case studies you show demonstrate your skills in designing for different screen sizes and formats.
Alternatively, if you're a UX Developer then you really want to be showing off you skills with all sorts of semantic tags, microdata, responsive CSS, media queries, etc.
So, as had been said in other comments here, it depends what job you're looking for.

UI/UX for a website on a desktop


What is Fuzzy Transposition?

Question: Is anyone familiar with fuzzy transposition? If so, could you please elaborate on the concept and its formulas?
Answer: In academic music theory, the notion of "fuzzy" just means that there is some level of imprecision.
The concept actually started out in mathematics; you can read about it briefly on this Wikipedia page for "fuzzy sets." I'm not sure I can help with any "formulas" per se, but that page may be of use.
In terms of fuzzy transposition, the idea is simply that whatever is being transposed isn't being transposed exactly. If you have C D E, a fuzzy transposition may move it to E F G#. Note that the F in the latter case wasn't transposed up a major third like E and the G#; this would be an example of a "fuzzy" operation.
If you're working with fuzzy transposition, make sure you also consider the notion of transposition in chromatic space and transposition in diatonic space. If you move C D E up by major third in chromatic space, you get E F# G#. But if you move C D E up by third in the diatonic space of C major, you get E F G, since those are the pitches a third higher in the key of C major.
Comment: Well....  TIL a new initialism (ELI5) :-)
Comment: I think it gets a little more complicated with Atonal music. As far as I can tell, they resorted to Fuzzy Transposition as a tool for working with Atonal music where "pitch class" isn't so cut and dry? Not well read on this.
Comment: It's definitely more complicated, and it has been expanded far beyond just the concept of transposition. For better or worse, I treated this as an ELI5 answer.

What is Fuzzy Transposition?