I am required to convert all instances of strlen in our code base to the more secure version strnlen_s. The only difference between the two functions arguments is strnlen_s' requirement for the maximum length of the buffer you are providing.  This is a really straight forward process with instances of a character array (char array[64]) that have explicit lengths (sizeof(array)). Unfortunately, there are several instances of strlen being used with a character pointer (char*), whose size is always 8.  Is there a way to use strneln_s with character pointers?
First off, here is some code:  int main()  {     int days[] = {1,2,3,4,5};     int *ptr = days;     printf("%u\n", sizeof(days));     printf("%u\n", sizeof(ptr));      return 0; }   Is there a way to find out the size of the array that ptr is pointing to (instead of just giving its size, which is four bytes on a 32-bit system)?
Unable to post - login problems with Area 51 ... again I recently signed up for Area 51 with my stackexchange network account/ID, verified the account and logged in.  I see the main page  where I confirm that I am logged in.  I click on the discuss link on the black menubar at the top, which takes me to the discussion zone. From here I click on ask question, which asks me to add  a login even though I have already logged in with my stackexchange ID.  Here if I choose the stackexchange login option then it takes me back to the main page, from where the cycle begins again. I used python add in to make a tool bar in Arcmap that edits features on a map. It works on a file geodatabase, but not on an ArcSDE version one. I've been getting an FDO error: 0. The solutions that I've found all involve opening a workspace, but I'm getting an error doing that as well. Here is the relevant portion of my code:          outFolderPath = r"U:\tempStuff"         outName = "Stuff.sde"         databasePlatform = "SQL_Server"         instance = "SQL Server"         arcpy.CreateDatabaseConnection_management(outFolderPath, outName,                                                   databasePlatform,                                                   instance)         print "Centroid of buidling:(%r,%r) Side length: %r" % (xCoordinate,                                                                 yCoordinate,                                                                 bob)         print "workspace is %r" % outName #outName is workspace          #Start edit session with an undo/redo stack then start         #edit operation         print "Starting editing"         edit = arcpy.da.Editor(outName) #outName is workspace Line 86         edit.startEditing(True, True)         edit.startOperation()          #stuff happens          cursor = arcpy.da.InsertCursor( fc, ["SHAPE@"])         cursor.insertRow([stuff])             #stop the edit operation and then save changes         edit.stopOperation()         edit.stopEditing(True)          del cursor         print "Building should be drawn"   This is the exact error I've been getting:  Traceback (most recent call last):   File "C:\Users\153289\AppData\Local\ESRI\Desktop10.3\AssemblyCache\{0BEF4E61-6332-4BCA-A908-959CA3C0B4E7}\leetScripts_addin.py", line 86, in onClick     edit = arcpy.da.Editor(outName)#outName is workspace RuntimeError: cannot open workspace   What's am I doing wrong in my code? How do you keep user.config settings across different assembly versions in .net? Notepad ignoring linebreaks Most documents I'm opening in notepad.exe under windows 7 lately, there are no linebreaks... everything just runs together.  The same documents in any other program, even previewed directly in Explorer, will show the linebreaks correctly.  this is happening with many .info files, .css, .js.. but not all of them.   I am guessing it's some kind of character encoding unix line endings something or other, but wondering if there's anything I can do or if anyone else has experienced similar and if I can make notepad work correctly. I prefer it to notepad++/other text editors for certain uses. How much money did Charlie Harper have? This is quite tricky to figure out, and I am not looking for a specific number, but for a approximation.  As you know, Charlie (nearly) always had a lot of money to spend, but a few hints suggest that he actually did not have money at all (talking about absolute, not cash flow)   he went bancrupt after a few months without income he told Alan that there is no money, and everything just a house of cards he worries about Bertha giving away a few clothes he has three mortgages on his house when he died, there was no inheritage to Alan or anyone, and they had to sell the house ...   However, considering the lifestyle and spendings, Charlie must have had a substantial amount available.   driving the latest foreign expensive cars owning a malibu beachhouse paying the property tax for said house discussing retirement at 45 spending endless money on booze, betting and women ...   So all things considered, did he have money, or was he just a scam? Is time continuous or discrete? I was coding a physics simulation, and noticed that I was using discrete time. That is, there was an update mechanism advancing the simulation for a fixed amount of time repeatedly, emulating a changing system.  I though that was interesting, and now believe the real world must behave just like my program does. It is actually advancing forward in tiny but discrete time intervals? I would like to evaluate the sum  $$\sum_{n=0}^\infty \frac{1}{an^2+bn+c}$$  Here is my attempt:    Letting    $$f(z)=\frac{1}{az^2+bz+c}$$  The poles of $f(z)$ are located at   $$z_0 = \frac{-b+\sqrt{b^2-4ac}}{2a}$$  and  $$z_1 = \frac{-b-\sqrt{b^2-4ac}}{2a}$$  Then  $$ b_0=\operatorname*{Res}_{z=z_0}\,\pi \cot (\pi z)f(z)= \lim_{z \to z_0} \frac{(z-z_0)\pi\cot (\pi z)}{az^2+bz+c}= \lim_{z \to z_0} \frac{\pi\cot (\pi z)+(z_0-z)\pi^2\csc^2 (\pi z)}{2az+b} $$  Using L'Hopital's rule. Continuing, we have the limit is  $$ \lim_{z \to z_0} \frac{\pi\cot (\pi z)+(z_0-z)\pi^2\csc^2 (\pi z)}{2az+b}= \frac{\pi\cot (\pi z_0)}{2az_0+b} $$  For $z_0 \ne 0$  Similarly, we find  $$b_1=\operatorname*{Res}_{z=z_1}\,\pi \cot (\pi z)f(z)=\frac{\pi\cot (\pi z_1)}{2az_1+b}$$  Then   $$\sum_{n=-\infty}^\infty \frac{1}{an^2+bn+c} = -(b_0+b_1)=\\ -\pi\left( \frac{\cot (\pi z_0)}{2az_0+b} + \frac{\cot (\pi z_1)}{2az_1+b}\right)=  -\pi\left( \frac{\cot (\pi z_0)}{\sqrt{b^2-4ac}} + \frac{\cot (\pi z_1)}{-\sqrt{b^2-4ac}}\right)= \frac{-\pi(\cot (\pi z_0)-\cot (\pi z_1))}{\sqrt{b^2-4ac}}= \frac{\pi(\cot (\pi z_1)-\cot (\pi z_0))}{\sqrt{b^2-4ac}} $$  Then we have  $$\sum_{n=0}^\infty \frac{1}{an^2+bn+c} = \frac{\pi(\cot (\pi z_1)-\cot (\pi z_0))}{2\sqrt{b^2-4ac}}$$    Is this correct?  I feel like I made a mistake somewhere.  Could someone correct me?  Is there an easier way to evaluate this sum? When writing answers on here, it's often necessary to create a new script and chmod +x it to make it executable. I won't go into whether this is a good thing or not, but explaining to people that they need to fire in three separate command (and teaching them to use nano!) is a bit of a waffle.  Is there anything easier? Protagonist becomes the avatar of an alien deity and has to cope with adversary god I read this at least 20 years ago, and I believe it was originally published in the '60s.   The main character is a human, but somehow "inherits godhood" from an alien, whose species is very long lived. IIRC this is one of the old-style god thingies, i.e. "god of thunder" not "omniscient omnipotent omnipresent transcendent being".  The plot somehow revolved around identifying and fighting some enemy which, I believe, was in turn a member of the alien species who acted as the avatar of the opposite god in the alien pantheon.  The only thing I remember for sure is that the enemy was identified as "green green" or "gringrin" (sadly, I read this in translation so I am not sure what the original meant) While explaining to my nephew about the physics of light, I told him we cannot see infrared color, and he kicked back with a very simple question: why can't we see it? I could not tell him. Is the human eye unable to sense such light or can it indeed but the brain can't understand the signal? any other reason? Can't install Skype 4.3 on Ubuntu 14.04 64 bit First of all, I think this question is not duplicated, because I have tried all other solutions I found here, but nothing solved my problem.  I use Ubuntu 14.04 64 bit.  I have tried until now: sudo apt-get install skype -> It didn't work. The error was:   The following packages have unmet dependencies: skype : Depends: skype-bin E: Unable to correct problems, you have held broken packages.   I have tried sudo dpkg add-architecture &amp;&amp; sudo dpkg -i skype-ubuntu-precise_4.3.0.37-1_i386.deb but it didn't work either. The error was:  dpkg: dependency problems prevent configuration of skype: skype depends on libqt4-dbus (&gt;= 4:4.5.3); however: Package libqt4-dbus is not installed. skype depends on libqt4-network (&gt;= 4:4.8.0); however: Package libqt4-network:i386 is not installed. skype depends on libqt4-xml (&gt;= 4:4.5.3); however: Package libqt4-xml:i386 is not installed. skype depends on libqtcore4 (&gt;= 4:4.7.0~beta1); however: Package libqtcore4:i386 is not installed. skype depends on libqtgui4 (&gt;= 4:4.8.0); however: Package libqtgui4:i386 is not installed. skype depends on libqtwebkit4 (&gt;= 2.2~2011week36); however: skype depends on libstdc++6 (&gt;= 4.2.1); however: Package libstdc++6:i386 is not installed. skype depends on libx11-6; however: Package libx11-6:i386 is not installed. skype depends on libxext6; however: Package libxext6:i386 is not installed. skype depends on libxss1; however: Package libxss1:i386 is not installed. skype depends on libxv1; however: Package libxv1:i386 is not installed. skype depends on dpkg: error processing package skype (--install): dependency problems - leaving unconfigured Processing triggers for hicolor-icon-theme (0.13-1) ... Processing triggers for gnome-menus (3.10.1-0ubuntu2) ... Processing triggers for desktop-file-utils (0.22-1ubuntu1) ... Processing triggers for bamfdaemon (0.5.1+14.04.20140409-0ubuntu1) ... Rebuilding /usr/share/applications/bamf-2.index... Processing triggers for mime-support (3.54ubuntu1) ... Errors were encountered while processing: skype   I have tried to use after sudo apt-get -f install but it didn't solve the issue.  I have tried to install by using Gdebi. The error was:  Cannot install 'libqtwebkit4:i386'   I have tried to install using Ubuntu Software Center. The error was:  Cannot install 'libqtwebkit4:i386'   I have tried changing the server in "Software and Updates". I have tried to use "Main Server" and "Servers for United States". But it couldn't solve my problem.  Anyone has any idea how to solve that?  SOLVED  Well, I formatted my pc and I installed Skype first of all. Probably another installation that I had done before the Skype installation was the problem, i guess.  Thanks people! Browser back leaves page after going fullscreen in stack snippet Opening a Stack Snippet in full screen should use history.pushState() to add an entry to the browser history stack. Clicking back will then close the snippet rather than leave the page completely. I'm getting the following error when trying to update a taxonomy field value via REST api:  {   "error": {     "code": "-1, Microsoft.SharePoint.Client.ClientServiceException",     "message": {       "lang": "en-US",       "value": "Cannot deserialize data for type Microsoft.SharePoint.Taxonomy.TaxonomyFieldValueCollection."     }   } }   The request:  https://server/_api/web/GetFileByServerRelativeUrl('/Shared Documents/file.txt')/ListItemAllFields  {   "__metadata": {     "type": "SP.Data.Shared_x0020_DocumentsItem"   },   "Title": "some title",   "Project": {     "results": [       {         "Label": "Term1",         "TermGuid": "897bdf7f-08d6-44b9-a71a-ddc4cf131664",         "WssId": 5       }     ]   } } I have a file containing two columns and 10 million rows. The first column contains many repeated values, but there is a distinct value in column 2. I want to remove the repeated rows and want to keep only one using awk. Note: the file is sorted with values in column 1. For example:    1.123 -4.0 2.234 -3.5 2.234 -3.1 2.234 -2.0 4.432 0.0 5.123 +0.2 8.654 +0.5 8.654 +0.8 8.654 +0.9 . . . .   Expected output  1.123 -4.0 2.234 -3.5 4.432 0.0 5.123 +0.2 8.654 +0.5 . . . . How to save animation as a video format I am basically trying to make an intro for my youtube channel. I am sort of familiar with the program because I was playing around with it for a long time, getting the basics of it. With the help of youtube videos I am basically done with my project. I put my name in it and everything. I just need to know how to save the animation onto my desktop as a file that I could open and would be in a video format. Can the default font be changed? I have been playing with the settings for the text object recently, and every time I add a new text object, I need to change the font to my favorite one. (Eurostile LT ExtendedTwo) Is there any way to change the default font so I do not need to change it every time I add a new text object?   Example: How to run scripts without typing the full path? I'd like to know if there is a way to run  program/shell script without typing full path:  /opt/idea/bin/idea.sh When performing k-fold cross validation, I understand that you obtain the accuracy metrics by pointing all the folds except one at that one fold and make predictions, and then repeat this process $k$ times.  You can then run accuracy metrics on all of your instances (precision, recall, % classified correctly), which ought to be the same as if you calculated them each time and then averaged the result (correct me if I'm wrong).  The end result you want is a final model.  Do you average the models obtained to make your set of $k$ predictions to end up with the model that has the accuracy metrics obtained by the above method? Why is quadratic integer ring defined in that way? Quadratic integer ring $\mathcal{O}$ is defined by \begin{equation}    \mathcal{O}=\begin{cases}       \mathbb{Z}[\sqrt{D}] &amp; \text{if}\ D=2,3\ \pmod 4\\       \mathbb{Z}\left[\frac{1+\sqrt{D}}{2}\right]\  &amp; \text{if}\ D=1\pmod 4    \end{cases} \end{equation} where $D$ is square-free.   I understand $\mathbb{Z}\left[\frac{1+\sqrt{D}}{2}\right]$ is not closed under multiplication if $D=2,3\pmod 4$. But still, isn't it more natural to define $\mathcal{O}=\mathbb{Z}[\sqrt{D}]$ for all square-free $D$? (in that case, it really seems like 'quadratic integer') I wonder what is the motivation of this definition. Evaluating the supremum of a function as n tends to infinity Problem: Let $g:[0,1]\to\mathbb{R}$ be a continuos function such that $g(1)=0$. Show that $\sup\limits_{x\in[0,1]}|x^ng(x)|\to0$ as $n\to\infty$.  My approach: Let $f(x)=x^ng(x)$. Then, $f(x)$ is continuos on $[0,1]$. Using the extreme value theorem we can say, that $|f(x)|$ is bounded on $[0,1]$ and attains its bounds, i.e., $\exists x_0\in[0,1]$ such that $|f(x_0)|=\sup\limits_{x\in[0,1]}|f(x)|$.  Now, $|f(x_0)|=|x_0^ng(x_0)|$. If $x_0=0$, then we are done. So, let us assume $x_0\neq0$. By the Archimedean property of $\mathbb{R}$, $\exists$ a $y\in\mathbb{R}$ such that $y=x_0^n\leq1$, since $x_0\in[0,1]$.   Hence, $\lim\limits_{n\to\infty}\sup\limits_{x\in[0,1]}|x^ng(x)|=\lim\limits_{n\to\infty}\sup\limits_{x\in[0,1]}|f(x)|=\lim\limits_{n\to\infty}|f(x_0)|=\lim\limits_{n\to\infty}|yg(y^{\frac{1}{n}})|\leq\lim\limits_{n\to\infty}|g(y^{\frac{1}{n}})|=g(1)=0.$  I will be glad if anyone can tell me if I have done any mistake and if so please help me to correct it.  Thank you.