Posts

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.

java - Regex matching doesn't work even though the pattern is correct -

it's been few years since i've used regex, if remember correctly, following should work: string test = "axaxa"; pattern p = pattern.compile("([a-c])x\1x\1"); matcher m = p.matcher(test); m matches nothing on run. super simplified version of i'm doing in code. example taken java tutorial on regex! tried rewrite html matching code way when didn't work, went researching, thinking did wrong... according internet, haven't. so. have clue why doesn't work? extra info, test.matches(the_pattern) returns false . seems group backtracking messing up. try using \\1 in pace of \1 . \ escape character in java string. send \1 regex engine, need escape \ \\1 .

c# - asp.net publish only pages -

i have asp.net 3.5 web project. there lots of images on images folder. apprx. 1.5gb size. everytime want publish project, takes 35minutes. dont want publish folders. want publish pages. im using shared web hosting. how can solve problem? thanks. remove images folder project. publishing website publish folders part of project, removing folder project ensure not published. this add burden maintaining site , ensuring have images on development environment. you can still have in source control if wish.

erlang - CouchDB heart-beat time-out -

my couchdb (production) server shut down, without wanting to. while inspecting logs noticed erlang/couchdb (one or other) sends heart beat, , heart beat monitored. when time-out occurs, server brutally killed ( couchdb -k ). unwanted behaviour, on production server. i've come across this issue , states same , indicates occurs during heavy server loads, noticed also. i'm looking solution keep server running, need know more behaviour. unfortunately both the couchdb wiki , the guide don't give information (only parameter in changes api). can provide more info this? the couchdb -k should kill background process , couch should restarted. default restart feature disabled. enable should use -r parameter value greater 0. can in bin/couchdb script - change respawn_timeout 0 e.g. 5.

logging - message passing in python -

i read metaphor objects use message passing while passing message object. possible capture/log such messages! learning purposes, thought necessary handly tool provenance system! you might want @ aop (aspect oriented programming) . in essence allows capture object events such method invocation , apply logic them. in case it'd print out traces. have @ a lightweight approach aspect-oriented programming in python , should need.

Dynamic WCF Service Contracts based on authentication credentials -

1) want have client application adds reference wcf service 2) client application should able send credentials wcf service 3) based on credentials permissions, wcf service should return appropriate interface (service contract) client 4) client consumes it. e.g. suppose hav class @ server, defines entity 'asset' , have methods related possible operations on it class asset { add() { ..... } edit() { ...... } flag() { ...... } deploy() { ........ } } now have client application wants perform actions on 'asset'. don't want give entire class dll client. instead want give interface. client can consume , call appropriate actions on it. now problem when client app adds reference wcf service. how can appropriate interface asset class returned client based on ws* or authentication credentials. .net 4.0 provides easy way create , return service contract dynamically? e.g. //following pseudo code if(current.user.role == 'admin') { ...

Ruby/RoR - Count occurrence of an element in an array -

i'v hash {1=>true, 7=>false, 6=>true, 4=>false} or array [1, true], [7, false], [6, true], [4, false]] or [true, false, true, false] . how can find number of true s in array? in order count elements, have iterate on collection. since iterating on hash yields two-element array s, first 2 same: { 1 => true, 7 => false, 6 => true, 4 => false }.count(&:last) [[1, true], [7, false], [6, true], [4, false]].count(&:last) for simple array case, this: [true, false, true, false].count(true) this array of course same hash#values hash above, use same method on that: { 1 => true, 7 => false, 6 => true, 4 => false }.values.count(true) if don't know 1 of 3 get, use this: { 1 => true, 7 => false, 6 => true, 4 => false }.flatten.count(true) [[1, true], [7, false], [6, true], [4, false]].flatten.count(true) [true, false, true, false].flatten.count(true)

objective c - iPhone, Access Array, local declaration hides instance variable -

i have array in view controller a: fiarray = [[nsmutablearray alloc] init]; firma * afirma = [[firma alloc] init]; afirma.title = @"title"; afirma.boxofficegross = [nsnumber numberwithint: 200000000]; afirma.summary = @"summary"; afirma.name = @"name"; afirma.subtitle = @"subtitle"; afirma.coordinate = cllocationcoordinate2dmake(37.33444, -122.036777); [fiarray addobject: afirma]; [afirma release]; now want access values , add them object in view controller b nsmutablearray *anarry = [root fiarray]; firma *gettitle = (firma *) [anarry objectatindex:0]; myannotation *ale = [[myannotation alloc] init]; ale.title = gettitle; ale.subtitle = @"bla"; ale.coordinate = (123,123); [mapview addannotation:ale]; but warning above, regarding "gettitle" variable. , there no value stored in ale.title . gettitle getter defined in uiviewcontroller access title property. rename !