How do I get Emacs to fill sentences, but not paragraphs?

Here’s what I use, which was mostly cribbed from Luca de Alfaro: (defun fill-sentence () (interactive) (save-excursion (or (eq (point) (point-max)) (forward-char)) (forward-sentence -1) (indent-relative t) (let ((beg (point)) (ix (string-match “LaTeX” mode-name))) (forward-sentence) (if (and ix (equal “LaTeX” (substring mode-name ix))) (LaTeX-fill-region-as-paragraph beg (point)) (fill-region-as-paragraph beg (point)))))) I bind this to M-j with (global-set-key … Read more

How to make a pattern “fixed” in Raphael.js / IE?

It seems like a redraw bug in IE. One workaround is to reset the fill image by adding path_f.attr({fill:’url(http://www.fotoshack.us/fotos/58480536599_97943820.jpg)’}); after the translation. See fiddle here. This works okay in IE9 except for being slightly sluggish, but maybe you can find a cheaper way of forcing redraws. Not tested in older IEs. Also, it causes flickering … Read more

MATLAB, Filling in the area between two sets of data, lines in one figure

Building off of @gnovice’s answer, you can actually create filled plots with shading only in the area between the two curves. Just use fill in conjunction with fliplr. Example: x=0:0.01:2*pi; %#initialize x array y1=sin(x); %#create first curve y2=sin(x)+.5; %#create second curve X=[x,fliplr(x)]; %#create continuous x value array for plotting Y=[y1,fliplr(y2)]; %#create y values for out … Read more

How to fill a Path in Android with a linear gradient?

While steelbytes’ answer will probably give you more control over the individual sections of the gradient, you can do it without the path: Paint m_Paint = new Paint(); protected void onDraw(Canvas canvas) { super.onDraw(canvas); // start at 0,0 and go to 0,max to use a vertical // gradient the full height of the screen. m_Paint.setShader(new … Read more