I have to know size of an array after passing it to a function. For example,  #include&lt;stdio.h&gt; void func(char *ptr) {      printf("%d\n",------); //Here i want the actual size of the array passed to ptr. What to fill in the blank to get total size of the arr[] } main() {     char arr[10] = "Hello";     printf("%d\n",sizeof(arr));  // here it is giving 10 bytes that is equal to total size of the array     func(arr); }
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)?
How do distributed transactions work (eg. MSDTC)? What special characters must be escaped in regular expressions? I am tired of always trying to guess, if I should escape special characters like '()[]{}|' etc. when using many implementations of regexps.  It is different with, for example, Python, sed, grep, awk, Perl, rename, Apache, find and so on. Is there any rule set which tells when I should, and when I should not, escape special characters? Does it depend on the regexp type, like PCRE, POSIX or extended regexps? Are delphi variables initialized with a value by default? Can present progressive statements be use at present or for the future? or both? Prevent windows from going into sleep when my program is running? How do I remove "Ubuntu" in the bios boot menu? (UEFI) See this   I have this on my Lenovo s205 too.   Is there some way to remove "ubuntu" from the menu? I don't even have it installed anymore. How to change the name of an iOS app? I began an iPhone project the other day with a silly development code name, and now I want to change the name of the project since it's nearly finished.   But I'm not sure how to do this with Xcode, trying the obvious of changing the application's name in the info.plist file, causes the signing process to go wrong (I think...) and my app won't launch giving me a Launcher error.  I guess I could make a new project and copy paste everything over, but it seems so primitive that I'm hoping for a more civilized solution. Irfanview nearest equivalent for linux I just did a clean install of 20.04 and I noticed that no key shortcuts for files manipulation work when my focus in on Desktop (not in Nautilus).   When I have copied a file to clipboard, I cannot Ctrl+V it to Desktop, when I click on a file on Desktop, I cannot Ctrl+C it, or I cannot Delete it with keys. Only ways to do it is either navigate to the Desktop folder in Nautilus, or right-click the file on the Desktop and copy/move to trash/paste...  Sorry if I'm missing something obvious, all the key shortcuts worked normally for me in 18.04. Proof of property of abelian group I want to show that $\forall x$,$y\in G$, $(xy)^2=x^2y^2 \iff G $ is an abelian group.  Proof of the backward direction seems easy enough:  Assume $G$ is an abelian group. Then consider $(xy)^2=(xy)(xy)$. By associativity, $(xy)(xy)=xyxy$. Since $G$ is abelian, $xyxy=xxyy=x^2y^2$.   Proof of the forward direction I attempt by contrapositive:  That is, assume $G$ is not an abelian group. Then, consider $(xy)^2=xyxy$ as above. Yet, $xyxy\neq xxyy=x^2y^2$ since we no longer have commutativity.  Is this proof by contrapositive completely correct? After the latest Ubuntu updates, I have not been able to open virtualbox, on starting it gives me an error saying the kernel driver is either not loaded or set up properly and that I should reinstall virtualbox-dkms package. After removing virtualbox, and trying to reinstall I get the error below: ERROR: Cannot create report: [Errno 17] File exists: '/var/crash/virtualbox-dkms.0.crash' Error! Bad return status for module build on kernel: 5.8.0-34-generic (x86_64) Consult /var/lib/dkms/virtualbox/6.1.10/build/make.log for more information. dpkg: error processing package virtualbox-dkms (--configure):  installed virtualbox-dkms package post-installation script subprocess returned error exit status 10 dpkg: dependency problems prevent configuration of virtualbox:  virtualbox depends on virtualbox-dkms (&gt;= 6.1.10-dfsg-1~ubuntu1.20.04.1) | virtualbox-source (&gt;= 6.1.10-dfsg-1~ubuntu1.20.04.1) | virtualbox-modules; however:   Package virtualbox-dkms is not configured yet.   Package virtualbox-source is not installed.   Package virtualbox-modules is not installed.   Package virtualbox-dkms which provides virtualbox-modules is not configured yet.  dpkg: error processing package virtualbox (--configure):  dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of virtualbox-qt:  virtualbox-qt depends on virtualbox (= 6.1.10-dfsg-1~ubuntu1.20.04.1); however:   Package virtualbox is not configured yet.  dpkg: error processing package virtualbox-qt (--configure):  dependency problems - leaving unconfigured No apport report written because the error message indicates it's a follow-up error from a previous failure.                             No apport report written because the error message indicates it's a follow-up error from a previous failure.                                                         Processing triggers for menu (2.1.47ubuntu4) ... Processing triggers for bamfdaemon (0.5.3+18.04.20180207.2-0ubuntu2) ... Rebuilding /usr/share/applications/bamf-2.index... Processing triggers for desktop-file-utils (0.24-1ubuntu3) ... Processing triggers for mime-support (3.64ubuntu1) ... Processing triggers for hicolor-icon-theme (0.17-2) ... Processing triggers for gnome-menus (3.36.0-1ubuntu1) ... Processing triggers for systemd (245.4-4ubuntu3.3) ... Processing triggers for man-db (2.9.1-1) ... Processing triggers for shared-mime-info (1.15-1) ... Errors were encountered while processing:  virtualbox-dkms  virtualbox  virtualbox-qt E: Sub-process /usr/bin/dpkg returned an error code (1)  This happens even when I boot from the previous kernel using the grub menu, any help would be very appreciated. I have also tried to use aptitude to remove any conflicting versions of virtualbox from other repositories but still the same issue. Can ovulation and menstruation occur simultaneously? Is that possible that ovulation happens in the time of actual menstrual haemorrhage in human females - let say in a case that woman has 21 day cycle and her menstrual period is 7 days?   If yes, does it means that in this particular case the woman has lower chances to conceive? How do I disable Aero Shake in Windows 7? I'm always accidentally minimizing most of my windows. This is really annoying. How do I disable Aero Shake? How to see time stamps in bash history? Is there any way I can see at what time the commands were executed from the bash history? We can see the order but is there any way I can get the time also?  Bottom-Line: Execution time in the Bash history Diamond moderator rollbacks can resurrect blacklisted tags How can I install a Canon printer or scanner driver? How can I combine two or more querysets in a Django view? I am trying to build the search for a Django site I am building, and in that search, I am searching in three different models. And to get pagination on the search result list, I would like to use a generic object_list view to display the results. But to do that, I have to merge three querysets into one. How can I do that? I've tried this: result_list = [] page_list = Page.objects.filter(     Q(title__icontains=cleaned_search_term) |     Q(body__icontains=cleaned_search_term)) article_list = Article.objects.filter(     Q(title__icontains=cleaned_search_term) |     Q(body__icontains=cleaned_search_term) |     Q(tags__icontains=cleaned_search_term)) post_list = Post.objects.filter(     Q(title__icontains=cleaned_search_term) |     Q(body__icontains=cleaned_search_term) |     Q(tags__icontains=cleaned_search_term))  for x in page_list:     result_list.append(x) for x in article_list:     result_list.append(x) for x in post_list:     result_list.append(x)  return object_list(     request,     queryset=result_list,     template_object_name='result',     paginate_by=10,     extra_context={         'search_term': search_term},     template_name=&quot;search/result_list.html&quot;)  But this doesn't work. I get an error when I try to use that list in the generic view. The list is missing the clone attribute. How can I merge the three lists, page_list, article_list and post_list? Existence of a Riemannian metric inducing a given distance. Let $M$ be a smooth, finite-dimensional manifold. Suppose $M$ is also a metric space, with a given distance function $d: M \times M \rightarrow \mathbb{R}_{+}$, which is compatible with the original (manifold) topology on $M$.  Question: is there a Riemannian metric $g$ on $M$ such that the distance $$d_g(p, q) = \inf_{\gamma \in \Omega(p, q)} L_g(\gamma)$$ coincides with $d$?  I believe that this setting is very standard, but for the sake of completeness: $L_g$ denotes the Riemannian length of the curve $\gamma$, and $\Omega(p, q)$ the set of all piecewise smooth curves $\gamma : [a, b] \rightarrow M$ s.t. $\gamma(a) = p$ and $\gamma(b) = q$. Thanks in advance. failed to fetch security undermined error [IP: 91.189.91.38 80] in ubuntu 20.04 How can we get the command line of a running application?