Posts

Android CardFlip animation to exchange Fragments -

i know answer tells how display cardflip between 2 layouts, displaying card flip animation on old android but how can display flip between 2 fragments added in oncreate method? thanks i used support library. bofredo :)

entity framework - MVC4 EF Database Creation and Seeding Issue -

i getting update error when trying seed database. not sure if structure correctly setup create casefile contains basic information, create more complex file creating ot or pt casefile linked casefile (i hope semi-understandable) i order make little easier view data i'm linking directory of code , stacktrace error getting. happens when add casefile code in seed method of configuration.cs file. somewhere hanging on old definition foreign key relationship between casefile , keywordid , settingid there in incarnation of class removed. i tried delete database , used package manager add-migration initial gave me file '201308191626305_initial.cs' has these foriegn keys created. tried manually remove these file before running 'update-database -verbose' still produces errors complaining keyword-keywordid in stack track. tables build correctly , populated except casefile table gets created correctly not populated. updating source files here. large files... na...

python - Can't read line from html page -

i trying cut time format specific site. regex working (tried regex tester , worked), when try run code in python get: import urllib,re sock = urllib.urlopen("http://www.wolframalpha.com/input/?i=time") htmlsource = sock.read() sock.close() ips = re.findall( r'([01]?[0-9]{1}|2[0-3]{1}):[0-5]{1}[0-9]{1}:[0-5]{1}[0-9]{1}',htmlsource) print ips the result: >>> ['7', '4'] >>> the time on regextester.com marked red color want extract time in following format: xx:xx:xx (24h). why happening? thank you! you have redundant quantifiers in regexp (those {1} ). can remove them. another thing re.findall returning captures, hours. change first capture non-caturing group (?: ... ) , capture whole regex: ((?:[01]?[0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]) this should doing think.

Cleaning a CSV file using linux commands, while ignoring commas between quotes -

i've got rather large csv file need import postgresql database, virtually contains many errors import using sql copy command. i've managed fix issue quotation marks being in places shouldn't, using awk command: awk -f\" 'nf % 2 == 1 { print $0 }' ./db_downloaded.csv > ./db_sanitized.csv this drops line has odd number of quotation marks on it, , works quite well. other common problem run incorrect number of columns. current solution problem use following awk command drop line has wrong number of commas: awk -f"," 'nf == 40 { print $0 }' ./db_sanitized.csv > ./db_sanitized2.csv however, makes drop rows have commas between quotes, quite few rows. now, it's not critical every single row imported, i'd if had way count commas didn't appear between quotation marks on row. way can think have sort of boolean variable flips every time there's quotation mark in stream, turn off checking commas, i'm not s...

linux - Awk between two patterns with pattern in the middle -

hi looking awk can find 2 patterns , print data between them file if in middle there third patterns in middle. example: start 1 2 middle 3 end start 1 2 end , output be: start 1 2 middle 3 end i found in web awk '/patterns1/, /patterns2/' path > text.txt need output third patterns in middle. and here solution without flags: $ awk 'begin{rs="end"}/middle/{printf "%s", $0; print rt}' file start 1 2 middle 3 end explanation: rs variable record separator , set "end", each record separated "end". then filter records contain "middle", /middle/ filter, , matched records print current record $0 , separator print rt

php - fnmatch() returning false with pure wildcard -

i have following code: echo "matching: ".$params['perm']." against: "; var_dump($perm); if (fnmatch($params['perm'], $perm)) { $x=true; } $this->code = 200; return $x; for asking if $perm contains start of $params['perm'] or * in case output is: matching: acl.adduser against: array(1) { [0]=> string(1) "*" } {"code":200,"data":false} shouldn't return true since * permission have, , allows me own acl.adduser ? $perm supposed string, while in example array. fnmatch not work correctly in case, , should have seen php warning this. also, order of arguments appears reversed. test works expected: var_dump(fnmatch('*', 'acl.adduser'));

dataset - BIRT Data set consisting of report parameters -

i rather new birt , reporting, , not sure whether there easy answer question have yet find one. i have 10 parameters want use consist of data within data set, unsure how approach this. the idea user enters list of names , numbers through parameters, numbers query xml data. then, xml data grouped within chart , table according names passed. i group data if names consisted of data set, separate parameters. i had image below, new community not have enough reputation post this, unfortunately. idea create report comparing total electrical consumption comparing different electrical meters, names drawn parameters , xml data consisting of values , timestamps. understanding, best way approach create data set consisting of parameters, unsure how this. advice appreciated.