Posts

c# - overloading explicit CAST operator with user-defined interface parameter -

c# - overloading explicit CAST operator with user-defined interface parameter - at these given classes [activerecord] public class basemoo : activerecordbase [activerecord] public class foo : basemoo { } somewhere in code do var fooobj = new foo(); // fooobj basemoo obj = fooobj; here seek cast var newfooobj = (foo)obj; // , goes if changes classes this: [activerecord(lazy=true)] public class basemoo : activerecordbase [activerecord(lazy=true)] public class foo : basemoo { } making lazyest @ these lines: var fooobj = new foo(); // fooobj basemoo obj = fooobj; the ar creates non foo instance instead basemooproxy object var newfooobj = (foo)obj; // throws invalidcast exception as sugested @adam houldsworth in this question i overloads foo explicit operator in way public static explicit operator foo(nhibernate.proxy.inhibernateproxy nhproxy) { var resultobj = (foo)nhproxy.insomewayigettheoriginalobject(); // insomewayigettheoriginalobje...

java - Is there a simple way of parsing this text into a Map -

java - Is there a simple way of parsing this text into a Map - i receive response service below. how parse map ? first thought of split @ whitespace doesn't work value might contain spaces e.g. @ value of sa key in below response. one alternative thought of split @ whitespace provided previous character double quote. not sure how write regex though. tx="0000000000108000001830001" fi="" os="8" ci="qu01sf1s2032" aw="sss" sa="1525 windward concourse" parse @ quotes. utilize regular look find each key/value pair, assuming each value in quotes. question be, rules if value contains embedded quotes? (are escaped using '\' or such? regardless, not accounted in below...) for example: (\w+)="([^"]*)" this give groups #1 , #2 can used provide key , value, respectively. run in loop, using java's matcher.find() method, until find of pairs. sample code: string input = ...

iphone - Difference between Icon properties in info.plist? -

iphone - Difference between Icon properties in info.plist? - i'm working on iphone app , i'm not sure plist property utilize out of following: could shed lite on each of them , difference between them? apple requires include icon measures 57x57 pixels. if going utilize image, set under icon file property. however, apple recommends include images of different sizes different purposes, such retina display, ipad, , search bar. if going include multiple images, create app better, retina one, include of images in icon files property. note not need icon file property if using icon files property. i still developing ios 4 not know icon files (ios 5) property assume there new places icon might pop in ios 5 not pop in older ios versions. place images under property. hope helps. iphone ios xcode

asp.net - Change folder permission after deploy -

asp.net - Change folder permission after deploy - i have in application folder save files uploaded users. folder needs write permision apppool user. untill did manualy. my question is, if done somehow automatic ? maybe running script after deploy or this. i have not tried out myself, seems if deployment bundle stuff in vs2010: http://leethams.wordpress.com/2010/06/12/modifying-directory-permissions-with-web-deployment/ asp.net asp.net-mvc deployment

c# - Google Contacts API - After getting the access token (oauth) -

c# - Google Contacts API - After getting the access token (oauth) - i managed access token google's contacts api when seek create phone call retrieve logged in user's profile, 401 unauthorized error... i did research , followed steps mentioned in "various" google documentations ( this one , this one , many others) no use... so far think i'm signing request wrong. here's i'm doing after access token. string outurl,querystring; string sig = oauth.generatesignature(new uri("https://www.google.com/m8/feeds/contacts/default/full"), server.urlencode(oauth.consumerkey), oauth.consumersecret, oauth.token, null, "get", timestamp, nonce, out outurl, out querystring); string requrl = "https://www.google.com/m8/feeds/contacts/default/full?access_token=" + oauth.token + "&oauth_signature_method=hmac-sha1&oauth_signature=" + server.urlencode(sig) + "&oauth_consumer_key=" + oauth.consumerkey + ...

Android autoCompleteTextView changes with screensize? -

Android autoCompleteTextView changes with screensize? - hello fellow android developpers, i have problem regarding autocompletetextview. i'm developping on tablet, , customized nicely. when run on tablet, looks this: this want - visible, little items, bluish instead of orange. cool. , happens when run exact same app on smaller device, illustration nexus-s: the original views disappear, have orange stuff, , see 1 suggested item @ time or 2 @ best. not intended. if run app not in landscape, in portrait, works fine. insane. know can maintain custom layout on smaller screen? the sec image shown here result of auto finish text view or edit text when device in landscape mode. if device in portrait mode display suggestions in vertical list, , landscape mode display in horizontal list , tries fill entire screen edit text , soft keyboard. i faced same problem, please check android developers website info supporting multiple screens, may help you. new answe...

php - Using a constant inside a static array -

php - Using a constant inside a static array - im on php 5.2.x i have loader class looks so: class loader { static $account_nameclasses = array( 'db' => '/home/account_name/public_html/includes/php/db.php', 'skin' => '/home/account_name/public_html/includes/php/skin.php', 'api' => '/home/account_name/public_html/api/apiclass.php', 'search' => '/home/account_name/public_html/includes/php/search.php', 'user' => '/home/account_name/public_html/includes/php/user.php' ); static function loader($classname) { $filename = self::$account_nameclasses[$classname]; if(file_exists($filename)){ require_once $filename; }else{ homecoming false; } } } spl_autoload_register(array(account_name_loader, 'loader')); as can see, repeat /home/account_name/public_html/includes/ph...