Search Results

Search found 1993 results on 80 pages for 'comparison'.

Page 21/80 | < Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >

  • Java graph library for comparing 2 graphs

    - by user311909
    Hello, Does anyone know a good java library for graph comparing by searching maximal common subgraph isomorphism to get information about their similarity? I do not want to compare graphs based on node labels. Or is there any other way how to topologicaly compare graphs with good java library? Now I am using library SimPack and it is usefull but I need something more. Any suggestions will be very helpful. Thanks in advance

    Read the article

  • Pros/cons of reading connection string from physical file vs Application object (ASP.NET)?

    - by HaterTot
    my ASP.NET application reads an xml file to determine which environment it's currently in (e.g. local, development, production). It checks this file every single time it opens a connection to the database, in order to know which connection string to grab from the Application Settings. I'm entering a phase of development where efficiency is becoming a concern. I don't think it's a good idea to have to read a file on a physical disk ever single time I wish to access the database (very often). I was considering storing the connection string in Application["ConnectionString"]. So the code would be public static string GetConnectionString { if (Application["ConnectionString"] == null) { XmlDocument doc = new XmlDocument(); doc.Load(HttpContext.Current.Request.PhysicalApplicationPath + "bin/ServerEnvironment.xml"); XmlElement xe = (XmlElement) xnl[0]; switch (xe.InnerText.ToString().ToLower()) { case "local": connString = Settings.Default.ConnectionStringLocal; break; case "development": connString = Settings.Default.ConnectionStringDevelopment; break; case "production": connString = Settings.Default.ConnectionStringProduction; break; default: throw new Exception("no connection string defined"); } Application["ConnectionString"] = connString; } return Application["ConnectionString"].ToString(); } I didn't design the application so I figure there must have been a reason for reading the xml file every time (to change settings while the application runs?) I have very little concept of the inner workings here. What are the pros and cons? Do you think I'd see a small performance gain by implementing the function above? THANKS

    Read the article

  • Difference in F# and Clojure when calling redefined functions

    - by Michiel Borkent
    In F#: > let f x = x + 2;; val f : int -> int > let g x = f x;; val g : int -> int > g 10;; val it : int = 12 > let f x = x + 3;; val f : int -> int > g 10;; val it : int = 12 In Clojure: 1:1 user=> (defn f [x] (+ x 2)) #'user/f 1:2 user=> (defn g [x] (f x)) #'user/g 1:3 user=> (g 10) 12 1:4 user=> (defn f [x] (+ x 3)) #'user/f 1:5 user=> (g 10) 13 Note that in Clojure the most recent version of f gets called in the last line. In F# however still the old version of f is called. Why is this and how does this work?

    Read the article

  • Ruby on rails active-record generated SQL on Postgres

    - by jpartogi
    Dear all, Why does Ruby on rails generated more queries in the background on Postgres than MySQL? I haven't tried deploying Rails on production with Postgres yet, but I am just afraid this generated queries would affect the performance. Do you find Rails with Postgres is slower than MySQL, knowing that it produce more query on the background? Or it is relatively the same?

    Read the article

  • Which key value store is the most promising/stable?

    - by Mike Trpcic
    I'm looking to start using a key/value store for some side projects (mostly as a learning experience), but so many have popped up in the recent past that I've got no idea where to begin. Just listing from memory, I can think of: CouchDB MongoDB Riak Redis Tokyo Cabinet Berkeley DB Cassandra MemcacheDB And I'm sure that there are more out there that have slipped through my search efforts. With all the information out there, it's hard to find solid comparisons between all of the competitors. My criteria and questions are: (Most Important) Which do you recommend, and why? Which one is the fastest? Which one is the most stable? Which one is the easiest to set up and install? Which ones have bindings for Python and/or Ruby? Edit: So far it looks like Redis is the best solution, but that's only because I've gotten one solid response (from ardsrk). I'm looking for more answers like his, because they point me in the direction of useful, quantitative information. Which Key-Value store do you use, and why? Edit 2: If anyone has experience with CouchDB, Riak, or MongoDB, I'd love to hear your experiences with them (and even more so if you can offer a comparative analysis of several of them)

    Read the article

  • Need advice on comparing the performance of 2 equivalent linq to sql queries

    - by uvita
    I am working on tool to optimize linq to sql queries. Basically it intercepts the linq execution pipeline and makes some optimizations like for example removing a redundant join from a query. Of course, there is an overhead in the execution time before the query gets executed in the dbms, but then, the query should be processed faster. I don't want to use a sql profiler because I know that the generated query will be perform better in the dbms than the original one, I am looking for a correct way of measuring the global time between the creation of the query in linq and the end of its execution. Currently, I am using the Stopwatch class and my code looks something like this: var sw = new Stopwatch(); sw.Start(); const int amount = 100; for (var i = 0; i < amount; i++) { ExecuteNonOptimizedQuery(); } sw.Stop(); Console.Writeline("Executing the query {2} times took: {0}ms. On average, each query took: {1}ms", sw.ElapsedMilliseconds, sw.ElapsedMilliseconds / amount, amount); Basically the ExecutenNonOptimizedQuery() method creates a new DataContext, creates a query and then iterates over the results. I did this for both versions of the query, the normal one and the optimized one. I took the idea from this post from Frans Bouma. Is there any other approach/considerations I should take? Thanks in advance!

    Read the article

  • Divide and conquer method to compute roots [SOLVED]

    - by hellsoul153
    Hello, Knowing that we can use Divide-and-Conquer algorithm to compute large exponents, for exemple 2 exp 100 = 2 exp(50) * 2 exp(50), which is quite more efficient, is this method efficient using roots ? For exemple 2 exp (1/100) = (2 exp(1/50)) exp(1/50) ? In other words, I'm wondering if (n exp(1/x)) is more efficient to (n exp(1/y)) for x < y and where x and y are integers.

    Read the article

  • Any difference in compiler behavior for each of these snippets?

    - by HotHead
    Please consider following code: 1. uint16 a = 0x0001; if(a < 0x0002) { // do something } 2. uint16 a = 0x0001; if(a < uint16(0x0002)) { // do something } 3. uint16 a = 0x0001; if(a < static_cast<uint16>(0x0002)) { // do something } 4. uint16 a = 0x0001; uint16 b = 0x0002; if(a < b) { // do something } What compiler does in backgorund and what is the best (and correct) way to do above testing? p.s. sorry, but I couldn't find the better title :) EDIT: values 0x0001 and 0x0002 are only example. There coudl be any 2 byte value instead. Thank you in advance!

    Read the article

  • Find a name in a list if the name is spelt wrong

    - by Matt
    I've got a list of names which some code checks against to see if the person exists, and if so do some stuff.. My issue is that I want to handle the case of the name being entered incorrectly.. I.e. I have a list of names Bob Frank Tom Tim John If I type in Joohn, I want it to ask me if I meant John. If I type Tm, I get asked if I meant Tim, if I say no, it asks if i meant Tom.. Etc.. Has anyone done something like this before?

    Read the article

  • MS-ACCESS query to match first few characters in string comparision

    - by neobee
    What query is suitable to compare two tables specied below, however only part of string in location(table1) will matches with the Location(table2). Location(table1) Location(table2) india- north USxcs India-west Indiaasd India- east Indiaavvds India- south Africassdcasv US- north Africavasvdsa us-west UKsacvavsdv uk- east Indiacascsa uk- south UScssca Africa-middle Indiacsasca Africa-south Africaccc Africa-east UKcac only 1st two characters of location(table1) and 1st two characters of location(table2) should match. Please help only any four characters of location(table1)and any two characters of location(table2)should match.

    Read the article

  • Looking for pros/cons of using GWT or JSF

    - by cliff.meyers
    I'm a long time Java developer who has been building UI with Adobe Flex for the past few years. I'm looking to broaden my repertoire with a RIA technology that runs in a plain-old browser, no plug-ins required. I've read a lot about GWT but don't know much about JSF, especially given the varying implementations. Below are some criteria that are important to me as a developer. I'm hoping that the community might be able to tell me about the strengths and weaknesses of GWT and JSF in each: Layout: is it declarative, programmatic or a mix of both? Control library: how rich is the available control library? How easy is it to extend or write custom controls that "play nice" with the built-ins? Javascript: how much of it do I need to write in order to be successful with the framework? Cross-browser: assuming I'm not writing a lot of my own HTML and JS, do the frameworks function equally well in all modern browsers? Tooling: is a rapid edit/refresh cycle available? How easy is it to debug the client and server code? Bookmarking / Browser Navigation: this is a common problem in Flex; does the framework play nicely with these? I would love to hear any other important pros / cons I might not have covered. Thanks!

    Read the article

  • Is there a difference here?

    - by HotHead
    Please consider following code: 1. uint16 a = 0x0001; if(a < 0x0002) { // do something } 2. uint16 a = 0x0001; if(a < uint16(0x0002)) { // do something } 3. uint16 a = 0x0001; if(a < static_cast<uint16>(0x0002)) { // do something } 4. uint16 a = 0x0001; uint16 b = 0x0002; if(a < b) { // do something } What compiler does in backgorund and what is the best (and correct) way to do above testing? p.s. sorry, but I couldn't find the better title :) Thank you in advance!

    Read the article

  • JavaScript Used As PHP

    - by Nathan Campos
    I'm now thinking to stabilish my code on Javascript, and begin to do all on it, but I want to know about it's security and flexibility compared to PHP. I want to know too, if it can be sucessfully used to develop things like forum boards, full web-sites and things like this, as PHP does.

    Read the article

  • comparing salt and hashed passwords during login doesn't seem work right....

    - by Pandiya Chendur
    I stored salt and hash values of password during user registration... But during their login i then salt and hash the password given by the user, what happens is a new salt and a new hash is generated.... string password = collection["Password"]; reg.PasswordSalt = CreateSalt(6); reg.PasswordHash = CreatePasswordHash(password, reg.PasswordSalt); These statements are in both registration and login.... salt and hash during registration was eVSJE84W and 18DE22FED8C378DB7716B0E4B6C0BA54167315A2 During login it was 4YDIeARH and 12E3C1F4F4CFE04EA973D7C65A09A78E2D80AAC7..... Any suggestion.... public static string CreateSalt(int size) { //Generate a cryptographic random number. RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider(); byte[] buff = new byte[size]; rng.GetBytes(buff); // Return a Base64 string representation of the random number. return Convert.ToBase64String(buff); } public static string CreatePasswordHash(string pwd, string salt) { string saltAndPwd = String.Concat(pwd, salt); string hashedPwd = FormsAuthentication.HashPasswordForStoringInConfigFile( saltAndPwd, "sha1"); return hashedPwd; }

    Read the article

  • How do you tell if two wildcards overlap?

    - by Tom Ritter
    Given two strings with * wildcards, I would like to know if a string could be created that would match both. For example, these two are a simple case of overlap: Hello*World Hel* But so are all of these: *.csv reports*.csv reportsdump.csv Is there an algorithm published for doing this? Or perhaps a utility function in Windows or a library I might be able to call or copy?

    Read the article

  • Samples of Scala and Java code where Scala code looks simpler/has fewer lines?

    - by Roman
    I need some code samples (and I also really curious about them) of Scala and Java code which show that Scala code is more simple and concise then code written in Java (of course both samples should solve the same problem). If there is only Scala sample with comment like "this is abstract factory in Scala, in Java it will look much more cumbersome" then this is also acceptable. Thanks!

    Read the article

  • How to calculate this string-dissimilarity function efficiently?

    - by ybungalobill
    Hello, I was looking for a string metric that have the property that moving around large blocks in a string won't affect the distance so much. So "helloworld" is close to "worldhello". Obviously Levenshtein distance and Longest common subsequence don't fulfill this requirement. Using Jaccard distance on the set of n-grams gives good results but has other drawbacks (it's a pseudometric and higher n results in higher penalty for changing single character). [original research] As I thought about it, what I'm looking for is a function f(A,B) such that f(A,B)+1 equals the minimum number of blocks that one have to divide A into (A1 ... An), apply a permutation on the blocks and get B: f("hello", "hello") = 0 f("helloworld", "worldhello") = 1 // hello world -> world hello f("abba", "baba") = 2 // ab b a -> b ab a f("computer", "copmuter") = 3 // co m p uter -> co p m uter This can be extended for A and B that aren't necessarily permutations of each other: any additional character that can't be matched is considered as one additional block. f("computer", "combuter") = 3 // com uter -> com uter, unmatched: p and b. Observing that instead of counting blocks we can count the number of pairs of indices that are taken apart by a permutation, we can write f(A,B) formally as: f(A,B) = min { C(P) | P:|A|?|B|, P is bijective, ?i?dom(P) A[P(i)]=B[P(i)] } C(P) = |A| + |B| - |dom(P)| - |{ i | i,i+1?dom(P) and P(i)+1=P(i+1) }| - 1 The problem is... guess what... ... that I'm not able to calculate this in polynomial time. Can someone suggest a way to do this efficiently? Or perhaps point me to already known metric that exhibits similar properties?

    Read the article

< Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >