How do I convert a vec4 rgba value to a float?

Question: I packed some float data in a texture as an unsigned_byte, my only option in webgl.  Now I would like unpack it in the vertex shader.  When I sample a pixel I get a vec4 which is really one of my floats.  How do I convert from the vec4 to a float?
Comment: How did you "pack" this data as a byte? And what texture format are you using to store this data in?
Comment: I passed an array of numbers to the Uint8Array constructor.
Comment: The format is RGBA.  This is the call I make.  It is java because I use google web toolkit.

  glContext.texImage2D(
    WebGLRenderingContext.TEXTURE_2D,
    0,
    WebGLRenderingContext.RGBA,
    width,
    height,
    0,
    WebGLRenderingContext.RGBA,
    WebGLRenderingContext.UNSIGNED_BYTE,
    byteBuffer);
Answer: The following code is specifically for the iPhone 4 GPU using OpenGL ES 2.0. I have no experience with WebGL so I cant claim to know how the code will work in that context. Furthermore the main problem here is that highp float is not 32 bits but is instead 24 bit.
My solution is for fragment shaders - I didnt try it in the vertex shader but it shouldnt be any different. In order to use the you will need to get the RGBA texel from a sampler2d uniform and make sure that the values of each R,G,B and A channels are between 0.0 and 255.0 . This is easy to achieve as follows:
highp vec4 rgba = texture2D(textureSamplerUniform, texcoordVarying)*255.0;

You should be aware though that the endianess of your machine will dictate the correct order of your bytes. The above code assumes that floats are stored in big-endian order. If you see your results are wrong then just swap the order of the data by writing
rgba.rgba=rgba.abgr;

immediately after the line where you set it. Alternatively swap the indices on rgba. I think the above line is more intutive though and less prone to careless errors.
I am not sure if it works for all given input. I tested for a large range of numbers and found that decode32 and encode32 are NOT exact inverses. Ive also left out the code I used to test it.
#pragma STDGL invariant(all)

highp vec4 encode32(highp float f) {
    highp float e =5.0;

    highp float F = abs(f);
    highp float Sign = step(0.0,-f);
    highp float Exponent = floor(log2(F));
    highp float Mantissa = (exp2(- Exponent) * F);
    Exponent = floor(log2(F) + 127.0) + floor(log2(Mantissa));
    highp vec4 rgba;
    rgba[0] = 128.0 * Sign  + floor(Exponent*exp2(-1.0));
    rgba[1] = 128.0 * mod(Exponent,2.0) + mod(floor(Mantissa*128.0),128.0);
    rgba[2] = floor(mod(floor(Mantissa*exp2(23.0 -8.0)),exp2(8.0)));
    rgba[3] = floor(exp2(23.0)*mod(Mantissa,exp2(-15.0)));
    return rgba;
}

highp float decode32(highp vec4 rgba) {
    highp float Sign = 1.0 - step(128.0,rgba[0])*2.0;
    highp float Exponent = 2.0 * mod(rgba[0],128.0) + step(128.0,rgba[1]) - 127.0;
    highp float Mantissa = mod(rgba[1],128.0)*65536.0 + rgba[2]*256.0 +rgba[3] + float(0x800000);
    highp float Result =  Sign * exp2(Exponent) * (Mantissa * exp2(-23.0 ));
    return Result;
}

void main()
{
    highp float result;

    highp vec4 rgba=encode32(-10.01);
    result = decode32(rgba);
}

Here are some links on IEEE precision I found useful. Link1. Link2. Link3.
Comment: It also makes the assumption, that the byte value from the texture converted to floating point (by the implementation) and multiplied by 255.0 gives you exactly the original byte value from the texture in front of the decimal point. I don't know if you can count on that, but it would be interesting if the specification secures this in any way.
Comment: This highly depends on the conversion from the fixed point texture value to floating point and I'm not sure if the whole computation is robust, but it's an interesting idea, anyway.
Comment: The conversion makes 2 assumptions. 1)Highp float is IEEE single precision 2)The data is loaded into the texture as GL_UNSIGNED_BYTE with internal format RGBA (i.e 8 bits per unsigned byte)
Comment: @twerdster: You mentioned you also wanted to implement the reverse. Did you finish that? And would you mind sharing the code for that?
Comment: @twerdster Thanks to your code i got it working in Java, (not tested on the GPU yet). I made some small modifications to get better results. I posted them as a new answer since i wanted to share the code i've written. Maybe it might be of use to you as well. Tanks again for your help.
Comment: I have a similar problem but I don't understand why you need to multiply by 255? can you explain this please. Thanks.
Answer: Twerdster posted some excellent code in his answer. So all credit go to him. I post this new answer, since comments don't allow for nice syntax colored code blocks, and i wanted to share some code. But if you like the code, please upvote Twerdster original answer.
In Twerdster previous post he mentioned that the decode and encode might not work for all values.
To further test this, and validate the result i made a java program. While porting the code i tried to stayed as close as possible to the shader code (therefore i implemented some helper functions).
Note: I also use a store/load function to similate what happens when you write/read from a texture.
I found out that:

You need a special case for the zero
You might also need special case for infinity, but i did not implement that to keep the shader simple (eg: faster)
Because of rounding errors sometimes the result was wrong therefore:

subtract 1 from exponent when because of rounding the mantissa is not properly normalised (eg mantissa < 1)
Change float Mantissa = (exp2(- Exponent) * F); to float Mantissa = F/exp2(Exponent); to reduce precision errors
Use float Exponent = floor(log2(F)); to calc exponent. (simplified by new mantissa check)

Using these small modifications i got equal output on almost all inputs, and got only small errors between the original and encoded/decoded value when things do go wrong, while in Twerdster's original implementation rounding errors often resulted in the wrong exponent (thus the result being off by factor two).
Please note that this is a Java test application which i wrote to test the algorithm. I hope this will also work when ported to the GPU. If anybody tries to run it on a GPU, please leave a comment with your experience.
And for the code with a simple test to try different numbers until it failes.
import java.io.PrintStream;
import java.util.Random;

public class BitPacking {

    public static float decode32(float[] v)
    {
        float[] rgba = mult(255, v);
        float sign = 1.0f - step(128.0f,rgba[0])*2.0f;
        float exponent = 2.0f * mod(rgba[0],128.0f) + step(128.0f,rgba[1]) - 127.0f;
        if(exponent==-127)
            return 0;
        float mantissa = mod(rgba[1],128.0f)*65536.0f + rgba[2]*256.0f +rgba[3] + ((float)0x800000);
        return sign * exp2(exponent-23.0f) * mantissa ;
    }

    public static float[] encode32(float f) {
        float F = abs(f);
        if(F==0){
            return new float[]{0,0,0,0};
        }
        float Sign = step(0.0f,-f);
        float Exponent = floor(log2(F));

        float Mantissa = F/exp2(Exponent);

        if(Mantissa < 1)
            Exponent -= 1;

        Exponent +=  127;

        float[] rgba = new float[4];
        rgba[0] = 128.0f * Sign  + floor(Exponent*exp2(-1.0f));
        rgba[1] = 128.0f * mod(Exponent,2.0f) + mod(floor(Mantissa*128.0f),128.0f);
        rgba[2] = floor(mod(floor(Mantissa*exp2(23.0f -8.0f)),exp2(8.0f)));
        rgba[3] = floor(exp2(23.0f)*mod(Mantissa,exp2(-15.0f)));
        return mult(1/255.0f, rgba);
    }

    //shader build-in's

    public static float exp2(float x){
        return (float) Math.pow(2, x);
    }

    public static float[] step(float edge, float[] x){
        float[] result = new float[x.length];
        for(int i=0; i<x.length; i++)
            result[i] = x[i] < edge ? 0.0f : 1.0f;
        return result;
    }

    public static float step(float edge, float x){
        return x < edge ? 0.0f : 1.0f;
    }

    public static float mod(float x, float y){
        return x-y * floor(x/y);
    }

    public static float floor(float x){
        return (float) Math.floor(x);
    }

    public static float pow(float x, float y){
        return (float)Math.pow(x, y);
    }

    public static float log2(float x)
    {
        return (float) (Math.log(x)/Math.log(2));
    }

    public static float log10(float x)
    {
        return (float) (Math.log(x)/Math.log(10));
    }

    public static float abs(float x)
    {
        return (float)Math.abs(x);
    }

    public static float log(float x)
    {
        return (float)Math.log(x);
    }

    public static float exponent(float x)
    {
        return floor((float)(Math.log(x)/Math.log(10)));
    }

    public static float mantissa(float x)
    {
        return floor((float)(Math.log(x)/Math.log(10)));
    }

    //shorter matrix multiplication
    private static float[] mult(float scalar, float[] w){
        float[] result = new float[4];
        for(int i=0; i<4; i++)
            result[i] = scalar * w[i];
        return result;
    }

    //simulate storage and retrieval in 4-channel/8-bit texture
    private static float[] load(int[] v)
    {
        return new float[]{v[0]/255f, v[1]/255f, v[2]/255f, v[3]/255f};
    }

    private static int[] store(float[] v)
    {
        return new int[]{((int) (v[0]*255))& 0xff, ((int) (v[1]*255))& 0xff, ((int) (v[2]*255))& 0xff, ((int) (v[3]*255))& 0xff};
    }

    //testing until failure, and some specific hard-cases separately
    public static void main(String[] args) {

        //for(float v : new float[]{-2097151.0f}){ //small error here
        for(float v : new float[]{3.4028233e+37f, 8191.9844f, 1.0f, 0.0f, 0.5f, 1.0f/3, 0.1234567890f, 2.1234567890f, -0.1234567890f, 1234.567f}){
            float output = decode32(load(store(encode32(v))));
            PrintStream stream = (v==output) ?  System.out : System.err;
            stream.println(v + " ?= " + output);
        }

        //System.exit(0);

        Random r = new Random();
        float max = 3200000f;
        float min = -max;
        boolean error = false;
        int trials = 0;
        while(!error){
            float fin = min + r.nextFloat() * ((max - min) + 1);
            float fout = decode32(load(store(encode32(fin))));
            if(trials % 10000 == 0)
                System.out.print('.');
            if(trials % 1000000 == 0)
                System.out.println();
            if(fin != fout){
                System.out.println();
                System.out.println("correct trials = " + trials);
                System.out.println(fin + " vs " + fout);
                error = true;
            }
            trials++;
        }
    }
}

Comment: I did test the code on hardware and it seems to work as intended. (I did make a 16 bit float version since the 32 bit floats are not supported in hardware, so added precision will be stored, but is not used since internal calculations used to fill the buffers are 16 bit fp, so storing this 16 bit result in 32 bits will be waste of space)
Comment: Regular java floats are 32 bits. GPU highp floats depend on the GPU hardware. On the iPhone for example they are 24 bits. You definitely need to test on the GPU.
Answer: I tried Arjans solution, but it returned invalid values for 0, 1, 2, 4. There was a bug with the packing of the exponent, which i changed so the exp takes one 8bit float and the sign is packed with the mantissa:
//unpack a 32bit float from 4 8bit, [0;1] clamped floats
float unpackFloat4( vec4 _packed)
{
    vec4 rgba = 255.0 * _packed;
    float sign =  step(-128.0, -rgba[1]) * 2.0 - 1.0;
    float exponent = rgba[0] - 127.0;
    if (abs(exponent + 127.0) < 0.001)
        return 0.0;
    float mantissa =  mod(rgba[1], 128.0) * 65536.0 + rgba[2] * 256.0 + rgba[3] + (0x800000);
    return sign *  exp2(exponent-23.0) * mantissa ;

}

//pack a 32bit float into 4 8bit, [0;1] clamped floats
vec4 packFloat(float f)
{
    float F = abs(f);
    if(F == 0.0)
    {
        return  vec4(0,0,0,0);
    }
    float Sign =  step(0.0, -f);
    float Exponent = floor( log2(F));

    float Mantissa = F/ exp2(Exponent);
    //std::cout << "  sign: " << Sign << ", exponent: " << Exponent << ", mantissa: " << Mantissa << std::endl;
    //denormalized values if all exponent bits are zero
    if(Mantissa < 1.0)
        Exponent -= 1;

    Exponent +=  127;

    vec4 rgba;
    rgba[0] = Exponent;
    rgba[1] = 128.0 * Sign +  mod(floor(Mantissa * float(128.0)),128.0);
    rgba[2] = floor( mod(floor(Mantissa* exp2(float(23.0 - 8.0))), exp2(8.0)));
    rgba[3] = floor( exp2(23.0)* mod(Mantissa, exp2(-15.0)));
    return (1 / 255.0) * rgba;
}

Comment: This will no longer work with a buffer of IEEE floats, right, because the sign is now packed with the mantissa?
Answer: Since you didn't deign to give us the exact code you used to create and upload your texture, I can only guess at what you're doing.
You seem to be creating a JavaScript array of floating-point numbers. You then create a Uint8Array, passing that array to the constructor.
According to the WebGL spec (or rather, the spec that the WebGL spec refers to when ostensibly specifying this behavior), the conversion from floats to unsigned bytes happens in one of two ways, based on the destination. If the destination is considered "clamped", then it clamps the number to the destination range, namely [0, 255] for your case. If the destination is not considered "clamped", then it is taken modulo 28. The WebGL "specification" is sufficiently poor that it is not entirely clear whether the construction of Uint8Array is considered clamped or not. Whether clamped or taken modulo 28, the decimal point is chopped off and the integer value stored.
However, when you give this data to OpenWebGL, you told WebGL to interpret the bytes as normalized unsigned integer values. This means that the input values on the range [0, 255] will be accessed by users of the texture as [0, 1] floating point values.
So if your input array had the value 183.45, the value in the Uint8Array would be 183. The value in the texture would be 183/255, or 0.718. If your input value was 0.45, the Uint8Array would hold 0, and the texture result would be 0.0.
Now, because you passed the data as GL_RGBA, that means that every 4 unsigned bytes will be taken as a single texel. So every call to texture will fetch those particular four values (at the given texture coordinate, using the given filtering parameters), thus returning a vec4.
It is not clear what you intend to do with this floating-point data, so it is hard to make suggestions as to how best to pass float data to a shader. However, a general solution would be to use the OES_texture_float extension and actually create a texture that stores floating-point data. Of course, if it isn't available, you'll still have to find a way to do what you want.
BTW, Khronos really should be ashamed of themselves for even calling WebGL a specification. It barely specifies anything; it's just a bunch of references to other specifications, which makes finding the effects of anything exceedingly difficult.
Comment: I found your answer helpful and countered the downvote with an upvote.  Your tone does seem a little harsh (see first and last paragraph; I found the webgl specification quite extensive myself -- they are indeed usually written for implementors and hence hard to look specifics up in).
Answer: You won't be able to just interpret the 4 unsigned bytes as the bits of a float value (which I assume you want) in a shader (at least not in GLES or WebGL, I think). What you can do is not store the float's bit representation in the 4 ubytes, but the bits of the mantissa (or the fixed point representation). For this you need to know the approximate range of the floats (I'll assume [0,1] here for simplicity, otherwise you have to scale differently, of course):
r = clamp(int(2^8 * f), 0, 255);
g = clamp(int(2^16 * f), 0, 255);
b = clamp(int(2^24 * f), 0, 255);     //only have 24 bits of precision anyway

Of course you can also work directly with the mantissa bits. And then in the shader you can just reconstruct it that way, using the fact that the components of the vec4 are all in [0,1]:
f = (v.r) + (v.g / 2^8) + (v.b / 2^16);

Although I'm not sure if this will result in the exact same value, the powers of two should help a bit there.
Comment: It is possible to fully utilize the 4 bytes using a method similar to the one you suggest above. I have posted an answer to the OPs question  and have tested it but im not sure if its bulletproof...


Recalculating signal of acceleration

Question: I have an acceleration vibration signal (m/s^2)
and I need to calculate displacement from this signal, as I know first I have to integrate acceleration I will get vibration velocity [mm/s]
after that, I have to do it again integration of vibration velocity and I will get vibration displacement [μm]
Am I right?
But the result of the second integration is weird. Displacement should be also decries as I understand.
Comment: Discrete integration is tricky. What algorithm did you use? Keep in mind that a continuous integrator has infinite gain at 0 Hz, so having any type of bias in your signal will turn into the drift you see. In general, double integration will amplify any low frequency noise greatly, so there should some sort of high pass filter in there to manage this.
Comment: Welcome to SE.SP!  The usual way of finding velocity and displacement estimates from an accelerometer signal is to use a [Kalman filter](https://dsp.stackexchange.com/a/8869/80). This tends to deal with some of the issues @Hilmar raises in his comment.
Answer: Besides the offset and drift issues that can occur in practical implementation, the graphs and interpretation of the graphs make sense:
We integrate acceleration to get velocity- I can't tell from the acceleration curve if the velocity would truly be positive or if there is an offset error involved, but assuming the velocity was positive, this would give us a positive displacement. As we move forward in time, the velocity decreases, but it is still positive-- so the displacement MUST continue to increase in the positive direction, albeit at a lower rate as the velocity goes down. The only way to be the displacement start to go down instead of up is to introduce a velocity in the opposite direction.  This is all given mathematically as the time integration of the velocity curve.

Recalculating signal of acceleration


Is MultiBit secure? And hong long will MultiBit import .aes.json take?

Question: Two questions:

Is MultiBit secure?
I opened a wallet in blockchain.info, and I want to import .aes.json to MultiBit, hong long will MultiBit import .aes.json take? I waited too long.
Answer: There is currently a bug in the 0.5.9 code that prevents it from loading blockchain.info wallets. It is fixed in the develop code and will get into version 0.5.10 (which will probably be released after the Bitcoin conference now). The older versions work fine - version 0.4.23 is in https://multibit.org/releases . You could just use that version for the import.
Is MultiBit secure ?
Security for bitcoins has several aspects - here are the main ones:

Is it open source ? Yes.
Can you trust the developers ? Well that is for you to decide but I've been working on it solid for over a year now and code it 'in the open' not pseudonymously.
Can you check the downloads are the correct ones ? This is important now that Trojans have started appearing. Yes. Download from https://multibit.org. Check the binary against the PGP signatures. The Mac version is also signed with a Mac developer cert and soon I'll start doing the same with the Windows version. Not enough? : build it directly from the code.
Do you control the private keys ? Yes, there are stored locally.
Can you encrypt them ? Yes.
What about malware and keyloggers ? Until we get hardware wallets bitcoin clients in general are vulnerable to an attack by malware and keyloggers combined. You need to practice 'Safe Computing' on the computer you have your bitcoin on. If you are dealing with serious amounts of bitcoin sign your transactions offline with either Electrum or Armory rather than MultiBit.
Answer: I don't know MultiBit too well, but since it is mentioned on the bitcoin.org homepage, I think it's secure enough.
Once MultiBit is in sync with the network, such an import should only take a matter of seconds. If you have to wait fora minute or more, there is probably something wrong.
Are you sure that MultiBit supports Blockchain.info's wallet format?
Comment: Hi,Steven Roose, yes,MultiBit is in sync for an hour,it hasn't finised yet, how long will it take?
Comment: THe Blockchain.info says its wallet can recovery by MultiBit.
Comment: I imported a blockchain.info wallet backup recently using MultiBit 0.5.12. Took about half an hour on "coffee shop" WiFi.


FourSquare API is giving lots of result but not the result I expect

Question: I am using FourSquare api for searching a particular business
https://api.foursquare.com/v2/users/search?name=Spa Gregories&oauth_token=ACCESS_TOKEN
it is giving lots of result but not the result i expect. that is
Spa Gregories
2710 Via De La Valle, Ste B-270
San Diego, California 92014
when i use https://foursquare.com/search?q=Spa+Gregories&near=san+diago then i got the exact result. So is their any way to find the business according the location. I have only name and city location to use for Search. I have also checked for the venues option but it asks for longitude and latitude.
thnks
Answer: Seems you're hitting the user search endpoint instead of the venue search.
Looks like this is the one you want:
https://developer.foursquare.com/docs/venues/search.html


How is Tail Call Optimization implemented in DrScheme?

Question: I've heard that trampolining is an ineffective way of implementing TCO. How does DrScheme (PLAI Scheme, technically) do it? Does it do it the 'right' way (that is, produce assembly code which directly branches to the tail call, instead of going through the stack and trampolining)?
Answer: Matthew Flatt, the chief implementor of MzScheme (now PLT Scheme) told me in June 2008 that at one time they compiled down to virtual-machine code, in which case it is easy to write a VM that does proper tail calls.  Now, however, the system is mature enough that on x86 they use a simple JIT.  In either case, there is no trampolining---the PLT Scheme guys know their business.
Answer: The implementors of PLT Scheme are quite active in their Google group, where you can get a quick answer from the people who write the code.
I'm not sure they read SO, though, so your best bet would probably be asking there.
Answer: Trampolines are used in implementations that translate Scheme code into a target language X (C, Java, etc.) that doesn't support Proper Tail Calls. PLT Scheme employs JIT-compilation -  and therefore trampolines are not needed. For the exact implementation strategy used, ask the question on the PLT mailing list.
PS: You can read more on trampolines in the various "Compile Scheme to C" papers available on ReadScheme.org.


Questions that have negative votes.

Question: Some questions that are asked get down votes. Is it okay to answer the question then or are you supposed to just leave it be?
Comment: I would point out that there's a [badge](http://math.stackexchange.com/help/badges/57/reversal) for providing a highly-voted answer to a poorly-voted question.
Answer: Short version: Use your judgement, and read the comments on the original question.
Long version: It depends. Sometimes questions get a downvote for pretty much no reason whatsoever, or because someone doesn't like the asker, or for any number of reasons. If the question seems well-intentioned and on-topic, and you can write a good answer, then I think you certainly can and should do so.
Now if the question is receiving multiple downvotes, that generally indicates that there's something seriously flawed in the question, at least to a few users. It could be that the user has a history of trolling, or is unresponsive to comments on previous questions (e.g. people who post numerous homework problems without any context or details - from the trends I've seen, they might have one or two questions neutrally received, and then the downvotes start*). Now there is a badge specifically awarded for giving a highly voted answer to a negatively voted question, so it's not explicitly discouraged. So in the end, I think the question one needs to ask is:

Does providing an answer to this particular question improve the website, and will it be useful for future visitors?

And then proceed accordingly.
Comment: Nice answer. I wonder if forum could (perhaps in software) mandate down votes to require some sort of explanation why. This could help avoid leaving asking person in the dark why question gets down vote.

Questions that have negative votes.


I have ubuntu and win 10 in dual boot it shows GNU grub2 error

Question: I have i7 7th gen with nvidia GTX 1050 with 8GB ram, 128 GB ssd and 1TB hdd.
I had just win 10 installed on my SSD then i installed ubuntu 18.04 lts alongside windows without swap on my HDD. I couldnt shutdown or reboot my ubuntu so I formatted ubuntu partiton from win10 disc manager then when i rebooted it showed GNU GRUB2 error.
I can boot into windows so I tried installing Ubuntu 16.04 on the same drive as of ubuntu 18.04 (this time with swap partition). But I dont think that worked and i see the same grub2 error screen again. I can give windows boot manager upper priority and boot into win. But how can i fix my grub or completely remove it from my system?
Comment: If you have UEFI, you just need to use UEFI boot manager (menu), Same f10 or f12 you used to boot flash drive. And then boot Windows entry. But to remove grub entries & ubuntu folder see this: http://askubuntu.com/questions/63610/how-do-i-remove-ubuntu-in-the-bios-boot-menu-uefi You probably needed 18.04, but perhaps boot parameter(s) depending on your system to have Ubuntu work.
Answer: I recently did something similar, and I just wanted to get back to Windows only. You need to fix the boot record of your disk - something like https://www.easeus.com/partition-master/repair-mbr-windows-10.html or https://www.pcworld.com/article/3113585/windows/how-to-repair-windows-master-boot-record-and-fix-your-bricked-pc.html
What I ended up doing was:

Use ubuntu live usb stick to erase the ubuntu partitions and resize
the windows partition to use the new free space - I used gparted for this.
Create a windows 10 installation usb stick and repair the boot record.

I strongly recommend having a second system available to create usb sticks and google stuff.
Comment: My win10 is running fine. I just have problem with that grub2 and I want to use linux.


What did Mt 10:5-7 mean to its original audience?

Question: In the text "Go not into the way of the Gentiles, and into any city of Samaritans enter not: but go rather to the lost sheep of the house of Israel." Does Jesus place restrictions on the preaching of the twelve? How would the original audience have understood the text?
Comment: This is one of the main reasons why some people doubt Paul as an accurate portrayal of Christ.
Comment: It is only common sense to try putting one's own house in order, before telling anyone else how to take care of their own.
Answer: Jesus sent the Disciples first to the Jews so that they (the Jews) would not later be able to claim that they did not believe in Him because He preached first to the Gentiles and Samaritans and not to them.  On this passage, John Chrysostom (347-407 AD) writes:

He sends them on the harder task, indicating his guardian care of
  them, and stopping the mouths of the Jews, and preparing the way for
  the teaching of the apostles, that people might not hereafter blame
  them for entering in to men uncircumcised [Acts 11:3] and think they
  had a just cause for shunning and abhorring them. And he calls them
  "lost," not "stray," "sheep," in every way contriving how to excuse
  them, and whining their mind to himself.
Homily XXXII on the Gospel According to St. Matthew

It has also been suggested that Jesus wanted the Disciples to avoid - at this point at least - the lifestyle of the Gentiles.  Hilary of Poitiers (300-368 AD) writes:

They are warned to avoid the ways of the Gentiles, not because they
  were never going to be sent for the salvation of the Gentiles, but
  because they were to avoid the works and lifestyle of the
  unenlightened Gentiles. They were warned, moreover, not to go into the
  assemblies of heretics [i.e. Samaritans]. For heterodoxy does not
  differ at all from unenlightenment. Therefore they were being sent to
  the lost sheep of the house of Israel, who raged against him with the
  tongues and jaws of wolves and vipers. At any rate, the law was due to
  receive the special benefit of the gospel. The less excuse Israel had
  for its ungodly behavior, the more zeal it might have in heeding the
  warning
On Matthew X.III

Jerome (327-420 AD) moreover explains how Jesus' command here to avoid the Gentiles is not inconsistent with His later command to make disciples of all nations (Matthew 28:19):

This passage is not contrary to the command given later: "Go,
  therefore, and make disciples of all nations, baptizing them in the
  name of the Father, and of the Son and of the Holy Spirit." The former
  command was given before the resurrection and the latter after the
  resurrection. It was necessary to announce Christ's first coming to
  the Jews, lest they have a good excuse for saying that the Lord
  rejected them because he had sent the apostles to the Gentiles and the
  Samaritans.
Commentary on Matthew I.X.5-6
Answer: The commissioning of the twelve, of Matthew 10, was for an exclusive purpose for a period of time. Jesus stated his purpose was to reach "the lost sheep of the house of Israel". A close look at who the "lost sheep" were, and examining the prophetical context of that verse will shed light on why Jesus temporarily directed the disciple's focus to their brethren according to the flesh.
When Jesus referenced the house of Israel He was speaking of all twelve tribes. After the nation of Israel was divided (only Benjamin remained loyal to the house of David), many Jews fled the northern kingdom to Judah because of its abominations. II Chronicles 11 records why members of Levi came to Judah.

2Ch 11:14  For the Levites left their pasture lands and their
  possession, and came to Judah and Jerusalem; for Jeroboam and his sons
  cast them off, that they should not execute the priest's office to
  Yahweh.  2Ch 11:15  He himself appointed priests for the high places,
  for the male goats, and for the calves which he had made.  2Ch 11:16
  After them, out of all the tribes of Israel, those who set their
  hearts to seek Yahweh, the God of Israel, came to Jerusalem to
  sacrifice to Yahweh, the God of their fathers.

It's clear that only a remnant of the tribes returned. And as Israel's level of sins reached its fill, God caused the the Northern kingdom to be exiled by the Assyrians. Though most were exiled, a few remained. These lost sheep would typify a people who were many years to come. That is, a lost people who were in need of a righteous King.

For the children of Israel walked in all the sins of Jeroboam which he
  did; they departed not from them; Until the LORD removed Israel out of
  his sight, as he had said by all his servants the prophets. So was
  Israel carried away out of their own land to Assyria unto this day. II
  Kings 17:22-23

Please read the following passages. They record how remnants of the Northern Kingdom (sometimes called Ephraim/Israel) came to Judah, once again faithful to the House of David: 2nd Chronicles 15:9-10, 2nd Chronicles 30:6, 2nd Chronicles 30:10.
The passages found in 2 Chronicles 30 are very important. They record how Hezekiah, King of Judah, called for those who remained In Israel to humble themselves and come to Judah for Passover.

"So the posts went with the letters from the king and his princes
  throughout all Israel and Judah, and according to the commandment of
  the king, saying, Ye children of Israel, turn again unto the LORD
  God of Abraham, Isaac, and Israel, and he will return to the remnant
  of you, that are escaped out of the hand of the kings of Assyria.
  2nd Chronicles 30:10

But the call from the king was neglected by all but a remnant. Eventually Judah's string of evil kings, and the sins of the nation caused them be exiled by the Babylonians.
Lost Sheep?
The earthly ministry of Jesus was a time when the Jews were lead by blind guides and hypocrites (Matt 23: 16-22). The were in need of Righteous leadership. Hence Christ's command to preach the message of God's kingdom (Matt 10:7). Christ had not come to set up a carnal earthly kingdom. It was His purpose to seek and save the lost (Lk 19:10). Israel, and later Judah, had historically been nations of lost sheep, each lead by bad shepherds.

Jer 50:6  My people have been lost sheep. Their shepherds have
  caused them to go astray. They have turned them away on the
  mountains. They have gone from mountain to hill. They have forgotten
  their resting place.

This verse speaks of both Judah and Israel.

Jer 50:17  "Israel is a hunted sheep. The lions have driven him away.
  First, the king of Assyria devoured him, and now at last
  Nebuchadnezzar king of Babylon has broken his bones."

Only to the lost sheep?
It was God's design to call a remnant to faithfulness through the ministry of His dear Son. What the OT typified was fulfilled in Christ. Here again we see the most righteous King, Jesus, calling His lost sheep through the agency of His disciples. This was specific in scope and focus for a period of time to Israel. What we find here is the fulfillment of OT prophesy. What Hezekiah did in part; unify the two divided nations into one loyal to house of David, Jesus did in totality; unify one spiritual holy nation loyal to the King of Kings.
How are we to understand this?
It was God's divine plan to bring a people to Himself (To the Jew first then the gentile Rom 1:16). But the gentiles were not to be neglected. In fact, Paul explained that it was God's plan all along to bring gentiles into the fold making one new man in Christ (Eph 2:15). Jesus makes mention of this in John 10:16:

And I have other sheep that are not of this fold. I must bring them
  also, and they will listen to my voice. So there will be one flock,
  one shepherd.

If we consider God's treatment of Israel under its ignoble kings and their abominations. And consider God calling Israel "not my people" Hos 1:9. Then we can better understand why the inspired apostle Paul used this passage in regarding the calling of the gentiles.

Rom 9:24   whom he also called, not from the Jews only, but also
  from the Gentiles?  Rom 9:25  As he says also in Hosea, "I will call
  them 'my people,' which were not my people; and her 'beloved,' who was
  not beloved."

You asked a very good question. I hope I've answered it well. I added a lot of information with the aim detouring doctrinal errors proposed by dispensationalists who purpose that the message of the kingdom was only for Israel until Jewish rejection.
Answer: Christ came to the Jews and the House of Israel - God's chosen people - first (Mat. 15:24). He gave them a chance to accept salvation knowing they were so steeped in tradition and man's commandments they would, for the most part, reject Him (Mat. 13:57). It was ordained from the beginning that Christ would be born a Jew and that they would have Him crucified.  He went first to His own people and they did not recognize Him (John 8:19)!
In Acts 13:46 Barnabas and Paul tell the Jews that they were to receive the Gospel first but, since they rejected salvation, it was being offered to the Gentiles.
There are no restrictions now on where or to whom the Gospel is to be preached (Mat. 12:21, Acts 9:15) but while Christ lived, He - and His disciples - went only to His own. Not because they were better than anyone else but they had been entrusted with the preservation of God's Word and SHOULD have known and accepted the true Messiah.  Their perversion of God's commandments and their smug traditions made it impossible for most to see what was right before their eyes.
Answer: In order to explain this question, I have to give you the back story of Israel. At the outset, after the Egyptian captivity and Pharaoh's defeat, the children of Israel promised in the wilderness by saying to Moses in Exodus 24:7 "All that the Lord has said, we will do, and be obedient."  So Moses proceed with the blood covenant which was made between God and Israel. Well the tribes did not keep their end of the covenant and the children's children had to pay for the sins of the fathers via the Assyrians captivity spoken of in 2 Kings 17:6, the Babylonian slavery stated in 1 Chronicle's 9:1 and others such as the Persian-Medes (Ezra 9:9), Greek (1 Maccabees 8:18) Romans (during Christ), the Sub-Saharan and Spain captivity (after Christ) and finally the Trans Atlantic Slave Trade of the Americas as stated in Deuteronomy 28:68. Slavery had occurred so much that it provoked Jeremiah in verses 2:14 to ask, "Is Israel a slave? Or is he a home-born servant? So God declaring the end from the beginning stated in Jeremiah 5:19, "And when the people ask, 'Why has the LORD our God done all this to us?' you will tell them, 'As you have forsaken me and served foreign gods in your own land, so now you will serve foreigners in a land not your own.'
Not being in their land would prevent them from sacrificing as told, So the God of Israel not only tested Abraham with the sacrificing of Isaac, but He ultimately sent his son as an ultimate sacrifice for Israel knowing they would need a lamb for the condition and sins to come especially since they would be scattered to the four corners of the earth per the curses starting at Deuteronomy 28:15 and become without a land (Luke 21:24), heritage (Jeremiah 17:4, 12:7 and 15:14) and a loss people without a God (Isaiah 1:3 and Jeremiah 2:11)
As you may know, all the new covenant is based on the old so John 3:16 which really comes from Isaiah 45:17 states: "But Israel shall be saved in the LORD with an everlasting salvation: ye shall not be ashamed nor confounded world without end." And this is why it states in Matthew 1:21 "...and He shall save His people from their sins." and the Messiah stated in Matthew 15:24, "I am only sent to the lost sheep of Israel." So ultimately Israel would become a nation among nations and be as gentiles serving gods as the gentiles do. So this is why in John 7:35 when the Messiah stated he was going to where he could not be found, the people asked among themselves, "Whither will he go, that we shall not find him? will he go unto the scattered among the Gentiles, and teach the scattered Gentiles?"And Paul stated, in Ephesians 2:11, "Therefore remember that formerly you, the Gentiles in the flesh,...remember that you were at that time separate from Christ, excluded from the commonwealth of Israel, and strangers to the covenants of promise, having no hope and without God in the world." Additionally, this is why James is addressed to the 12 Tribes, who are scattered and the other book are addressed to those who were Hellenized and living like heathens which it was unlawful for Jew to even talk to them as Cornelius. Finally know, the Northern 10 tribes were not even present when the Messiah walked the Earth only Judah, or Jews, the tribe of the Messiah linage, The Tribe of Benjamin and the Levites (which included some of Pharisees and Sadducees) who were rejecting the Messiah and also being paid by the Romans Kingdom. Thus, those not present when he came needed to hear the good news too.
Answer: But she came and bowed down before him and said, "Lord, help me!" "It is not right to take the children's bread and throw it to the little dogs,". "Yes, Lord," she replied, "but even the dogs eat the crumbs that fall from their masters' table." Then Jesus answered her, "Woman, your faith is great! Let what you want be done for you." And her daughter was healed from that hour (Mt 15:25-28 [NET])
After Jesus left there, he went to the region of Tyre. When he went into a house, he did not want anyone to know, but he was not able to escape notice. Instead, a woman whose young daughter had an unclean spirit immediately heard about him and came and fell at his feet. The woman was a Greek, of Syrophoenician origin. She asked him to cast the demon out of her daughter. He said to her, "Let the children be satisfied first, for it is not right to take the children's bread and to throw it to the dogs." She answered, "Yes, Lord, but even the dogs under the table eat the children's crumbs." Then he said to her, "Because you said this, you may go. The demon has left your daughter." She went home and found the child lying on the bed, and the demon gone. Then Jesus went out again from the region of Tyre and came through Sidon to the Sea of Galilee in the region of the Decapolis. (Mc 7:25-31 [NET])
Jesus was in the region of Tyre. Talking to a Greek woman, of Syrophoenician origin
I understand that the children in the context, represent those who were waiting for the Messiah: The Jews, the Samaritans as the woman of the well (John 4:1-4:42) and up to some gentilics, like the magicians who visited Jesus in his birth.
And the little dogs all arrange what were not waiting for the Messiah, in great majority, the gentilics.
How do understand the text? David M Moyane

He came to what was his own, but his own people did not receive him.
  (Jo 1:11 [NET])


Extra Rep Cap Buffer from Answer Accepts?

Question: I capped on Code Review today, but I had a curious revelation in doing so.  I accepted one of my ancient answers on a question of mine that never got any others, and had another answer be accepted.  I thought that accepting my own answer would not add to the rep cap buffer, but I earned 219 rep, 4 above the 15 point buffer created by the other accept.  Is this a bug, or is it planned to do this?
Comment: you do know that all UVs on answers after they that have been accepted do not count towards the limit.
Comment: No, I did not know that.  I've only had the 15 points from the accept count before, unless I didn't get any upvotes on that day.
Answer: Rep you gain from accepting others' answers is evidently also not subject to the cap. You accepted two answers that day, for +4 total, which perfectly explains the discrepancy.
This has previously been documented.
Answer: The rep limit only limits rep gained from up votes on question and unaccepted answers.
Bounties and accepted answers are exempt from the limit; not just the 15 from the accept, but all the UVs after it is accepted too. (Hence how folks like Jon Skeet always get more then 200)
However all up votes "lost" to the rep cap on unaccepted answers will not be given out once the answer is accepted.
Comment: This [just isn't so at all](http://i.stack.imgur.com/Xk8JU.png).


plot the graph using different Excel files

Question: I have some data stored in different Microsoft Excel Worksheet (.xlsx) .
Now i want to ploat a graph by using these data (which are in different .xlsx) files. How can i do this ? means which language or platform i should use or any other help related to that.
Answer: You can use Java API's to create graph if you are familiar with java. You can use Apache POI or jfreechart or openxmlformats(api provided by apache).
Answer: Matlab has the built-in function xlsread which parses data from Excel files. Depending on how the files are organized, writing some code to read them all should be easy, and concatenating the matrices of data and plotting them is also pretty easy.
Answer: if you use saveAs to save them as CSV files, you can read them in very easily to Java and split the values with String.split(","). If you want to keep them as .xlsx files, JExcelApi might be able to help, though personally I've never used it. As for graphing, I'd recommend Javaplot/gnuplot, Jzy3D, or JMathPlot depending on what you want to graph. They're free and relatively easy to use.


Is it possible to change the signature on the GMail email client?

Question: Is it possible to change programmatically the email's signature from the GMail client application? Like the: Sent from my iPhone signature. I know this is kind of intrusive and agressive but I am just curious about whether this is possible (Where do you think the email signature is stored? Is it possible to change it, even with a hack?).
Answer: No, you cannot do this through your app. No app can edit another app's preferences using the Android SDK.
You may be able to do it if it is a rooted device, your app has root access, and if you know exactly where and in what format (SharedPreferences, SQLite) Gmail stores the signature.
But I would strongly advise you to not do this, as such an invasion of a user's privacy is going to put you on a highway to being uninstalled.
Answer: This is totally possible with Google Apps Email Settings API.
Check it out here:
https://developers.google.com/admin-sdk/email-settings/#manage_signature_settings
Note that you are not actually changing the signature for the phone's gmail but for that user's gmail in general, so might not exactly be what you are looking for...
[EDIT]: Note that this applies only to Google Apps for your own domain (and not gmail.com). Sorry if I confused anyone...


How to quickly create a cable easily editable?

Question: How can i quickly create a cable that i can edit easily to position it, deform it and add gravity?
Comment: related: http://blender.stackexchange.com/questions/64887/cable-bump-how-would-you-do-it/64901
Answer: Use a curve, add one by doing Shift + A then Curve > Bezier. Place and orient the controll points of your cable, to deform it and add gravity select both points and press W > Subdivide. From V menu set the intermediate cuts to Automatic to keep a smooth curve, then position it. If you add multiple cuts spread them to get some space to keep a smooth line.
To make that curve have some volume set the Fill mode to Full. In the Geometry rollout under the "Bevel" adjust the Depth for the width of the cable and the resolution for the amount of sides.
Comment: Also adding some details is possible by using Bevel object which should be another curve and which can have desired form of the cable.
Comment: Yes and also this allows to edit the radius of the cables of all at once.


Dangers of controlled fusion temperatures

Question: I've been looking for an answer to this question for some time, and I apologize in advance for my lack of general knowledge on the subject matter. I can't wrap my head around how we can have temperatures in a fusion reactor or high-energy density experiments without it creating some sort of catastrophe. How can these temperatures exist on Earth and not destroy everything within a thousand miles?
Answer: So first of all, in an experimental fusion nuclear reactor, even though the plasma reaches temperatures of millions of degrees, the amount of material at this temperature is very low, so that in case of the worst possible scenario, the heat will be absorbed by the reactor with not much problem. Also, when the hydrogen or gas in the reactor reaches high temperatures, the gas transforms to a plasma state, where each atom loses the electrons. This plasma contains both ions and electrons that they cannot recombine due to the high temperatures. Because the plasma is positively charged, with the help of magnetic and electric fields, the plasma can be contained at the center of the reactor, without touching the walls or any material, just vacuum with the plasma flowing through the center of the reactor
Answer: High temperatures do not by themselves mean highly destructive. Temperature is simply a statistical parameter for a population of molecules. If that population is relatively small (and the amounts of the plasma in question are small compared to everyday, kitchen-cooking-recipe amounts of molecules), then their total energy and destructive power can still be small.
Moreover, not everything of high temperature transfers its potentially destructive energy to its surroundings with the same efficiency. High speed gas or plasma molecules don't tend to transfer much of their energy to solid containers when they collide; the effect is rather like an elastic collision between a small body and a very massive one - negligible energy gets transferred to the latter. Plasmas tend to be like highly diffuse gases. Energy coupling between high temperature solids is much swifter - you could poke your head for a few seconds into a flask of air at 500C and as long as you didn't breathe in, your face would simply feel slightly singed. In contrast, if you firmly grasp an iron rod at 200C for even a fraction of a second, you're going to need to urgently visit the local burns unit at your hospital with deep burns that may even cost you your hand.


What could a 4th crew member do in a tank with an autoloader?

Question: The tanks are normal tanks. Big gun, lot of armour, very fast, tracks, etc. It can't just be a dedicated drone operator. (It can be part of the role but not the whole thing) You can add whatever you want onto the tank as long as its within the realm of the semi-sane. The technology level is near future. Being hacked mid combat isn't a concern. The primary scenario is conventional warfare between relatively equal powers. Although counter insurgency is somewhat relevant. Combat resembles that of today some-what closely. Without a loader what could a 4th crewmember do?
Comment: A political officer.
Answer: With a traditional turret layout:
Engine in the front or rear, driver in the hull, three soldiers in the turret. One is the (main) gunner, one the the commander, what can the third turret position do?

Load the autoloader.
Typically an autoloader has only a limited number of ready rounds, with more stowed anywhere they might fit. The gunner could do that, but the gunner typically fills other jobs as well.
Help maintain situational awareness.
The driver worries where the tank is going. The commander worries what it should do. The gunner aims the gun. That leaves the ammo handler (see above) to worry about the sides and rear.

Alternatively:

Unit commander or staff.
In a traditional tank platoon, the commander of one tank wears two hats as the tank commander and platoon commander. So give the tanks with the platoon leader and platoon sergeant a more junior sergeant as dedicated vehicle commander, and let the platoon leadership lead the platoon.
Tanks without the platoon leadership could host an artillery observer or company or battalion staff, but that could lead to tricky command relationships -- what if an artillery lieutenant habitually sits in the senior seat of a tank commanded by an armor sergeant? Who is in charge?

With a futuristic tank layout:
Engine in front, unmanned turret with an autoloader, four crew in a protective capsule in the hull. With drive-by-wire controls, in theory everybody can do everything, but the training and the consoles are somewhat optimized.

Two of the crew positions are optimized for weapons and sensor operation. The consoles are mirrored, but one is the commander and one is the gunner.
Two of the crew positions are optimited for movement and sensor operations. Again the consoles are mirrored, but one faces forward and one faces rearward to avoid disorientation when the tank drives rearward at high speed. The skill sets of the driver and rear driver are interchangeable, and whoever is not controlling the vehicle handles the sensors.
Answer: Radio operator and IT guy.
Radio operator has been a historical position on tanks. While it makes sense to let the commander operate it the commander is also a busy man. Having someone else who can take note of orders coming in during the heat of battle or transmit information to unload the commander is a good idea.
But tanks are becoming more and more electronic, having someone who can manage the systems and solve problems can become vital, especially with how software can be altered easily on the field. This can be likened to an automatic transmission versus a manual transmission as well. An automatic transmission does not always switch properly for the situation at hand as it is programmed for a more linear acceleration which can make it less efficient, your IT guy can alter the software parameters to set templates based on the current goals and situation of the tank.
Your gunner still thanks you to this day for solving the "404, ammo not found" bug on the spot.
Comment: Hard nope to both. A radio operator was needed when radios were large and fragile, and used Morse instead of voice.  That hasn't been true since transistors, and anyway if the info is important then the commander needs it immediately.  As for IT - just no.  You've clearly never worked with embedded electronics or embedded software.  As someone who's been in this field for 25 years, most notably in automotive and defense, it simply doesn't work like that.  If something needs controlling, there is a well-defined way to do it, and no random jackass is allowed to tinker with internal parameters.
Answer: Not be there in the first place!
The interior space of an armoured vehicle is a trade-off between carrying engines, fuel, weapons, ammunition, and crew.  The more you want of one, the less you have of the others.  If you have one less crew member, you have roughly a 5ft x 3ft x 2ft volume of space which can be used for something else.
For example, an M1 Abrams has a fuel tank of 1900 litres, giving 265 miles range.  That amount of space is an extra 810 litres, which would give you another 112 miles of range.  Worth having, right?
Answer:
Manage communications during an engagement, e.g. coordination with other units or calling in air and artillery support
Operate additional sensors mounted on the tank or reconnaissance drones to improve tactical awareness
Operate defensive measures (e.g. smoke, active defenses) or a light secondary weapon for protection against infantry or helicopters.
Answer: Defence officer
Modern tanks have a lot of defense systems. Flares to spoof heath seeking missiles. Electronic countermeasures. Remotely fired machine guns. So one more soldier taking control of all these weapons while the gunner is mainly concerned with the main weapon would make sense.
Answer: Autoloaders are used specifically to reduce the number of crewmen. If you want 4 crew members, just drop the autoloader and get yourself much more efficient, and safe to use tank, as autoloaders generally are massive safety hazard in the tanks that use them.
That's why almost western designs from Cold War era pretty much exclusively had human loader allowing for much safer ammo storage. On the other hand, Soviet autoloaded tanks tend to burnout on any penetrating hit.


When koshering meat by roasting can I put pepper

Question: What are the Ashkenazi and sifardi customs when kashering meat by roasting
if it is permitted to use salt and/or other spices?
Answer: Shulchan Arukh, Yoreh De'ah 76:2 - Translation from sefaria.org:

If one wishes to salt the meat before roasting it (2) [6] and eat it
  without  washing it, one may do so and we are not worried about the
  blood  remaining on the salt. Some say this ruling refers to one who
  salted it, and  then immediately roasted it, (3) but if it lay in the
  salt (4) the salt absorbs  and is forbidden. [7] Therefore it should
  be well washed before the  roasting. Rema: [8] Some say that roasting
  requires a preliminary washing  (Ramban), and some say that it
  requires a slight salting beforehand as well  (Rashi). The custom is
  to wash it first and then to lightly salt it when it is on  the
  skewer, and to then immediately roast it so that the salt will not
  absorb  blood. [9] Nevertheless, if it wasn't washed or salted at all,
  or it was salted  without having been washed first, and then roasted,
  it is still permitted.  This is only if it did not sit idle in the
  salt (5) without being washed for the  entire salting period, but if
  it did indeed lay idle for this amount of time  before being roasted,
  it is forbidden.

As you can see, there are divergent opinions. I am thus inferring what the purpose of the salt is, which seems to be for koshering and not for flavoring. Thus, if you follow the opinion that it does not need to be salted before roasting, then your adding salt is for flavoring, and it seems that you can add pepper or anything else you like. However, if you follow the opinion that the meat must be salted before roasting, then, it seems the meat is unkosher otherwise, beforehand, and the salt is for koshering purposes. Thus, adding pepper before koshering would make the pepper unkosher.
Comment: But the salt does not become not kosher even if it is used for kashering?
Comment: @hazoriz - Good question, and IIRC< based on what I saw in another par. in YD nearby, no, it doesn't happen. This is prob. why the par. above says that you have to roast it immediately after salting. I guess there is a time factor after which the salt is absorbed and is considered unkosher. I apologize that the version of YD I have now does not have commentaries, as I'm quite sure someone addresses this question, there.


A problem on metric space and countable base

Question: Suppose, in a separable (so it has a countable base) metric space $X$, a subset $E$ is uncountable. Now, $P$ be the set of all points $p$ of $X$ such that every neighbourhood of $p$ contains uncountably many points from $E$. I want to prove that any point in $P$ is a limit point of $P$. If we take any neighbourhood of a point $p$ in $P$, then why should it contain another point in $P$. Suppose all the other points in the  neighbourhood of this point has at least one neighbourhood which has only countable number points from $E$. Then what is the contradiction ? Can I construct a neighbourhood of $p$ which contains only countable number of points from $E$. Stuck here
Answer: It's a little easier to think about if you let $C$ be the set of $x\in X$ such that some nbhd of $x$ contains only countably many points of $E$; clearly $C=X\setminus P$. Let $\mathscr{B}$ be a countable base for $X$, and for each $x\in C$ let $B_x\in\mathscr{B}$ be an open nbhd of $x$ such that $B_x\cap E$ is countable. Let $\mathscr{B}_0=\{B_x:x\in C\}$; $\mathscr{B}$ is countable, so $\mathscr{B}_0$ is countable as well. Let $U=\bigcup\mathscr{B}_0$.

Use the countability of $\mathscr{B}_0$ to show that $U\cap E$ is countable.
Then show that $E\setminus C\subseteq P$.
Conclude that if $p\in P$, and $V$ is any open nbhd of $p$, then $V\cap P$ is uncountable.


How should I answer "What do you dislike about your current manager?" during an interview?

Question: How to answer during interview when they ask "What do you dislike about your direct manager?"
Comment: Some thinking of your own is allowed. Maybe add a few possibilities which you can think of.
Answer: Personally, I think this is an incredibly poor question to ask an interviewee and it shows bad judgement on the part of the interviewer.
If I were asked, I'd almost certainly respond with something along the lines of:

I don't dislike anything about my current manager. We occasionally have differences of opinion, but I think that's a healthy part of working in a team where all members are trying to do their best for the project and isn't indicative of any personality clashes.

Whether that's entirely true or not is immaterial because an interview is not the place to be airing dirty laundry about your current or previous employers.
Comment: In many cases this will be a poor response. The question is intended to discover whether you able to be realistic about your relations with other workers, and how you handle it. If your response is always "there is nothing I dislike" then you are portraying yourself as someone who is either unrealistic about their workplace relations, or who is bull***tting because they don't want to be 'airing dirty laundry'. Please remember that just because you dislike something about a manager that doesn't make them a bad manager.
Comment: How you interact with your co-workers is definitely relevant to a potential employer. I suspect that the problem is, you think the interviewer is trying to find out information about your manager. They are not. They are trying to find out information about you.
Comment: @DJClayworth - I don't dislike anything about my manager. He's a nice guy who does his job and manages well.
Comment: I always find it interesting when these 'generic' but good sounding messages are posted. They can be molded to fit most people and it can turn a question you'd be caught off guard hearing into a positive way to show yourself.
Comment: @DJClayworth The point is it's none of your business and I won't be sharing it with you any more than I'd share detail about my marriage. If you feel it makes me unsuitable, then I'm probably not a good match for you.
Answer: Nobody likes a complainer or a dissident.  These kinds of questions are meant to find out what kinds of opinions you might really have about your direct boss.  Some people in general are highly critical of their boss or just outright defiant and they interviewer is really looking to see not only what you are divulging about your boss but also any negative emotions you may be harboring about that person.
Interviews are stressful and technical ones can be long and difficult. A long stressful interview can do much to soften some personal information that you would normally keep to yourself so remain vigilant if possible.
A general rule of thumb that I live by in the workplace is,

Never have anything negative to say about anybody

You may have negative opinions about an individual and rightly so but keep it to yourself.  I leave you with another piece of wisdom:

Average minds discuss people, good minds discuss events but great minds discuss ideas

If it were me answering this question I would try to be sincere but really only bring up a very minor fault and try to seem uninterested in the question.  I might even just say that your manager is pretty awesome and you have no complaints.  The important thing is that you don't want to be seen speaking ill of people.  People like to work with pleasant people that get along with everybody.
Answer: This question isn't as terrible or as 'mine-field'y as I think many of the other answers are presenting it as.
"Tell me what you dislike about ___" is a question designed to feel you out. It can be a bit tricky(you should never use it as an opportunity to unload personal feelings for example) but largely it's being used to see what you need or want in a team and whether you can identify appropriate pain points in a system and, potentially, propose solutions. It's much more useful to ask what someone doesn't like about a thing (a manager, a role, a system) than what they do like because, typically, it's hard to codify what makes you like something and many of those things are irrational or unquantifiable.
Let me be a bit more specific.
"Nahkki, what do you dislike about your manager at Widgets INC?"
Acceptable responses to this question are professional, actionable and reasonable. I would recommend using a compliment/positive sandwich method because no on wants to come off as just complaining. Some examples might be:

"My manager is excellent at supporting our team but sometimes we
don't communicate as often as I would like. I would like to have
regular stand ups with my team."
"My team works really hard at what they do. However we don't have a
process for planning and implementing new widgets. It would be pretty
cool to use something like Scrum."
"Overall I am happy with my company, I appreciate the opportunities I
have had to learn more about my role and industry. I'm leaving
because I felt I didn't have a clear career path/opportunities for my
future. I want to work for companies that have career paths and
mentorships."

Notice what these answers have in response. They start with something positive about the target of the question('manager', 'team', 'company'). They then move into a solvable measurable/neutral 'negative'. And they finish up by pointing out what would have made you happier/changed your dislike of the situation. Additionally the responses are filled with 'I' statements.
This sounds a little bit janky no? Let's look at some inappropriate or less helpful answers:

"I hated that jerk! He was so lazy and never was around!"
"My company is terrible. It's all about profit. They canceled our monthly BBQ party, the employee training program and then started
tracking our time cards!"
"My team is full of lazy assholes"

Notice the difference? These answers are full of red flags for an interviewer. Whether or not they are true, whether or not they are something you might say to your friends/support network doesn't matter. What matters, overall, is that they are unprofessional and personal in an inappropriate way.
Consider questions like this not as dangerous or bad questions but as an opportunity to interview the company you hope to work for. If someone balks when you say "My company required a lot of overtime. I want to work somewhere when I don't regularly have to work nights and weekends" then that tells you something about that company and can help you decide if you want to work there. Keep answers honest but positive and professional. Use the answers you give to highlight you preferences(or even your 'strengths').
Comment: Those first three are really good answers. It's also important to communicate that just because there are things you dislike about your manager, that doesn't make them a bad manager, and doesn't stop you working with them productively.
Answer: State what it is that you like about your manager and that you would not be happy if you didn't have it.
State what it is that your manager could do better by you and specifically state what changes you have in mind that would make you happy.
If there is anything that your manager is doing that's driving you crazy and that your manager is not changing, and state your unfulfillable wish that he changes that.
Again, keep it dispassionate and matter-of-fact.


Does Bash support command.subcommand structure in addition to command subcommand structure? If yes, how to incorporate this in bash scripts?

Question: After installing microk8s (Micro Kubernetes) on my local machine, one of the commands I encountered was microk8s.enable dns which can also be run as microk8s enable dns. This doesn't seem to be a universal thing. git status is a valid command but git.status is not. How do Linux systems support such type of command structures? How can I incorporate this behavior in my Bash scripts?
Comment: Command names are as arbitrary as filenames, because that is what they most often are.
Comment: What do you mean by "How can I incorporate this behavior in my Bash scripts?" Do you mean "How can I write a script that works this way?"
Comment: @Kusalananda Yes, I meant "How can I write scripts that work this way?"
Answer: You'll sometimes see programs (and scripts) inspect the name of the file that was used to invoke the program and condition behavior off of that.
Consider for example this file and symbol link:
$ ls -l
-rwxr-xr-x  ... foo
lrwxr-xr-x  ... foo.bar -> foo

And the content of the script foo:
#!/bin/bash

readonly command="$(basename "${0}")"
subcommand="$(echo "${command}" | cut -s -d. -f2)"

if [[ "${subcommand}" == "" ]]; then
    subcommand="${1}"
fi

if [[ "${subcommand}" == "" ]]; then
    echo "Error: subcommand not specified" 1>&2
    exit 1
fi

echo "Running ${subcommand}"

The script parses the command name looking for a subcommand (based on the dot notation in your question).  With that, I can run ./foo.bar and get the same behavior as running ./foo bar:
$ ./foo.bar
Running bar

$ ./foo bar
Running bar

To be clear, I don't know that that's what microk8s.enable is doing.  You could do a ls -li $(which microk8s.enable) $(which microk8s) and compare the files.  Is one a link to the other?  If not, do they have the same inode number?
Comment: you can use prefix-removing expansion in the shell to avoid calling `basename` and `cut`: `readonly command=${0##*/}` and `subcommand="${command##*.}"`
Comment: @ilkkachu yes, thank you, but IMO that's far less readable to a novice.
Comment: This seems like a legit way to do this. Thanks for your answer. Although, I would like to add the following - i. which revealed microk8s and microk8s.enable are two different files with different inode numbers in /snap/bin directory. ii. One is not a symbolic link to the other but both are symbolic links to /usr/bin/snap. This is due to the way snap installs applications. How does microk8s actually incorporate this is not so easy to find out it seems.
Answer: This has become a fairly common way of providing a tool that can perform multiple actions depending on what "sub command" is being used.  It is not standardized in any way that I know of and using a dot as a separator between the base command name and the sub command when writing them together is definitely not universal for these tools.
Some tools can only be called with a sub command, like git (git by itself provides a help text if it is called alone), but provides manuals for the sub commands like man command-subcommand (as is the case for the git sub commands).
You have obviously found a tool that may be called as command-subcommand (but with a dot) or as command subcommand.  In this case, you will likely find that both the base command and each combined command are either symbolic links or hard links to one and the same file.
A program (whether a script or a compiled binary) can easily inspect by what name it has been invoked, and with what arguments, and adjust its actions accordingly.
Below is an example of a fictional process command that can take a sub command as the first argument, as in process action, or be called with the sub command like process-action.
The sub commands implemented by this script is compile, debug, and mogrify.
#!/bin/sh

basecmd=process         # base command name
cmd=${0##*/}            # get command name ( basename "$0" )
subcmd=                 # no sub command yet

# Now pick out the sub command from the command name,
# or from the first argument.  Then fail if unsuccessful.

case $cmd in
        "$basecmd"-*)   # has sub command in command name
                subcmd=${cmd#$basecmd-}
esac

if [ -z "$subcmd" ] && [ "$#" -ge 1 ]; then
        # called as "process action"
        # rather than as "process-action"
        subcmd=$1
        shift   # remove sub command from argument list
fi

if [ -z "$subcmd" ]; then
        echo 'No action' >&2
        exit 1
fi

# Act on the sub command.
# Each action would probably be implemented as a function,
# possibly called as
#     somefunction "$@"
# ... passing the remaining command line argument to it.

case $subcmd in
        compile)        # do "compile" action
                echo 'compile'
                ;;
        debug)          # do "debug" action
                echo 'debug'
                ;;
        mogrify)        # do "mogrify action"
                echo 'mogrify'
                ;;
        *)
                printf 'Invalid action "%s"\n' "$subcmd" >&2
                exit 1
esac

I've written this for POSIX sh, as there is nothing mysterious that require bash for this to work. A C program would do things in a similar manner, as would a program written in any other compiled or interpreted language. This also does not require Linux; I'm writing and testing this on OpenBSD and it should work on any POSIX system.
Along with this base process script would be a set of hard or symbolic links, one for each sub command.  Here, I've chosen to create hard links:
$ ls -li
total 8
244420 -rwxr-xr-x  4 kk  wheel  538 May  9 21:55 process
244420 -rwxr-xr-x  4 kk  wheel  538 May  9 21:55 process-compile
244420 -rwxr-xr-x  4 kk  wheel  538 May  9 21:55 process-debug
244420 -rwxr-xr-x  4 kk  wheel  538 May  9 21:55 process-mogrify

Each of these names is just another name for the same script.
Test-running:
$ ./process mogrify
mogrify
$ ./process-mogrify
mogrify
$ ./process
No action
$ ./process-compile
compile
$ ./process compile
compile
$ ./process compilee
Invalid action "compilee"

Comment: @YashJakhotiya If the `microk8s` tools are _scripts_, you should be able to investigate them easily enough, otherwise you would have to hunt down the source code for the tools, if the source is available publicly at all. I have no experience with these tools.
Comment: Thanks for your answer. They indeed turned out to be different filenames. But the symlinks are actually to /usr/bin/snap (as are all snap installed executables). What you have provided is a good enough way to incorporate this behavior, but how does microk8s do this is not so easy to find out.


Where does the phrase "cool your jets" come from?

Question: When was it first used and in what context?
Comment: Welcome Katelyn!  What does your research show?  Please provide it in your question so the community can benefit from it and not repeat what you've already done.  :-)
Comment: @John: Exactly my first thought! Well, not specifically Tom Corbett, but it certainly looks to me like the kind of "future slang" you got in sci-fi from people like Robert Heinlein and Isaac Asimov many decades ago. Apparently we are now actually in that future, but it already sounds horribly "dated" to me.
Comment: The future is always disappointing when it arrives.
Comment: [_Tom Corbett, Space Cadet_](http://www.solarguard.com/tcrah.htm)
Comment: @JohnLawler "The future is already here — it's just not very evenly distributed." ——William Gibson
Comment: The future _never arrives_.
Comment: I would bet that the phrase was used a half-dozen times in some 50s/60s kiddies "space cadets"-like movie or TV show, and was picked up from there.  Actually nailing down the origin is likely to be difficult, though, since the films of those shows weren't exactly enshrined in the Smithsonian.
Answer: The OED says the phrase "cool your jets", meaning to calm down or become less agitated, is originally US and the first quoted in a newspaper:

1973   Daily Tribune (Wisconsin Rapids) 29 Jan. 1/1   If you want to cool your jets, just step outside, where it will be about 10 degrees under cloudy skies.

That use is to literally cool yourself down. The first with the usual meaning is a bit later the same year:

1973   Independent Rec. (Helena, Montana) 21 Oct. 4/3   Nixon may be able to stifle Congress but he better cool his jets if he thinks he can mess with the rest of the world.
Comment: Most certainly the Daily Tribune reference was to the slang term and was used in a sort of reverse metaphorical sense.
Comment: There was a flight school run out of the Helena HS that had very close ties to Boeing.  I'd bet that searching the Boeing company newspaper/newsletter from 1950-1970 would pay off.
Answer: The phrase appeared in works by E. E. Smith.  I can't do a citation just now - need to get out the books.  But that would put in not later than the 1960s, and possibly as early as the 1920s.  My best guess is the 1940s or 1950s.
Comment: I hope that you'll find time to nail down the pre-1970s instance of "cooling [one's] jets" from E. E. Smith. When you post it, I will gladly upvote this answer.
Answer: Like the OED (which Hugo cites in his answer), J. E. Lighter, Random House Dictionary of American Slang, volume 1 (1994) gives a first occurrence date of 1973 for "cool [one's] jets":

cool (one's) jets to take it easy; become less less agitated or excited.
[Examples:] 1973 Eble Campus Slang (Nov.) 1: Cool your jets—settle down and relax: Cool your jets or the cops will still think you're the guilty one. 1978 UTSQ Get off my case, cool your jets, take a hike. 1980–89 Cheshire Home Boy 310: Martinez ... bops him one ... Cruise cools his jets. 1989 Dream Street (NBC-TV): Cool your jets, man. He's my brother.

But a Google Books search finds an instance of "cool your jets" from 1970. From William Walter Scott, Hurt, Baby, Hurt (Ann Arbor, Michigan: New Ghetto Press, 1970): [combined snippets]:

If you're getting bored like hell, the feeling's mutual, but just cool your jets and wait for a while. I've sorta got to talk about the conflict between me and my old man.
Like during this time there were lots of undercurrents that forced me to put my foot down and say the hell with what other people say. I've got to start thinking for myself. That was the gist of it.

Hathi Trust confirms the book's publication date and notes that "cool your jets" appears on page 53 of Hurt, Baby, Hurt, but it declines to reproduce its content, owing to copyright restrictions.
Answer: I am unable to provide a proper citation as I seem no longer to have a copy of the book available.  However I believe E. E. "Doc" Smith used it in "Gray Lensman" (serial published in 1939-40, book in 1951).  About the second or third chapter Kinnison attended some sort of soiree where he was treated like a rock star and swarmed by young women.  "Cool you jets" was used in the course of the conversational repartee.  As I recall there were many other future slang references to jets - clogging, not firing on all jets, and the like.
Apologies for lack of citation.
Comment: I ran a search for _jets_ on a [free, searchable online copy](http://freeread.com.au/@rglibrary/EEDocSmith/Lensmen/GrayLensman.html) of _Gray Lensman_ (which was originally serialized in 1939–1940 in _Astounding Science-Fiction_), and found three idiomatic phrases involving _jets_: "clog [one's] jets" (six occurrences in the novel), "burn out [one's] jets" (two occurrences), and "baffle [one's] jets (one occurrence). I think you may have misremembered "clog [one's] jets"—meaning "cramp one's style" or "make trouble for one"—as "cool [one's] jets." The latter does not appear in the novel.
Answer: The n-gram is instructive https://books.google.com/ngrams/graph?content=cool+your+jets&year_start=1800&year_end=2000&corpus=15&smoothing=3&share=&direct_url=t1%3B%2Ccool%20your%20jets%3B%2Cc0 Note the origination in the early 40's, almost certainly in pulp SF. In the absence of direct attribution, the suggestions of other answers of Smith or Heinlein seem very likely, although Tom Corbett "Space Cadet" is a few years too late to be the first use. It then seems to have fallen into disuse until the mid-60s.
Comment: If you shift your Ngram's smoothing to 0 (from 3), you'll see that the claimed matches for the uptick during the early 1940s are entirely from 1942. But if you check the individual matches from the first reported set of dates (1800–1984), you'll find that none are earlier than 1970. To see whether a match might be lurking at a finer level of filtering, I changed the search period to 1940–1980, which yields a separate results link for 1942 alone—but none of the matches for that year are exact matches for "cool your jets." My conclusion: The "matches" Ngram claims from 1942 are illusory.
Answer: the term cool your jets came from the P2 Neptune aircraft use after World War II as a sub Hunter it had to radial engines and two outboard jet engines after takeoff they would turn the jet engines off the cool your jets that's where it came from
Comment: Can you add some sort of reference -- even personal knowledge as a pilot of that era would be helpful.
Answer: I thought it might be a military term like for pilots or maybe its meaning is it's so cold you can cancel a jet engine heat, like the afterburner on a fighter plane
Comment: Can you provide a citation? Otherwise, this seems like idle speculation.
Comment: For somone who does  not understand  that queer expression the first thing one wants to know is in what sense "jet" is used, and  what area  this picture belongs to. Ste is the first to say that " jet" might refer to jet engines or jet fighters. The second thing that interests is what is the meaning in normal  language . The year when such a queer saying came up and the TV-series is of minor importance, at least for me.


Initial Probabilities of an HMM

Question: I have a learned Hidden Markov Model (HMM) from a certain sequential data using Gibbs sampling. I have managed to obtain the transition probabilities (transition matrix) of the Markov chain and the params of the probability distributions of the hidden states. The only set of params that I have yet been able to obtain are the initial probabilities $\pi$ that specify where the Markov chain would start. So given the parameters that I have estimated, is there a way to figure out $\pi$? Or how can I specify the Gibbs sampler to find out $\pi$?
Comment: [Baum-Welch](http://en.wikipedia.org/wiki/Baum%E2%80%93Welch_algorithm) is capable of estimating the initial probabilities along with the transition and emission matrices. But I guess you opted not to use it. Is there a specific reason why the initial probabilities are important?
Comment: I understand that this can be done easily with EM algorithm. The reason why I'm using Gibbs sampling here is because I want to incorporate covariates into $\pi$ and the transition matrix $T$, which I know how to specify using the BUGS modeling language. I don't know how to do this using EM.
Answer: If you're training the HMM on one long string then it only has one example of a transition from the start state, thus your initial transition probability is rather meaningless. To get a meaningful estimate of $\pi$, you must break the sequence into natural segments and precede each segment with a distinguished 'start state', then train the model.

Initial Probabilities of an HMM


What is Biradial Symmetry?

Question: I am trying to visualize biradial symmetry. I have read the section in the Wiki entry on Symmetry in Biology but it is quite brief and there is no example to illustrate it. I haven't been able to find one anywhere else on the internet.
Comment: Wellcome to StackExchange Biology. I've tidied up your question a little. We always like links to sources people mentioned, so I've included what I imagine your source is to make it clear there was only a small section on your topic (which is best included in the body of the question as well as the title).
Comment: This blog post provides examples of biradial and trimeric symmetry: http://planetfuraha.blogspot.com/2010/04/illustrating-symmetry.html
Answer: In biradial symmetry, in addition to antero-posterior axis there are also two other axes or planes of symmetry at right angles to it and each other such as the sagittal or median verticular-longitudinal and transverse or cross axes. Such animals have two pairs of symmetrical slides i.e there are two planes of symmetry.
You can visualize it as a combination of radial and bilateral symmetry. The body has similarity on either side of a central axis but slight differences in sections next to each other if divided across any plane.
E.g.ctenophores.

for more info
In this image you can see that there are two planes of symmetry, one passing along the oral-aboral axis and the long axis of the mouth. The other passing along the oral-aboral axis and short axis of the mouth. The antimeres on either side of one plane are slightly different from the antimeres on either side of the plane (Imagine in 3D). The comb plates give it radial symmetry and mesogleal layer (jelly-like) give it bilateral symmetry.
If you are interested in the evolutionary aspect, then read this.
Answer: Biradial symmetry is a type of symmetry in which there are two planes of symmetry passing through the principal axis. It is different from bilateral symmetry where there is only one plane of symmetry.
The following image shows difference between biradial and radial symmetry:
Another subtype of radial symmetry is pentamerous radial symmetry which has only 5 planes of symmetry, seen in star fish.
Answer: lets use a simple quadrant diagram to explain

so in this diagram 2 and 4 would be identical, but 2 and 1 or 3 would not.
or you could say side 2, 3 is the same as side 1,4 but not as a mirror image more as a rotation.
Another way you can picture it is radial symmetry but with only two sides, hence BIradial. Many believe it may be an intermediate stage between radial and bilateral symmetry.
Comment: Your explanation illustrates nicely and simply the definition in OP's reference, but how does that apply to a typical shape of a Ctenophore, such as [this example](http://cronodon.com/images/Ctenophore_diagram_close.jpg)? It doesn't seem that II and IV would be identical, because II would contain a tentacle stem while IV would not.
Comment: ts because that picture is from the side, from above it makes more sense, http://lanwebs.lander.edu/faculty/rsfox/invertebrates/images/cten13L_x550_x_420x.gif
Answer: Imagine in terms of letters.
A has a bilateral symmetry. Left and right part are symmetrical.
X has a radial symmetry (Tetramerous),  anterior part (v) is symmetrical to posterior part (^) but also identical to left part (>) and right (<) as well which are made by a different plane.
Now consider I. It has two bilateral symmetry but they are dissimilar. That is anterior part (T) is symmetrical to posterior part ( ⊥) but different from left part (]) which is symmetrical to right ([). This is biradial symmetry.

What is Biradial Symmetry?


How to fix missing GPG keys?


elementary OS Freya won't boot

Question: I have been trying to boot elementary OS Freya beta 2 to my windows 8 UEFI laptop. I have tried using different wifi networks to download the OS on different computer with different ISO to USB burning apps but no success yet. It will start to boot when I hit install but then it goes black and stops working. Any ideas? I have tried it with and without secure boot. By the way, it an Asus k200ma.
Answer: Maybe I can help you.
Instead of pressing the enter-key on "install elementary" press the e-key to edit the code. When the code comes up you will see a line of code that has the words "quiet splash" written. On the end of that line write: nomodeset xforcevesa , and then press the f10-key.

elementary OS Freya won't boot


Probability at specific point in normal distribution curve

Question: In a normal distribution probability curve, it is said that the probability exists for a range of random variables. Probability for a specific point is said to be zero. Can you explain why is this so along with its practical/physical meaning?
Answer: There are a number of ways to look at this.
First, intuitively, the "size" of a single point in comparison to the real line is negligible. As an analogy, consider a population of size $10^{500}$. If we choose one element uniformly at random, then that single element occurs with probability $10^{-500} \approx 0$. The real line is "infinitely bigger" than a population of size $10^{500}$.
Formally, this is a consequence of the integral definition. For a continuous random variable $X$ with probability density function $f$, we define $$P(a \leq X \leq b) = \int_a^b f(x)\ dx.$$ If we only care about a single point, then we get $$P(X = a) = P(a \leq X \leq a) = \int_a^a f(x)\ dx = 0.$$ This holds for any continuous random variable, and normally distributed ones in particular.
If you want to get really technical, then this is a consequence of the fact that finite sets have Lebesgue measure zero. In a sense, sets like $\{a\}$ are simply too small to integrate over without getting $0$.


What is the difference between protected and private?

Question: I don't understand the difference between protected and private members or methods, as I assumed both will hide the member or the function to access from outside the class.
What is the difference between the protected and the private keywords?
Answer: private -  only available to be accessed within the class that defines them.
protected - accessible in the class that defines them and in other classes which inherit from that class.
Answer: Things that are private are only visible within the class itself.
Things that are protected are visible in the class itself and in subclasses.
Answer: The difference is who can access those functions.

Private = only members of the same class can access the function.
Protected = Same as private but derived classes can also access.
Answer: Private members can only be used by that classes members and its friends; protected members can be inherited by other classes, and can be used by the classes members and friends.
Answer: Private methods are usually visible to class instances (internal implementations), protected methods are visible to subclasses and classes in the same package (inheritance and restricted usage).


Wireless doesn't appear on my device

Question: I have installed elementary os with a dual boot on my laptop. Nevertheless, I can't connect my computer to the wifi because the wireless icon doesn't appear in settings.
I've look in the web but I haven't find a working solution.
 Do you have any idea to help me please ?
Answer: Try this
reinstall libappindicator and then logout and log back in.
Use the following command to reinstall libappindicator
sudo apt-get install --reinstall libappindicator3-1 libappindicator1

If the above solutions doesn't work. Try reinstalling the network manager
sudo apt-get install --reinstall network-manager network-manager-gnome

Wireless doesn't appear on my device


getting data from database in windows 8 app

Question: I am building a windows 8 app which requires me to get data from a remotely hosted server. Which API can I use to get the required data? I am using c# and xaml. I basically want to communicate with Microsoft SQL Server Analysis Services. ADOMD.NET cannot be used as windows 8 store apps donot support it.
Comment: More information is required to help. What database application are you using? We also need to know if we are talking local or remote databases. There are limited options for a local database within a Windows Store application.  This question talks about your options http://stackoverflow.com/questions/10909202/do-windows-8-metro-style-application-support-sql-server-ce-local-database
Comment: the database is olap database. Its remote.
Answer: In a Windows 8 app, we can specify for example a connection string to read out data stored in a server-side database. Not only would this be a huge security risk (imagine your connection string being on the thousands of devices where your app is downloaded!), it would also be pretty useless to have it there. WinRT has no knowledge of talking with a (remote) database. This means no ADO.NET or LINQ-To-SQL classes are in the API.
windows 8 style apps dont have out of the box functionality to contact to a database. so you need webservices to conect at a remote database.
If you have a database on a web server for which you can write an OData service, then that's an option. You can use the OData Libraries
I hope http://blogs.msdn.com/b/phaniraj/archive/2012/04/26/developing-windows-8-metro-style-applications-that-consume-odata.aspx will help you.
Comment: thanx :) can odata be used for olap cubes or just simple relational data?
Comment: @Bunny - Try it for olap cubes and report your findings.
Comment: @Ramhound Is there a standard interface for publishing an MDX query up to SSAS from any client tool, and then be able to consume it via OData?


Radio Buttons ng-checked with ng-model

Question: In my HTML page, I have two sets of Boolean based radio buttons: Labeled: "Yes" and "No" / Values: True and False respectively. I'm populating a full form from a PostgreSQL database table to allow the authenticated user to view the form with populated data and edit the populated fields including the radio buttons, then save the form which will save the data to the DB. All of the other text fields populate without issue; it's both collection of radio buttons I am having an issue with pre-checkmarking the radio buttons.
The below does not pre-populate the checked on front end (but adds the correct attribute of checked in HTML source):
    <input id="billing-no" type="radio" name="billing" ng-model="person.billing" value="FALSE" ng-checked="person.billing == 'false'" />
    <input id="billing-yes" type="radio" name="billing" ng-model="person.billing" value="TRUE" ng-checked="person.billing == 'true'" />

However, this does check the correct radio button on load:
    <input id="billing-no" type="radio" name="billing" value="FALSE" ng-checked="person.billing == 'false'" />
    <input id="billing-yes" type="radio" name="billing" value="TRUE" ng-checked="person.billing == 'true'" />

Note: I needed to check against the string boolean value in the directive ng-checked since the boolean value always comes back as a string from PostgreSQL. This, apparently, was a part of PostgreSQL's design when querying data from columns that have boolean data types.
When adding the ng-model directive, the radio button no longer is checked (at least in the rendered browser view). The odd part is that I looked at the source and it clearly checks the correct one. What's even more odd, is that I have to click on the radio button twice to 'check' it. I've tested this in latest version of Chrome, FF, and IE and it all results in the same issue.
The question is: when adding the ng-model directive, why would the HTML source add 'checked' in the radio button attribute, but seemingly does not mark the radio button? Furthermore, why would I have to click twice on the radio button that IS supposed to be checked?

Solution:
To fix this, I removed the ng-checked directive from the radio buttons and only used ng-model as suggested by @Cypher and @aet. I then replaced the attribute value with the directive ng-value "true" & "false". After, I set the values in the controller.
HTML
<input id="billing-no" type="radio" name="billing" ng-model="person.billing" ng-value="false" />
<input id="billing-yes" type="radio" name="billing" ng-model="person.billing" ng-value="true" />

Angular JS
app.controller('peopleCtrl', function($scope, peopleFactory){
    ...
    peopleFactory.getPerson(personParams).then(function(data){
        $scope.person = data;
        /* moved from ng-checked */
        $scope.person.billing = data.billing == 'true';
    });
    ...
};

Comment: You really should not need to use ng-model and ng-checked at the same time. ng-checked is more like for a read-only checkbox thats reflecting some other value. If you just want it to start out checked set the model to true.
Answer: I think you should only use ng-model and should work well for you, here is the link to the official documentation of angular https://docs.angularjs.org/api/ng/input/input%5Bradio%5D
The code from the example should not be difficult to adapt to your specific situation:

<form name="myForm" ng-controller="Ctrl">
   <input type="radio" ng-model="color" value="red">  Red

   <input type="radio" ng-model="color" ng-value="specialValue"> Green

   <input type="radio" ng-model="color" value="blue"> Blue

   <tt>color = {{color | json}}</tt>

</form>

Comment: When switching back from different controller/scope to this raido button 's view, the pre-checked radio button is no longer checked even though data is still stored correctly. How to fix that?
Answer: I solved my problem simply using ng-init for default selection instead of ng-checked

<input id="billing-no" type="radio" name="billing" ng-model="person.billing" ng-value="FALSE" />
<input id="billing-yes" type="radio" name="billing" ng-model="person.billing" ng-value="TRUE" />

Answer: [Personal Option]
Avoiding using $scope, based on John Papa Angular Style Guide
so my idea is take advantage of the current model:

(function(){
  'use strict';

   var app = angular.module('way', [])
   app.controller('Decision', Decision);

   Decision.$inject = [];

   function Decision(){
     var vm = this;
     vm.checkItOut = _register;

     function _register(newOption){
       console.log('should I stay or should I go');
       console.log(newOption);
     }
   }

})();

    <form name="myCheckboxTest" ng-submit="vm.checkItOut(decision)">

  <input type="radio" name="option" ng-model="decision.myWay"
                           ng-value="false" ng-checked="!decision.myWay"> Should I stay?

                    <input type="radio" name="option" ng-value="true"
                           ng-model="decision.myWay" > Should I go?

</form>

I hope I could help ;)
Comment: Technically, speaking one should use `vm.myWay` :)
Answer: Please explain why same ng-model is used? And what value is passed through ng- model and how it is passed? To be more specific, if I use console.log(color) what would be the output?
Comment: You should include what you have tried as code as well as any errors you get back. Otherwise this is a question more suited to Google, not a QA site.

Radio Buttons ng-checked with ng-model