I'm writing a OpenGL with NDK example.  My shader code in main.c:  const char vShaderStr[] =       "#version 300 es                             \n"       "uniform mat4 u_mvpMatrix;                   \n"       "layout(location = 0) in vec4 a_position;    \n"       "layout(location = 1) in vec4 a_color;       \n"       "out vec4 v_color;                           \n"       "void main()                                 \n"       "{                                           \n"       "   v_color = a_color;                       \n"       "   gl_Position = u_mvpMatrix * a_position;  \n"       "}                                           \n";  const char fShaderStr[] =       "#version 300 es                                \n"       "precision mediump float;                       \n"       "in vec4 v_color;                               \n"       "layout(location = 0) out vec4 outColor;        \n"       "void main()                                    \n"       "{                                              \n"       "  outColor = v_color;                          \n"       "}                                              \n";  userData-&gt;programObject = esLoadProgram ( vShaderStr, fShaderStr );   I had tried this  to convert(I also change the way of create shader in main.c), but failed:  I want use extern shader file by reading them in main.c  .  How can I convert it?
What is the simplest way (least error-prone, least lines of code, however you want to interpret it) to open a file in C and read its contents into a string (char*, char[], whatever)?
Finding Zero Divisors and Units of Rings $\mathbb{Z}_n \times \mathbb{Z}_m$ Imagine a situation in which the whole place is on fire, a bomb is about to explode, everyone is running for their lives and someone is checking his looks on the mirror... pretty inappropriate for the situation, don't you think? I'm looking for an idiom or colloquial/slang/informal expression to describe such an indifferent stance. How we differentiate between flash memory and SD card memory? Is there a way I can see all the versions that are in the archives that I have configured in sources.list. I can see the last version of each archive withapt-get policy, but how can I see them all?  Is there any way that this can also include PPA and anything in sources.list.d? I am trying to understand the sentence  the mean minimizes the mean squared error.   from wikipedia .  From a previous post  I can see a formal proof which according to the authors prove that the mean minimaze. But my objection on that prove is that is you substitute m with median all the reasoning still stands.  Therefore, I restricted myself to one dimension and built the following example :   MSE = 1/n[SUM(Y_hat_i - Y_i)**2]   Given the following distribution Y = [5,3,2,7,4], minimizing MSE I intended as in the following: I should find a function Y_hat such that when it is applied to the MSE formula (more specifically to each element of the Y distribution), we are sure that we obtain the minimum value. For simplicity, I could consider the Y_hat as any measure or function for the central tendency, including, mean, median, mode, etc.  Lets suppose, Y_hat = mean (=4.2 for our distribution), therefore, I did all the calculations such as:  1/5 [(4.2-5)**2 + (4.2-3)**2+ (4.2-2)**2 + (4.2-7)**2  + (4.2-4)**2 ] = 2.96   Let's suppose, Y_hat = median (=4 for our distribution), therefore, I did all the calculations such as:  1/5 [(4-5)**2 + (4-3)**2+ (4-2)**2 + (4-7)**2  + (4-4)**2 ] = 2.8   If I did all the calculation correctly, the result shows that for this case, the median is minimizing better than the mean.  I am sure, I am doing something wrong and missing important aspects of the overall reasoning.  Please, could you provide any clarification on the above topic? I would really appreciate it.  Many Thanks in advance, Best Regards, Carlo Every finite commutative ring with no zero divisors contains a multiplicative identity? The bevel depth (the radius of the tube) is set to 9cm but it actually isn't when compared to the background grid. This is is confirmed by importing it into sketchup and scaling it to the proper units it turns out the radius is only around 2.286cm. This problem only shows up on certain projects. What's wrong and how do I fix it?  (sorry that I can't upload the file, it's a long story) What to do when OP answers his/her own question in an edit? Reference question:   Sometimes users solve their own questions, which is great. Sometimes they say they've solved it and move on, which is not so great. The above question is middle-ground: the user posted an answer to his own question, but as an edit to the question instead of as a real answer.  Should any action be taken in such a case? The obvious solution is to copy the edit into a real answer. But is this the right solution? In this case, the answer is a little hidden and there are no other answers, so it appears on the unanswered list.     Related: Drawing a large binary matrix as colored grid in TikZ In C# check that filename is *possibly* valid (not that it exists) Is there a method in the System.IO namespace that checks the validity of a filename?  For example, C:\foo\bar would validate and :"~-* would not  Or a little trickier, X:\foo\bar would validate is there is an X: drive on the system, but wouldn't otherwise.  I suppose I could write such a method myself, but I'm more interested in a built-in one. How to find all the available tools in mac terminal? I am trying to setup a bunch of development projects in my Mac. I have to run various tools like python, ruby, scala, groovy etc.  To see if a tool is available I use options like   ruby --version.    Instead I would like to see all the list of tools available in Mac terminal via a single command. What is the command/options for it? Possible Duplicate:          I was thinking about making a pacman clone, I know there is a similar question here  , but I know i can't use the original art from the game because it belongs to Namco, so if I design a character that has the shape of the slice circle it will look exactly like pacman, maybe if I use green instead of yellow? Also if the game plays like the original pacman, it is wrong?  I just want to make the game as a personal project and and publish it in my site without getting in trouble Why is "the set of all sets" a paradox, in Layman's terms? I've heard of some other paradoxes involving sets (i.e., &quot;the set of all sets that do not contain themselves&quot;) and I understand how paradoxes arise from them.  But this one I do not understand. Why is &quot;the set of all sets&quot; a paradox?  It seems like it would be fine, to me.  There is nothing paradoxical about a set containing itself. Is it something that arises from the &quot;rules of sets&quot; that are involved in more rigorous set theory? I'm really new to Mac OSX and UNIX based systems. I wanted to run a few Windows games on my Mac Mini so I started installing Wine and MacPorts. I think the installs are correct, but when I type sudo port install wine I see a not found error in my terminal. I tried other basic commands like say and clear and all of them return the same not found error. My research shows that my PATH might be incorrectly set, but it lacks steps I can implement. Specifically, I ran this command: echo $PATH and it returned:  /opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/opt/local/bin  I'm a complete newbie to mac and have no idea where .bash_profile or any of those files are. My skills let me install Xcode and the Command Line tools for Xcode and I sense I need to level up on path management. At this point I need help managing my dot files and changing my path to fix these specific errors on Mountain Lion. What are my next steps? Blender 2.79b is installed (from .exe) on my computer, currently. And I just downloaded the Blender 2.8 release candidate 2 (.zip).  When I create something in Blender 2.8, after I save it, I cannot open it again because the computer tries to open the blend file in version 2.79b. And manually selecting the 2.8 version from zip file does not work.  How can I open my blender 2.8 files? Do I have to delete Blender 2.79b? Delaunay triangulation to generate abstract networks and nodes Is it possible to use Delaunay triangulation to generate an image like the below from a raster or vector of an object (in this case, a human heart)? What software and techniques would be required to make something like this? My intention is to make and use something like this in Inkscape without having to draw all the nodes/lines/effects manually. A man condemned to serve his sentence in other times $AB-BA$ is a nilpotent matrix if it commutes with $A$ I saw this in a  and am putting it here for posterity.  Problem: Let $A$ and $B$ by square matrices and set $C=AB-BA$. If $AC=CA$, prove $C$ is nilpotent. Invalid signature for Kali Linux repositories : "The following signatures were invalid: EXPKEYSIG ED444FF07D8D0BF6 Kali Linux Repository" CaseComment and CaseHistory relatedlist in visualforce page I want to add CaseComment and CaseHistory related list to my visualforce page.   &lt;apex:relatedList list=" " /&gt;  What should be the value for List attribute in the code defined above. When I added   &lt;apex:relatedList list="CaseHistory" /&gt; 'Histories' is also not working   &lt;apex:relatedList list="CaseComment" /&gt; 'CaseComments' is also not working  I get errors saying they are not valid child relationship name for entity Case.  Please help me out on this issue.