Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

group by - Get line counts of INSERT's by tablename from mysqldump - awk, sed, grep -


bash master needed...

to compare mysqldumps multiple dates, need sql group by, order functionality... on command line...

using grep / sed / awk need insert statements, export line count per tablename. i'd love byte count per tablename too...

a typical line looks this:

insert `admin_rule` ... 

match insert, match tablename in ``, counting unique tablename

how little awk snippet:

begin   { fs="`" } /^insert/ { count[$2]+=1; bytes[$2]+=length($0) } end { for(table in count) print table "," count[table] "," bytes[table]; } 

edit: test case here:

$ cat test.sql insert `t1` values('a', 12, 'b'); insert `t2` values('test', 'whatever', 3.14); insert `t3` values(1, 2, 3, 4); insert `t2` values('yay', 'works', null); insert `t2` values(null, 'something' 2.71); insert `t3` values(5, 6, 7, 8); insert `t5` values('beta', 'gamma'); insert `t6` values('this', 'is', 'table', 'six'); $ awk -f t.awk <test.sql t5,1,41 t6,1,54 t1,1,38 t2,3,144 t3,2,72 

Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -