protected virtual void OnPreProcess(EventArgs e) { if (PreProcess != null) { PreProcess?.Invoke(this, e); } }
public void divideSpace() { string testString = "not 30.24 and(125 or 175)"; Assert.AreEqual( "not 30.24 and ( 125 or 175 )" , PreProcess.divideSpace(testString)); }
public void identifyChar() { Assert.AreEqual(PreProcess.IdentifyChar('a') , charType.letter); Assert.AreEqual(PreProcess.IdentifyChar('4') , charType.number); Assert.AreEqual(PreProcess.IdentifyChar('+') , charType.symbol); }
static void Main(string[] args) { string path = @"C:\Users\tram.huynh\Downloads\Demo\Example\1.cs"; string path2 = @"C:\Users\tram.huynh\Downloads\Demo\PreProcess\1.cs"; string a = "#include abc;\r\nusing System;\nnamespace ConsoleApp1\n{\n class Program\n { /*\n* abc desnnj \n*/\n static void Main(string[] args)\n {\n //abc// ebc/\n string c =\"acf\";\n int a;\nint b, s;\n /*dvahsdbjas\n dad**/\n Console.WriteLine(b);\n Console.ReadKey();/*dvahsdbjas*/\n }\n }\n}\n"; string text = File.ReadAllText(path); //var b = PreProcess.StripComments(text); var b = PreProcess.StripComments(a); var c = PreProcess.RemoveBlank(b); var d = PreProcess.RemovePackage(c); File.WriteAllText(path2, d); //Console.ReadKey(); }
private void runTheAlgorithm(int minStores, int maxStores, bool continueWhenMatchesFound, List<Store> storeList, List<Item> itemList, Algorithm alg, PreProcess preProc = null) { // Pre-process the data if (preProc != null) { preProc(ref storeList, ref itemList); } // Now run the algorithms for the specified number of stores in the solution. for (int k = minStores; k <= maxStores; k++) { if ((!matchesfound || continueWhenMatchesFound) && !calcWorker.CancellationPending) { beginCalculation(k, storeList.Count); alg(k, storeList, itemList); endCalculation(k); } } }
private void runApproxAlgorithm( int minStores, int maxStores, int millisToRunEach, List <Store> storeList, List <Item> itemList, Algorithm alg, //PreProcess preProc = null) PreProcess preProc) { // Pre-process the data if (preProc != null) { preProc(ref storeList, ref itemList); } if (timeoutTimer != null) { timeoutTimer.Stop(); } else { timeoutTimer = new System.Timers.Timer(); timeoutTimer.Elapsed += timeoutTimer_Elapsed; } timeoutTimer.Interval = millisToRunEach; for (int k = minStores; k <= maxStores; k++) { if (!calcWorker.CancellationPending) { beginCalculation(k, storeList.Count); timeoutTimer.Start(); alg(k, storeList, itemList); timeoutTimer.Stop(); endCalculation(k); } } }
private void runApproxAlgorithm(int minStores, int maxStores, int millisToRunEach, List<Store> storeList, List<Item> itemList, Algorithm alg, PreProcess preProc = null) { // Pre-process the data if (preProc != null) { preProc(ref storeList, ref itemList); } if (timeoutTimer != null) { timeoutTimer.Stop(); } else { timeoutTimer = new System.Timers.Timer(); timeoutTimer.Elapsed += timeoutTimer_Elapsed; } timeoutTimer.Interval = millisToRunEach; for (int k = minStores; k <= maxStores; k++) { if (!calcWorker.CancellationPending) { beginCalculation(k, storeList.Count); timeoutTimer.Start(); alg(k, storeList, itemList); timeoutTimer.Stop(); endCalculation(k); } } }
private void runTheAlgorithm(int minStores, int maxStores, bool continueWhenMatchesFound, List <Store> storeList, List <Item> itemList, Algorithm alg, PreProcess preProc = null) { // Pre-process the data if (preProc != null) { preProc(ref storeList, ref itemList); } // Now run the algorithms for the specified number of stores in the solution. for (int k = minStores; k <= maxStores; k++) { if ((!matchesfound || continueWhenMatchesFound) && !calcWorker.CancellationPending) { beginCalculation(k, storeList.Count); alg(k, storeList, itemList); endCalculation(k); } } }
public CommandNode <TEnv> Handles(PreProcess <TEnv> process) { Process = process; return(this); }