How to trigger the click event of the SharePoint OOTB list's new form Save button?

I have custom list in which there are two mandatory fields, and I want to ask the user if he wants to again enter the new item after one item is created. I searched over the internet and found this link which triggers the click event of the save button. I placed the contnet editor web part in the NewForm.aspx and wrote the code as below:

<script src="/sites/zzz/Style%20Library/jquery.SPServices-0.7.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){        
     $('input[value=Save]').click(function() {       
        confirm('Do you want to enter the another record?');
      });  
    });  
</script>

But I want to trigger the function after the validations are fired and the item is saved to the list.

I have applied JSLink to one field in the NewForm also, can there be anything done using JSLink?

How do I accomplish this?

Excel data doesn't appear, in the Excel Web Access

I’ve added an Excel Web part into my page. I did check out this excel workbook. But, when I want to run my page , I’m getting as follows error. Also,when I want to open xslx file in my desktop, the file doesn’t open. Do I need to save in another format the file?

What is the reason for this? What should I do?
Thanks for advice.

enter image description here

Centering text body and margin notes together

With geometry, I want to center text body and margin notes together, namely to center textwidth + marginparsep + marginparwidth parts of horizontal elements.

I think one option would be to include margin notes into total body by includemp and center the total body. But that would screw up the current layout of my document and I have to adjust hscale all over again.

So how could I do it?

Table caption longer than table

How do I make the table caption the length of the table please?

begin{table}[ht]
caption{Empirical Model Results}
centering
begin{tabular}{l c c c c} 
hlinehline 
& multicolumn{4}{c}{Model} \
 & 1 & 2 & 3 & 4 \ [0.5ex]
hline
Interest & -3.58$^ddagger$ & -.50 & -3.44$^ddagger$ & -.44$^nmid$ \ 
 & (.37) & (.54) & (.20) & (.25)  \[1ex]
Lagged Rainfall & -.06$^ddagger$  & -.07$^ddagger$ & -.01 & -.01$^dagger$\
 & (.009) & (.008) & (.007) & (.005) \ [1ex]
Yearend & 3.58$^dagger$ & 3.72$^dagger$ & 4.23$^ddagger$ & 4.37$^ddagger$ \
& (1.67) & (1.53) & (1.13) & (.91) \[1ex]
State Fixed Effects & No & No & Yes & Yes \[1ex]
Time Fixed Effects & No & Yes & No & Yes \ [1ex]
$bar{R^2}$ & .16 & .31 & .62 & .77 \[1ex] 
hline
end{tabular}
 centering 
 caption*{
    footnotesize Note: $nmid$, $dagger$ and $ddagger$ denote significance at .1, .05 and .01 levels respectively. Standard errors presented in paratheses}

Wrapfigure placing image on the wrong side of page

I’m using wrapfigure to place images on the outside (o) edge of my document. Mostly it seems to work fine but sometimes an image gets placed on the wrong side.

You can see the problem on page 3. The space for the first image is on the left rather than the right and the image doesn’t seem to place correctly.

I think it has to do with a command someone helped me write once that forces the end of a wrapfigure environment:

documentclass[10pt]{report}
usepackage{graphicx}
usepackage{wrapfig}
usepackage[latin]{babel}
usepackage{blindtext}
usepackage{forloop}    
usepackage[twoside,a4paper,portrait,lmargin=10mm,rmargin=10mm,tmargin=14mm,bmargin=9mm]{geometry}  
begin{document}
% make a command, wrapfill, that forces the end of a wrapfigure
makeatletter
defwrapfill{par
  ifxparshapeWF@fudgeparshape
    nobreak
    ifnumc@WF@wrappedlines>@ne
      advancec@WF@wrappedlinesm@ne
      vskipc@WF@wrappedlinesbaselineskip
      globalc@WF@wrappedlinesz@
    fi
    allowbreak
    WF@finale
  fi
}
makeatother
newcounter{ct}
forloop{ct}{1}{value{ct} < 12 }%
{
begin{wrapfigure}{o}{0pt}
  includegraphics[width=12cm,height=25mm,keepaspectratio=true]{test.jpg}
end{wrapfigure}
blindtext
blindtext
wrapfill
}
end{document}

tex file: https://www.dropbox.com/s/30rg37nv2dkpc56/t1.tex
test.jpg: https://www.dropbox.com/s/w5y7ys7twvpmi9c/test.jpg

I’ll post a link to the PDF later. I can only include 2 links due to reputation being < 10.

Any idea how I might track down what’s going on or how I could fix it?

Line break after lstlisting not working

enter image description here

I just started working with Latex so this may sound like a very nooby question. I put some code in a lstlisting and after that I want to add some blank line and then the “Define the bla bla” line.

Problem 1: That space before Define, I don’t know why is that occurring… it doesn’t happen in the rest of my document…

Problem 2: I try to insert a line break after lstlisting using but it doesn’t work…

This is my code for that area:

subsection*{Part C}

Read over and experiment with the following code:\

begin{lstlisting}
def is_b_list(x):
    """(object) -> bool
    Return whether x is a binary list.
    >>> is_b_list("b_list")
    False
    >>> is_b_list(0)
    True
    >>> is_b_list([0, 0])
    True
    >>> is_b_list([[0]])
    False
    """
    return (x == 0 or
           (isinstance(x, list) and len(x) == 2
            and all([is_b_list(y) for y in x])))
end{lstlisting}

\Define the size of a binary list as the number of left brackets in its Python representation, i.e the total number of list objects in the binary list. So 0 has size 0 and [0, 0] has size 1.

begin{enumerate}
item Experiment until you find a formula (probably recursive) that computes the number of different binary lists of size s. Notice that if you call the formula C(s) then C(0) computes 1 and (C1) also computes 1.

This is what I would like to achieve:

enter image description here

How to draw the graphs of sin x and cos x on two separate grids next to each other in TikZ

I got stuck and decided to go here. How would I draw two graphs of sin x and cos x next to each on TikZ with intervals of -2π to 2π? This seemed like something easy to do in TikZ but I’m having trouble learning how to create intervals and draw functions.

Something like this? Except I would also want to add a graph of sin x to the left of the cos x graph. I have tiny bits of code so far but have tried this to start.

cos x

documentclass{article}
usepackage{pgfplots}

begin{document}

begin{tikzpicture}

draw (-0.5,0) -- (11,0) (0,-1.5) -- (0,1.5);
draw plot[domain=0:2*pi,smooth] (x,{sin(x r)});
draw plot[domain=0:3*pi/.9,smooth] (x,{sin(0.9*x r)});
end{tikzpicture}

end{document}

Thanks!

Automate chroot into broken system

Every time you have to mount a system with a live-boot-CD and chroot into the system to repair grub, you have to type so many lines to mount into the right partition:

fdisk -l

find the right partition for example /dev/sda1

mount /dev/sda1 /mnt/
mount -t proc none /mnt/proc
mount -o bind /dev /mnt/dev
mount -t sysfs sys /mnt/sys
chroot /mnt/

Is there a way to optimize this with a single script?

Why are my virtual consoles completely blank?

When I go from my graphical session to a virtual console by Ctrl + Alt + F i (with i in 1 – 7 and 9-12) I see a completely black screen. Only on F8 I see the GUI. Not even a blinking coursor on the others. When I enter anything, I can’t see anything.

What is the problem and how do I fix it?

My system

$ uname -a
Linux pc09 3.13.0-36-generic #63-Ubuntu SMP Wed Sep 3 21:30:07 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
$ cat /etc/issue
Linux Mint 17 Qiana n l
$ lspci | grep VGA
01:00.0 VGA compatible controller: NVIDIA Corporation GK110B [GeForce GTX Titan Black] (rev a1)
$ lspci -k | grep -A 2 -i "VGA"
01:00.0 VGA compatible controller: NVIDIA Corporation GK110B [GeForce GTX Titan Black] (rev a1)
Subsystem: NVIDIA Corporation Device 1066
Kernel driver in use: nvidia

edit: I tried the first steps suggested on http://forums.linuxmint.com/viewtopic.php?f=42&t=168108 and the problem seems to be the framebuffer.

I did this:

This has been an issue that has been an annoyance with Nvidia
proprietary drivers for two or three years, and has kept me away from
Ubuntu-based distros for some time. Finally, on the Nvidia forum, I
found the workaround I’d been looking for. The problem arises with
Nvidia proprietary drivers (Nouveau doesn’t show this behavior): when
you push ctrl-alt-F1, you get only a black screen or, at best, a
flashing cursor that does nothing. The problem apparently, has to do
with the way the framebuffer in implemented and this needs to be
disabled. To see if this is the problem, first you need to make a
couple of minor modifications to /etc/default/grub – but first, make a
backup!

$ sudo cp /etc/default/grub /etc/default/grub.bak

Now edit the file by entering

$ sudo pluma /etc/default/grub

in the editor, uncomment the lines

#GRUB_TERMINAL=console
#GRUB_GFXMODE=640x480

by removing the #. Save the file and run undate-grub to implement the changes

sudo update-grub

Now I have (a low resultion) tty working again :-)