I am currently working on my first java project and have jumped into using spring/hibernate.  I have created a of API's which is used to perform CRUD operations on a database. I thought it would be a good idea to write the current time an item is added to the database.   To do this this I created a new column in the database &amp; updated the entity I am using to write to it, with a new javafield called "timestamp" &amp; mapped it to the database column.  I then used (or tried to) the below code to have the system set the timestamp as the item is written into the db as I am doing something similar to ensure the id is set to 0 before it auto increments.   for (Downloads tempDownload : theDownloads) {              // display the download               tempDownload.setId(0);              tempDownload.setTimestamp(System.currentTimeMillis());              System.out.println(tempDownload);              // save to the database               downloadsService.saveProduct(tempDownload);     }      However when the item is written to the db the timestamp is written as 0. if I remove the   tempDownload.setTimestamp(System.currentTimeMillis());   then I am able to set the time via json by manually passing it in with the payload. Is there another way to go about this, or a step I could be missing?  Kind regards,  Danny
For a certain Hibernate entity we have a requirement to store its creation time and the last time it was updated.  How would you design this?   What data types would you use in the database (assuming MySQL, possibly in a different timezone that the JVM)?  Will the data types be timezone-aware? What data types would you use in Java (Date, Calendar, long, ...)? Whom would you make responsible for setting the timestamps&mdash;the database, the ORM framework (Hibernate), or the application programmer? What annotations would you use for the mapping (e.g. @Temporal)?   I'm not only looking for a working solution, but for a safe and well-designed solution.
I'm trying to use the ant migration tool to retrieve all the Custom Metadata records for a single Custom Metadata Type.  However, I can't figure out the syntax.  I would think that something like this would work:    &lt;Package xmlns="http://soap.sforce.com/2006/04/metadata"&gt;     &lt;types&gt;         &lt;members&gt;State_Sales_Tax.*&lt;/members&gt;         &lt;name&gt;CustomMetadata&lt;/name&gt;     &lt;/types&gt;     &lt;types&gt;         &lt;members&gt;State_Sales_Tax__mdt&lt;/members&gt;         &lt;name&gt;CustomObject&lt;/name&gt;     &lt;/types&gt;     &lt;version&gt;36.0&lt;/version&gt; &lt;/Package&gt;   but no dice. In Section 9 of Chapter 6, Lang constructrs for the first time a non-abelian extension as a splitting field $K$ of $X^n - a$ when the ground field $k$ does not contain primitive $n$-th roots of unity $\zeta_n$. He constructs an injective homomorphism of the Galois group $G(K/k)$ into the matrices of type   $$ M=\begin{pmatrix} 1 &amp; 0 \\ b &amp; d \end{pmatrix} \quad \hbox{with}\ b\in \mathbb{Z}/n\mathbb{Z} \quad \hbox{and} \quad d\in (\mathbb{Z}/n\mathbb{Z})^*,$$  where $(\mathbb{Z}/n\mathbb{Z})^*$ the multiplicative group of integers modulo n.  Afterwards, he states in Theorem 9.4 that if $n$ is an odd positive integer prime to the characterstic and $[k(\zeta_n):k]=\varphi(n)$ (i.e, the primitive roots of unity are not in the ground field), then the above homomorphism is, in fact, an isomorphism. Besides, the commutator group is $G(K/k(\zeta_n))$, so $k(\zeta_n)$ is the maximal abelian subextension of $K$.  Lang proves the theorem inductively over the number of prime factors in the decomposition of $n$ (i.e. if $n=9= 3\cdot 3$, then the proof "would take two steps" to complete). The induction start with $n$ prime is written clearly and I agree with it.   Now come the questions:   I do not understand Lang's argument to prove that the commutator subgroup is the subgroup $\begin{pmatrix}1 &amp; 0 \\ b &amp; 1\end{pmatrix}$, $b\in \mathbb{Z}/n\mathbb{Z}$. What is this projection on the diagonal and how does one see that the factor group of the commutator group is isomorphic to $(\mathbb{Z}/n\mathbb{Z})^*$?   By the way, direct computation of $x\, y\, x^{-1}\, y^{-1}$ for two arbitrary matrices $x=\begin{pmatrix} 1 &amp; 0 \\ b &amp; d \end{pmatrix}$, $y=\begin{pmatrix} 1 &amp; 0 \\ c &amp; e \end{pmatrix}$ yields a matrix $\begin{pmatrix} 1 &amp; 0 \\ b(1-e)+c(d-1) &amp; 1 \end{pmatrix}$. As $n$ is odd, $2 \in (\mathbb{Z}/n\mathbb{Z})^*$, so taking $e=1$ and $d=2$, we indeed reconstruct the above-mentioned group.   The second (inductive) part of the proof is a complete mystery to me with virtually every sentence being a Theorem which needs an extra proof. Can someone give me some hints?   2.a. Lang writes $n=p\,m$ and takes $\alpha$ to be the root of $X^n-a$. It is clear that $\beta=\alpha^p$ is a root of $X^m -a$. Now comes the argument "By induction we can apply the theorem to $X^m-a$". I agree that we can apply it here but the result is that $K=k(\beta,\zeta_m)$ is the splitting field of $X^m-a$. In the diagram below, there appears $k(\beta,\zeta_n)$ out of nowhere.   2.b. Now Lang proceeds to apply the theorem on $X^p-\beta$ over $k(\beta)$. Bergman's "Companion" reminds to check that $[k(\beta,\zeta_p):k(\beta)]=\varphi(p)$ before applying the theorem and gives a hint "$[k(\zeta_p):k]$ and $[k(\beta):k]$ are relatively prime". I disagree with this hint. Take $n=21= m p$ where $m=3$ and $p=7$. Then $[k(\zeta_p):k]=\varphi(p)=p-1=6$ but $[k(\beta):k]=m=3$ and both are not co-prime. Can we apply the theorem here at all? Or if so what is the argument? If Bergman's argument is valid, where is the fault in my logic?  2.c. Even assuming that we can apply the theorem in 2.b., then we can say something about $k(\alpha, \zeta_p)$ and not $k(\alpha,\zeta_n)$. How do we proceed to checking everything Lang states in the last section of the proof (basically, everything after the diagram)?  EDIT: I have found the essentially same question When exactly does tmpwatch clear out files I place in /tmp? How to connect to my web server? I don't know if it's the right place to ask but can somebody advise me for buying a ram memory for my computer.  I have a Dell Vostro 200 with 1GB of RAM and 667MHz. (2 x 512MB)  I want to buy raise the amount of RAM but I'm confused whether to buy 1 x 2GB or 2 x 1GB  I know it's the same for the available amount of memory but is ther a difference maybe in the clock speed so that 2 x 667MHz will be better than 1 x 667MHz. or maybe accessing one single memory slot will be faster and better than accessing two slots.  Please anyone helps. I would like to use  with a video.  With ffmpeg I can export some (.jpeg) images from a video. Can I convert a .jpeg into a valid .tiff or export directly .tiff images from the video with ffmpeg? BibTeX: Abbreviate first name (aka given name) to 2 or 3 letters (not 1) I have put a bounty on , however I don't see it appear in the  (also not when I'm not logged in).  Why is this. Aren't all bounty questions supposed to be visible there? Prove that if $A$ is a set with $m$ elements, $B$ is a set with $n$ elements, and $A \cap B = \emptyset$, then $A \cup B$ has $m+n$ elements. How can I install the most used plugins like flash player and mp3 in Ubuntu? Active Web Site as Gnome Background Is there a way to put an active website, such as Gmail, as your Desktop background in Gnome, running Ubuntu 10.10 64-bit? MS Win calls it "Active Desktop". Reputation in summary tab shows as blank instead of 0, if net result is zero The calling thread cannot access this object because a different thread owns it Mounting filesystem with special user id set Given that $W$ is a subspace of $V$, prove: $\dim W=\dim V \implies W=V$ Suppose $W$ is a subspace of the finite-dimensional vector space $V$ and $\dim W = \dim V=n$  Let $\{\overrightarrow w_1,\ldots,\overrightarrow w_n\}$ be a basis for $W$ and $\{\overrightarrow v_1,\ldots,\overrightarrow v_n\}$ be a basis for $V$.  The set $\{\overrightarrow w_1,\ldots,\overrightarrow w_n,\overrightarrow v_1,\ldots,\overrightarrow v_n\}$ still spans $W$. Since $W$ is a subspace of $V$, $W\subset V$ and all the $w_i$'s can be written in terms of $\{ \overrightarrow v_{1},\ldots,\overrightarrow v_n\}$.  $\therefore$ We can remove one by one all the $w_i$'s from the set $\{\overrightarrow w_{1},\ldots,\overrightarrow w_n,\overrightarrow v_1,\ldots,\overrightarrow v_n\}$ while still having it span $W$, which leaves us with the set $\{\overrightarrow v_1,\ldots,\overrightarrow v_n\}$. We know it to be linearly independent since it is a basis for $V$. Therefore the basis of $V$ is also a basis of $W$. From there on, it is trivial to prove double inclusion $W\subset V$ and $V\subset W$ which gives us $W=V$.  Is my approach correct? Can I fine-tune my screen brightness? My laptop is Lenovo T400, and my OS is Ubuntu 10.10. I change the brightness of my screen by pressing the FN key and one of the two keys for increasing/decreasing brightness.  The brightness I feel comfortable is between two consecutive levels that are offered. So I wonder if it is possible to fine-tune the screen's brightness? According to the Wikipedia page for the , "Use of the comma is consistent with conventional practice" and "Use of the comma is inconsistent with conventional practice." Did the Oxford Comma come before its omission, or was the Oxford Comma traditionally omitted?  It makes logical sense that every item in a list would be separated in the same way: by a comma. If the Oxford Comma is conventionally correct, when and why did people begin to omit it? For any smooth manifold, is it true that for any two points on the manifold, there exists a chart that covers the two points? I am trying to really understand why the gradient of a function gives the direction of steepest ascent intuitively.  Assuming that the function is differentiable at the point in question, a) I had a look at a few resources online and also looked at this   , a popular question on this stackexchange site. The accepted answer basically says that we multiply the gradient with an arbitrary vector and then say that the product is maximum when the vector points in the same direction as the gradient? This to me really does not answer the question, but it has 31 upvotes so can someone please point out what I am obviously missing?  b) Does the gradient of a function tell us a way to reach the maxima or minima? if yes, then how and which one - maxima or minima or both? Edit: I read the gradient descent algorithm and that answers this part of my question.  c) Since gradient is a feature of the function at some particular point - am I right in assuming that it can only point to the local maxima or minima? Installing QGIS with ECW support on Mac? I bought a imac recently and I tried to install qgis: without success! It is not possible to read the raster files.  I installed GDAL ECW plugin, but it is necessary to copy and paste another file from  ERDAS ECW/JPEG2000 following this instruction.  "VERY IMPORTANT POST-INSTALL  You MUST download and install the ECW SDK yourself. I don't have the means to enforce export restrictions. I'm sorry, but installation is a manual process for now:  Go to . Select "ERDAS ECW/JPEG2000 SDK" from the Product popup. Click on the MacOSX line, then the Download Now link.  Open the downloaded disk image and run the installer. It will install into the top of your boot drive, /Intergraph. Dig into this folder to Desktop_Read-Only/redistributable/libstdc++.  Copy the libNCSEcw.dylib file to:  /Library/Application Support/GDAL/1.11/Libraries  and copy the whole Desktop_Read-Only/etc folder here to:  /Library/Application Support/GDAL/1.11  so it looks like (there may be other files in Libraries and PlugIns for other installed plugins):  Library Application Support GDAL 1.11 etc Libraries libNCSEcw.dylib PlugIns gdal_ECW_JP2ECW.dylib  You can trash the installed Intergraph folder when done to save a few hundred MB of space.  I failed the procedure! Could you help me?