Word Table Breaks (or not)

March 31st, 2013 No comments

I’m currently writing an essay and I’ve got a lot ot tables in my word document. There are many ways to prevent cells, rows or tables to be splitted.
Here’s a list of the different possibilities:

Wenn man Tabellen oder nur einzelne Teile einer Tabelle vor unerwünschten Seitenumbrüchen schützen will, bieten sich folgende Einstellungen an:

  • Seitenumbruch in einer Zelle/Zeile verhindern: „Seitenwechsel in der Zeile zulassen“ deaktivieren (Tabelleneigenschaften > Reiter „Zeile“)
  • Seitenumbruch zwischen zwei Tabellenzeilen verhindern: „Absätze nicht trennen“ für die erste Tabellenzeile aktivieren (Format > Absatz > Reiter „Zeilen- und Seitenumbruch “)

Wenn mehrere Zeilen einer Tabelle auf einer Seite zusammen gehalten werden sollen, müssen mehrere, aufeinanderfolgende Zeilen mit dem Attribut „Absätze nicht trennen“ formatiert werden. Mit diesem Hilfsmittel lassen sich verschiedene Teile einer Tabelle auf einer Seite zusammen halten:

  • Die ganze Tabelle („Absätze nicht trennen“ für alle Zeilen außer der letzten)
  • Die ersten drei Zeilen nach der Tabellenkopfzeile („Absätze nicht trennen“ für die Tabellenkopfzeile und die nächsten beiden normalen Zeilen)
  • Die letzten drei Zeilen einer Tabelle („Absätze nicht trennen“ für die vor-vorletzte und vorletzte Tabellenzeile)
  • Die ganze Tabelle mit der Tabellenbeschriftung und der Quellenangabe („Absätze nicht trennen“ für alle Tabellenzeilen sowie den Absatz mit der Tabellenbeschriftung)

Wenn ein normaler Absatz vor der Tabelle, z.B. eine Tabellen-Beschriftung oder Tabellen-Überschrift mit der Tabelle zusammen halten sollen, muss auch für diesen Absatz „Absätze nicht trennen“ eingeschaltet werden.

Wenn ein normaler Absatz nach einer Tabelle mit der Tabelle (bzw. der letzten Tabellenzeile) zusammen gehalten werden soll, dann muss man für die letzte Tabellenzeile „Absätze nicht trennen“ einschalten.

Source

Ad
Categories: Uncategorized Tags:

Cleanup your TFS Workspace

February 26th, 2013 No comments

After some time, your TFS-Workspace can get quite crowded with files and folders which were deleted.

To clean your workspace and delete all unversioned files, navigate to a folder which is under source control and run the following command:
tfpt treeclean /exclude:*.suo,*.user /recursive
After some time, you’ll get a dialog which shows all files which will get deleted.

Ad
Categories: Tools Tags:

Fixing NTFS Security Permissions (Win 7/8)

January 12th, 2013 No comments

Sometimes after formatting a Harddrive and re-installing Windows, the NTFS-Permissions for other drives are kinda corrupted (need Admin-Rights for everything, “Unknown User” is there, …).

There is a simple command-line command you can execute to reset the permissions.

  1. Start “cmd” as Administrator
  2. Navigate to the Drive you want to reset the permissions
  3. Run the following command: icacls * /T /Q /C /RESET

After a while, your permissions are all fixed!

Source: http://lallousx86.wordpress.com/2009/06/14/resetting-ntfs-files-security-and-permission-in-windows-7/

More Info about icacls.exe

Ad
Categories: Tools Tags:

Msysgit couldn’t reserve space for cygwin’s heap

December 13th, 2012 No comments

This error has greeted me several times before in the past when working with Msysgit on Windows. It alway appears for no apparent reason; sometimes from one boot to the next, and sometimes it suddenly starts happening while the system is running. Once the error is there, it stays consistently at the very least until the next reboot. Sometimes it only happens for specific commands like “git log”, sometimes it seems to affect every cygwin command.
Read more…

Categories: Programming, Tools Tags:

Why “Browser OS” is a stupid idea

October 1st, 2012 No comments

Yesterday, I listened to an episode of the .NET Rocks podcast featuring Scott Hanselman and Chris Sells talking about HTML and JavaScript in today’s modern web. While the episode is essentially hysterically funny and I quite like Hanselman and his (at times) extremely helpful blog posts, there is a lot in this particular episode that rubbed me the wrong way and I somehow need to get this off my chest.
Read more…

Categories: HTML / CSS, Programming Tags:

PowerShell “|%” Construct

September 6th, 2012 No comments

Recently I stumbled on a piece of PowerShell syntax that confused me massively on first glance

$ some-command |% {some-expression}

It took me a while to find the documentation for that since I was of course looking in the wrong place. It looked to me like some sort of special pipe, when in fact it is just a pipe “|” followed by the ForEach-Object CmdLet which has an alias that (unfortunately) is “%”. So what was actually happening is:

$ some-command | ForEach-Object {some-expression}

For example, I used this to basically fill in some placeholders in a template file

$ Get-Content "mytemplate.txt" |% {$_ -replace "PLACEHOLDER", "42"}

Categories: PowerShell Tags:

OpenSSH Configuration

April 10th, 2012 No comments

I work quite a bit with Git these days and I do that cross-platform. On Windows I tend to use msysgit (with the GIT Bash) since I already know my way around the Git command line and quite frankly, I like it. One of the things I always have to Google together from different sources is how to get an SSH setup that allows me to authenticate with Github and my own repositories using public/private keys. Read more…

Categories: Tools Tags: , , ,

add attributes on properties in a generated class

April 4th, 2012 No comments

If you need to add attributes on properties in a generated class, you can do this by using following pattern.

[MetadataType(typeof(TimeFrame_Extension))]
public partial class TimeFrame { }

public class TimeFrame_Extension
{
    [XmlIgnore]
    public string From { get; set; }

    [XmlIgnore]
    public string To { get; set; }
}

source : http://ardalis.com/adding-attributes-to-generated-classes

Categories: C#, Programming Tags:

Cancel running JQuery AJAX Request

February 28th, 2012 No comments

I’ve implemented a google map which loads the markers according the current viewport. This can result in a lot of requests if a user is panning / zooming wildly.

Here’s a pattern which cancels requests and only processes the last one:

// Globals
var currentRequestID = 0;
var currentRequest;
var requestTimer;

// Add the Event for reloading the Markers
google.maps.event.addListener(map, 'idle', function () {
	SingleProcessMarkerLoading(map);
});

function SingleProcessMarkerLoading(map) {
	// Clear the "Queue"
	clearTimeout(requestTimer);
	// Abort if a Request is running
	if (currentRequest) { currentRequest.abort(); }
	// Start a new Request
	requestTimer = setTimeout(function () {
		// Get the RequestID, increase for the next Request
		localRequestID = ++currentRequestID;
		// Load the markers
		LoadMarkersForCurrentViewport(map, localRequestID);
	}, 500);
}

function LoadMarkersForCurrentViewport(map, localRequestID) {
	// Get the current Bounds
	var bounds = map.getBounds();

	// Get the Points
	var swPoint = bounds.getSouthWest();
	var nePoint = bounds.getNorthEast();

	// Get the Coordinates
	var swLat = swPoint.lat();
	var swLng = swPoint.lng();
	var neLat = nePoint.lat();
	var neLng = nePoint.lng();

	// Calculate an Adjustment for increasing the Viewport a little
	var increasePercentage = 0.1;
	var latAdjustment = ((neLat - swLat) * increasePercentage);
	var lngAdjustment = ((neLng - swLng) * increasePercentage);

	// Adjust
	swLat -= latAdjustment;
	swLng -= lngAdjustment;
	neLat += latAdjustment;
	neLng += lngAdjustment;

	// Build the Url to get the Markers for the Viewport
	var url = 'someurl?' + swLat + '|' + swLng + '|' + neLat + '|' + neLng;

	// Get the JSON-Response and process it
	currentRequest = $.get(url, function (data) {
		// Check if the Request is obsolete
		if (localRequestID != currentRequestID) return;
		// Process the Data here
		});
	return;
}
Categories: Programming Tags: , , ,

Microsoft Reference Source Code

February 14th, 2012 No comments

Sometimes you want to step into Source Code which comes from the core components of Microsoft. You can either decompile the .Net Libraries with .Net Reflector or ILSpy or use the Microsoft Reference Source Code Packages.

The Reference Source Code allows you to directly lookup the source or even debug into the core components of Microsoft. Just download the Packages you want, install them and you’re done. You now can Debug into (F11) the source or look it up (F12).

Alternative for Visual Studio 2010
Setting up Visual Studio 2010 to step into Microsoft .NET Source Code

Categories: Programming, Tools, VisualStudio Tags: