Bijection between $\mathbb{Z} \longmapsto \mathbb{R}$

I recently learned of Cantor's diagonal argument, and was thinking about why there can't be a bijection between any infinite set of integers and any infinite set of real numbers. I understood the basic idea behind the proof, but I was thinking of a particular transformation, for which I don't see why it doesn't form a bijection.    Let's say we want to map all of the integers, to the real numbers between $[-1, 1]$. My transformation is created in such a way, that for every integer, I transform it into a mirrored number that is placed after a decimal.   For example:  $$0 \rightarrow 0.0$$ $$1 \rightarrow 0.1$$ $$2 \rightarrow 0.2$$ $$\vdots$$ $$100 \rightarrow 0.001$$ $$\vdots$$  It would seem to me that this is one to one, and every number between $[-1, 1]$ is hit. Even in the example of an irrational number, say $(\sqrt2 - 1)$, there is sum integer of infinite size that maps exactly to $(\sqrt2 - 1)$, because $(\sqrt2 - 1)$ can be written as a decimal made of up an infinite number of integer sitting behind a decimal point. It could be mapped as:  $$...73265312414 \rightarrow 0.41421356237...$$  Now, I'm assuming I was probably not the first person to think of this, so, why does this not work as a bijcetive mapping?


Email enabled document library in Office 365

I have requirement where users need to send document to SharePoint library by using an email id. please let me know is it possible to achieve. For On premise we can use email enabled libraries but i am not able to find option for SharePoint office 365. What are the alternatives we have in order to achieve this functionality


I'm coding a decryption service and wondering which is the best name, Decryptor or Decrypter I had a quick look online and it appears -er and -or convert a verb to an agent noun, however is one preferable over the other?  Interestingly my Mac tells me to use the latter.


Consider the following function:  $$S(n)=1+ c + c^2 + ··· + c^n,$$  where c is a positive real number.  (A) This function is the sum of a geometric series. Give a precise closed-form formula for $S(n)$, interms of $c$ and $n$, in the case where $c \neq 1$.  (B) Show that $S(n)$  is:  $\theta(1)$ if $c<1$  $ \theta(n)$ if $c=1$  $\theta(c^n)$ if $c>1$    can someone please explain how i can go about finding the solutions for these problems, i have never encountered these and am stuck, i know that big theta means that the function is bond on both sides but how do i got about finding the answer?  (edit) im still having trouble understanding part B. can someone please explain? (can someone walk me through the second one) so far i have $n \leq c^{n+1} \leq ???$  (edit #2) i tried doing the first one can someone verify if i did it right  $S(n)$ is $\Theta(1)$ if c<1  (1)$S(n)$ is $O(1)$ if c<1  (2)$S(n)$ is $\Omega(1)$ if c<1  (1) $$\frac{C^{n+1}-1}{C-1} \lt (C_1)(1)$$ $$\frac{C^{n+1}-1}{C-1} \lt (C_1)$$ $$C^{n+1} \lt C_1(C-1)$$ $$C^nC-1 \lt C_2C-1$$ $$C^n \lt C_2$$ $$C^n \lt 1$$ since c<1 this means that any number that will be $C^n$ will be less then 1 for all positive n  i did the omega part pretty much the same way and got $$C^n \gt C_2$$ $$C^n \gt 0$$ since c<1, $C^n$ can potentially become very very small so the only thing bounding it is 0 for all positive n


Query that converts a timestamp to a date

Is it possible to convert a timestamp to a date format in a query?  This is the code I am using.  $query = db_select('my_submissions', 's'); $query->fields('s', array('sid','name','company','email','phone','is_customer','submitted','count')); $entries = $query->execute();  $rows = array(); foreach ($entries as $entry) {   $row = array_map('check_plain', (array) $entry);   $row['submitted'] = $row['submitted'] ? date('d.m.Y H:i', $row['submitted']) : "";   $rows[] = $row; }


acrordrdc (wine) doesn't open files in /tmp dir

I installed acrordrdc via snap on Ubuntu 20.04 with Mate desktop manager. I found that acrordrdc can't open files in the /tmp directory. This is related with a previous question:  If I try acrordrdc /tmp/file.pdf  it doesn't work. Why? Can it be fixed?


I was just reading up on the Birth section of stat and it appears ext4 should support it, but even a file I just created leaves it empty.    ~  % touch test                                                       slave-iv  ~  % stat test.pl                                                     slave-iv   File: ‘test.pl’   Size: 173             Blocks: 8          IO Block: 4096   regular file Device: 903h/2307d      Inode: 41943086    Links: 1 Access: (0600/-rw-------)  Uid: ( 1000/xenoterracide)   Gid: (  100/   users) Access: 2012-09-22 18:22:16.924634497 -0500 Modify: 2012-09-22 18:22:16.924634497 -0500 Change: 2012-09-22 18:22:16.947967935 -0500  Birth: -   ~  % sudo tune2fs -l /dev/md3 | psp4                                  slave-iv tune2fs 1.42.5 (29-Jul-2012) Filesystem volume name:   home Last mounted on:          /home Filesystem UUID:          ab2e39fb-acdd-416a-9e10-b501498056de Filesystem magic number:  0xEF53 Filesystem revision #:    1 (dynamic) Filesystem features:      has_journal ext_attr resize_inode dir_index filetype needs_recovery extent flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize Filesystem flags:         signed_directory_hash  Default mount options:    journal_data Filesystem state:         clean Errors behavior:          Continue Filesystem OS type:       Linux Inode count:              59736064 Block count:              238920960 Reserved block count:     11946048 Free blocks:              34486248 Free inodes:              59610013 First block:              0 Block size:               4096 Fragment size:            4096 Reserved GDT blocks:      967 Blocks per group:         32768 Fragments per group:      32768 Inodes per group:         8192 Inode blocks per group:   512 RAID stride:              128 RAID stripe width:        256 Flex block group size:    16 Filesystem created:       Mon May 31 20:36:30 2010 Last mount time:          Sat Oct  6 11:01:01 2012 Last write time:          Sat Oct  6 11:01:01 2012 Mount count:              14 Maximum mount count:      34 Last checked:             Tue Jul 10 08:26:37 2012 Check interval:           15552000 (6 months) Next check after:         Sun Jan  6 07:26:37 2013 Lifetime writes:          7255 GB Reserved blocks uid:      0 (user root) Reserved blocks gid:      0 (group root) First inode:              11 Inode size:           256 Required extra isize:     28 Desired extra isize:      28 Journal inode:            8 First orphan inode:       55313243 Default directory hash:   half_md4 Directory Hash Seed:      442c66e8-8b67-4a8c-92a6-2e2d0c220044 Journal backup:           inode blocks   Why doesn't my ext4 partition populate this field?


Use (IIII) rather than (IV) in enumeration with roman numerals

Using the package enumitem I can edit my enumerations to use roman numerals, so that  \begin{enumerate}[label=\textsc{\textsc(\roman*)}] \item A \item B \item C \item D \end{enumerate}   yields the expected  (I) A (II) B (III) C (IV) D   but in computer modern with nice formatting bits. How can I change this so that (IV) becomes (IIII) instead?


How to draw box around text that contains a verbatim block?

Typically, to box in some text, I use the following:  \fbox {     \parbox{\linewidth}{     This is some text! Blah blah blah...     } }   However, say I have a verbatim block within that. It will never compile. Anyone know how I could draw a box around text which contains a verbatim block? I should note that I want to be able to draw a box around not just a verbatim block. For example, I would want to draw a box around something like:  This is text. \begin{verbatim} This is some more text. \end{verbatim} And this is even more text.


Let $A$ and $B$ be two events such that $P((A \space $U$ \space B)^c) = 0.6$ and $P(A \cap B) = 0.1$. Let $E$ be the event that either $A$ or $B$ but not both will occur. Find $P(E \mid A \space $U$ \space B)$. What I have tried: $P((A \space $U$\space B)^c) = 0.6 = 1-P(A \space $U$\space B) \space$. Therefore, $\space P(A \space $U$ \space B) = 0.4$. For either event $A$ or $B$ to occur and not both, we have $$E = P(A\cap B^c)\cup P(A^c\cap B)$$ So we now have: $$\begin{align} P(E \mid A\cup B) &= \frac{P((A\cap B^c)\cup (A^c\cap B))\cap P(A\cup B)}{P(A \cup B)} \\ &= \frac{P((A\cap B^c)\cup (A^c\cap B))\cap 0.4}{0.4} \end{align}$$ I'm not sure how to get $P(A)$ from $P(A^c\cap B)$ when $P(A^c\cap B) = P(A) - P(A\cap B)$.


If a measure only assumes values 0 or 1, is it a Dirac's delta?

Let $\mu$ be a probability measure on a metric space $M$ (with the Borel $\sigma$-algebra). If $\mu(A)\in \{0,1\}$ for all measurable set $A\subset M$, then:     Is it true that $\mu$ is a Dirac measure?   I think the answer should be negative, but I do not know of a counterexample. There is an answer  for the general case where we don't know anything about the topology (metrizable in our case). There you can see also that the result holds for all Polish spaces.


Was given the following infinite sum in class as a question, while we were talking about Taylor series expansions of $\ln(1+x)$ and $\arctan(x)$: $$1+\frac12-\frac23+\frac14+\frac15-\frac26+\cdots$$  The question isn't homework or anything, just a thought tease. I tried for a long while but couldn't find anything remotely close. Thanks in advance for the help.


Screen tearing in Xubuntu, no problem with Ubuntu

I have both Ubuntu 14.04 and Xubuntu 16.04 installed on one of my older desktops.  While both work fine, I experience screen tearing while dragging windows around in Xubuntu. However, I do not experience it on Ubuntu.  It is using the motherboard's built-in AMD graphics chip.  Note: This exact situation also holds true for my main desktop with a GTX650 graphics card...    At this point, I'm thinking it has something to do with Untiy being a 3D DE, and XFCE being a 2D DE...


I got the following email: Sandbox: Developer script exception from     ContactTrigger: System.LimitException: Too many futurecalls: 51   Important addition: I do not see that mentioned 50 calls were executed in my HTTP call's handler logs.  Indeed I do some future calls upon contact inserting/updating in the loop, but I don't see so many contacts created in bulk in our Salesforce instance. Actually at the time I received this letter no contacts were created at all.  Here is some code:      trigger ContactTrigger on Contact (after delete, after insert, after undelete, after update, before delete, before insert, before update) {      ...      if(tc.isAfter){         // call handler instance to meet new registration requirements         new ContactHelper().execute(tc);     } }   and the helper  public class ContactHelper extends GenericTrigger {      public override void execute(TriggerContext tc)     {         if (Test.isRunningTest()) {             return;         }         List<Contact> affectedContacts = tc.newList;         if (tc.isInsert) {             for (Contact contact: affectedContacts)             {                 if (!contact.Greylist__c) {                     updatePartnerPortal(contact.id, 'contact_inserted');                 }             }         }          if(tc.isUpdate) {             for (Contact contact: affectedContacts)             {                 if (contact.PersonID__c == null && !contact.Greylist__c) {                     updatePartnerPortal(contact.id, 'contact_updated');                 }             }         }     }      @future (callout=true)     public static void updatePartnerPortal(string contactId, string operationType)     {         // HTTP call     } }


What scriptable OCR Software exists on OSX for a paperless office

I'm planning to get a paperless office and for that, I a need good scriptable piece of OCR for OS X?  I've read a  by Marco Arment about a few programs. Are there any workable ones there that allow me to script things?


I'm trying to delete some unwanted data from my datastore with Java and found some code using the DatastoreService that I modified to delete as many entries as possible in 10 seconds:  DatastoreService datastore = DatastoreServiceFactory.getDatastoreService(); Query query = new Query("PostalCodes"); long starttime = (new Date()).getTime(); for (Entity entity : datastore.prepare(query).asIterable()) {         datastore.delete(entity.getKey());         if ((new Date().getTime()) > (starttime + 10000))                 break; }   It seems to work when I run this. I check the console's data viewer and the Kind I'm trying to delete ("PostalCodes") is gone, but the day after I do this, the whole thing has been restored. Am I missing a call to flush or commit or something?!?  Is there a better way to do this?


My /dev/md1 is full  # du -x -m --max-depth=1 | sort -n   shows  0   ./dev 0   ./proc 0   ./sys 1   ./home 1   ./lost+found 1   ./media 1   ./mnt 1   ./selinux 1   ./srv 1   ./tmp 4   ./lib32 6   ./bin 7   ./etc 13   ./boot 13   ./sbin 15   ./lib 236   ./root 1047   ./usr 5392   ./opt 11702   ./var 18431   .   There are files that have been deleted but open processes are still active. The result :  # lsof | grep 'deleted'   shows  mysqld     2881      mysql    4u      REG                9,1          0     393317 /tmp/ib16UZEE (deleted) mysqld     2881      mysql    5u      REG                9,1        798     393318 /tmp/ibqA5RvA (deleted) mysqld     2881      mysql    6u      REG                9,1          0     393319 /tmp/ibfXpKmw (deleted) mysqld     2881      mysql    7u      REG                9,1          0     393322 /tmp/ibcluSds (deleted) mysqld     2881      mysql   11u      REG                9,1          0     393323 /tmp/ib9jDsiu (deleted) python     4502      plone    5u      REG                9,1     453508     393757 /tmp/tmp2Npr1b.tbuf (deleted) python     4502      plone    6u      REG                9,1   20971520     393766 /tmp/tmps3e2Bl (deleted) python     4529      plone    5u      REG                9,1          0     393724 /tmp/tmpJoTgfW.tbuf (deleted) python     4529      plone    6u      REG                9,1   20971520     393762 /tmp/tmph-di8Z (deleted) imap       4744  mailboxes    7u      REG                9,2        496   21244100 /home/mail/noveltys.fr/contact/dovecot.index (deleted) imap       4759  mailboxes   10u      REG                9,2      37720   21244660 /home/mail/noveltys.fr/xxxxx/dovecot.index (deleted) python     5857      plone    7u      REG                9,1       2174     405341 /tmp/tmpCB3Rk1.tbuf (deleted) python     5857      plone   11u      REG                9,1  134217728     405343 /tmp/tmpqPyaAD (deleted) python     5857      plone   18u      REG                9,1       4096     405288 /tmp/ffi672jsh (deleted) python     5871      plone    7u      REG                9,1          0     405342 /tmp/tmpVSEquV.tbuf (deleted) python     5871      plone   11u      REG                9,1  134217728     405344 /tmp/tmpt7QsPV (deleted) python     5871      plone   18u      REG                9,1       4096     405287 /tmp/ffiqNqmsh (deleted) imap      25060  mailboxes    7u      REG                9,2     262576   21244694 /home/mail/noveltys.fr/yyyyy/dovecot.index (deleted)   If I delete these files does it diminish the size of / var ?  If yes, how to remove these and can I remove them ?  If not, you have another idea ?


Cannot save blend files - permission denied

I installed blender for the first time, so I have the latest version, 2.78c.  I played with it for a bit.  Then I discovered I couldn't save my work.  I uninstalled it and reinstalled it.  Rebooted.  Same problem.  After a little testing, I realized I CAN save to my NAS storage drive.  I cannot save on my C: drive.  Any project.  Any folder.  C: always fails.  If I run blender as Administrator, it will save to the C: drive.  But not as my normal userid.  So it sounds like a bug of some kind.  I am running Windows 10.  Bitdefender A/V.  I use OneDrive.  I have a 2TB drive installed.  All clean and purring nicely.  Is there a better way to install it?  Or some change I can make (other than always running as administrator)?    Sounds like a bug - but hopefully there's a proper solution.  Thanks,  Jerry


Here is a text from the book Complex Variables and Applications by Churchill :   I don't understand the last paragraph at all. Why $F(z)$ is not differentiable? What does this mean "So $C$ does not lie in any domain throughout which $F'(z) = 1/z$? and more important than anything Why multi-value of log results in its non-differentiability? meaning even if it is multi-value it's derivative exists and equal to $1/z$.  Simple clear explanation would be much appreciated.


Virtual box-not filling entire screen even after installing aditional files

I tried to full screen the ubuntu OS in vm box but even after installing additional files my screen had black background and it showed this error if i tried to install the additional file again. Please suggest me some solution so that i can run the ubuntu OS in fullscreen in the VM Box.


What's the fastest way to get n-th line of a text file

Given a file with m lines, how to get the n-th line. m can be smaller than n sometimes. I have tried:  method1: sed -ne '10p' file.txt method2: sed -ne '10p' <file.txt method3: sed -ne '10{p;q;}' file.txt method4: awk 'NR==10' file.txt   in LeetCode's . method1 beats others. I don't know why. I think method3 should be faster.   Are there faster ways?   Updates:  Following @skwllsp suggestion, I run some commands. The results are: instructions  instructions commands 428,160,537 perf stat sed -ne '10p' file.txt 427,426,310 perf stat sed -ne '10p' <file.txt 1,033,730   perf stat sed -ne '10{p;q;}' file.txt 1,111,502   perf stat awk 'NR == 10 { print ; exit ;} ' file.txt    method4 has changed according to @Archemar's answer  and   777,525 perf -stat tail -n +10 file.txt |head -n 1   which is much less than method1.


Don't accept comments during review audit

For the nth time this month, I've written a considered, thought-out comment to help guide the poster of an off-topic question to a more useful resource - only to find that after all my thought and typing it was simply a review audit, and no-one would benefit from that advice.  Please could selecting "add a comment" be made to pop up the "this is an audit" box, rather than waiting until I've written the comment?


How can we prove that there are no other integers with $\phi(n)=2$ besides 3,4,6?

Where $\phi(n)$ is Euler's phi function that counts the number of relatively prime integers less than or equal to n. I've been able to compute that 3,4,6 all have only 2 relatively prime integers less than or equal to them, however I'm unsure how to prove that there are indeed no others. While I am certain that this is the case, how can this be proved rigorously?


I disable SIP like this: reboot into recovery mode, run csrutil disable and then restart.  Great, now SIP is disabled.  But if my MacBook restarts again, it looks like it is enabled again.  How can I make subsequent restarts not change csrutil status?


Find a vector knowing his dot and cross product

I'm trying to get back to my graduation after a long time and i'm stuck on this problem using vectors: I want to find $\vec{x}$ knowing that $e = \vec{c}.\vec{x}$ and $\vec{v} = \vec{c} \times\vec{x}$. What is the best approach?


Perpetual machine from a PN-junction diode

Consider a PN junction diode  Now, this system will naturally form a depletion region due to diffusion and will convert into this-  Now, I wish to connect the ends of this diode with a conducting wire and resistance like this-  Thus, I expect the electric field in this space to be aligned as follows (Indicated din green)-  This will make the charges in the wire accumulate in the following way-  And finally, this system will end up neutralizing all the charges so that no electric field remains inside and outside the diode; creating equilibrium state for the free charges. So, we are going to be back on a simple p-n junction diode with no depletion region and no electric fields. However, this will again create a difference in electron concentration between n and p sides; these high-speed free electron will naturally flow from n-side to p-side creating an electric field which would later be balanced by the conducting wire. I thus expect this cycle to go on and on leading to continuous charge flow through the resistance. Overall, the diode will be taking up heat from the surroundings, while the resistance would be releasing heat there. Obviously I expect this analysis to be wrong, but I am not able to figure out where did I made any mistake?


Trigger to prevent duplication of records in Salesforce

I need to see an apex code of trigger, on say object 'Account' to prevent any new records from saving. Existing records do have duplicates but we cannot clean/ remove the data, as the requirement has come midway.  The unique feature applies to 2 fields say A(picklist) and B(text) of object Account, (concatenated) where A is a picklist, having values 1,2,3,4 where we need only values (TEXT) 1,2,3 of A to be unique alongside (concatenated with) text field B, and not the value 4.  Again, the requirement is to prevent any new records from saving which match any of the existing records. Duplicates within the existing records can be ignored.  Thanks in advance.


If $A$ and $B$ are similar, can the same be said of $A^t$ and $B^t$?   $A$ similar to $B$ $\iff \exists P$ such that  $A = PBP^{-1}$  Apply the transpose on both sides  $A^t = (PBP^{-1})^t = (P^{-1})^tB^tP^t = (P^t)^{-1}B^tP^t$  Can I conclude that they are similar?


The equivalence between Cauchy integral and Riemann integral for bounded functions

Definitions  Suppose $P\colon a=x_0<x_1<\dotsb<x_n=b$ is a partition of $[a,b]$. Let $\Delta x_k=x_k-x_{k-1}$ and $\lVert P\rVert$ denotes $\max_{0<k\le n}\Delta x_k$.  The Cauchy integral of a function $f$ on closed interval $[a,b]$ equals to $I$ if and only if for each $\epsilon>0$, there's some $\delta>0$, for each partition $P$ of $[a,b]$ such that $\lVert P\rVert<\delta$, we have $\left\lvert\sum_{k=1}^nf(x_k)\Delta x_k-I\right\rvert<\epsilon$.  Problem  If $f$ is bounded on $[a,b]$ whose Cauchy integral equals to $I$, then $f$ is Riemann-integrable and $\int_a^bf=I$.  Background  It's an exercise from our calculus(analysis) problemset book, and there's a hint: consider the partitions whose $x_k-x_{k-1}$ is a constant for different $k$'s, and try to estimate the Riemann sum for each of these partitions through the Cauchy integral.  I have no idea about such estimation. After drawing some pictures, I discouraged. I googled on the Internet and found an . I realized that it's a quite different approach and with some advanced techniques (such as the analysis of a positive measure set -- discontinuities). I hope there will be some simpler approachers, just as the hint says. I need a more detailed hint, or a solution. Can anybody help me? Thanks!


Should you contact seller's Realtor directly to buy a house?

I'm interested in buying a house as an investment property and am wondering if it's a faux pas to reach out to the seller's Realtor directly, as opposed to getting an agent of my own.  I could hire my own agent easily enough, but I'd hope that if I didn't have an agent, I could negotiate a lower sales price, because the seller would not have to pay commissions to my agent. (In my area, the seller's agent and buyer's agent both typically get 3 percent of the sales price, so if I don't have an agent, then the seller only has to lose 3 percent to Realtors rather than 6 percent.)  I'd be buying the house in cash, and have bought investment properties before without Realtors involved, so I don't have much need of my own agent's guidance anyway.  I know I can contact the seller's agent directly; there is nothing to stop me. But I'm wondering if this is normal, or if would make me look like I don't know what I'm doing. I'm in the United States, for what it's worth.


Move an off-screen window back on-screen on Mac OS X

It seems that Mac OS X 10.6.1 Snow Leopard has a tendency to leave some windows off-screen at times, especially when I disconnect an external monitor from my MacBook. How can I move the window back on-screen when it's not possible to grab the title bar and drag it back onto the screen?   recommends adjusting your screen resolution downward to have off-screen windows "snap back into view" and then adjust your screen resolution back to its original setting. In OS X 10.4 Tiger, I had a script that brought all off-screen windows back on-screen, but in my upgrades to Leopard and now Snow Leopard, I don't seem to have that script.  Any better solutions out there?


Installation of linux-image package fails

I get an issue installing Let's Encrypt.  Command : sudo ./certbot-auto  Issue :  Unpacking linux-image-3.16.0-70-generic (3.16.0-70.90~14.04.1) ... dpkg: error processing archive /var/cache/apt/archives/linux-image-3.16.0-70-generic_3.16.0-70.90~14.04.1_amd64.deb (--unpack): « ./boot/System.map-3.16.0-70-generic » to « /boot/System.map-3.16.0-70-generic.dpkg-new » : No space left on device Examining /etc/kernel/postrm.d . run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.16.0-70-generic /boot/vmlinuz-3.16.0-70-generic run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.16.0-70-generic /boot/vmlinuz-3.16.0-70-generic dpkg-deb : (Broken pipe) /var/cache/apt/archives/linux-image-3.16.0-77-generic_3.16.0-77.99~14.04.1_amd64.deb /var/cache/apt/archives/linux-image-3.16.0-70-generic_3.16.0-70.90~14.04.1_amd64.deb E: Sub-process /usr/bin/dpkg returned an error code (1)


How can I remove Ubuntu from the UEFI boot options?

I have a Gigabyte motherboard. GA-Z77X-UD3H to be specific.  I recently installed Ubuntu and deleted it again, but it still shows up on the UEFI boot option even if I removed all hard drives connected to the motherboard.   So NO hard drives, even CD/DVDs, USB drives connected and I still see the Ubuntu boot option. Any ideas/suggestions?


How did the big bang create space and time?

Does the big bang theory state that space and time originated after the bang? So, was the singularity was converted into the vast space plus time?


guys why is my blender model in both white and grey? I'm a noob, and I tried to find problems with the textures and materials, but seemingly the problem isn't there. Does anyone know why this is?


Which SE site closes the most questions?

My favorite SE site gets a lot of bad questions, and a large amount of them get closed, it got me wondering if there were other SE sites that get as many bad questions, or if my chosen favorite just attracts more than it's fair share of stinkers. Are there any analytics for keeping track of how many questions each SE site closes and deletes?


jquery: fade in div with same div class one by one?

i am trying to find a way of fading in multiple divs with the same div class one by one using jquery, can anyone please show me how to do this? so far all my divs fade it at once because they all have the same div class but i have seen this done before where multiple divs with the same class can be faded in one after the other/ one by one with a short 2 second delay?  the divs i am trying to fade in are called 'noti_box'

You have 11 New Messages

You have 11 New Notifications

6 Matters Needing Your Attention


How do I make Sublime Text 3 the default text editor

I'd like to replace gedit, and use Sublime Text 3 as my default text editor for all text files on my Ubuntu system. Can you let me know how do I go about making this change?


Probability of having picked every item from the set at least once after n turns, while picking 3 per turn

Let's say I have a set of 100 items. Each turn, I pick three items at random, note which ones I've picked, and put them back. What is the probability I've picked every item at least once after $n$ turns? The only statement I can make right now is that $n \geq \frac{100}{3}$ in order for the probability to be non-zero.


Drawing TikZ pictures step by step for beamer slides

I want to uncover/draw a picture bit by bit for beamer slides. I imagined that using \only inside a \foreach loop should work, for instance:  \documentclass{beamer} \usepackage{tikz}  \begin{document}   \begin{frame}     \begin{tikzpicture}[every node/.style={draw,circle}]       \node (n0) {$0$};       \foreach \i [evaluate=\i as \j using \i-1] in {1,...,3} {%         \only<\i->{%           \node[right of=n\j] (n\i) {$\i$};         }       }     \end{tikzpicture}   \end{frame} \end{document}   Unfortunately, two problems occur.   Something goes wrong with node names; I get errors of the form  Package pgf Error: No shape named n0.0 is known.  When using \j in the parameter of \only, I get hundreds of errors and pages.   What is going on here?


Alter the access of menu links before rendering

I need to alter the access of menu links before being rendered. In Drupal 7, we used hook_translated_menu_link_alter() for it. Drupal 8 change records show that there are no direct replacement for that hook.  Is there any other hook or controller to alter the access of the menu link before it is rendered?


YouTube embeds should be full-screenable

I hate not being able to full screen the YouTube videos embedded on Stack Exchange sites.  What's the reason for blocking full screen?  Please enable it...


question: $\int_0^\infty\frac{\sin^2x}{x^2}dx$ is equal to (A)$\int_0^\infty\frac{\sin x}{x}dx$ (B)$\int_0^\infty\frac{\cos x}{x}dx$ (C)$\int_0^\infty\frac{\cos^2x}{x^2}dx$ (D)None of the above  I tried splitting the integral as $$\int_0^\infty\frac{1-\cos^2x}{x^2}dx=\int_0^\infty\frac{1}{x^2}dx-\int_0^\infty\frac{\cos^2x}{x^2}dx$$ But for the first integrand, the function is not defined when $x=0$. Then I tried using $$\sin^2x=\frac{1-\cos 2x}{2}$$ but that did not work as well.


Why not reuse schoolbooks from older siblings?

In Harry Potter and the Chamber of Secrets, the Weasleys buy at least one second-hand schoolbook for Ginny:     "Busy time at the ministry, I hear," said Mr. Malfoy. "All those raids... I hope they're paying you overtime?"   He reached into Ginny's cauldron and extracted, from amid the glossy Lockhart books, a very old, very battered copy of A Beginner's Guide to Transfiguration.   Why buy books that Fred, George, and probably also Percy needed before? Why not just take those and reuse them, like happens in real life if siblings with a short age difference go to the same school?


How to Prove $ \sum \frac{\cos n} { \sqrt n}$ converges Using Abel’s theorem ?  I think it can be done using $\cos n = Re(e^{in})$ { Real Part of Complex Number }  How to proceed ?


Sufficient condition for square integrability

The necessary condition for $\int\limits_{-\infty}^{+\infty}|\psi(x)|^2dx$ to be integrable is that $\psi(x)\rightarrow 0$ as $x\rightarrow\pm\infty$. But this is not the sufficient condition. For example, $\delta(x)$ vanishes as $x\rightarrow \pm \infty$, but it is not square-integrable. What is the sufficient criterion for $\int\limits_{-\infty}^{+\infty}|\psi(x)|^2dx$ to converge? In the previous question $\psi(x)$ was an arbitrary function. If now $\psi(x,t)$ be an arbitrary solution (not necessarily a stationary state) of the time-dependent Schrodinger equation what is the sufficiency condition for $\int\limits_{-\infty}^{+\infty}|\psi(x,t)|^2dx$ to be finite? Does this conditions remain valid in three-dimensions?   EDIT: Can we have a continuous function $\psi(x)$ which does not go to zero as $x\rightarrow \pm\infty$ and yet the integral $\int\limits_{-\infty}^{+\infty}|\psi(x)|^2dx$ converges?


Generating a subgroup with two permutations

I have what appears to be a simple question but I do not know if my method is correct.  I have to find what the subgroup of $S_5$ generated by $(123)$ and $(12345)$ is.  So I have worked out that the product of the above permutations is $(52134)$ so now do I compute the 5th power of the product I calculated? Then somehow find out what subgroup that is?


Short sci-fi story with matter falling apart, from galaxies to atoms, Earth receives and tries to decipher extraterrestrial transmissions

The plot of this short story revolved in a future around dying universe. Some sort of physical law discovered at that time stated that at some moment forces keeping matter together will vanish, and anything, from galaxies to atoms will fall apart.  People living on Earth started to see how distant objects disappear, at the same time they received a lot of extraterrestrial transmissions that they tried to decipher.  I believe this story was written by an American author.


Recursive Lock (Mutex) vs Non-Recursive Lock (Mutex)

POSIX allows mutexes to be recursive. That means the same thread can lock the same mutex twice and won't deadlock. Of course it also needs to unlock it twice, otherwise no other thread can obtain the mutex. Not all systems supporting pthreads also support recursive mutexes, but if they want to be .  Other APIs (more high level APIs) also usually offer mutexes, often called Locks. Some systems/languages (e.g. Cocoa Objective-C) offer both, recursive and non recursive mutexes. Some languages also only offer one or the other one. E.g. in Java mutexes are always recursive (the same thread may twice "synchronize" on the same object). Depending on what other thread functionality they offer, not having recursive mutexes might be no problem, as they can easily be written yourself (I already implemented recursive mutexes myself on the basis of more simple mutex/condition operations).  What I don't really understand: What are non-recursive mutexes good for? Why would I want to have a thread deadlock if it locks the same mutex twice? Even high level languages that could avoid that (e.g. testing if this will deadlock and throwing an exception if it does) usually don't do that. They will let the thread deadlock instead.  Is this only for cases, where I accidentally lock it twice and only unlock it once and in case of a recursive mutex, it would be harder to find the problem, so instead I have it deadlock immediately to see where the incorrect lock appears? But couldn't I do the same with having a lock counter returned when unlocking and in a situation, where I'm sure I released the last lock and the counter is not zero, I can throw an exception or log the problem? Or is there any other, more useful use-case of non recursive mutexes that I fail to see? Or is it maybe just performance, as a non-recursive mutex can be slightly faster than a recursive one? However, I tested this and the difference is really not that big.


Why is the gravitational constant.. constant?

Many scientists have now come to the conclusion that a big bang might not explain the 'start' of the universe and are coming up with alternatives. Could it be that gravity is dependent on the expansion of the universe? Could it not increase as the expansion of the universe continues?   This would of course be true in reverse, as the the universe contracts to a near point, gravity becomes repulsive and causes 'a big bang'?  Is any of this plausible? I've been contemplating the universe for too long. Since our frames do not allow for measuring on a universe scale, perhaps we can't determine differences in the constant?


MacBook Pro battery not charging error - long term fix

I have a 2018 MacBook Pro 13 inch (the one without the touchbar). Over the past weeks, I have twice faced the situation where the charger is plugged in but the battery is draning and I get a "Battery not charging" message if I look at the Activity Monitor or hover over the battery icon. Resetting the SMC seems to fix the problem but it reappears after a few days. Should I continue resetting the SMC each time or try something else? The laptop has a third party warranty but I cannot leave my home due to the COVID lockdown.


Is it possible to call Batch from a future call?

I was wondering if it is possible to call a batch from a @future method? The reason I am asking as you may have guessed is because I am trying to call batches from a trigger. Eg: Leads are inserted then call batch after insert trigger on Leads.  I know it is possible to call Database.executeBatch, however there is a limitation to the number of batches you can send. With current FlexQueue implementation you can invoke up to 100 batch calls per a transaction.   But my question is what if I need to send more than that per a transaction?  I was thinking of calling a @future method and in that method I call the batch, but I get this error:      System.AsyncException: Database.executeBatch cannot be called from a   batch start, batch execute, or future method.   Pseudocode:  trigger leadTrigger on Lead(after insert) {      //some code      TriggerHelper.callTheBatch();  }   public without sharing class TriggerHelper {      @future      public static void callTheBatch() {          MyBatchClass myBatchClass1 = new MyBatchClass();          Id batchId = database.executebatch(myBatchClass1, 50);      }  }    Any suggestion or idea?


What is a word for making something seem not as bad as it actually is?

Some examples:   Instead of admitting that I'm an alcoholic, I just say I had one too many drinks. Instead of the bank admitting that it has lots of loans that are in arrears and are likely to default, it only says that it has underperforming loans. Instead of admitting that they overeat, they simply claim that they have a strong appetite.    Basically, I'm after a word for when a phrase is used that is not really a lie, but doesn't give the whole truth to make it sound more positive than it actually is. Usually when something should be dealt with, but it's kind of swept under the carpet by the misleading phrase.


Alpha not showing up in renders for textures painted with transparent png

I want to paint the fassade of my building with some leaves here and there. The file I'm using as a brush is a png with transparent parts. It's working fine in texture paint mode, but in renders it always displays the alpha as black. I created the picture which is painted on with transparent background though, so I'm not seeing why this is happening. Any clues?


Does cron impose some limitations to types of commands and privilege of execution?

I've experienced an issue where some of my scripts run perfectly fine when I call them manually, but these same scripts when called as cron jobs via cron don't seem to work at all.  So my question: I'd like to know if there are restrictions that apply with the use of commands and/or scripts (and the privilege of execution) in a script scheduled to run with cron?


: Solve the equation $\sqrt{\sin (x) - \sqrt{\sin(x) +\cos(x) }}=\cos(x)$


function make_withdraw(balance) {     return function(amount) {         if (balance >= amount) {             balance = balance - amount;             return balance;         } else {             return "Insufficient funds";         }     } }  var W1 = make_withdraw(100); W1(50); // 50 W1(60); // "Insufficient funds" W1(40); // 10       function w(amt){ var b= 100; if(b>=amt){b=b-amount;return b;}else{return alert("error!");}} w(10); //90 w(10); //90     Why by assigning balance the W1 function can keep track of balance, while w function cannot?


I do something error, I transfer yesterday all post from draft to publish by my user, Now how can i return all this post to draft ??


They vs it when talking about "your dog"

I have the following example from :  "Your dog gets some kind of reward when they bark. Otherwise, they wouldn't do it."  Should it actually be:  "Your dog gets some kind of reward when it barks. Otherwise, it wouldn't do it."  If the first example is actually correct, can you please tell me why. I thought when talking about a single thing, you should always say "it" as opposed to "they".


what is the problem with declaring a variable bounded by a parameter in the function itself rather than in the main function?

I have been trying to include the declaration of the variable in the function itself but it doesn't work unless I include it in the main function. Why does this happen?   #include<iostream> using namespace std;    function1(int x) { int x =1; cout << x << endl; return 0; }  int main () { function1( x); return 0; }`  `


Prove that $\lim \limits_{(x,y,z) \to (0,0,0)} \frac{{xyz}}{{x+y+z}}=0$

I have a strong feeling that the following limit is zero, can anybody help me prove it.    $ \lim\limits_{(x,y,z) \to (0,0,0)} \frac{{xyz}}{{x+y+z}}$   Thanks!


Some questions about String comparison(Java)

Why isn't this code working? Could you please give me some help?   I want to read 60 lines of words from the file,like"smell,", print all the values in the order, sorts the values, and prints the values again. I use compareTo as the selection sort algorithm for the String type. However, when I run the code, it shows as follow: " Exception in thread "main" java.lang.NullPointerException at practice.selectionSort(practice.java:36) at practice.main(practice.java:10)"   So what the problems of this code are? Thank you!!  import java.util.Scanner; import java.io.*; public class practice {    public static void main (String[] args) throws IOException    {       final int DATA_NUM = 60;        String[] array = new String[DATA_NUM];       readData(array);       selectionSort(array);       printData(array);     }     public static String[] readData(String[] array) throws IOException     {       String filename = "input.txt";       Scanner file = new Scanner(new File(filename));       int count = 0;       while(file.hasNext())       {          String newLine = file.nextLine();          array[count] = newLine;          count++;       }       for(int i = 0; i < array.length; i++)       {          System.out.println(array[i]);       }       return array;    }     public static String[] selectionSort(String[] array)    {       for(int x = 1; x < array.length; x++)       {          int s = x - 1;          for(int y = x; y < array.length; y++)          {             if(array[y].compareTo(array[s]) < 0)             {                s = y;                         }          }          String minValue = array[x-1];          array[x-1] = array[s];          array[s] = minValue;       }       return array;    }    public static String[] printData(String[] array)    {       for(int i = 0; i < array.length; i++)       {          System.out.println(array[i]);       }       return array;    } }


How to use MySQL stored procedures with PHP?

I have a database with millions of record and I have to search and show the records based on search key. I am using PHP to communicate with MySQL and I can do it in traditional way but it's not a optimized way to do that.  I want to this with MySQL procedures, is this a optimized way? If yes then how we can create procedure and how to use in PHP code? I am using this code to create:  DELIMITER $$ DROP PROCEDURE IF EXISTS `getExerciseForSearchKey` $$ CREATE PROCEDURE `getExerciseForSearchKey`(IN searchText varchar(255),OUT result varchar) BEGIN SELECT * FROM exercisetemplate WHERE key like '%searchKey%'; END $$  DELIMITER ;


Can $\sqrt{n} + \sqrt{m}$ be rational if neither $n,m$ are perfect squares?

Can the expression $\sqrt{n} + \sqrt{m}$ be rational if neither $n,m \in \mathbb{N}$ are perfect squares? It doesn't seem likely, the only way that could happen is if for example $\sqrt{m} = a-\sqrt{n}, \ \ a \in \mathbb{Q}$, which I don't think is possible, but how to show it?


I don't know why the regex patterns was not working ! I couldn't find any error ! But when i run this with wrong input it just skips the pattern test line and moves to the next page !  <!DOCTYPE html>       <title>Validation</title>             <form name="myform" action="number.php" onsubmit="return validate()">     Email:<input type="text" name="email"/>
     Password:<input type="text" name="pass"/>
     Phone:<input type="text" name="phno"/>
     <input type="submit" value="submit"/>     </form>     I expect the alert validation failed, if I give any input that mismatch the pattern.


Why does a sed command work interactively but not in my script?

SED command not replacing in bash under Debian, but works in command line.  Works in command line:   sed -i 's|/dev/disk/by-label/SR6D4|/dev/disk/by-label/SR4D4|g' /etc/my/config.xml   Not working in bash script, does not replace the string:  from="SR6D4" to="SR4D4" path_from="/dev/disk/by-label/${from}" path_to="/dev/disk/by-label/${to}" echo "sed -i 's|${path_from}|${path_to}|g' $file" sed -i 's|${path_from}|${path_to}|g' $file   Why doesn't replace string in file when using sed in bash?


Derivation of formula of potential energy by a conservative force

the formula for  by a conservative force is given by:  $$ F = -\nabla U(r), $$  which in one dimension may be simplified to:  $$ F = -\frac{dU}{dx} .$$  My question is how is it derived and why do we use a negative sign in the formula?. Is this by definition or is there some other reason?


how can I update ubuntu v12.04 to v13.04 without using a internet connection?

I have ubuntu 12.04 and I want to update to 13.04, but without downloading it from the website. How can I do it ?


C#: format a datetime to ISO format. "scheduledDateTime":"2015-04-09T01:00:00.000-0400" for EST

I have a "scheduledDateTime" in datetime that I need to format into this ISO format for submission to do XYZ.   "2015-04-09T01:00:00.000-0400" for EST (server is in EST zone)  1) have time in server time and want to change to the above format.  Many examples answer every question but this.


DG31PR intel board with 1GB RAM, can I add 2GB RAM with existing 1 GB?

I have a PC with below mentioned configuration     DG31PR intel board  Core 2 Duo Processor  Transend DD2 667 1 GB JetRam , JM667QLJ-1G, 240P DDR2 DIMM (128M*64) (64Mx8 DDR2 667 5-5-5) [LM]    I am planing to upgrade the RAM to increase the performance/Speed...  I searched for the Transend RAM with same series JM667QLJ-2G, but not found in flipkart/amazon. Only JM667QLU-2G available will it support my DG31PR intel board ?  Can I use it with existing 1GB Ram + 2 GB RAM (my board supports MAX 4GB, 2 Slots) ?  Please share your views...  Thanks for your time... -SVNindia


When can likelihood be interpreted as probability function?

I'm interested in  likelihood $L(\theta | x) = P( x | \theta)$ seen as the function of $\theta$ for a given $x$.  I have been reading in books and other posts that $L$ is generally not a probability function (with respect to $\theta$) because it may not integrate to 1 and, moreover, there my be even no $\sigma$-field defined over the $\theta$ space.  In the Bayesian approach, we define a prior probability $P(\theta)$ and so the $\sigma$-field had to be defined.  What other properties we need to be able to interpret $L(\theta|x)$ as the conditional probability $P(\theta|x)$? Perhaps normalization to integrate to 1? What else? (whuber mentions some regularity conditions in this post . What would these be?)  EDIT  After some searching, I believe the answer is in Fisher's fiducial distribution. See Casella&Berger(2002, sec. 6.3.1), the original Fisher's papers (1933,1935) or this question:   EDIT2  Now that I know the key-word is fiducial, there is a fairly good explanation in the answer to this question:


Converting in batch into 8 unsigned bit format using GDAL?

Could you please correct my batch command?   I had 100 img images which need to be converted into 8 unsigned bit format for further use in TIMESAT.   mkdir test for %%f in (*.img) do gdal_translate -of ENVI -scale -1 1 1 255 -a_nodata 0 -co INTERLEAVE=BSQ "%%f" test/%%f.dat


Why can't we initialize members inside a structure?

Why can't we initialize members inside a structure ?  example:  struct s {    int i = 10; };


I am building a plasma speaker using a 555 timer to generate the audio tone.  I am driving a mosfet with the output of the 555 timer, which in turn powers a flyback transformer to generate a plasma arc.  I have heard conflicting information about putting a resistor in between the 555 and mosfet.  I have heard that the resistor prevents over drawing current from the 555 timer.  On the other hand, I have heard that a resistor keeps the mosfet in a transition state for a long time causing the mosfet to dissipate additional energy as heat.  My mosfet is an IRFP460.  Should a resistor connect the 555 to the mosfet?


show if $n=4k+3$ is a prime and ${a^2+b^2} \equiv 0 \pmod n$ , then $a \equiv b \equiv 0 \pmod n$

$n = 4k + 3 $  We start by letting $a \not\equiv 0\pmod n$ $\Rightarrow$ $a \equiv k\pmod n$ .  $\Rightarrow$ $a^{4k+2} \equiv 1\pmod n$  Now, I know that the contradiction will arrive from the fact that if we can show $a^2 \equiv 1 \pmod n $ then we can say $b^2 \equiv -1 \pmod n $ then it is not possible since solution exists only for $n=4k_2+1 $ so $a \equiv b\equiv 0 \pmod n $  So from the fact that $a^{2^{2k+1}} \equiv 1 \pmod n$ I have to conclude something.


Renaming many files to their parent directory name

I want to recursively change many files named raw.tex to parent-directory-hw.tex. Is there a simple scripting solution to this problem?  For example, running the script on  . `-- root     |-- baz     |   `-- raw.tex     |-- foo     |   `-- bar     |       `-- raw.tex     `-- spam         |-- eggs         |   `-- raw.tex         `-- raw.tex   should result in  . `-- root     |-- baz     |   `-- baz-hw.tex     |-- foo     |   `-- bar     |       `-- bar-hw.tex     `-- spam         |-- eggs         |   `-- eggs-hw.tex         `-- spam-hw.tex


I'm trying to find an exact match in an array. I have my array array with a single object, and an exact match stored in example. When I iterate over the array array, it goes right past it. I discovered this when working with a much larger array, but broke it down to a single 1/1 relationship for a sort of 'proof of concept'. I feel like the answer is simple and staring right at me, but I don't see it. Save me.  'use strict';  var array = [ { foo: 'hello', bar: 'foo' } ];  var example = { foo: 'hello', bar: 'foo' };  for (var i = 0; i < array.length; i++) {   if ( array[i] === example ) {     console.log(array[i]);   } }


As per the Harry Potter books (1-5) we know that Sirius Black was on the run from the Ministry of Magic for the supposed killings of twelve muggles and one wizard by the name of Peter Pettigrew. Many muggles declared that they have witnessed this, thus the Ministry of Magic have been trying to capture Black. Prior to Harry Potter and the Prisoner of Azkaban, Sirius was already on the run for twelve years. After then, he has either been hiding or at Number Twelve Grimmauld Place. In Harry Potter and the Order of the Phoenix, Black was executed by none other than Bellatrix Lestrange. Up to this point, the Ministry was after him.  Was the Black name ever vindicated before or after this incident?


Embedding a PDF file with clickable external links into a LaTeX document

I want to embed a screenshot of a web page into a LaTeX document as a vector graphic with clickable links.  I'm using  to render the web page as a letter-sized pdf file with working links.  Then, I'm using this command to crop the pdf file while retaining the links:  gs -sDEVICE=pdfwrite -o "screenshot_cropped.pdf" -c "[/CropBox [`gs -sDEVICE=bbox -dBATCH -dNOPAUSE "screenshot.pdf" 2>&1 | awk '/HiRes/ { print $2,$3,$4,$5 }'`] /PAGES pdfmark" -f "screenshot.pdf"   (Commands taken from ; I can't use , since it apparently removes the links)  Finally, I'm embedding the file into my LaTeX document with the following:  \includegraphics[width=6 in]{screenshot_cropped.pdf}   Unfortunately, the links no longer work in the resulting pdf file.  How can I fix this?  I'm using XeLaTeX if it matters.


How to enable Onboard Graphics for a GIGABYTE B450 PRO

Today I ran into a problem with setting up my 2nd screeen. After searching I figured out that the onboard graphics has to be enabled in the BIOS (it is not showing up in device manager).  Using control + F1 in the BIOS won't show any new options and there is nothing saying PCIe or VGA ord Display settings.   Does anyone knows what it is called and where exactly it is located? I'm using a GIGABYTE AORUS B450 PRO updated with the latest drivers.


How to move Windows from one hard drive to another?

I have a desktop PC with multiple SATA ports on the Motherboard, two USB drives, two SATA cables and two (internal) hard drives:   1x 250 GB SATA HDD, contains C: with Windows installed. 1x 500 GB SATA HDD, empty.   I want to move Windows from the smaller to the bigger hard drive to utilize the additional space.  The data on C: is not critical, I'm willing to go without a backup.  Ideally the process would not require additional devices and would involve open source software only.


Blocking of infrared radiation from the sun by $\rm CO_2$

Why is the infrared heat from the sun not prevented from entering the earth's atmosphere by $\rm CO_2$ to the same extent that it is prevented from leaving the Earth's atmosphere?


Proving that ${-1 \leq \operatorname{Corr}(X,Y) \leq 1}$

To prove that $-1\leq \operatorname{Corr}(X,Y) \leq 1$    , I am using the identity $\operatorname{Var}(\frac{X}{\sqrt{\operatorname{Var}(x)}}-\frac{Y}{\sqrt{\operatorname{Var}(Y)}})\geq 0$. Where does this identity come from? How do I prove it?


Prove the following sequence is convergent: $a(1) = 1$ and $a(n+1) = 1/2 \cdot (a(n) + 3/a(n))$

I know the limit is $\sqrt 3$. And I tried proving that the sequence is decreasing from $a(2)$, yet when I got to this point, I have been stuck: $a(n+1) - a(n) = (3 - a(n)^2) / 2a(n)$ ? Thank you very much!


How can I upsert a homogeneous List, in a good way?

I have some abstracted code, which at the end of some process will create a homogeneous list of SObjects.    It could be a list of Accounts, it could be a list of contacts, it could be a list of some custom SObject.  It doesn't matter, every record in the list will be an instance of the same type of SObject.  upsert resultSObjectList   I can't simply do an because it results in:     System.TypeException: DML on generic List only allowed for insert, update or delete   If I send the list back to whatever method called my abstraction and then try to cast it back into whatever type it should be, e.g.:  List<Account> accountList = (List<Account>) resultSObjectList; upsert accountList;   It still results in:     System.TypeException: DML on generic List only allowed for insert, update or delete   I can make this work with:  List<Account> accountList = new List<Account>(); for (SObject sObj : resultSObjectList) {     accountList.add((Account) sObj); } upsert accountList;   But that is ugly and I will need to make a similar implementation for every consumer of my process.  Likewise, I'd prefer not to create two separate lists (for insert and for update) and then do two separate DML operations.  Any ideas?


Is the impact of throwing and catching exception big?

I need to have a validation function, boolean isFloat(String) , to check if a given string can be directly converted to an integer. There are at least two approaches on base of :   in plain Java:  isFloat(String f) {   if (strNum == null) {     return false;   }   try {     Float.parseFloat(strNum);   } catch (NumberFormatException nfe) {     return false;   }   return true; }  in regular expression, hereby I don't list the code   The first approach is more strict forward and easy to understand, whereas one of my colleagues said throwing exception might the whole stack trace, which might affect performance when happening frequently. The second approach might be error-prone as we always need to think about how the expression is formed.  Question: Is the impract of throwing and catching the whole stack trace of an exception really that big?


Very simply, what is tail-call optimization?  More specifically, what are some small code snippets where it could be applied, and where not, with an explanation of why?


Fantasy story series about a boy from a village who has adventures around the world

I remember reading this as a kid and it starts out with:   a boy in his home village where the other kids are mean to him during sports and they heat up their home with floating logs or something.   The kid is being hunted by some reaper character and that reaper finds him at a place called "The Edge" or something similar.   He buys a glove covered in an expensive dust that purifies things and is really rare.  In one book they had to climb down the edge for some reason.  There was another part where people only communicated telepathically and when sneaking into somewhere he only thought of light.  One of the main things is the floating ships and how he is really good at flying them and he assembles a team for a mission or something.  There is like float powder and stuff.  I read this close to 10 years ago.


I am doing a project where we are attempting to determine how many more buildings would flood if the FEMA flood plain increased by 1',2' and 5'. I have the elev of the flood plain rasters from lidar data, but I am having trouble figuring out how much more area will be inundated by the rises I described earlier. I'm using raster calc and I have a buffer for the flood plain that also has elevation data. Any thoughts?


Which is the easiest way to evaluate $\int \limits_{0}^{\pi/2} (\sqrt{\tan x} +\sqrt{\cot x})$?   I have reduced this problem to $$   2\int_0^{\pi/2} \sqrt{\tan x} \ dx$$  but now, evaluating this integral is giving me some problems, simply substituting $u=\tan(x)$ and then $\mathrm{d}u=\sec^2(x)\mathrm{d}x \Rightarrow \frac{\mathrm{d}u}{1+u^2}=\mathrm{d}x$ and which in turn gives something a bit ugly, I was wondering which is the most elegant way to evaluate this?


\documentclass[12pt, UTF8]{ctexart} %\documentclass[12pt, UTF8, scheme = plain]{ctexart} %\documentclass[12pt, UTF8]{article}  \begin{document}  This is \textit{a test}.  \end{document}  \textit{} stopped working in ctex package after recent update? It looks like normal texts instead of in _italic_....


Why does dispatch_once only get called for the first instance of class?

In my UITableViewCell subclass, I have the following code:  -(void)updateConstraints {        static dispatch_once_t once;     dispatch_once(&once, ^ {     // Set constraints here     });      [super updateConstraints]; }   The constraints are only set for the first instance of the custom cell class. I don't really understand what's happening with the static token. I was under the impression that it is an instance-specific variable, but apparently it is class-scoped. Can anyone explain this?


NullPointerException in ExpandableListView for Child Items

Am getting NullPointerException When I click on parent item. Can you please suggest for this reason by seeing my code.I am not getting anything next step what I have to take for this mistake.Try to suggest me by seeing my code.The screen shot of logcat also I posted here.  Thanks in Advance.    public class ExpandListAdapter extends BaseExpandableListAdapter {  private Context context; private ArrayList<Group> groups;  ImageLoader imageLoader = MyApplication.getInstance().getImageLoader();  public ExpandListAdapter(Context context, ArrayList<Group> groups) {     this.context = context;     this.groups = groups; }  @Override public Object getChild(int groupPosition, int childPosition) {     ArrayList<Child> chList = groups.get(groupPosition).getItems();     return chList.get(childPosition); }  @Override public long getChildId(int groupPosition, int childPosition) {     return childPosition; }  @Override public View getChildView(int groupPosition, int childPosition,                          boolean isLastChild, View convertView, ViewGroup parent) {      Child child = (Child) getChild(groupPosition, childPosition);     if (convertView == null) {         LayoutInflater infalInflater = (LayoutInflater) context                 .getSystemService(context.LAYOUT_INFLATER_SERVICE);         convertView = infalInflater.inflate(R.layout.child_item, null);     }      if (imageLoader == null)         imageLoader = MyApplication.getInstance().getImageLoader();      TextView tv = (TextView) convertView.findViewById(R.id.country_name);     NetworkImageView iv = (NetworkImageView) convertView             .findViewById(R.id.flag);      tv.setText(child.getName().toString());     iv.setImageUrl(String.valueOf(child.getImage()), imageLoader);      return convertView; }  @Override public int getChildrenCount(int groupPosition) {     ArrayList<Child> chList = groups.get(groupPosition).getItems();     return chList.size(); }  @Override public Object getGroup(int groupPosition) {     return groups.get(groupPosition); }  @Override public int getGroupCount() {     return groups.size(); }  @Override public long getGroupId(int groupPosition) {     return groupPosition; }  @Override public View getGroupView(int groupPosition, boolean isExpanded,                          View convertView, ViewGroup parent) {     Group group = (Group) getGroup(groupPosition);     if (convertView == null) {         LayoutInflater inf = (LayoutInflater) context                 .getSystemService(context.LAYOUT_INFLATER_SERVICE);         convertView = inf.inflate(R.layout.group_item, null);     }     TextView tv = (TextView) convertView.findViewById(R.id.group_name);     tv.setText(group.getName());     return convertView; }  @Override public boolean hasStableIds() {     return true; }  @Override public boolean isChildSelectable(int groupPosition, int childPosition) {     return true; }   }  XML File:  <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingTop="4dp" android:paddingBottom="4dp" android:layout_marginLeft="50dp">  <TextView     android:id="@+id/name"     android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:layout_alignBottom="@+id/flag"     android:layout_marginBottom="14dp"     android:layout_marginLeft="29dp"     android:layout_toRightOf="@+id/flag"     android:text="TextView"     android:textSize="20dp" />  <com.android.volley.toolbox.NetworkImageView     android:id="@+id/flag"     android:layout_width="70dp"     android:layout_height="40dp"     android:layout_alignParentLeft="true"     android:layout_alignParentTop="true"     android:layout_marginLeft="27dp"     android:src="@drawable/ic_launcher" />


In the book class, footnote numbering restarts with each new chapter. Is there a way I can have all footnotes numbered sequentially regardless of which chapter they appear in?  MWE:  \documentclass{book} \title{The Book} \author{The Author} \begin{document} \maketitle  \chapter{Chapter One}  Here is some text.\footnote{And here is a footnote.}  \chapter{Chapter Two}  Here is some more text.\footnote{And here is another footnote.} \end{document}   The second footnote should carry the number "2," not the number "1."


RSA: Private key calculated from public key?

The wiki article on RSA () says that d is "the modular multiplicative inverse of e (mod φ(n))" , where d is the private key and e and n make up the public key. How come an interceptor cannot calculate the d in the exact same manor as the encrypter does, if the interceptor has knowledge of e and n?


How to fix full boot partition with unmet dependencies

My Ubuntu instance will do security updates until boot partition is full and from then on kernel updates will fail.  When boot is full it is also not possible to remove older kernels because there are unmet dependencies. Apt will not allow those unmet dependencies to exist. As shown below, I cannot purge 138 because of unmet dependencies but I also cannot install 138 because the disk is full.  I suppose at this point I have edit dependencies manually. Bypassing Apt. How can I fix this issue? Without completely reinstalling Ubuntu?  [user@mysystem:~] $ sudo apt-get purge linux-image-extra-4.4.0-138-generic linux-image-4.4.0-138-generic  Reading package lists... Done Building dependency tree        Reading state information... Done Package 'linux-image-4.4.0-138-generic' is not installed, so not removed You might want to run 'apt-get -f install' to correct these: The following packages have unmet dependencies:  linux-image-generic : Depends: linux-image-4.4.0-138-generic but it is not going to be installed                        Depends: linux-image-extra-4.4.0-138-generic but it is not going to be installed                        Recommends: thermald but it is not going to be installed E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).   I tried the suggestion in . I used commands like  sudo dpkg --force-all -P linux-image-3.13.0-32-generic   This does free up space. But if I run   sudo apt-get autoremove --purge -f   Those kernels will be downloaded and installed again. Untill boot is again full. So autoremove and purge in the last command is a bit misleading to say the least.   At this point I think the only way to really fix this is to increase boot partition. It seems small with only given the way that Ubuntu updates kernels. It should be a lot larger default size with ample warnings.


How to show Google Review in Google Search Result?

Any one know how to do this? What I mean is Review box at the right hand side:


What happens when there is a quotation within a quotation within another quotation?

For example: Kevin said to Ms.Russell: "Sam was mocking Dave by saying 'My name is Dave!? I'm so smart!?'"  *note that the question marks are what I'm wondering what I would put there   **note that Kevin is speaking


What possible characteristics may a local commutative unital ring have?  We define the characteristic of a commutative unital ring $R$ in the following way: there is a unique ring homomorphism $\phi: \mathbb{Z} \to R$ defined as $\phi(n)=n \cdot 1$. Since $\mathbb{Z}$ is a PID, $\mathrm{ker}(\phi)$ is a principal ideal. If $\text{ker}(\phi)=c\mathbb{Z}$, then we'll say that the characteristic of $R$ is $c$.   We can prove that the characteristic of a domain is either $0$ or a prime $p$. But how do we classify the characteristic of a local ring $R$ with max ideal $\mathfrak{m}$?


Page number appears in the middle of page on every new chapter

I currently use Latex for a simple paper that's based on the extbook class. My source code looks like this: \documentclass[10pt, twoside]{extbook} \usepackage[german]{babel} \usepackage{blindtext} \setlength{\parindent}{0pt} \usepackage[paperheight = 18cm, paperwidth = 11.5cm, outer=1.5cm, inner = 1.5cm, top = 1.3cm, bottom=2cm]{geometry} \usepackage{titlesec} \titleformat{\chapter}[display]   {\normalfont\huge\bfseries}{{\chaptertitlename\ \thechapter}}{20pt}{\large} \usepackage{fancyhdr} \fancypagestyle{wholeBook}{ \fancyhf{} \renewcommand{\headrulewidth}{0pt} \fancyfoot[RO, LE]{\thepage} \fancyfoot[C]{}  }  \pagestyle{wholeBook} \begin{document} \sloppy \input{Chapters/Chapter1.tex} \input{Chapters/Chapter2.tex} ... etc \end{document}  This is meant to produce a page number on the left side of every even page and on the right of every odd page. Oddly enough, it produces unexpected output: For every first page of a chapter, the page number appears in the middle of the page. I don't want this, yet I have no clue how to disable it. Does anybody here have a solution?


Given six numbers $x,y,z,a,b,c$ which satisfy the following relations. Express $x+y+z$ in terms of $a,b,c$

Given six numbers $x,y,z,a,b,c$ which satisfy the following relations $y^2+yz+z^2=a^2$ $z^2+zx+x^2=b^2$ $x^2+xy+y^2=c^2$ Express $x+y+z$ in terms of $a,b,c$    My attempt: $\dfrac{(y^3-z^3)}{(y-z)}=a^2,\dfrac{(z^3-x^3)}{(z-x)}=b^2,\dfrac{(x^3-y^3)}{(x-y)}=c^2$ But this step didn't seem to help. So I tried adding and expressing $k(a+b+c)^2$ but some other unmanagable elements came along. I could not think of any other way to approach the problem. Please help.


Suppose I have 20 mice. I pair the mice in some way, so that I get 10 pairs. For the purpose of this question, it could be a random pairing, OR it could be a sensible pairing, like trying to pair mice from the same litter, of the same sex, with similar weight, OR it could be a deliberately stupid pairing like trying to pair mice with weights as unequal as they could possibly be. I then use random numbers to assign one mouse in each pair to the control group and the other mouse to the to-be-treated group. I now do the experiment, treating only the to-be-treated mice, but otherwise paying no attention whatsoever to the arrangements just made.  When one comes to analyze the results, one could either use unpaired t-testing or paired t-testing. In what way, if any, will the answers differ? (I'm basically interested in systematic differences of any statistical parameter that needs to be estimated.)  The reason I ask this is that a paper I was recently involved with was criticized by a biologist for using a paired t-test rather than an unpaired t-test. Of course, in the actual experiment, the situation was not as extreme as the situation I've sketched, and there were, in my opinion, good reasons for pairing. But the biologist didn't agree.  It seems to me that it's not possible to incorrectly improve statistical significance (decrease p-value), in the circumstances I sketched, by using a paired t-test, rather than an unpaired test, even if it is inappropriate to pair. It could however worsen statistical significance if mice were badly paired. Is this right?


Soo, I think I accidentally pressed something and I don't know how to fix that. The thing is that keyframes in the timeline are know hidden behind the numbers    The animation still works, I can add new keyframes, but I cannot select any of them as they're hidden... does anyone know how to get back to default settings?


Difference between capacity and output current rating

I'm linking to this example, but all battery packs i see on Ebay and Aliexpress are like this.  Capacity is rated 20Ah yet output current is 1-2A. No where do they mention time rate. Are we to assume they mean 20Ah / 10h, that is, 2A for 10h? Shouldn't such battery pack be able to provide more than 1-2A?? I mean, even tiny AAA can provide 0.5-1A for an hour, and this massive battery pack can do no more? They even put discharge protection so it can definitely output only few amps, this one for example, has discharge protection set at 4.5A, yet capacity is 12.4Ah.  What's the catch. And what about individual batteries like this, are these really 2.2Ah or is that too false. Aren't battery packs made of batteries like this. They are. So if each can output 1 or 2 A in parallel they should give much more.


What is the proper use of the apostrophe in this phrase:     The party is at the Johnsons's   Assuming, the regular form of the last name is "Johnson" and there are at least two people in the Johnson family.  I assume it should be possessive because it is implied that it is referring to their house.  What would the correct form be for a last name ending in an S in its singular form?


There are $n$ types of balls in an urn; $a$ balls of type $1$ , $b$ balls of type $2$ , $c$ balls of type $3$ and so on. Now balls are drawn until a ball of type $1$ is obtained with condition that if a ball of type $i$ is drawn at any moment ( $i \neq 1$ ) then all balls of type $i$ will be removed from the urn. What is the expected number of draws done? (In one draw, all balls of that particular type are removed)  My approach for $n = 3$ is like:  expectation value = $a/(a+b+c)+2(ba/(a+b+c)(a+c)+ca/(a+b+c)(a+b))+3(bca/(a+b+c)(a+c)a+cba/(a+b+c)(a+b)a)$  But it's messy , is there any general form for n type of balls ?


What experiment would disprove Friedmann model of cosmology?

What experiment would disprove  of cosmology?  As a layman, I have read a lot of articles and threads in specialized forums. I am probably wrong, but I developed an impression that that theory is circular, 99.9% self- referential. The only hard experimental datum seems to be the redshift, and then most other parameters, distance, luminosity, age, scale factor, expansion rate, etc. are model-dependent and therefore confirm the theory,  a) - what are the other hard facts at the bottom of the theory, if any?  If I am not wrong, the prerequisite of a scientific theory is that it can be disproved.  b) - how do you disprove that redshift is determined by stretching of space,   c) - how do you disprove that space can expand and that just a metric devised by a theorist can make it expand?     spacetime is not an object expanding like some rubber foam. It's a combination of a manifold and metric. The expansion means the metric is time dependant, and this is explained by the requirement that the metric be a solution to Einstein's equation.


When I do the two tailed t-test using a sample less than 30, can I use this result? This is because I do also still see the t-test table which has degrees of freedom far less than 30. How further small can the sample size be?


Why the dark objects won't be differenced from the base object?

I made the objects by creating a cube in Object mode, going into Edit mode, deleting the vertices, clicking shift+LMB new vertices, making a face and extruding.   On the light colored objects, I can add a Boolean modifier and set it to Difference, and it would make a hole in the base object the shape of the new object. However, inspite of these dark objects were made the same way as the lighter ones, when I try to apply a Boolean modifier, it deletes the base object.


having trouble installing ubuntu studio 13.04

I am currently trying to install Ubuntu Studio 13.04 along side Windows 7.  When I boot into the USB stick, I make the proper selections and it reboots.  When I boot into Windows 7 and open wubi.exe, I am given a choice to run demo or learn more (I don't get the screen that allows you to select drive size and what not). It says that I can install from the demo, so i make the proper selection, then it reboots.  How can I overcome this and install Ubuntu Studio?


Does time really exist? or is it a human invention and convention? What is the truth? are there time particles? please remember, I'm looking for constructive answers, not condescending and void ones.


Suppose we have ARIMA(2,3,2) in a study. How to write the final formula for this model? The parameters are: AR1 and AR2 for auto-regressive part, MA1 and MA2 for the moving average part. Most of similar posts in this platform, are hard to understand by beginner. For example, I have been addressed to this , but it is somehow complicated, too. So I decided to create this post to keep it simple as possible for future references.


I get the error: "Latex error: File not found. " eventhough the file is .png and it is in the correct folder

I want to include a .png file that is called Screenshot 1 and is in folder Screenshotsforassignment, but typing \includegraphics{Screenshot 1} gives me the error:   LaTex Error: File 'Screenshot 1' not found.   Does anybody know how to fix this?  Edit: I solved it!


If statement is not checking the condition even though both types are of String - (codesignal Challenge)

I am currently doing a coding challenge at codesignal, challenge name is  commonCharacterCount, I have kind of made the logic below , but after troubleshooting for some time I can see the if statement is not running at all, I am not sure what the reason behind as both the typesS1Array[x]and  S2Array[i] are of String. Any hint on this please , what I am missing here. int commonCharacterCount(String s1, String s2) {          String[] S1Array= s1.split("");     String[] S2Array= s2.split("");          int count=0;       for(int x=0;x<S1Array.length;x++){           // S2ArrayCopy is to check if the S2Array's array element is already been checked using 1 and 0, if 1 then count will not be updated as already checked             int[] S2ArrayCopy= new int[S2Array.length ] ;             Arrays.fill(S2ArrayCopy,0);           for(int i=0;i<S2Array.length;i++){                                                                     if(S1Array[x] == S2Array[i] && S2ArrayCopy[i] != 1 ){                                                  count++;                                 S2ArrayCopy[i]=1;                                  break;             }                                                }                       }


Can I visit London with a US visit visa during a 11 hours lay over at LHR?

I hold an Indian passport and I am flying to Seattle, US from Bangalore, India via LHR, London and the layover is 11 hours. Can I visit London with the US visit visa I have (this is accepted in many countries I heard)?  Do British Airways provide any help in this kind of situation either to visit or stay comfy at airport?


AIX-Need to add lines after identifying the Pattern in the file using Non-GNU - Sed

I have the following file:  export TMOUT  PS1="$(hostname):${LOGNAME}:\${PWD} ${PROMPT} " PS1="${FGOLD}$(hostname):${LOGNAME}:\${PWD} ${PROMPT} ${NORMAL}"   PS1=abd   PS1="$(hostname):$LOGNAME:\$PWD $PROMPT "   export PS1 LANG   I need to add the line below under the line matching export TMOUT:  FGOLD=`echo "\033[1;32m"`       So, the final output should look like this:  export TMOUT   FGOLD=`echo "\033[1;32m"`      PS1="$(hostname):${LOGNAME}:\${PWD} ${PROMPT} " PS1="${FGOLD}$(hostname):${LOGNAME}:\${PWD} ${PROMPT} ${NORMAL}"   PS1=abd   PS1="$(hostname):$LOGNAME:\$PWD $PROMPT "   export PS1 LANG   The command below is not working:  sed 's/.*export.*\TMOUT./&\FGOLD=`echo "\033[1;32m"`/' pro   outputs:  export TMOUT    PS1="$(hostname):${LOGNAME}:\${PWD} ${PROMPT} " PS1="${FGOLD}$(hostname):${LOGNAME}:\${PWD} ${PROMPT} ${NORMAL}" PS1=abd PS1="$(hostname):$LOGNAME:\$PWD $PROMPT " export PS1 LANG


Is it possible to run Windows (7, x64) with a defective RAM module? More precisely, is there some way to tell Windows not to allocate a known bad address or block of addresses?  For Linux, there is . Is there an existing implementation for Windows? Is that even possible with Windows' kernel (NT 6.1)? Maybe a kernel mode driver?


How to enable automatic update in wordpress running on IIS7 and Windows 2008?

I have a dedicated server using Windows 2008 and IIS7 running 5 blogs with Wordpress. I can't use the autoupdate feature of the wordpress neither the automatic plugin instalation.  I believe I must set writing permissions in some temporary folder, the question is which one. Do you have any idea?


i try to install or un-install some think and i get this:   installArchives() failed: (Reading database ...  (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 222127 files and directories currently installed.) Removing vlc ... Processing triggers for desktop-file-utils ... Processing triggers for gnome-menus ... Processing triggers for bamfdaemon ... Rebuilding /usr/share/applications/bamf-2.index... Processing triggers for mime-support ... Processing triggers for man-db ... Processing triggers for vlc-nox ... dpkg: error processing python-wxgtk2.8 (--configure):  Package is in a very bad inconsistent state - you should  reinstall it before attempting configuration. dpkg: dependency problems prevent configuration of playonlinux:  playonlinux depends on python-wxgtk2.8; however:   Package python-wxgtk2.8 is not configured yet.  No apport report written because the error message indicates its a followup error from a previous failure. dpkg: error processing playonlinux (--configure):  dependency problems - leaving unconfigured Errors were encountered while processing:  python-wxgtk2.8  playonlinux Error in function:  dpkg: error processing python-wxgtk2.8 (--configure):  Package is in a very bad inconsistent state - you should  reinstall it before attempting configuration. dpkg: dependency problems prevent configuration of playonlinux:  playonlinux depends on python-wxgtk2.8; however:   Package python-wxgtk2.8 is not configured yet.  dpkg: error processing playonlinux (--configure):  dependency problems - leaving unconfigured


TikZ: How to extract / highlight a segment of a curved path

I would like to highlight a segment of a curvy path (color, thickness) defined by several controls as shown in the following image. I already tried it using intersections and clipping but I failed.   Preferably, I would like to mark the end points of the highlighted segment by arrows. The segment of the path which should be highlighted is given as an 'interval' of the original path, e.g. start highlighting after 1/3 of the original path and stop highlighting at 5/7 of the path.   But in fact, if I would have a solution if I define start and stop of the highlighted segment somehow by hand, I would be glad.  Any ideas?     \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{calc} \begin{document}   \begin{tikzpicture}[scale=1, >=stealth, ->]     \tikzstyle{node_style}=[inner sep=2pt, circle, fill=black]      \node[node_style, label=right:{$x$}] at (3,3) (x) {};     \node[node_style, label=below:{$y$}] at (0,0) (y) {};      \draw (y) .. controls ++(2,-0.1)  .. (1,1) .. controls ++(-1.5,1.5)  .. (2,2) .. controls ++(2,-0.3)  ..(x);   \end{tikzpicture} \end{document}


What is the difference between meta sites and main sites?

I have just installed the Stack Exchange Android app, and have been creating accounts on different sites on Stack Exchange.  I noticed that from the main sites, I can reach a "meta site". What is this meta site?  Note: this question is about per-site meta, not Meta Stack Exchange which is covered aleady in .


How to protect against SQL injection with an IN() array?

How I can protect my code from SQL injections? I have URL like this:  example.com/players.php?ids=100098,131183,188736,261945,301588   and query  $ids = (isset($_GET['ids'])) ? $_GET['ids'] : false; $query = "SELECT * FROM player WHERE profileid IN (". $ids .")";


Although I include the header file of a class in my implementation like:  #include<Utility.h>   I still get fatal error: Utility.h: No such file or directory  Is there any idea why? Utility.h and Utility.cpp in my current project folder


What benefits are there to getting Stack Overflow reputation over 10k?

I read many articles related to Stack Overflow reputation, such as the following:   It states:     "The final milestone in this reputation scheme is at 10,000 reputation. At this level, you gain the highest level of privilege possible without being elected a community moderator."   Apart from that my knowledge will increase, I have some questions in mind.   What will happen if someone is elected as a community moderator? Can the reputation help programmers clear a job interview?   Or    Can I sell my reputation for money?    What additional benefits can I get from reputation above 10k?


null pointer excpetion while sorting in java

I have a project in which i am trying to sort an arrayList the ArrayList is of type ScheduleTime class i want to sort on basis of totalMinutes field package fG.Model;  public class ScheduleTime {     public String date;     public Integer hours;     public Integer minutes;     public Integer totalMinutes;          @Override     public String toString() {         return "ScheduleTime [date=" + date + ", hours=" + hours + ", minutes=" + minutes + ", totalMinutes="                 + totalMinutes + "]";     }      @Override     public boolean equals(Object anObject) {         if (!(anObject instanceof ScheduleTime)) {             return false;         }         ScheduleTime otherMember = (ScheduleTime)anObject;         return ( (otherMember.getDate().equals(this.getDate())) && (otherMember.getHours().equals(this.getHours())) && (otherMember.getMinutes().equals(this.getMinutes())));     }  }  here is the code for sorting i tried....         ArrayList<ScheduleTime> nonDuplicateSlots = new ArrayList<ScheduleTime>();                  Collections.sort(nonDuplicateSlots, new Comparator<ScheduleTime>() {             @Override             public int compare(ScheduleTime o1, ScheduleTime o2) {                 return o1.totalMinutes - o2.totalMinutes;             }         });  hence i am getting a null pointer exception..please help me with it


how to calculate the value of following question without overflow?

(nCr + nC(r+1) + nC(r+2) + .... + nCn)/2^n  value of this is atmost 1,but for large n(10^5) nCr value overflows. can any1 give me an efficent approach to solve this(r<=n). thanks.


How can the aperture value written in Exif be larger than the nominal limit of the lens?

A photo shot with an 1:1.8 lens contains the following exif data:  ApertureValue: 1695994/1000000   MaxApertureValue: 16/10   How is this possible? Both values are <1.8.


I need to configure a Salesforce Community to display a customer URL, ie portal.[DOMAIN].com instead of the standard [DOMAIN].force.com/  The  doesn't seem to work   We've got the cert installed and everything seems to be setup correctly in Salesforce.    I've done this before but it only comes up every 18 mos or so.  Whatever I learned last time (and didn't write down), is forgotten.  Appreciate any help.


So I was thinking about something for the past while  Consider a large spherical foam-ball with homogeneous density. Where a foam ball is defined as an object that can absorb matter with 0 friction (example: a gravitational well without an object inside). This is a purely theoretical construct.  If the foam-ball has a radius R and a charge Q. What charge must the foam-ball have, such that there is well defined sphere or horizon such that any object with a negative charge (even if it is the slightest bit) must travel faster than C in order to escape the field of the ball.  Aka what charge would turn this into a black-hole for all objects with opposite sign on their charge?  Once again I assume the foam-ball is a single particle, that doesn't repel itself... its just a very large homogenous 'thing' with charge.


Are the glitches from the original pokemon generation 1 in the 3ds versions?

I'm thinking about buying the generation 1 games on the 3ds, but if they patched the glitches from the original game I'm not going to.   To be more specific, I'm wondering if the experience overflow glitch and the mew glitch still work. Thanks!


I have a $X_1$,$X_2$,...,$X_n$ sequence of binary random interchangeable variables. Given $\theta$*=$\theta$, $X_1$,$X_2$,...,$X_n$ $\thicksim$ iid Ber($\theta$)  With a prior distribution $\pi$($\theta$)=Beta($\theta$).  Thus, I have a posterior distribution $\pi$($\theta$|x)$\propto$Beta($\alpha$+r,$\beta$+n-r)  E($\theta$*|x)=$\frac{\alpha+r}{n+\alpha+\beta}$  Var($\theta$|x)=$\frac{1}{(\alpha+\beta+n)(\beta+n-r+1)(\alpha+r+2)}$  Confidence Interval = $\frac{\alpha+r}{n+\alpha+\beta}$-$Z_{\frac{\alpha}{2}}$$\frac{1}{(\alpha+\beta+n)(\beta+n-r+1)(\alpha+r+2)}$ < $\theta$ < $\frac{\alpha+r}{n+\alpha+\beta}$+$Z_{\frac{\alpha}{2}}$$\frac{1}{(\alpha+\beta+n)(\beta+n-r+1)(\alpha+r+2)}$  On the other hand, when i do frequentist inference, the maximum likelihood estimator is $\theta_{ML}$=$\frac{r}{n}$ and its variance is Var($\theta_{ML}$)=$\frac{r(1-r)}{n}$  Confidence Interval = $\frac{r}{n}$-$Z_{\frac{\alpha}{2}}$($\frac{r(1-r)}{n})^\frac{1}{2}$ < $\theta$ < $\frac{r}{n}$+$Z_{\frac{\alpha}{2}}$($\frac{r(1-r)}{n})^\frac{1}{2}$  The point estimation is different, the confidence interval also is. The expectations are the same only if $\alpha$=$\beta$=0, but even then, the variances are different.  My question is, when is the frequentist and bayesian inference the same? I read somewhere that it was the same for this example, but I strongly disagree. The only case in which the inference would be the same is if in the bayesian case, n tended to infinity and then the relative weight of the prior distribution would be decline, and it would tend to be the same as the frequentist inference. Am I correct?  Second question: If I have a Beta distribution and I want to construct the confidence intervals, should i use a normal distribution? Is there another option?  Thanks!


Question: Give an example of a normal subgroup of $A_4$. Is the subgroup $H$={$(1),(25)(34),(35)(24),(45)(23)$} of $A_5$ a normal subgroup?I am having a hard time understanding this concept because the question itself is confusing me. Do I have to come up with a group showing $A_4$? Is $A_4$=[$(1),(12)(34),(13)(24),(123)$}? Need help


How to keep the structure of the Tablix when there is no data to show

We have a SSRS report which shows the result of a dataset in a tablix. If the query in the dataset returns no data, the header of the Tablix gets displayed but not the tablix cells below the header. I know there is a property to NoRowMessage, but in fact it is not what we want. Because when I specify a message, SSRS shows the message instead of the empty tablix.I must show the tablix structure as it is, but with empty cells.   I even set the rule for each cell value of the tablix using IsNothing function, to show blank (""), if the value is null, but it didn't help.  Do you have any idea?  Thanks for your help in advance.


After a fail in the HDD, I am trying to reinstall  (or Lion or whatever other without any particular choice) on a Mac Mini 2011 in an empty HDD.  Guessing because the disk is empty, most , mainly Option (Boot Options), Command+R (Recovery), D (Hardware Diagnostics), do not work, hence I do not know how to finish these tutorials, since the OSX USB Boot do not appear.  The unique keyboard combinations working are Command+Option+P+R for an  and PowerOn + Hold (10 s), for a .  From the hardware: I hear the Startup Sound, the keyboard is working but not the Num|Caps|Hold lights, I have disconnected the mouse or other peripherals, and the monitor and basic electronics apparently works, by sending a failure messages while booting from a Windows 8 USB Bootable media ("The Boot Configuration Data file doesn't contain valid information for an operating system").  I have tested some tricks on making some tricky formatting on the hard disk, plugging in pre-made bootable disks, but up to this moment, no choices made the Mac Mini to get loaded.  Neither Apple Stores accepts me to have the machine reinstalled for free (they don't do "maintenance service").  Question is which tutorial should I follow in this case.


How to install Google Chrome on Ubuntu 14.04?

I need to know how to install Google Chrome and how to use terminal on Ubuntu 14.04.


Put new harddrive in Acer model # N17Q3 laptop downloaded Ubuntu 20.04 to harddrive of a desktop computer with Ubuntu used disk creator made a bootable 16G usb and plugged it into my laptop it will NOT boot? The harddrive I removed had windows on it.


A star starts at rest at infinity, how do you calculate the kinetic energy of the star when it crosses the event horizon of a black hole?

A star that begins very, very far away from a black hole (infinity) is brought in by the black hole's gravitational pull.   How do you calculate the kinetic energy of the star as it passes the point of the event horizon (/Schwarzschild radius)?  edit - I'm looking specifically on how to calculate the kinetic energy, not the velocity of an object (in this case, the star).


How can I remove duplicated tags (not synonyms)

How can I remove duplicate tag that is not used and is only singular of a similar tag?  I don't think that these tags can be used as synonyms. Consider the following example:  question and questions


If statement does not accept proper value

When I debug this code I noticed that the If statement does not ever switch the boolean type sales variable to true... This is bugging me because I know that answer = "y" when it gets to the If statement. Help please! and yes I did import java.util.Scanner  Scanner input = new Scanner(System.in); boolean sales = false; String answer;  System.out.print("Will you be calculating the Sales department pay aswell? (y or n):"); answer = input.nextLine().trim();  if (answer == "y") {     sales = true; }   i have


Referencing multiple files that are not a certain file type in a directory

I am working on a script that contains a line similar to  "command /path/to/directory/*example*"  If the directory contains files that are named 1example.txt, example.tmp, example.war it will run the command on all of them. I would like for the command to be run on all of them except for the .war.  Is there some way of doing this cleanly?  The "/path/to/directory/*example*" is a string that is passed through.


How do I reach my internal server on the external IP?

We are trying to configure our Cisco 5505, and it has been done through ASDM.  There is one big problem that we're not able to solve, and that's when you go from inside to outside and back in again.   Example, we have a server "inside" and we want to be able to reach this server with the same adress if we're on the inside or if we're on the outside.   The problem is adding a rule that will allow traffic from inside to outside and then back in again.


Calculating dominant angle of a polygon in QGIS without main_angle function

How can I calculate dominant angle of a polygon in QGIS without main_angle function? I have a shapefile of Oriented Minimum Bounding Box rectangles (accessible from the following link: ) produced by using as Input Layer a shapefile of irregular polygons (accessible from the following link: )  Figure 1: Shapefile of Oriented Minimum Bounding Box  Figure 2: Shapefile of Irregular Polygons I need to find the main_angle of every polygon in the Oriented Minimum Bounding Box layer. I used the main_angle function available in QGIS 3.16 onwards. main_angle function returns the main angle of a geometry. However, when I constructed centerlines using the centroid of the polygons (in this case rectangles) and main_angle values computed using the main_angle function in QGIS with the following expression:  intersection ( extend (     make_line (         centroid ($geometry),          project (             centroid ($geometry),              25000,              radians("main_angle")         )     ),     25000,     0 ), $geometry  ) Main_angle of the polygons computed with main_angle function is not at all times the angle of longest collection of segments as in the image below encircled below:  What expression can be used such that main_angle is always the angle of longest segment of the Oriented Minimum Bounding Box in a project whereby main angle of every Oriented Minimum Bounding Box is the determining factor of accuracy of end results. I found this comment from the following link:  You need an expression dependent on the height and width data:  The end result I am seeking is the overall orientation of all ploygons collectively as illustrated in the image below from the Line Direction Tool QGIS plugin. By unfortunately provides no values.  I used XLSTAT to use Principal Component Analysis but did not achieve conculsive results. Computed results and report is accessible from following link:


I can’t get selenium to click on this checkbox button no matter what I do.   Error:     no such element: Unable to locate element:   I have used sleep thread timers and wait.until(ExpectedConditions.visibilityOfElementLocated()).  Here is the HTML of the button:  <input id="1_2_null" type="checkbox" name="1.0.50.gecb16" xgc="" rownumber="1">   I have tried :  driver.findElement(By.xpath("//*[@id=\'1_2_null\']")).click(); driver.findElement(By.name("1.0.50.gecb16")).click(); driver.findElement(By.id("1_2_null")).click();   It's possibly inside this iframe:  <iframe frameborder="no" width="100%" height="100%" src="" id="maincontent" name="maincontent"></iframe>


so I had to get Ubuntu and I have no idea what I am even doing. and I NEED STEAM! so I download it and nothing it won't open so can you very smart people help me????????


What happens to the connectedness of $\mathbb R^2$ when countable many points are removed?

Does $\mathbb R^2$ remain connected when countably many points are removed? Does it remain path connected?  This is not homework but is in response to working several problems where countable or uncountable many points are removed and the pattern always holds.  Thank you.


How many legitimate uses of "could of" / "would of" / "should of" are there?

After some bad calls using search/replace, I'm curious how many legitimate forms of "could/would/should of" there are. I'm interested in uses that do not derive from, and cannot be replaced by "could have," "would have," "should have," or their contractions.   One could of course add a few commas to this paragraph to make it easier to read, but I'm not sure that would of necessity be the only correct way to punctuate it. I frequently see constructs like "of itself," "of course," "of her own volition," and so forth in print without being couched in commas.   Still, I wouldn't make as big a deal of that example as I would of this one.   What other legitimate patterns for their use might there be, and are there any foolproof rules for helping identify them? (e.g. Is it safe to say that "would of [verb]" is always wrong?)  Contrary to folk wisdom saying , it's not always wrong. Some well-formed sentences contain "should of" without meaning "should've". I want to feed someone some exceptions to the "it's always wrong" rule, and if the exceptions are rare enough (unlikely, I suppose), a list of all the cases where it's proper to use "should of."


Suppose the application $$f:\mathbb{N}^{*}\rightarrow\mathbb{R}$$  $$n\rightarrow\sum_{k=1}^{n}\frac{1}{k}$$How can I prove that $f(\mathbb{N}^*)\cap\mathbb{N}=\{1\}$?


I was checking specification of Canon SX520HS and this is what i found regarding focal length:  Focal Length    4.3 – 180.6 mm (35 mm equivalent: 24 – 1008 mm)   Now to get 35mm equivalent focal length, we generally multiple with factor of 1.6 for Canon but here multiplication factor of 5.5 has been used.  Can someone please explain why this difference in multiply factor or this description is misleading?


Usage of "in this list" - "on this list"

Do you use "in this list" and "on this list" in the following way?  a) In this list, when talking indirectly about the contents of the list.  Example:   Have you participated in this list? (Not this one)   This one: - I do not see any problem in this list.  b) On this list, when talking directly about the contents of the list.  Example:   The individuals on this list are from this town.


I have a big file and need to split into two files. Suppose in the first file the 1000 lines should be selected and put into another file and delete those lines in the first file.  I tried using split but it is creating multiple chunks.