Posts

String algorithm suggestion to find all the common prefixes of a list of strings -

String algorithm suggestion to find all the common prefixes of a list of strings - what algorithm suggest find out longest mutual prefixes of list of strings? i might have strings such as: call mike , schedule meeting. phone call lisa phone call adam , inquire quote. implement new class iphone project implement new class rails controller purchase groceries i want find out next prefixes: "call " "implement new class " i'll using objective c, ready made cocoa solution plus (though not must). edit: clarified question: sort strings find longest mutual prefix of each adjacent pair sort , dedupe mutual prefixes, remove that's strict prefix of another. actually, step (3) requires remove that's dupe/prefix of another, trie or whatever instead of sorting. in fact may whole thing can done faster suitably annotated trie - if include "count" @ each node you're looking exactly nodes count of 2+, have no children c...

ant - Concatenating CSS files in a specific order -

ant - Concatenating CSS files in a specific order - i have series of css files concatenating , minfying (using yui compressor) ant build script. css files are: reset.css formalize.css typography.css site.css there other css files ie.css , editor.css don't want include in minification. have build script working next code, problem files need concatenated in order posted above. <target name="minifycss"> <!-- combine css files except ones specified ie or content editor --> <concat destfile="css/e123-1.css"> <fileset dir="css" includes="*.css" excludes="ie.css editor.css print.css" /> </concat> <!-- minify css --> <java fork="true" jar="${yuicompressor.lib}" dir="css" output="css/e123-1.min.css"> <arg value="e123-1.css" /> </java> </target> i assume files added alphabeti...

Boost serialization end of file -

Boost serialization end of file - i serialize multiple objects binary archive boost. when reading objects binary_iarchive , there way know how many objects in archive or way observe end of archive ? the way found utilize try-catch observe stream exception. in advance. i can think of number of approaches: serialize stl containers to/from archive (see documentation). archive automatically maintain track of how many objects there in containers. serialize count variable before serializing objects. when reading objects, you'll know beforehand how many objects expect read back. i find approach kinda gross, i'm listing anyway sake of completeness. :-p have lastly object deed kind of sentinel indicates end of list of objects. perhaps add together islast fellow member variable object. this not pretty, have separate "index file" alongside archive stores number of objects in archive. use tellp position of underlying stream object observe if you...

wcf configuration - WCF Test Client - Any way to save the services/settings to a file to reload easily later? -

wcf configuration - WCF Test Client - Any way to save the services/settings to a file to reload easily later? - the wcf test client powerful tool. can avoid creating new console app test services. however, annoying can't seem save services/config add together client. if close , open 1 time again starts fresh. any way save "instance" of wcf test client... kind of how fxcop let's scan binaries , save setting fxcop file? the default behaviour of test client remember lastly few urls you've used. not enough? wcf wcf-configuration wcftestclient

android - Return to application from settings intent -

android - Return to application from settings intent - in applicattion need go de settings activity of phone whith next code: `intent myintent = new intent(settings.action_location_source_settings); startactivity(myintent);´ then in settings activity, when user press key, want homecoming applicattion ¿it's possible? thanks it should automatically go previous activity when key pressed. utilize location settings activity in 1 of apps , when user presses returns them app. time might not happen if app closed free memory app/service, unlikely if opening location settings . android android-intent settings return

r - Data frame of tables from a list -

r - Data frame of tables from a list - suppose have list observations: foo <- list(c("c", "e", "a", "f"), c("b", "d", "b", "a", "c"), c("b", "c", "c", "f", "a", "f"), c("d", "a", "a", "d", "d", "f", "b" )) > foo [[1]] [1] "c" "e" "a" "f" [[2]] [1] "b" "d" "b" "a" "c" [[3]] [1] "b" "c" "c" "f" "a" "f" [[4]] [1] "d" "a" "a" "d" "d" "f" "b" and vector each unique element: vec <- letters[1:6] > vec [1] "a" "b" "c" "d" "e" "f" i want obtain info frame counts of ea...

unit testing - googletest printing COleDateTime values -

unit testing - googletest printing COleDateTime values - i have integrated googletest our mfc application. while writing tests involving coledatetime objects came across next warning: 1>gtest/gtest-printers.h(169) : warning c4244: 'initializing' : conversion 'date' 'const testing::internal::biggestint', possible loss of info 1>gtest/gtest-printers.h(168) : while compiling class template fellow member function 'void testing::internal2::typewithoutformatter<t,ktypekind>::printvalue(const t &,std::ostream *)' the test following: test(functiontest, sumdays) { coledatetime res = sumdays(coledatetime(2010,10,31,0,0,0), 1); expect_eq(coledatetime(2010,11,01,0,0,0), res); } the problem cannot add together << operator or printto method documentation announces. allot more tests going involve date values want avoid inline solution documentation refers to. is there solution command print string coledatetime val...