I am inserting into two tables at the same time, tss_client and tss_details. First, I insert into tss_details, then using Details_ID from there, I insert into tss_client.   How to I get the most recent ID, from tss_details? I'm trying LAST_INSERT_ID() but it doest work   addDetailsQry.prepare("INSERT INTO tss_details(Username, Password, Email, Description, etc..) "                       "VALUES (:Username, :Password, :Email, :Description, etc..");   addClientQry.prepare("INSERT INTO tss_client(Client_Name, Website, Contact_Details_ID)"                      "VALUES (:Client_Name, :Website, :LAST_INSERT_ID()");  addDetailsQry.bindValue(":Username", username); addDetailsQry.bindValue(":Password", password); addDetailsQry.bindValue(":Email", email); addDetailsQry.bindValue(":Description", description);  addClientQry.bindValue(":Client_Name", clientName); addClientQry.bindValue(":VAT_Number", VATNumber); addClientQry.bindValue(":Website", website); addClientQry.bindValue(":Contact_Details_ID", /*what would i put here*/ );  if(addDetailsQry.exec()) {     qDebug() &lt;&lt; "Client Details added!";      if(addClientQry.exec())     {         qDebug() &lt;&lt; "Client added!";     } }   The ID column in tss_details is an identity.   I'm using ODBC and SQL Server version:     'Microsoft SQL Server 2016 (RTM) - 13.0.1601.5 (X64)   Apr 29 2016 23:23:58   Copyright (c) Microsoft Corporation  Express Edition (64-bit) on Windows 10 Pro 6.3  (Build 14393: )   and  I get:     [Microsoft][ODBC SQL Server Driver][SQL Server]'LAST_INSERT_ID' is not a recognized built-in function name.
Which one is the best option to get the identity value I just generated via an insert? What is the impact of these statements in terms of performance?   SCOPE_IDENTITY()  Aggregate function MAX() SELECT TOP 1 IdentityColumn FROM TableName ORDER BY IdentityColumn DESC
I want to list a company name in the author field of a bibliographic entry:  @book{CUDA,   author    = {NVIDIA Corporation},   title     = {NVIDIA CUDA Compute Unified Device Architecture Programming Guide},   publisher = {NVIDIA Corporation},   year      = {2007} }   But the entry keeps showing up "N. Corporation".  Is there a way to get the full author name to show up?  I'm currently using the siam BibTEX style. Unity Performance: How many Materials per Object? Good and easy way to share files on local machine I would like to have a directory that has following properties:    Many users can copy files into it  These files can be deleted/changed by these users (user A can delete/modify file that was copied into this directory)    it cant be done using normal file permissions (because permissions are retained on copy).  Here is what I found on the net:        Some use cases:    Sharing music on local machine  Simple git repository sharing (just make a bare repository writeable to many people) --- i know that there are solutions like gitosis Allow many developers to modify test instance of php app without giving them root (i guess they would copy files) --- I'm leading a team of nonprofit junior developers and I need to keep that one simple!    EDIT  AFAIK setting SGID bit is not enugh, it only affects newly created files --- and basic workflow for these use cases ivnolves copying and other operations (which cleave file's gid unchanged) What are the dev-loop services that started on boot? Regarding running Watir scripts for UI Automation from Jenkins CI - How to hook up Jenkins and watir-automations How to remove comma and "and" before institutional last author after compiling BibTeX I have the following BibTeX entry:  @article{pubmed18800157,     author = {Heng, T.S. and Painter, M.W. and Immunological Genome Project Consortium},     title = {The {I}mmunological {G}enome {P}roject: networks of gene expression in immune cells.},     journal = {Nat. Immunol.},     pages = {1091-1094},     volume = {9},     number ={10},     year = {2008}, }, %\bibliographystyle{unsrt}   When the bibliography is generated, it puts comma a the end of the author:   Notice the comma after M.W. Painter. Is there a way to remove it? What exactly does the *frequency* of a photon mean? I have to admit, I didn't even know spoilers were supported until today, but really bugs me that spoilers just look like empty block quotes before you mouse over them.   Is this a spoiler or just a long empty block quote? I can't tell right away, so it would be really nice if there was some indication of which one it was so I didn't have to push my mouse all the way over to it. What can I say, I'm incredibly lazy.  vs.         I suppose the author should include something that says 'Spoilers below:', but it would be nice if there was some other indication of what it was. In a Poisson model, what is the difference between using time as a covariate or an offset? I recently discovered how to model exposures over time using the log of (e.g.) time as an offset in a Poisson regression.  I understood that the offset corresponds to having time as covariate with coefficient 1.  I'd like to better understand the difference between using time as an offset or as a normal covariate (therefore estimating the coefficient). In which situation should I want to use one method or the other?  UPGRADE: I don't know if it is interesting, but I ran a validation of the two methods using randomly split data repeated 500 times and I noticed that using the offset method leads to a larger test error. What is the integral of $\int e^x\,\sin x\,\,dx$? I'm trying to solve the integral of $\left(\int e^x\,\sin x\,\,dx\right)$ (My solution):  $\int e^x\sin\left(x\right)\,\,dx=$  $\int \sin\left(x\right) \,e^x\,\,dx=$  $\left(\sin(x)\,\int e^x\right)-\left(\int\sin^{'}(x)\,\left(\int e^x\right)\right)$  $\left(\sin(x)\,e^x\right)-\left(\int\cos(x)\,e^x\right)$  $\left(\sin(x)\,e^x\right)-\left(\cos(x)\,e^x-\left(\int-\sin\left(x\right)\,e^x\right)\right)$  $\left(\sin(x)\,e^x\right)-\left(\cos(x)\,e^x-\left(-\sin\left(x\right)\,e^x-\int-\cos\left(x\right)\,e^x\right)\right)$  I don't know how to complete because the solution gonna be very complicated. What can I actually do with a high credit score? I recently checked my credit score via two of my credit card providers. It seems to be hovering between 790 and 815. One service brands the score it provides as a FICO score and the other specifically says its score comes from Transunion.   What can I actually do to leverage this high credit score to my advantage?  The only new debt I might take on would be a small HELOC or car loan. Does a high score give me any negotiating power with the lender to get a better rate? Should I treat the score as a card in my hand or is it something I should show early in negotiations?  Does a high score make me eligible for any discounts on insurance?  Does a high score open up any options for earning more interest on savings accounts?  The typical advice I'm reading suggests refinancing a mortgage. That seems like good advice in general but it does not apply to my personal circumstances. I've got 3.5% on a 15 year note with 9 years left. A casual review of current rates suggest I could maybe scrape 0.5% off of that, hardly seems worth the effort and cost for half a percent. This post pretty much summarizes my question :   I know for a fact that Mac and Linux are both Unix based  And the commands for Linux should work for Mac, but with limited knowledge for programming I couldn't get it to work.  EDIT: Just saw this -  currently working on it natbib and hyperref create by default two links to the bibentry in the reference section|chapter of the document:   \begin{filecontents}{\jobname.bib} @book{author08, title = {{A Title}}, publisher = {Alpha}, year = {2008}, author = {Author, A}, address = {London} } @book{buthor90, title = {{B Title}}, publisher = {Bravo}, year = {1990}, editor = {Buthor, B}, address = {New York} } \end{filecontents}  \documentclass{article}  \usepackage{natbib} \usepackage{hyperref} \hypersetup{colorlinks,citecolor=red}  \begin{document}  \noindent citet: \citet{author08}, \citet[see][p. 20]{author08} \\ citep: \citep{author08}, \citep[see][p. 20]{author08}  \bibliographystyle{plainnat} \bibliography{\jobname}  \end{document}     In order to avoid two links to the bibliography (one for the [author] and one for the year [year], respectively), I took  to an older question and added it to my preamble.  \usepackage{etoolbox} \makeatletter  \pretocmd{\NAT@citex}{%   \let\NAT@hyper@\NAT@hyper@citex   \def\NAT@postnote{#2}%   \setcounter{NAT@total@cites}{0}%   \setcounter{NAT@count@cites}{0}%   \forcsvlist{\stepcounter{NAT@total@cites}\@gobble}{#3}}{}{} \newcounter{NAT@total@cites} \newcounter{NAT@count@cites} \def\NAT@postnote{}  % include postnote and \citet closing bracket in hyperlink \def\NAT@hyper@citex#1{%   \stepcounter{NAT@count@cites}%   \hyper@natlinkstart{\@citeb\@extra@b@citeb}#1%   \ifnumequal{\value{NAT@count@cites}}{\value{NAT@total@cites}}     {\ifNAT@swa\else\if*\NAT@postnote*\else%      \NAT@cmt\NAT@postnote\global\def\NAT@postnote{}\fi\fi}{}%   \ifNAT@swa\else\if\relax\NAT@date\relax   \else\NAT@@close\global\let\NAT@nm\@empty\fi\fi% avoid compact citations   \hyper@natlinkend} \renewcommand\hyper@natlinkbreak[2]{#1}  % avoid extraneous postnotes, closing brackets \patchcmd{\NAT@citex}   {\ifNAT@swa\else\if*#2*\else\NAT@cmt#2\fi    \if\relax\NAT@date\relax\else\NAT@@close\fi\fi}{}{}{} \patchcmd{\NAT@citex}   {\if\relax\NAT@date\relax\NAT@def@citea\else\NAT@def@citea@close\fi}   {\if\relax\NAT@date\relax\NAT@def@citea\else\NAT@def@citea@space\fi}{}{}  \makeatother     Which gets me almost where I want to be, but leaves me with two issues I would like to be solved:   while \citet includes pre- and postnotes in the link, \citep doesn't. How can \citep be changed to include postnotes? is there a way to color the brackets and commas that are typeset in black in the unmodified first example also in black in the modified second example without removing them from the link? What does the word "SARGable" really mean? I can't find .bash_profile in Ubuntu 14.04 in my /home/user directory. I used the ls -a command to see the .bash_profile, but there isn't such a file. Zombie process using 100% CPU A zombie process, which should not be using any resources (RAM and CPU), is hogging up an entire core on my 8-core 64-bit Ubuntu 11.10 Desktop installation.  This is the output of ps -el|grep Z:  F S   UID   PID  PPID  C PRI  NI ADDR SZ WCHAN  TTY          TIME CMD 0 Z  1000 10317     1 99  80   0 -     0 exit   ?        19:27:15 java &lt;defunct&gt;   ... and here is an excerpt from top:    PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                                                                                                                 10317 deltik    20   0     0    0    0 Z  100  0.0   1170:17 java &lt;defunct&gt;  1424 root      20   0  612m 193m 158m S   14  2.4 287:17.11 Xorg 12580 deltik    20   0  710m 135m  46m S    5  1.7  27:31.07 compiz   This is how the zombie process came to existence:   I opened a Java JAR called . This launcher downloads another JAR file to ~/.minecraft/bin/minecraft.jar That JAR was executing when I locked my computer with xscreensaver. Then, I entered my password to unlock the computer, and I saw that the Minecraft window was frozen. I tried killing it (PID 10317) with gnome-system-monitor. It became a zombie. kill -9 10317 was ineffective. xkill only closed the window titled "Minecraft"; it didn't close the underlying java process.   Relevant information:   The graphics driver is FGLRX, and it has caused notorious issues with  of  and , including sometimes high CPU usage of Xorg and compiz.   I want to know:   What way is there to destroy this process of java without restarting, if any? Why is this issue happening? What can I do to prevent this issue from happening again? Solving ODE with negative expansion power series I am solving a series of ODE, such that each DE is equal to some degree of term that I'm expanding to. For instance, one DE is this:  $\xi^r\partial_r g_{rr}+2g_{tt}\partial_t\xi^t=\mathcal{O}(r)$  $g_{ii}$ are given, from metric, but that's not important. I need to assume that the solution (since I'm looking for components of $\xi^\mu$, which is a vector with components $\xi^t,\xi^r,\xi^\phi$) is given with power series of the form:  $\xi^\mu=\sum\limits_{n}\xi^\mu_n(t,\phi)r^n$, and this is to be seen as expansion around $1/r$ (expansion around $r=\infty$).  Now when I plug this in the ODE I get this  $\frac{2}{l^2}\sum_n\xi^r_nr^{n+1}+2\sum_n\xi^t_{n,t} r^n+\frac{2}{l^2}\sum_n\xi^t_{n,t}r^{n+2}=\mathcal{O}(r)$, where   $\xi^\mu_{n,i}$   is the derivative with the respect to i-th component.   What troubles me is, how to expand this? Do I set n=0,-1,-2,... until my $\mathcal{O}(r)$ terms cancel each other out? Or?  I'm kinda stuck :\ Javascript: negative lookbehind equivalent? Is there a way to achieve the equivalent of a  in javascript regular expressions?  I need to match a string that does not start with a specific set of characters.  It seems I am unable to find a regex that does this without failing if the matched part is found at the beginning of the string.  Negative lookbehinds seem to be the only answer, but javascript doesn't have one.  EDIT: This is the regex that I would like to work, but it doesn't:  (?&lt;!([abcdefg]))m  So it would match the 'm' in 'jim' or 'm', but not 'jam' relative polar coordinates for TikZ elements in axis environment I would like to annotate a patch plot with lines whose start and end points are given in absolute polar and relative polar coordinates, respectively.  The patch plot, based on cartesian data, comes out as a circular shape centred around the origin (0,0) and shall be simulated here by a plain circle.  Lines should start at the circumference of the shape and point away from the shape under a given angle and have a well defined length. Therefore, the use of relative polar coordinates for the line's end point.  What seems to be straightforward with TikZ (left) fails inside the axis environment of pgfplots (right): neither the inclination angle nor the length of the line are correct if relative polar coordinates are used.    What is wrong with the rel. polar coordinates here?  The code:  \documentclass{standalone}  \usepackage{pgfplots} \pgfplotsset{compat=1.13}  \begin{document}  \begin{tikzpicture}   \draw(0,0) circle[radius=0.01];   \draw[blue] (0,0) circle[radius=1];   \draw[thick] (45:1) -- ++(45:0.5); \end{tikzpicture}  \begin{tikzpicture}   \begin{axis}[tiny,enlargelimits,   axis equal,   xmin=-2,xmax=2,   ymin=-1,ymax=1,   xtick={-2,-1,0,1,2},   ytick={-2,-1,0,1,2},   grid=major,   ]   \draw[blue] (0,0) circle[radius=1];   \draw[blue, dashdotted] (0,0) -- (45:2);   \draw[thick] (45:1) -- ++(45:0.5); %  \draw[thick] (45:1) -- (45:1.5); %absolute coordinates do work   \end{axis} \end{tikzpicture}  \end{document} I am using ffmpeg to cut out a section of a large file like this: ffmpeg -i input.wmv -ss 60 -t 60 -acodec copy -vcodec copy output.wmv  The -ss part works fine but the -t is ignored. It correctly removes the initial specified seconds specified with -ss but then keeps going to the end of the input with the copy. Is there a way to use ffmpeg to cut off the end of a video without recoding it?