Search Results

Search found 3 results on 1 pages for 'colinfang'.

Page 1/1 | 1 

  • How to copy paste images from / to OneNote web app from / to local PC?

    - by colinfang
    Does OneNote web app support paste image from clipboard (with ctrl+v)? I can manage to copy an image from web and directly paste into OneNote, but I cannot copy from my PC, and paste into OneNote. So, I tried copying an image from web and paste into desktop Word, and paste the image from Word but failing to paste into OneNote web app. Also, how can I copy an image from OneNote web app and paste into my desktop Word, or anywhere? It seems only paste a link to https://onenote.officeapps.live.com/o/GetImage.ashx?Fi=SD.....

    Read the article

  • How to store visited states in iterative deepening / depth limited search?

    - by colinfang
    Update: Search for the first solution. for a normal Depth First Search it is simple, just use a hashset bool DFS (currentState) = { if (myHashSet.Contains(currentState)) { return; } else { myHashSet.Add(currentState); } if (IsSolution(currentState) return true; else { for (var nextState in GetNextStates(currentState)) if (DFS(nextState)) return true; } return false; } However, when it becomes depth limited, i cannot simply do this bool DFS (currentState, maxDepth) = { if (maxDepth = 0) return false; if (myHashSet.Contains(currentState)) { return; } else { myHashSet.Add(currentState); } if (IsSolution(currentState) return true; else { for (var nextState in GetNextStates(currentState)) if (DFS(nextState, maxDepth - 1)) return true; } return false; } Because then it is not going to do a complete search (in a sense of always be able to find a solution if there is any) before maxdepth How should I fix it? Would it add more space complexity to the algorithm? Or it just doesn't require to memoize the state at all. Update: for example, a decision tree is the following: A - B - C - D - E - A | F - G (Goal) Starting from state A. and G is a goal state. Clearly there is a solution under depth 3. However, using my implementation under depth 4, if the direction of search happens to be A(0) -> B(1) -> C(2) -> D(3) -> E(4) -> F(5) exceeds depth, then it would do back track to A, however E is visited, it would ignore the check direction A - E - F - G

    Read the article

  • why my test performance class gives me inconsistent results even after proper warm-up?

    - by colinfang
    i made a class which helps me measure time for any methods in Ticks. Basically, it runs testing method 100x, and force GC, then it records time taken for another 100x method runs. x64 release ctrl+f5 VS2012/VS2010 the results are following: 2,914 2,909 2,913 2,909 2,908 2,907 2,909 2,998 2,976 2,855 2,446 2,415 2,435 2,401 2,402 2,402 2,399 2,401 2,401 2,400 2,399 2,400 2,404 2,402 2,401 2,399 2,400 2,402 2,404 2,403 2,401 2,403 2,401 2,400 2,399 2,414 2,405 2,401 2,407 2,399 2,401 2,402 2,401 2,404 2,401 2,404 2,405 2,368 1,577 1,579 1,626 1,578 1,576 1,578 1,577 1,577 1,576 1,578 1,576 1,578 1,577 1,578 1,576 1,578 1,577 1,579 1,585 1,576 1,579 1,577 1,579 1,578 1,579 1,577 1,578 1,577 1,578 1,576 1,578 1,577 1,578 1,599 1,579 1,578 1,582 1,576 1,578 1,576 1,579 1,577 1,578 1,577 1,591 1,577 1,578 1,578 1,576 1,578 1,576 1,578 As you can see there are 3 phases, first is ~2,900, second is ~2,400, then ~1,550 What might be the reason to cause it? the test performance class code follows: public static void RunTests(Func<long> myTest) { const int numTrials = 100; Stopwatch sw = new Stopwatch(); double[] sample = new double[numTrials]; Console.WriteLine("Checksum is {0:N0}", myTest()); sw.Start(); myTest(); sw.Stop(); Console.WriteLine("Estimated time per test is {0:N0} ticks\n", sw.ElapsedTicks); for (int i = 0; i < numTrials; i++) { myTest(); } GC.Collect(); string testName = myTest.Method.Name; Console.WriteLine("----> Starting benchmark {0}\n", myTest.Method.Name); for (int i = 0; i < numTrials; i++) { sw.Restart(); myTest(); sw.Stop(); sample[i] = sw.ElapsedTicks; } double testResult = DataSetAnalysis.Report(sample); for (int j = 0; j < numTrials; j = j + 5) Console.WriteLine("{0,8:N0} {1,8:N0} {2,8:N0} {3,8:N0} {4,8:N0}", sample[j], sample[j + 1], sample[j + 2], sample[j + 3], sample[j + 4]); Console.WriteLine("\n----> End of benchmark"); }

    Read the article

1