This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| SaveFileDialog sfd = new SaveFileDialog(); | |
| sfd.Title = "Save on XML"; | |
| sfd.OverwritePrompt = true; | |
| sfd.DefaultExt = "xml"; | |
| sfd.Filter = "XML files (*.xml)|*.xml|All files (*.*)|*.*"; | |
| if (sfd.ShowDialog() == DialogResult.OK) | |
| { | |
| ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const string REGEX = @"((?<id>\d+)\:)?(?<par1>\d+)\-(?<par2>\d+)\-(?<par3>\d+)(\/(?<par4>\d+)\-(?<par5>\d+))?"; | |
| private static Lazy<Regex> g_RegEx = new Lazy<Regex>(() => new Regex(REGEX, | |
| RegexOptions.ExplicitCapture | RegexOptions.Compiled | RegexOptions.CultureInvariant)); | |
| ... | |
| Match m = g_RegEx.Value.Match(value); | |
| Group gID = m.Groups["id"] as Group; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using System.Threading; | |
| using System.Net; | |
| using System.Diagnostics; | |
| using System.IO; | |
| using System.Web; | |
| using System.Collections.Specialized; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class CommandsController : ApiController | |
| { | |
| [HttpGet][HttpPost][HttpDelete] | |
| public void Action1() | |
| { | |
| } | |
| [HttpGet] | |
| [HttpPost] | |
| [HttpDelete] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // original source is likely to be https://github.com/thinkpixellab/bot/blob/master/net40-client/Core/LockHelper.cs although I can't verify it anymore. | |
| /// <summary> | |
| /// Provides services of Monitor static class, but while allowing better debugging of deadlocks. | |
| /// </summary> | |
| public class LockHelper | |
| { | |
| /// <summary> | |
| /// Creates a new instance of LockHelper. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // This builds untyped accessors. Remove converts for strong typing. | |
| var paramExp = Expression.Parameter(typeof(object), "obj"); | |
| var castParamExp = Expression.Convert(paramExp, this.UserDataDescriptor.Type); | |
| var propAccess = Expression.Property(castParamExp, PropertyInfo.Name); | |
| var castPropAccess = Expression.Convert(propAccess, typeof(object)); | |
| var lambda = Expression.Lambda<Func<object, object>>(castPropAccess, paramExp); | |
| Func<object, object> getter = lambda.Compile(); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Taken from http://social.msdn.microsoft.com/Forums/vstudio/en-US/a43fe625-a5cd-4438-895f-3ddeec6eb866/image-resizing-using-c?forum=csharpgeneral | |
| public static System.Drawing.Bitmap ResizeImage(System.Drawing.Image image, int width, int height) | |
| { | |
| //a holder for the result | |
| Bitmap result = new Bitmap(width, height); | |
| //use a graphics object to draw the resized image into the bitmap | |
| using (Graphics graphics = Graphics.FromImage(result)) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export PS1="\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[m\]\$ " | |
| export PS1="\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[m\]\$ " | |
| export CLICOLOR=1 | |
| export LSCOLORS=ExFxBxDxCxegedabagacad | |
| export GIT_EDITOR='subl -w' | |
| export EDITOR='subl -w' | |
| export JAVA_HOME=$(/usr/libexec/java_home) | |
| export AKKA_HOME="~/tools/akka-2.3.11" | |
| alias ll='ls -FGlAhp' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using UnityEngine; | |
| using System.Collections; | |
| public class LevelCloner : MonoBehaviour | |
| { | |
| // Use this for initialization | |
| void Start () | |
| { | |
| Debug.Log ("Enter!"); |
OlderNewer