How to post code in this website?
What can I do when getting “This question body does not meet our quality standards”?
Java date format conversion - getting wrong month I want to run a script to simply change the current working directory:  #!/bin/bash cd web/www/project   But, after I run it, the current pwd remains unchanged! How can I do that? How to get first N elements of a list in C#? I would like to use Linq to query a bus schedule in my project, so that at any time I can get the next 5 bus arrival times. How can I limit my query to the first 5 results?  More generally, how can I take a slice of a list in C#? (In Python I would use mylist[:5] to get the first 5 elements.) Using FFmpeg and IPython Minimal polynomial of $\sqrt{2}+\sqrt{3}$ over $\mathbb Q$ I had an example in the book given as follows:        Find the minimal polynomial of $\sqrt{2}+\sqrt{3}$ over $\mathbb Q$ .       Solution:  $~~~~~$$(\sqrt{2}+\sqrt{3})^2=5+2 \sqrt6$      $(\sqrt{2}+\sqrt{3})^4=49+20 \sqrt6$       Then $(\sqrt{2}+\sqrt{3})^4-10(\sqrt{2}+\sqrt{3})^2+1=0.$       Thus $a=\sqrt{2}+\sqrt{3}$ satisfies $f(x)=x^4-10x^2+1$ over $\mathbb Q$.       Let $p(x)$ be the minimal polynomial of $\sqrt{2}+\sqrt{3}$ over $\mathbb Q$.Then $(\sqrt{2}-\sqrt{3}),(-\sqrt{2}+\sqrt{3}),(-\sqrt{2}-\sqrt{3})$ are also roots of $p(x).$   So degree of $p(x)$ is atleast $4$.      But $f(a)=0 $ and $f(x) \in \mathbb Q[x] \implies p(x)$ divides $f(x)$ .      So $f(x)$ is minimal polynomial of $\sqrt{2}+\sqrt{3}.$   But I can't get the step  how are $(\sqrt{2}-\sqrt{3}),(-\sqrt{2}+\sqrt{3}),(-\sqrt{2}-\sqrt{3})$ also roots of $p(x).$   Kindly help with this. Why are extra dimensions necessary? Some theories have more than 4 dimensions of spacetime. But we only observe 4 spacetime dimensions in the real world, cf. e.g.  Phys.SE post.   Why are the theories (e.g. string theory) that require more dimensions taken seriously by scientists?  Is there any proof that these extra dimensions exist? Is there a simple layman's explanation for the need [or strong hint] for extra dimensions? Is there a missing definite article before caliph in 'the group's leader, XYZ, as (the) caliph'? With the Taylor series representation of $\sin$ or $\cos$ as a starting point (and assuming no other knowledge about those functions), how can one:  a. prove they are periodic?  b. find the value of the period? Is the convex hull of closed set in $\mathbb R^{n}$ is closed? Is convex hull of closed set in $\mathbb R^{n}$ closed? How do I grep for multiple patterns on multiple lines? What is an example of a transformation on a posterior distribution such that the MAP estimate will be non-invariant? Suppose that we have a posterior distribution $p(\theta\mid y)$ and we wish to define a transformation on $\theta$ such that $\phi = f(\theta)$. I know that generally such transformations will not affect the MLE as it is on the data space, but will result in non-invariance on the Maximum A Posteriori (MAP) estimate as it is a function of the parameter space. I am wondering if there is an example to illustrate this? Thanks. How should I successfully hibernate Ubuntu 16.04?  I've tried almost every solution on the web but non of them was actually helpful. I found my problem almost completely similar to I recently upgraded from QGIS 3.2 to 3.4 using the standalone installer (Windows 64 bit), and uninstalling 3.2 beforehand.  When I open 3.4 it goes the background behind all my other open programs and clicking its icon on the taskbar does nothing, nor does Alt-Tab.  To use QGIS I have to minimize all my other open programs.    Is this a Windows issue, a QGIS issue, or something else entirely? Electrodynamics textbooks that emphasize applications Please recommend undergraduate-level textbooks on electrodynamics which emphasize practical applications and real life examples. Please describe the book's level and contents and its intended audience in as much detail as possible.   Please provide both applications from everyday life for curious students as well as engineering applications from a physics perspective. 16.04 Cannot install anything from Ubuntu Software center Whenever I double click a deb file, it'd be opened in software center. However, when I click "install" button, it'd change to "installing" for a second but then turn back to "install" and nothing happens. It also says "This software comes from a 3rd party and may contain non-free components" at the bottom. I have enabled all the options in Software &amp; Updates and also tried reinstalling software center but nothing helped. What's the easiest way to run GUI apps on Windows Subsystem for Linux as of 2018? How to force Windows 7 to ask for a "fresh" IP address from DHCP server? I'm troubleshooting a certain issue with my DHCP configuration, and need my Windows machine to ask for a "fresh" IP address, so I can see which address DHCP server gives by default.   When I do ipconfig /release followed by ipconfig /renew, Windows "proposes" its old IP address to the DHCP server (just checked with Wireshark, initial "DHCP Discover" message has Option-50 (requested IP address) with Windows machine's old IP).  Tried disabling/enabling network adapter. Same behavior.  Question: How can I force Windows to just ask for a new IP address, without proposing its old IP address. I am using a Collection (a HashMap used indirectly by the JPA, it so happens), but apparently randomly the code throws a ConcurrentModificationException. What is causing it and how do I fix this problem? By using some synchronization, perhaps?  Here is the full stack-trace:  Exception in thread "pool-1-thread-1" java.util.ConcurrentModificationException         at java.util.HashMap$HashIterator.nextEntry(Unknown Source)         at java.util.HashMap$ValueIterator.next(Unknown Source)         at org.hibernate.collection.AbstractPersistentCollection$IteratorProxy.next(AbstractPersistentCollection.java:555)         at org.hibernate.engine.Cascade.cascadeCollectionElements(Cascade.java:296)         at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java:242)         at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:219)         at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:169)         at org.hibernate.engine.Cascade.cascade(Cascade.java:130) Is there any way to find out if a file is a directory?  I have the file name in a variable. In Perl I can do this:  if(-d $var) { print "it's a directory\n" } food safety regarding re freezing twice cooked chicken I am defrosting a cooked chicken to use in a curry it will be thoroughly heated at a high temperature. If I have too much curry will i be able to freeze it, as the cooked chicken was frozen before?