How To Switch an iPod from Mac to Windows
Posted via email from 米良的草窝
How To Switch an iPod from Mac to Windows
Posted via email from 米良的草窝
Posted via email from 米良的草窝
/// <summary> /// Pattern matching is used in functional languages. It can be thought of as a "switch statement on steriods"./// Here's an example of very basic pattern matching using Elevate. /// </summary>[Fact]public void PatternMatchingWithFunctions() { //given a value var value = "alpha"; var result = value.Match() //we can start a pattern match like this .With(string.IsNullOrEmpty, stringValue => "empty") //causes the pattern match to return "empty" if value is null or empty .With(stringValue => value.Contains("a"), stringValue => "contains a!") //match any string containing "a" .EndMatch(); Assert.Equal("contains a!", result); } [Fact]public void PatternMatchingWithMatchPatternsAsValues(){ //given a value var value = "gamma"; //we can equality match against values without having to specify //a condition function var result = value.Match() .With("alpha", stringValue => "1st letter = " + stringValue) .With("beta", stringValue => "2nd letter = " + stringValue) .With("gamma", stringValue => "3rd letter = " + stringValue) .EndMatch(); Assert.Equal("3rd letter = gamma", result); } [Fact]public void PatternMatchingWithMatchPatternsAndResultsAsValues(){ //given a value var value = "gamma"; //we can also match without having to speficy a lambda for either the //match predicate or the result var result = value.Match() .With("alpha", "first letter") .With("beta", "second letter") .With("gamma", "third letter") .EndMatch(); Assert.Equal("third letter", result); } [Fact]public void IncompletePatternMatching(){ //given a value var stringValue = "alpha, beta"; //if we construct a pattern match that does not match the value Assert.ThrowsDelegateWithReturn incompleteMatch = () => stringValue.Match() .With(value => value == "alpha", value => "Found foo") .With(value => value == "beta", value => "Found bar") .EndMatch(); //evaluating it will throw Assert.Throws<IncompletePatternMatchException>(incompleteMatch); } [Fact]public void PatternMatchingWithElse(){ //given a value var stringValue = "alpha, beta"; //we can add Else to cause the incomplete match from above to have a //default case var elseMatch = stringValue.Match() .With(value => value == "alpha", value => "Found foo") .With(value => value == "beta", value => "Found bar") .Else(value => "default!") .EndMatch(); Assert.Equal("default!", elseMatch); } [Fact]public void PatternMatchingElseWithValues(){ //given a value var stringValue = "alpha, beta"; //we can specify else as a concrete value without having //to use the input value var elseMatch = stringValue.Match() .With(value => value == "alpha", value => "Found foo") .With(value => value == "beta", value => "Found bar") .Else("default!") .EndMatch(); Assert.Equal("default!", elseMatch); }
/// <summary>/// A class containing extensions methods to enable pattern matching. /// </summary>public static class ObjectExtensionsForPatternMatching { /// <summary> /// Begins a pattern match on the specified value /// </summary> /// <typeparam name="T">The type of the value being matched.</typeparam> /// <param name="value">The value to match.</param> /// <returns>The matching context</returns> public static PatternMatchContext<T> Match<T>(this T value) { return new PatternMatchContext<T>(value); }}
/// <summary>
/// A partially complete pattern match with only the input type specified./// </summary> /// <typeparam name="T">The type returned by this pattern match</typeparam> public class PatternMatchContext<T> { internal readonly T value; internal PatternMatchContext(T value) { this.value = value; } /// <summary> /// Specifies the first condition to match against. Also defines the type of the result value. /// </summary> /// <typeparam name="TResult">The type of the result.</typeparam> /// <param name="condition">The condition to match against.</param> /// <param name="result">The result to return if this condition matches.</param> /// <returns>The pattern match with the selector defined</returns> public PatternMatch<T, TResult> With<TResult>( Func<T, bool> condition, Func<T, TResult> result) { if (condition == null) throw new ArgumentNullException("condition", "condition is null."); if (result == null) throw new ArgumentNullException("result", "result is null."); var match = new PatternMatch<T, TResult>(value); return match.With(condition, result); }}
/// <summary> /// A pattern matching block with the return value and the/// the type to match on specified. /// </summary>/// <typeparam name="T">The type of the value being matched.</typeparam> /// <typeparam name="TResult">The type of the result.</typeparam> public class PatternMatch<T, TResult> { private readonly T value; private readonly List<Tuple<Func<T, bool>, Func<T, TResult>>> cases = new List<Tuple<Func<T, bool>, Func<T, TResult>>>(); private Func<T, TResult> elseFunc; internal PatternMatch(T value) { this.value = value; } /// <summary> /// Specifies a condition to match against, and the value to return /// </summary> /// <param name="matchCondition">The condition to match with.</param> /// <param name="matchResult">The result to return if the condition matches.</param> /// <returns>The current PatternMatch</returns> public PatternMatch<T, TResult> With(Func<T, bool> matchCondition, Func<T, TResult> matchResult) { if (matchCondition == null) throw new ArgumentNullException("matchCondition", "matchCondition is null."); if (matchResult == null) throw new ArgumentNullException("matchResult", "matchResult is null."); cases.Add(Tuple.Create(matchCondition, matchResult)); return this; } /// <summary> /// Specifies a default result if all conditions fail to match. /// </summary> /// <param name="result">The result.</param> /// <returns>The current PatternMatch</returns> public PatternMatch<T, TResult> Else(Func<T, TResult> result) { if (elseFunc != null) throw new InvalidOperationException("Cannot have multiple else cases"); elseFunc = result; return this; } /// <summary> /// Evaluates this pattern match, returning the result of the condition that matches. /// </summary> /// <returns>the match resulg</returns> /// <remarks>If this does not contain a match, this method /// throws an IncompleteMatchException</remarks> public TResult EndMatch() { if (elseFunc != null) cases.Add( Tuple.Create<Func<T, bool>, Func<T, TResult>>(x => true, elseFunc)); foreach (var item in cases) if (item.First(value)) return item.Second(value); throw new IncompleteMatchException("Incomplete pattern match"); }}
由代码可知,Elevate的形成的Function Call Chain中的Context的切换完全是通过返回不同类型的class实现的~在一次一用的环境里,没有问题,但是如果在需要持久化的Case里就会有一些问题~
由于一次一用的实现和持久化的实现的代码几乎没有任何区别~但是Context的切换则会有非常大的不同,如何能够在重用实现的情况下还产生不同的Context(VS的IntelliSence会检测到这种区别,同时在没有强制类型转换的情况下,用户无法调用本不应该调用的Method,例如对一个持久化版的PatternMatch去调用EndMatch()方法,相应的,用户应该调用Apply方法)。
最后我想到了可以利用Interface去标识上下文,而利用同一个class去实现所有的interface,这样,context在切换,但是数据没有复制,调用永远都是一个class。
然而这个时候有存在问题了,由于需要实现ExtensionMethod,为了尽可能的复用代码,我比如让一些方法共集中到一个Interface里,但是同一个方法的调用,返回的Context Interface在一次一用和持久化的场景里,又应该有所不同,于是问题就彻底复杂话了~于是Generic的终极使用方法出现了————Generic的迭代。
public interface IWithContext<T, TResult, TSelf> where TSelf : IWithContext<T, TResult, TSelf>{ TSelf With(Func<T, bool> condition, Func<T, TResult> result); }
注意 TSelf 的限定~华丽丽的限定!还有With方法的返回类型!哈哈~
这里是完整的代码:
好复杂的继承关系!
public class PatternMatch<T, TResult> : IInstantMatchContext<T, TResult>, IWithContext<T, TResult, IInstantMatchContext<T, TResult>>, IElseContext<T, TResult, IEndMatchContext<TResult>>, IEndMatchContext<TResult>, ICompileMatchContext<T, TResult>, IWithContext<T, TResult, ICompileMatchContext<T, TResult>>, IElseContext<T, TResult, IAppliableCompilableContext<T, TResult>>, IAppliableCompilableContext<T, TResult>, ICompilableContext<T, TResult>, IApplyContext<T, TResult>{ #region Constructors internal PatternMatch() { HasValue = false; Cases = new List<MatchCase>(); ElseCase = null; } internal PatternMatch(T input) : this() { this.Input = input; HasValue = true; } #endregion #region Instant Mode Status Fields private T Input; private bool HasValue; #endregion #region Common Runtime Status Fields protected List<MatchCase> Cases; protected Func<T, TResult> ElseCase; #endregion #region Functional Methods protected PatternMatch<T, TResult> With(Func<T, bool> condition, Func<T, TResult> result) { if (condition == null) throw new ArgumentNullException("condition", "condition is null."); if (result == null) throw new ArgumentNullException("result", "result is null."); Cases.Add(new MatchCase(condition, result)); return this; } protected PatternMatch<T, TResult> Else(Func<T, TResult> result) { if (result == null) throw new ArgumentNullException("result", "result is null."); ElseCase = result; return this; } protected TResult EndMatch() { if (!HasValue) throw new InvalidOperationException(); return Apply(Input); } protected IApplyContext<T, TResult> Compile() { return this; } protected TResult Apply(T input) { foreach (var foCase in Cases) { if (foCase.Condition(input)) return foCase.Result(input); } if (ElseCase != null) return ElseCase(input); else throw new IncompletePatternMatchException(); } #endregion #region Nested Entity protected struct MatchCase { public MatchCase(Func<T, bool> condition, Func<T, TResult> result) { this.Condition = condition; this.Result = result; } public Func<T, bool> Condition; public Func<T, TResult> Result; } #endregion #region Contextual Methods #region Instant Mode #region IWithContext<T,TResult,IInstantMatchContext<T,TResult>> Members IInstantMatchContext<T, TResult> IWithContext<T, TResult, IInstantMatchContext<T, TResult>>.With(Func<T, bool> condition, Func<T, TResult> result) { return this.With(condition, result); } #endregion #region IElseContext<T,TResult,IEndMatchContext<TResult>> Members IEndMatchContext<TResult> IElseContext<T, TResult, IEndMatchContext<TResult>>.Else(Func<T, TResult> result) { return this.Else(result); } #endregion #region IEndMatchContext<TResult> Members TResult IEndMatchContext<TResult>.EndMatch() { return this.EndMatch(); } #endregion #endregion #region Compile Mode #region IWithContext<T,TResult,ICompileMatchContext<T,TResult>> Members ICompileMatchContext<T, TResult> IWithContext<T, TResult, ICompileMatchContext<T, TResult>>.With(Func<T, bool> condition, Func<T, TResult> result) { return this.With(condition, result); } #endregion #region IElseContext<T,TResult,IAppliableCompilableContext<T,TResult>> Members IAppliableCompilableContext<T, TResult> IElseContext<T, TResult, IAppliableCompilableContext<T, TResult>>.Else(Func<T, TResult> result) { return this.Else(result); } #endregion #region ICompilableContext<T,TResult> Members IApplyContext<T, TResult> ICompilableContext<T, TResult>.Compile() { return this.Compile(); } #endregion #region IApplyContext<T,TResult> Members TResult IApplyContext<T, TResult>.Apply(T input) { return this.Apply(input); } #endregion #endregion #endregion}
public class InitialWithContext<T> : IWithContext<T>
{ private T input; internal InitialWithContext(T input) { this.input = input; } #region IWithContext<T> Members public IInstantMatchContext<T, TResult> With<TResult>(Func<T, bool> condition, Func<T, TResult> result) { return (new PatternMatch<T, TResult>(input) as IInstantMatchContext<T, TResult>).With(condition, result); } #endregion}
public static class PatternMatch
{ public static <span
Posted via email from 米良的草窝
/// <summary> /// Pattern matching is used in functional languages. It can be thought of as a "switch statement on steriods"./// Here's an example of very basic pattern matching using Elevate. /// </summary>[Fact]public void PatternMatchingWithFunctions() { //given a value var value = "alpha"; var result = value.Match() //we can start a pattern match like this .With(string.IsNullOrEmpty, stringValue => "empty") //causes the pattern match to return "empty" if value is null or empty .With(stringValue => value.Contains("a"), stringValue => "contains a!") //match any string containing "a" .EndMatch(); Assert.Equal("contains a!", result); } [Fact]public void PatternMatchingWithMatchPatternsAsValues(){ //given a value var value = "gamma"; //we can equality match against values without having to specify //a condition function var result = value.Match() .With("alpha", stringValue => "1st letter = " + stringValue) .With("beta", stringValue => "2nd letter = " + stringValue) .With("gamma", stringValue => "3rd letter = " + stringValue) .EndMatch(); Assert.Equal("3rd letter = gamma", result); } [Fact]public void PatternMatchingWithMatchPatternsAndResultsAsValues(){ //given a value var value = "gamma"; //we can also match without having to speficy a lambda for either the //match predicate or the result var result = value.Match() .With("alpha", "first letter") .With("beta", "second letter") .With("gamma", "third letter") .EndMatch(); Assert.Equal("third letter", result); } [Fact]public void IncompletePatternMatching(){ //given a value var stringValue = "alpha, beta"; //if we construct a pattern match that does not match the value Assert.ThrowsDelegateWithReturn incompleteMatch = () => stringValue.Match() .With(value => value == "alpha", value => "Found foo") .With(value => value == "beta", value => "Found bar") .EndMatch(); //evaluating it will throw Assert.Throws<IncompletePatternMatchException>(incompleteMatch); } [Fact]public void PatternMatchingWithElse(){ //given a value var stringValue = "alpha, beta"; //we can add Else to cause the incomplete match from above to have a //default case var elseMatch = stringValue.Match() .With(value => value == "alpha", value => "Found foo") .With(value => value == "beta", value => "Found bar") .Else(value => "default!") .EndMatch(); Assert.Equal("default!", elseMatch); } [Fact]public void PatternMatchingElseWithValues(){ //given a value var stringValue = "alpha, beta"; //we can specify else as a concrete value without having //to use the input value var elseMatch = stringValue.Match() .With(value => value == "alpha", value => "Found foo") .With(value => value == "beta", value => "Found bar") .Else("default!") .EndMatch(); Assert.Equal("default!", elseMatch); }
/// <summary>/// A class containing extensions methods to enable pattern matching. /// </summary>public static class ObjectExtensionsForPatternMatching { /// <summary> /// Begins a pattern match on the specified value /// </summary> /// <typeparam name="T">The type of the value being matched.</typeparam> /// <param name="value">The value to match.</param> /// <returns>The matching context</returns> public static PatternMatchContext<T> Match<T>(this T value) { return new PatternMatchContext<T>(value); }}
/// <summary>
/// A partially complete pattern match with only the input type specified./// </summary> /// <typeparam name="T">The type returned by this pattern match</typeparam> public class PatternMatchContext<T> { internal readonly T value; internal PatternMatchContext(T value) { this.value = value; } /// <summary> /// Specifies the first condition to match against. Also defines the type of the result value. /// </summary> /// <typeparam name="TResult">The type of the result.</typeparam> /// <param name="condition">The condition to match against.</param> /// <param name="result">The result to return if this condition matches.</param> /// <returns>The pattern match with the selector defined</returns> public PatternMatch<T, TResult> With<TResult>( Func<T, bool> condition, Func<T, TResult> result) { if (condition == null) throw new ArgumentNullException("condition", "condition is null."); if (result == null) throw new ArgumentNullException("result", "result is null."); var match = new PatternMatch<T, TResult>(value); return match.With(condition, result); }}
/// <summary> /// A pattern matching block with the return value and the/// the type to match on specified. /// </summary>/// <typeparam name="T">The type of the value being matched.</typeparam> /// <typeparam name="TResult">The type of the result.</typeparam> public class PatternMatch<T, TResult> { private readonly T value; private readonly List<Tuple<Func<T, bool>, Func<T, TResult>>> cases = new List<Tuple<Func<T, bool>, Func<T, TResult>>>(); private Func<T, TResult> elseFunc; internal PatternMatch(T value) { this.value = value; } /// <summary> /// Specifies a condition to match against, and the value to return /// </summary> /// <param name="matchCondition">The condition to match with.</param> /// <param name="matchResult">The result to return if the condition matches.</param> /// <returns>The current PatternMatch</returns> public PatternMatch<T, TResult> With(Func<T, bool> matchCondition, Func<T, TResult> matchResult) { if (matchCondition == null) throw new ArgumentNullException("matchCondition", "matchCondition is null."); if (matchResult == null) throw new ArgumentNullException("matchResult", "matchResult is null."); cases.Add(Tuple.Create(matchCondition, matchResult)); return this; } /// <summary> /// Specifies a default result if all conditions fail to match. /// </summary> /// <param name="result">The result.</param> /// <returns>The current PatternMatch</returns> public PatternMatch<T, TResult> Else(Func<T, TResult> result) { if (elseFunc != null) throw new InvalidOperationException("Cannot have multiple else cases"); elseFunc = result; return this; } /// <summary> /// Evaluates this pattern match, returning the result of the condition that matches. /// </summary> /// <returns>the match resulg</returns> /// <remarks>If this does not contain a match, this method /// throws an IncompleteMatchException</remarks> public TResult EndMatch() { if (elseFunc != null) cases.Add( Tuple.Create<Func<T, bool>, Func<T, TResult>>(x => true, elseFunc)); foreach (var item in cases) if (item.First(value)) return item.Second(value); throw new IncompleteMatchException("Incomplete pattern match"); }}
由代码可知,Elevate的形成的Function Call Chain中的Context的切换完全是通过返回不同类型的class实现的~在一次一用的环境里,没有问题,但是如果在需要持久化的Case里就会有一些问题~
由于一次一用的实现和持久化的实现的代码几乎没有任何区别~但是Context的切换则会有非常大的不同,如何能够在重用实现的情况下还产生不同的Context(VS的IntelliSence会检测到这种区别,同时在没有强制类型转换的情况下,用户无法调用本不应该调用的Method,例如对一个持久化版的PatternMatch去调用EndMatch()方法,相应的,用户应该调用Apply方法)。
最后我想到了可以利用Interface去标识上下文,而利用同一个class去实现所有的interface,这样,context在切换,但是数据没有复制,调用永远都是一个class。
然而这个时候有存在问题了,由于需要实现ExtensionMethod,为了尽可能的复用代码,我比如让一些方法共集中到一个Interface里,但是同一个方法的调用,返回的Context Interface在一次一用和持久化的场景里,又应该有所不同,于是问题就彻底复杂话了~于是Generic的终极使用方法出现了————Generic的迭代。
public interface IWithContext<T, TResult, TSelf> where TSelf : IWithContext<T, TResult, TSelf>{ TSelf With(Func<T, bool> condition, Func<T, TResult> result); }
注意 TSelf 的限定~华丽丽的限定!还有With方法的返回类型!哈哈~
这里是完整的代码:
好复杂的继承关系!
public class PatternMatch<T, TResult> : IInstantMatchContext<T, TResult>, IWithContext<T, TResult, IInstantMatchContext<T, TResult>>, IElseContext<T, TResult, IEndMatchContext<TResult>>, IEndMatchContext<TResult>, ICompileMatchContext<T, TResult>, IWithContext<T, TResult, ICompileMatchContext<T, TResult>>, IElseContext<T, TResult, IAppliableCompilableContext<T, TResult>>, IAppliableCompilableContext<T, TResult>, ICompilableContext<T, TResult>, IApplyContext<T, TResult>{ #region Constructors internal PatternMatch() { HasValue = false; Cases = new List<MatchCase>(); ElseCase = null; } internal PatternMatch(T input) : this() { this.Input = input; HasValue = true; } #endregion #region Instant Mode Status Fields private T Input; private bool HasValue; #endregion #region Common Runtime Status Fields protected List<MatchCase> Cases; protected Func<T, TResult> ElseCase; #endregion #region Functional Methods protected PatternMatch<T, TResult> With(Func<T, bool> condition, Func<T, TResult> result) { if (condition == null) throw new ArgumentNullException("condition", "condition is null."); if (result == null) throw new ArgumentNullException("result", "result is null."); Cases.Add(new MatchCase(condition, result)); return this; } protected PatternMatch<T, TResult> Else(Func<T, TResult> result) { if (result == null) throw new ArgumentNullException("result", "result is null."); ElseCase = result; return this; } protected TResult EndMatch() { if (!HasValue) throw new InvalidOperationException(); return Apply(Input); } protected IApplyContext<T, TResult> Compile() { return this; } protected TResult Apply(T input) { foreach (var foCase in Cases) { if (foCase.Condition(input)) return foCase.Result(input); } if (ElseCase != null) return ElseCase(input); else throw new IncompletePatternMatchException(); } #endregion #region Nested Entity protected struct MatchCase { public MatchCase(Func<T, bool> condition, Func<T, TResult> result) { this.Condition = condition; this.Result = result; } public Func<T, bool> Condition; public Func<T, TResult> Result; } #endregion #region Contextual Methods #region Instant Mode #region IWithContext<T,TResult,IInstantMatchContext<T,TResult>> Members IInstantMatchContext<T, TResult> IWithContext<T, TResult, IInstantMatchContext<T, TResult>>.With(Func<T, bool> condition, Func<T, TResult> result) { return this.With(condition, result); } #endregion #region IElseContext<T,TResult,IEndMatchContext<TResult>> Members IEndMatchContext<TResult> IElseContext<T, TResult, IEndMatchContext<TResult>>.Else(Func<T, TResult> result) { return this.Else(result); } #endregion #region IEndMatchContext<TResult> Members TResult IEndMatchContext<TResult>.EndMatch() { return this.EndMatch(); } #endregion #endregion #region Compile Mode #region IWithContext<T,TResult,ICompileMatchContext<T,TResult>> Members ICompileMatchContext<T, TResult> IWithContext<T, TResult, ICompileMatchContext<T, TResult>>.With(Func<T, bool> condition, Func<T, TResult> result) { return this.With(condition, result); } #endregion #region IElseContext<T,TResult,IAppliableCompilableContext<T,TResult>> Members IAppliableCompilableContext<T, TResult> IElseContext<T, TResult, IAppliableCompilableContext<T, TResult>>.Else(Func<T, TResult> result) { return this.Else(result); } #endregion #region ICompilableContext<T,TResult> Members IApplyContext<T, TResult> ICompilableContext<T, TResult>.Compile() { return this.Compile(); } #endregion #region IApplyContext<T,TResult> Members TResult IApplyContext<T, TResult>.Apply(T input) { return this.Apply(input); } #endregion #endregion #endregion}
public class InitialWithContext<T> : IWithContext<T>
{ private T input; internal InitialWithContext(T input) { this.input = input; } #region IWithContext<T> Members public IInstantMatchContext<T, TResult> With<TResult>(Func<T, bool> condition, Func<T, TResult> result) { return (new PatternMatch<T, TResult>(input) as IInstantMatchContext<T, TResult>).With(condition, result); } #endregion}
public static class PatternMatch
{ public static <span
Posted via email from 米良的实验室
http://msdn.microsoft.com/en-us/library/dd997383.aspx#new_specific_cultures
The display names of Chinese cultures have changed to follow the naming convention LanguageName ([Script,] Country/RegionName). In the .NET Framework 4, the word "Legacy" has been appended to the zh-CHS and zh-CHT display names to differentiate them from zh-Hans and zh-Hant. zh, which was recently introduced into Windows, has “Chinese” as its display name.
Display name | Culture name | LCID |
---|---|---|
Chinese | zh | 0x7804 |
Chinese (Simplified) Legacy | zh-CHS | 0x0004 |
Chinese (Traditional) Legacy | zh-CHT | 0x7C04 |
Chinese (Simplified) | zh-Hans | 0x0004 |
Chinese (Traditional) | zh-Hant | 0x7C04 |
Chinese (Simplified, PRC) | zh-CN | 0x0804 |
Chinese (Traditional, Hong Kong S.A.R.) | zh-HK | 0x0C04 |
Chinese (Traditional, Macao S.A.R.) | zh-MO | 0x1404 |
Chinese (Simplified, Singapore) | zh-SG | 0x1004 |
Chinese (Traditional, Taiwan) | zh-TW | 0x0404 |
The parent chain of the Chinese cultures now includes the root Chinese culture. The following examples show the complete parent chain for two of the Chinese specific cultures:
zh-CN → zh-CHS → zh-Hans → zh → Invariant
zh-TW → zh-CHT → zh-Hant → zh → Invariant
Tibetan (PRC), French (Monaco), Tamazight (Latin, Algeria), and Spanish (Spain, International Sort) display names were updated as well. When the display name changes, usually the English and native names reflect this change; however, the ISO and abbreviated names of the script, language, and country may change as well.
Posted via email from 米良的草窝
http://msdn.microsoft.com/en-us/library/dd997383.aspx#new_specific_cultures
The display names of Chinese cultures have changed to follow the naming convention LanguageName ([Script,] Country/RegionName). In the .NET Framework 4, the word "Legacy" has been appended to the zh-CHS and zh-CHT display names to differentiate them from zh-Hans and zh-Hant. zh, which was recently introduced into Windows, has “Chinese” as its display name.
Display name | Culture name | LCID |
---|---|---|
Chinese | zh | 0x7804 |
Chinese (Simplified) Legacy | zh-CHS | 0x0004 |
Chinese (Traditional) Legacy | zh-CHT | 0x7C04 |
Chinese (Simplified) | zh-Hans | 0x0004 |
Chinese (Traditional) | zh-Hant | 0x7C04 |
Chinese (Simplified, PRC) | zh-CN | 0x0804 |
Chinese (Traditional, Hong Kong S.A.R.) | zh-HK | 0x0C04 |
Chinese (Traditional, Macao S.A.R.) | zh-MO | 0x1404 |
Chinese (Simplified, Singapore) | zh-SG | 0x1004 |
Chinese (Traditional, Taiwan) | zh-TW | 0x0404 |
The parent chain of the Chinese cultures now includes the root Chinese culture. The following examples show the complete parent chain for two of the Chinese specific cultures:
zh-CN → zh-CHS → zh-Hans → zh → Invariant
zh-TW → zh-CHT → zh-Hant → zh → Invariant
Tibetan (PRC), French (Monaco), Tamazight (Latin, Algeria), and Spanish (Spain, International Sort) display names were updated as well. When the display name changes, usually the English and native names reflect this change; however, the ISO and abbreviated names of the script, language, and country may change as well.
Posted via email from 米良的实验室
Posted via email from 米良的草窝
When I log into the network at my job my Mac’s hostname always turns to:
larryx.na.corp.ipgnetwork.com
I have my local hostname set to:
larryx.local
So What I would like to do is set my Mac’s hostname to my local hostname. You can do this all from Terminal in a single line.
Run this command in Terminal:
sudo scutil --set HostName larryx.local
This is also helpful if you’re in Terminal and have a really long hostname at your prompt. If you want to view your current hostname, run this command in Terminal:
hostnameThis is what it looked like for me:
Last login: Fri May 23 09:55:20 on ttys000 larryx:~ lgordon$ hostname larryx.na.corp.ipgnetwork.com larryx:~ lgordon$ sudo scutil --set HostName larryx.local Password: larryx:~ lgordon$ hostname larryx.localCare of: CodeSnippets
终于把我的iMac的名字改过来了~但是似乎还是ping不通~可能需要一点时间刷新纪录~
Posted via email from 米良的草窝
<#@ template debug="false" hostspecific="true" language="C#" #> ... <#@ assembly name="EnvDTE" #> ... EnvDTE.DTE dte = (EnvDTE.DTE) ((IServiceProvider) this.Host) .GetService(typeof(EnvDTE.DTE)); // Open the prototype document. XmlDocument doc = new XmlDocument(); doc.Load(System.IO.Path.Combine(dte.ActiveDocument.Path, "exampleXml.xml"));
Posted via email from 米良的实验室
<#@ template debug="false" hostspecific="true" language="C#" #> ... <#@ assembly name="EnvDTE" #> ... EnvDTE.DTE dte = (EnvDTE.DTE) ((IServiceProvider) this.Host) .GetService(typeof(EnvDTE.DTE)); // Open the prototype document. XmlDocument doc = new XmlDocument(); doc.Load(System.IO.Path.Combine(dte.ActiveDocument.Path, "exampleXml.xml"));
Posted via email from 米良的草窝
Posted via email from 米良的草窝
又有招聘了
Job Overview
This position is responsible for developing software applications for CA ARCserve product line. CA ARCserve provides industry leading data protection and high availability solutions. See detail from http://www.arcserve.com
This position is based on CA’s China Technology Center (CTC) in Beijing. Join CTC, you work in a team consist of hundreds of talented engineers, also a team that uses world class development process and tools to create the best in class software of the industry.
Key Responsibilities
· Research critical enterprise applications and advanced enterprise software architecture
· Design high availability solutions for enterprise applications
· Design and code, often for the complex units/modules/products that meet functional and business requirements.
· Perform unit/module testing of software to find and correct errors.
· Contribute innovative ideas and thoughts
1. Strong programming experience on C++ technologies.
2. Good knowledge and programming experience on C#/.NET (Good Plus).
3. Strong knowledge and troubleshooting skill on Windows platform(OS, Domain, Security, Network, …).
4. Good knowledge on complex enterprise application and infrastructure, like Exchange, SharePoint, MSSQL, IIS, Dynamics, MSCS… (Good Plus).
5. Good skills on software framework design and development.
6. Excellent written and verbal communication skills in English.
7. Has passion for solving complex problems. Working smart and good learning ability.
Preferred Education
No specific requirement
Work Experience
No specific requirement
有意者请把简历发送到Di.Wen at ca.com
Posted via email from 米良的草窝