I tried to get how many bytes are allocated for an array using standalone function but I failed. My code is as follows:  #include &lt;stdio.h&gt;  void testing(char *source);  int main(){      char a[12] = "Hello World!";     //printf("%d",sizeof(a));   Prints 12. I want to get this value     testing(a); // Prints 4. I need to get 12 by using functions   return 0; }  void testing(char *source){     printf("%d",sizeof(source)); }      I want to get result as 12 but output tells me that it is 4.
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)?
Fancyhdr does not apply same header/footer on chapter and non-chapter pages Pure significance of line integrals of vector fields I can understand how the line integral of a scalar function has pure-mathematical significance, representing an area beneath a curve. But is there a pure significance to the line integral of a vector field? The only understanding I have of this is the physical example of work done on a moving particle. Thanks for any insight. Determining functions from specifications... my high school teacher asked this question today, and I am struggling to find an answer that will work. The question is outlined below:  Give an example of a cubic polynomial, defined on the open interval (-3,3), which reaches both its maximum and minimum values. Can you trip as part of a Tome of Battle Maneuver? An idiom to describe someone who thinks he/she is wiser than others Which one is the formula of angular velocity? Is it $\omega= vr$? If not then why does the source below use $mvr=nh/2\pi$, where $mvr$ is angular momentum and $vr$ is angular velocity? Again $\omega=v/r$ shows radian per second. I saw $\omega= vr$ in one book and $\omega= v/r$ in another! I need to use a metaheuristic algorithm to solve an optimization problem on a Python codebase.  Metaheuristics usually need to be written in C++ or Java as they involve a lot of iterations, while Python is weak from this point of view.  Questions:   do any Python metaheuristic packages which wrap faster languages as C++/Java exist? do any Python metaheuristic packages based on maybe cython on numba exist? other solutions? What Hogwarts classes are taught to two houses at once? I remember from my mumble about nine mumble rereads of the Harry Potter series that the following classes Harry took were taught to more than one house in the same lesson:   Potions with the Slytherins  Herbology with the Hufflepuffs  Care of Magical Creatures with the Slytherins  broomstick riding with at least the Slytherins (maybe other houses, too?)    I don't remember any student from a house that isn't Gryffindor being mentioned in the sections on Transfiguration, Charms, Defense Against Dark Arts, History of Magic, or Divination. That would mean McGonagall had to teach twice as many classes as Snape, if both subjects got the same number of lessons (which I think I recall).   Were any subjects other than Potions, Herbology, and Care of Magical Creatures taught to more than one house in the same lesson? And do we know why some subjects are taught to more students at the same time than others? I want to copy all images on my computer to a single folder Imported CSV data is not displayed in QGIS The example bellow comes from the  (p610). It does not work my computer. Note that it works when I comment the option [prefix=figures/]. Any idea of what could go wrong here?  \documentclass{article} % main document, called main.tex \usepackage{tikz} \usetikzlibrary{external} \tikzexternalize[prefix=figures/] % activate  \begin{document} \tikzsetnextfilename{trees} \begin{tikzpicture} % will be written to ’figures/trees.pdf’ \node {root} child {node {left}} child {node {right} child {node {child}} child {node {child}} }; \end{tikzpicture} \tikzsetnextfilename{simple} A simple image is \tikz \fill (0,0) circle(5pt);. % will be written to ’figures/simple.pdf’ \begin{tikzpicture} % will be written to ’figures/main-figure0.pdf’ \draw[help lines] (0,0) grid (5,5); \end{tikzpicture} \end{document} Copy and set-mark in Bash as in Emacs? I would like to be able to copy and paste text in the command line in Bash using the same keyboard bindings that Emacs uses by default (i.e. using C-space for set-mark, M-w to copy text, C-y, M-y to paste it, etc.).  The  says that Bash comes with some of these key bindings set up by default.   For example, yanking (C-y) works by default on my terminal. However, I can't get the set-mark and copy commands to work, and they don't seem to be bound to any keys by default.  Usually, the way a user can define her own key bindings is to add them to .inputrc. So I looked and found the following bash functions in the documentation that I presume can help me define the Emacs-like behavior that I want (i.e. set-mark with C-space and copy with M-w).  copy-region-as-kill ()      Copy the text in the region to the   kill buffer, so it can be yanked right   away. By default, this command is   unbound.   and    set-mark (C-@)      Set the mark to the point. If a   numeric argument is supplied, the mark   is set to that position.   If I understand correctly, the above means that copy-region-as-kill is not bound to any keyboard sequence by default, while set-mark is bound to C-@ by default.   I tried C-@ on my terminal, but I don't think it runs set-mark because I don't see any text highlighted when I move my cursor. In any case, I tried adding  keyboard bindings (M-w and C-) to the functions  copy-region-as-kill and set-mark above in my .inputrc and then reloading it with C-x C-r, but this didn't work. I know that my other entries in .inputrc work because I have other user-defined keybindings defined in it.  Is there anything I am doing wrong? Am I missing anything? I am working on Ubuntu 12.04 64bit.  I want to add "Open terminal here" to Nautilus context or right-click menu but it tries to download 32bit version from Internet. Can a multi-core processor run multiple processes at the same time? I understand that a multi-core processor can run multiple threads of the same process at the same time using its different cores. Can it also run multiple processes at the same time(each core running a different process)? How are pronouns resolved? Are pronouns in English resolved syntactically or semantically? Do they always refer to the closest matching noun?  A  has these examples:        We gave the bananas to the monkeys because they were hungry.   We gave the bananas to the monkeys because they were ripe.   We gave the bananas to the monkeys because they were here.       My understanding was that pronouns are resolved syntactically, and so sentence 2 is semantically incorrect (unless the author really meant that the monkeys were ripe) and sentence 3 is not ambiguous. Is this wrong?  Citations and references are most welcome. How to assign dynamic Ids for ui:inputDate element inside aura:iteration? As title says, How do I assign dynamic Ids for ui:inputDate elements inside aura:iteration?  Here is the reproducible version of the problem I am facing:  HelloWorldApp.app  &lt;aura:application &gt;     &lt;c:inputDateExample /&gt; &lt;/aura:application&gt;   inputDateExample.cmp  &lt;aura:component &gt;     &lt;aura:handler name="init" value="{!this}" action="{!c.doInit}"/&gt;     &lt;aura:attribute name="datesList" type="List" /&gt;     &lt;table&gt;         &lt;aura:iteration items="{!v.datesList}" var="dateItem"&gt;             &lt;tr&gt;                 &lt;ui:inputDate aura:id="date-id"                                value="{!dateItem}"                                displayDatePicker="true"                               blur="{!c.fldChanged}"/&gt;             &lt;/tr&gt;         &lt;/aura:iteration&gt;     &lt;/table&gt; &lt;/aura:component&gt;   inputDateExampleController.js  ({     fldChanged : function(component, event, helper) {         console.log('Value changed');         //How do I find from which date element, event is fired??         //The below method finds both date elements because the Id is not unique         var dateComponent = component.find('date-id');         console.log(dateComponent);         console.log(dateComponent[0].get("v.value"));     },     doInit : function(component,event,helper){         var datesArray = [];         datesArray.push("2017-01-01");         datesArray.push("2017-01-31");         component.set("v.datesList",datesArray);     } })   This produces the below output and I need to find which element user is clicking on??    Notes:   I can assign unique Id for tr element but not sure how to use that inside component.find() method. I can assign dynamic id for plain input tags but there is too much markup involved for making these similar to lightning date element. I tried giving html5 data attributes for ui:inputDate but it doesn' accept.   Any workarounds or anything I am missing here? Evaluating and proving $\lim\limits_{x\to\infty}\frac{\sin x}x$ I've just started learning about limits. Why can we say $$ \lim_{x\rightarrow \infty} \frac{\sin x}{x} = 0 $$ even though $\lim_{x\rightarrow \infty} \sin x$ does not exist?   It seems like the fact that sin is bounded could cause this, but I'd like to see it algebraically.   $$ \lim_{x\rightarrow \infty} \frac{\sin x}{x} =  \frac{\lim_{x\rightarrow \infty} \sin x} {\lim_{x\rightarrow \infty} x}   = ? $$  L'Hopital's rule gives a fraction whose numerator doesn't converge. What is a simple way to proceed here? How can I remove all unused materials from a .blend file? It's so cool that the notification reminds you of the colour of badge you've earned. But I am a little puzzled by the symbols:      Is it feasible to use the symbol from the earned site? At the moment it uses the symbol from the site I happen to be on (as you can see by looking to the left of the dropdown in each case.) How do we know an $ \aleph_1 $ exists at all? I have two questions, actually. The first is as the title says: how do we know there exists an infinite cardinal such that there exists no other cardinals between it and $ \aleph_0 $? (We would have to assume or derive the existence of such an object before we label it something like $ \aleph_1 $.)  My second question is, can we say for certain if there's any limit to the number of cardinals existing between $ \aleph_0 $ and continuum (i.e. $ 2^{\aleph_0} $)? I mean, how could we know that there&#39;s not an infinite number of cardinals between the two - perhaps even more than $ \aleph_0 $?