In Ruby, how to compute the number of days until next Sunday?
Rails Previous Sunday in Relation to Any DateTime
What's the function of the "|" (pipe) operator? Reproject GeoJSON from EPSG:3857 to EPSG:4326 I have a Toshiba z830 with ubuntu 12.04. I could use without problems the DSL connection (I have no router, only a modem) at home until a couple of days ago:   It stopped to work when while connected with the DSL connection via CiscoVPN (to my workplace), I had to leave the laptop unattended for a while and I guess the laptop tried to go to suspend. When I came back there were many messages on a black screen (sorry, I cannot attach an image because of my low reputation) and the laptop was not responding. I had to reset the it.   After rebooting it, the internet connection didn't work as did before (no browsing, no ssh, no skype, etc) although it says it is connected. I only can browse, etc when I connect to CiscoVPN to the same place where I was connected when it crashed.  When I am physically where I connected via VPN (at work) I can use the wireless, which I am not able to use now anymore since the incident described above.  Some additional information:  martillu@ubuntu:~$ cat /etc/resolv.conf   domain km.icrr.u-tokyo.ac.jp   nameserver 10.240.12.134   nameserver 10.240.12.135    martillu@ubuntu:~$ route -n   Kernel IP routing table   Destination Gateway Genmask Flags Metric Ref Use Iface   0.0.0.0 61.127.116.199 0.0.0.0 UG 0 0 0 ppp0   61.127.116.199 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0   169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 ppp0    martillu@ubuntu:~$ ifconfig   eth0 Link encap:Ethernet HWaddr e8:e0:b7:2f:bc:5a   inet6 addr: fe80::eae0:b7ff:fe2f:bc5a/64 Scope:Link   UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1   RX packets:17620 errors:0 dropped:1 overruns:0 frame:0   TX packets:13168 errors:0 dropped:0 overruns:0 carrier:0   collisions:0 txqueuelen:1000   RX bytes:19452232 (19.4 MB) TX bytes:2568218 (2.5 MB)   Interrupt:20 Memory:c0700000-c0720000    lo Link encap:Local Loopback   inet addr:127.0.0.1 Mask:255.0.0.0   inet6 addr: ::1/128 Scope:Host   UP LOOPBACK RUNNING MTU:16436 Metric:1   RX packets:134 errors:0 dropped:0 overruns:0 frame:0   TX packets:134 errors:0 dropped:0 overruns:0 carrier:0   collisions:0 txqueuelen:0   RX bytes:36316 (36.3 KB) TX bytes:36316 (36.3 KB)    ppp0 Link encapoint-to-Point Protocol   inet addr:219.167.252.226 P-t-P:61.127.116.199 Mask:255.255.255.255   UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1454 Metric:1   RX packets:17608 errors:0 dropped:0 overruns:0 frame:0   TX packets:13129 errors:0 dropped:0 overruns:0 carrier:0   collisions:0 txqueuelen:3   RX bytes:18993590 (18.9 MB) TX bytes:2221195 (2.2 MB)    wlan0 Link encap:Ethernet HWaddr 9c:b7:0d:d9:21:f3   UP BROADCAST MULTICAST MTU:1500 Metric:1   RX packets:0 errors:0 dropped:0 overruns:0 frame:0   TX packets:0 errors:0 dropped:0 overruns:0 carrier:0   collisions:0 txqueuelen:1000   RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)    I think that: domain km.icrr.u-tokyo.ac.jp in the resolv.conf may be suspicious, since if I am not connected via CiscoVPN I do not know why it should appear "km.icrr.u-tokyo.ac.jp" (this is where I connect via VPN). Showing that the orthogonal projection in a Hilbert space is compact iff the subspace is finite dimensional Suppose that we have a Hilbert Space $H$ and $M$ is a closed subspace of $H$. Let $T\colon H\rightarrow M$ be the orthogonal projection onto $M$.   I have to show that $T$ is compact iff $M$ is finite dimensional.  So if we assume that $M$ is finite dimensional then $\overline{T(B(0,1))}$ is a closed bounded set in a finite dim vector normed space and so it is compact. Which gives that $T$ is compact.  But I am unsure how to prove that if $T$ is compact then $M$ is finite dimensional?  Thanks for any help Calculate work done by a hovering helicopter over time This is likely to be very simple, but...  How does one calculate work done by a hovering unmoving aircraft over time?  As in work in Joules.  In this scenario, to remain hovering the aircraft has to exert a force that counters gravity (which would be its mass times G, pointing in opposite direction of gravitational pull).  However, work is defined as newton per meter, and the aircraft does not move.  Meanwhile the battery charge or fuel is going to be expended, so the energy is spent.  The other question here:   is dealing with conservation energy and not calculating drain/work performed by hovering. Combinations of sets raised to the power of a prime modulus: $\binom{p^{\alpha}-1}k \equiv (-1)^k \pmod p$ How do I migrate my Keychain's "Local Items" to a new Mac? After preforming a Mavericks-Mavericks migration using Migration Assistant, I have a "Local Items" Keychain on my new machine in which many (perhaps most) items are out of date (using old passwords), and some are missing altogether. While I have access to a copy of the entire contents of the ~/Library/Keychains/ directory from my old machine, which presumably contains all the information I'm missing, I see no way of importing that information into my new machine.  How can I import the "Local Items" from my old Keychain into the Keychain on my new machine? How can I encode and decode percent-encoded strings on the command line? Showing a function on $[0,1]$ is the zero function Some sort of battle school (no, not Ender's Game), where teens are being trained as military commanders.   The control system for their army hinges around some sort of system that requires extremely fine motor control -- being able to "push" around digital representations of military units using a special interface that interprets minute finger movements.  The boy protagonist eventually meets a girl in the battle school, and is astonished to learn that most people do not live as well as he does -- for instance, he gets a fresh jumpsuit outfit every day and disposes of the old one; this is a luxury.  One scene I recall is them kissing for a moment in some sort of underground passageway; the boy protagonist notes the exact length of the kiss, as he has been trained to have heightened time perception.  I don't recall much about other commander characters; I think they have different special abilities, and one other major character might have physical deformities, possibly because of postwar-radiation-related birth defects.  They have been training for an upcoming, prearranged final battle between all the existing national governments; the military units are very possibly robotic or entirely digital in nature, so as to avoid wasting materiel / human life.    They ultimately win the battle, just barely; I think the girl protagonist gives them an edge in the competition by hacking the timing / control system in favor of their team, causing a discrepancy which only the boy protagonist notices due to his heightened perceptions.  It was agreed that the winning government gets dominion over one of the few islands of land left that was not irradiated in some previous war; the protagonists get to live there as a reward for their victory.  I believe the boy protagonist later realizes he's gradually losing his ability to exactly quantify the passage of time.  Published no later than 2004, likely somewhere between 1980-2000, probably sometime in the '90s. Gamma Distribution out of sum of exponential random variables Extracting embedded images from a PDF How can I heal undead creatures? Fifth edition seems to have removed any means of healing undead.  The positive/negative energy duality of 3rd edition seems to be gone. Negative energy spells now do necrotic damage; some undead are resistant or immune to necrotic damage, but it isn't listed as healing them. Classic negative energy spells like inflict wounds and harm don't list undead healing as a possible effect.  For zombies and skeletons it might not matter, but liches and vampires would never risk their necks if they didn't have some way to recover hit points. What is it? I have two Date values. I need to find number of weeks between them. I want to do it Apex Class. Not looking for formula fields.  So far I tried:  Integer numberofweeks = (projectStartDate - opp.Project_Start_Date__c)/7;    I receive this error:     Date arithmetic expressions must use Integer or Long arguments How can I integrate $\ln \left( x+\sqrt{1+x^2} \right) $? Is it acceptable to insult god in a user profile? Like always I hang around in Stack Overflow's chatrooms. Today, someone posted a link to his new "reloaded" user profile.  Along the lines I read in Arabic "god is a pig". So I asked him to remove it:     Me: I have a lot of respect towards you because of your knowledge but what you wrote there in Arabic is offensive. Could you remove it please?   OP: if it were in English, would it be equally offensive?   I will write it in Dutch because you ask it so kindly.   Me: yeah, I mean what's your goal? You're just seeding hatred   OP: It is an experiment.   After that, the user changed it to Dutch.  My question is: are such statements acceptable by Stack Exchange's standards? If not, should I flag one of his posts like stated ? If yes, could you state why?  My answers to possible questions:   This happened on SO, why don't you post it on MSO?   This happened on SO but I think it's applicable to all SE sites.  Why didn't you link the user or the chat conversation?   I want the user to remain anonymous unless he or she chooses to reveal him/her self. I will give the user a link to this question  Why do you care?   I find it offensive, not only to my religion but to any religion that believes in god. I posted this question to know what you guys and girls think about this. I live by the rules, so if it's acceptable by SE then so be it and I won't bother you again.  If you don't like it then move on.   I know that this is not a mosque/church/temple and that swearing  to a certain degree. But I don't see the point in insulting god, a religion or a race in a public profile. More over, it's not even built on arguments. Easiest way to import access db (.accdb) into SQL Server 2016? I have a .accfb file from an access 2016 database and am trying to import this database into a SQL Server 2016 developer edition instance.   While I found posts online discussing using import/export data tools in SQL Server and also migration assistant for access, neither have worked out for me.   Does anyone know how to easily move a database from access 2016 to sql server 2016? More specifically an "accdb" file type?  All suggestions are greatly appreciated! Remove specific duplicates (all but latest) When removing duplicate rows, using the below query from  tutorial, how would I go about forcing which of the found duplicates to remove?  DELETE FROM dbo.ATTENDANCE      WHERE AUTOID NOT IN (SELECT MIN(AUTOID) _ FROM dbo.ATTENDANCE      GROUP BY EMPLOYEE_ID,ATTENDANCE_DATE)    And this works great. The reason why I am using this one is because the only unique id available is one in the IDENTITY column. And to determine if there are duplicate rows I have to look at a combination of multiple columns.    But if I have a set of duplicate rows how do I / how does SQL Server decide which to remove? And how would I force it to remove all but the one with the highest IDENTITY value?  EMPLOYEE_ID     ATTENDANCE_DATE     AUTOID A001            2011-01-01          1 A001            2011-01-01          2   If I would run the query now it happens to remove the second one, with AUTOID 2. But I am trying to remove all but this one (because this is the one latest added). Disable the numbering of algorithms My problem is that I do not know how to disable the numbering for algorithms. I have created an algoritm and its number is "Algorithm 1", but I want to have "Algorithm".  \documentclass{article}  \usepackage[noend]{algorithmic}  % Hide endif .etc  \usepackage{algorithm}  \algsetup{indent=2em}  % Default 1 em  \renewcommand{\algorithmiccomment}[1]{\hspace{2em}// #1}  % Change to C-style comments, though still ugly  \begin{document} \begin{algorithm}     \caption{MyAlgorithm} \label{alg:MyAlgorithm}     \begin{algorithmic}[1]     % Default no line numbering        \end{algorithmic} \end{algorithm}  \end{document} How does Earth's interior dynamo work? I'm interested in getting a basic physical understanding of how Earth's magnetic field is generated. I understand that it's a "dynamo" type of effect, driven by convection currents in the molten outer core. These currents cause charges to move, and this generates the field.  However, what I can't find a good explanation of is why there is a separation of charges in the first place. Presumably, moving neutrally charged molten iron would have the same effect as moving any other neutrally charged thing, i.e. it wouldn't create a field.  And presumably, if the fluid wasn't moving then it would become neutral pretty quickly, since molten iron is a good electrical conductor.  So am I right in thinking that the charge separation is the result of positive feedback, in that an intial deviation from neutrality would generate a field, and this would (somehow) cause a greater separation of charges, resulting in a kind of self-maintaining charge separation?  Or is there another explanation?  In either case, does anyone know of a good resource that explains the basic principles in physical terms?  I know that the interior dynamo is a very complex phenomenon, but I'd like something that gives a good physical picture of how the electromagnetic and fluid dynamical phenomena interact, rather than diving straight into partial differential equations.