python: the way strings exist in memory
is keyword in Python
Creating a DateTime in a specific Time Zone in c# I'm trying to create a unit test to test the case for when the timezone changes on a machine because it has been incorrectly set and then corrected.  In the test I need to be able to create DateTime objects in a none local time zone to ensure that people running the test can do so successfully irrespective of where they are located.  From what I can see from the DateTime constructor I can set the TimeZone to be either the local timezone, the UTC timezone or not specified.  How do I create a DateTime with a specific timezone like PST? Is there a feasible way to take a one year break from a IT job and work as a crew member on a big ship? How can one go about this? I am a recreational sailor and know intermediate sailing, coastal navigation, radio handling and all that stuff. I think this could be the experience of a life time. Where should  I look? I imagine getting it would be hard since obviously this is a lucrative job. Generalizing $\,r(n^2) = r(n)^2,\,$ for $\,r(n) := $ reverse the digits of $n$ I'm assuming this theorem was found by someone else before, but I found this relationship between square numbers of 3 digits or less. The theorem is this: If you reverse the digits in a square number, then the result will also be a square number. Take the square 961. It is 31 squared, and if you reverse the digits you will get 169, which is also a square number. Plus, 31 and 13(the roots of these reversed squares) are also reverses of eachother. The problem is this breaks with 4 or more digits. If I take the square 1024 and reverse the digits, I get 4201, which is not a square. How can I expand this theorem to fit 4 or more digits? Prove $2^k+1$ divisible by 3 for odd K Word for someone who pays attention to details wp_delete_auto_drafts() deletes links in menus Since yesterday the wp_scheduled_auto_draft_delete cron job somehow deletes all page entries from our menus. All entries in the table wp_postmeta with meta_key = '_menu_item_object' and meta_value = 'page' get deleted in the process. By tracing back the DELETE query I found out that the menu entries are deleted by a function called _wp_delete_post_menu_item. I got the following stacktrace for that function:  #0  _wp_delete_post_menu_item(3244) #1  call_user_func_array(_wp_delete_post_menu_item, Array ([0] =&gt; 3244)) called at [/srv/www/htdocs/biva/wp-includes/plugin.php:470] #2  do_action(delete_post, 3244) called at [/srv/www/htdocs/biva/wp-includes/post.php:2483] #3  wp_delete_post(3244, 1) called at [/srv/www/htdocs/biva/wp-includes/post.php:5645] #4  wp_delete_auto_drafts() #5  call_user_func_array(wp_delete_auto_drafts, Array ()) called at [/srv/www/htdocs/biva/wp-includes/plugin.php:546] #6  do_action_ref_array(wp_scheduled_auto_draft_delete, Array ()) called at [/srv/www/htdocs/biva/wp-cron.php:100]   But I'm stuck here, I'm not a wordpress developer and I have no clue why deleting old drafts results in deleting attached menu entries although the main pages still exist.  Workaround: As a workaround we added the following to the top of wp-config, wich will disable wp-cron:  /** Disable wp-cron to prevent menu from getting deleted. Detailed Bug description: http://wordpress.stackexchange.com/questions/145953 **/ define('DISABLE_WP_CRON', true);   If you are experiencing similar difficulties you might try locking the rows in the table wp_postmeta with meta_key = '_menu_item_object' and meta_value = 'page' and then tracing back the error message when WP trys to delete these rows, that's how we nailed down our error.  Reproduce the Error: It is definitely the stealth publish plugin that is causing our error, one can easily reproduce it, by doing the following:   Install a fresh Wordpress 3.9.1. Install the stealth publish plugin . Create a few test pages and add them to a new menu. Create a new page, with some dummy content, but do not save it!. Leave the page without saving. Change the system time 8 days into the future. The wp_scheduled_auto_draft_delete cron job will run because it runs daily and it hasn't run for 7 days as soon as you visit your page. It will then find your never saved dummy page delete it as it is older than 7 days and the menu will vanish. You might need to refresh the page a few times till the effect becomes visible.   I've recorded a screencast on how to reproduce the error (but I took not the time to comment it): How to select lenses for outdoor sports photography? I would like to get into sports photography, and would probably want a better telephoto lens so I can get better close up shots.  What other factors should I keep in mind as I make my choice? Does IS (or VR) matter?  What is a good focal length?  I'll probably be shooting mostly little league baseball/softball, church softball leagues, and kids soccer. Tracking very long shot with no points in common between first and last frame Is it possible to track an handheld shot (there is already an answer on here about tripod shots: ) that doesn't have any visible points in common between the first and the last frame? As an example, imagine a shot of someone driving in a car for thirty minutes. Obviously everything from the first couple of seconds won't be there anymore at minute 15. How to do a generalized linear model with multiple dependent variables in R? I have six dependent variables (count data) and several independent variables, I see that in a MMR the script goes like this:  my.model &lt;- lm(cbind(DV1,DV2,DV3,DV4,DV5,DV6) ~ IV1 + IV2 + ... + IVn)   But, since my data are counts, I want to use a generalized linear model and I tried this:  my.model &lt;- glm(cbind(DV1,DV2,DV3,DV4,DV5,DV6) ~ IV1 + IV2 + ... + IVn, family="poisson")   And appears this error message:  Error in glm.fit(x = c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,  :    (subscript) logical subscript too long`   Can anyone explain me this error message or a way to solve my problem? Show that the $\max{ \{ x,y \} }= \frac{x+y+|x-y|}{2}$. Show that the $\max{ \{ x,y \} }= \dfrac{x+y+|x-y|}{2}$.   I do not understand how to go about completing this problem or even where to start. I have a custom .desktop file: [Desktop Entry] Type=Application Terminal=false Icon[en_US]=/home/alex/bin/idea-IC-173.4127.27/bin/idea.png Name[en_US]=IntelliJ Exec=/home/alex/bin/idea-IC-173.4127.27/bin/idea.sh Name=IntelliJ Icon=/home/alex/bin/idea-IC-173.4127.27/bin/idea.png  Output of ls -lha .local/share/applications/intellij.desktop: -rwx--x--x 1 alex alex 248 Dez 30 10:54 .local/share/applications/intellij.desktop  Answers posted to a previous question () don't work for me. I can find this launcher in Activities and I can double click on that file and IntelliJ will start. Nevertheless, I cannot add this launcher as a favorite to the dock. The option does not show up. Importing installed package from script raises "AttributeError: module has no attribute" or "ImportError: cannot import name" How do I complete the square from the point I have left off at, and is this correct so far?   I have a normal prior for $\beta$ of the form $p(\beta|\sigma^2)\sim \mathcal{N}(0,\sigma^2V)$, to get:  $p(\beta|\sigma^2)=(2\pi\sigma^2V)^\frac{p}{2}\exp[-\frac{1}{2\sigma^2}\beta^T\beta]$  where $\beta^T\beta$ is   $\sum\limits_{i=1}^p \beta_i^2$.  My likelihood has a normal distribtuion for the data points y of the form $p(y|\beta,\sigma^2)\sim\mathcal{N}(B\beta,\sigma^2I)  $  $p(y|\beta,\sigma^2)=(2\pi \sigma^2V)^\frac{n}{2}\exp[-\frac{1}{2\sigma^2}({\bf y}-{\bf B}{\bf \beta})^T({\bf y}-{\bf B}{\bf \beta})]$  (Note that $\beta$ is a matrix/vector too, \bf does not work.)  To get my posterior for $\beta$ I combined the above, took the exponential parts only, and then expanded to get:  $\exp[-\frac{1}{2\sigma^2}({\bf y}^T{\bf y}-{\bf y}^T{\bf B}\beta-\beta{\bf B}^T{\bf y}-\beta^T{\bf B}^T{\bf B}\beta)]\exp[-\frac{1}{2\sigma^2}({\bf \beta}^T{\bf B})]$.  I dropped the $({\bf y}^T{\bf y})$ term, as is not a function of $\beta$.  Putting into one expression without the exponential:  $-\frac{1}{2\sigma^2}(-{\bf y}^T{\bf B}\beta-\beta{\bf B}^T{\bf y}-\beta^T{\bf B}^T{\bf B}\beta+{\bf \beta}^T{\bf B})$.  I know I need to combine the similar terms and get into the form of the multivariate normal distribution, which is what I am aiming for, but I am unsure how to do this? I probably have to add an extra term to the expression to get it into the correct form?  Note: This is not homework, it's a project, but my Bayesian working knowledge is not good at all and so I need to understand the working out. I intend to integrate out the $\beta$ and then the $\sigma^2$ after getting into the multivariate form. Divisor in $\mathbb{C}[X]$ $\implies$ divisor in $\mathbb{R}[X]$? let $P \in \mathbb{R}[X]$ be a real polynomial divisible by a polynomial $Q \in \mathbb{R}[X]$ in $\mathbb{C}[X]$. How can I easily show that $P$ is also divisible by $Q$ in $\mathbb{R}[X]$?  A simple argument without using higher algebraic theorems is desirable. If I could use instruments of higher algebra, the exercise I have to do in whole would be done in two lines. But I'm not allowed to use. I think there would be an easy argument which I can't see yet because of my mental fogginess that I have sometimes.  Thank you beforehand. Is the localization of a PID a PID? Let $A$ be a commutative ring and $S$ a multiplicative closed subset of $A$. If $A$ is a PID, show that $S^{-1}A$ is a PID.   I've taken an ideal $I$ of $S^{-1}A$ and I've tried to see that is generated by one element; the ideal $I$ has the form $S^{-1}J$ with $J$ an ideal of $A$. $J$ is generated by one element but I can't see why $I$ has to be generated by one element, maybe I'm wrong. How can I disable cloud-init? I have a fully-configured instance and an image from that for an autoscaling group. When autoscaling new instances from this image, it calls cloud-init. cloud-init changes the hostname and breaks fstab.  I want to prevent cloud-init from starting on instance launch. Global hotkey in console application Misleading chat usercard on SE 2.0 chat Hotspot and Internet access together — why not? If I try to set up a hotspot in GNOME, I get the following message:  If you have a connection to the Internet other than wireless, you can use it to share your internet connection with others. Switching on the wireless hotspot will disconnect you from &lt;network name&gt;. It is not possible to access the internet through your wireless while the hotspot is active.  What are the technical reasons why I can't set up an Hotspot and be connected to the Internet at the same time? This thought occurred to me earlier and I'm surprised I hadn't considered it previously. I get the feeling that no meaningful generalization can occur in a non-separable Banach space but on the surface it seems like a meaningful generalization can be had if the Banach space is separable. Even if it's possible, convergence and other issues likely severely complicate the matter.