Posts

c# - Match a regex and reverse the matches within the target string -

c# - Match a regex and reverse the matches within the target string - based on this question regex \d+(?:-\d+)+ match 10-3-1 , 5-0 . example: this 10-3-1 string after performing matching , reversing, want this: this 1-3-10 string notice 10-3-1 should become 1-3-10 , not normal string reverse result in 1-3-01. a basic algorithm be: extract match string. "10-3-1" split match segments "-" character. you have list of elements. ["10","3","1"] reverse list. ["1","3","10"] join elements of array "-" character. "1-3-10" replace match newly joined string. c# regex string reverse

php - How to preserve application.ini paths using Zend_Config_Writer_Ini -

php - How to preserve application.ini paths using Zend_Config_Writer_Ini - i'm working on build scheme in phing takes zend framework project template , configures according phing parameters. 1 problem i've come across when using zend_config_writer_ini. my phing task takes pre-populated file repo called application.default.ini , modifies using zend_config_ini add together parameters build file (db details, etc). writes application.ini ready project use. simplified version of related task code looks this: $appconfig = new zend_config_ini( $appdefaultconfigpath, null, array( 'skipextends' => true, 'allowmodifications' => true ) ); $appconfig->production->resources->db->params->host = $buildproperties->db->host; $appconfig->production->resources->db->params->username = $buildproperties->db->username; $appconfig->production->resources->db->params->password = ...

swing - Java: How to select all descendants of a given ancestor on the Jtree? -

swing - Java: How to select all descendants of a given ancestor on the Jtree? - i select ancestor defaultmutabletreenode , descendant defaultmutabletreenode of ancestor in jtree. i using treeselectionlistener grab selection event on current jtree. basically, able is, select ancestor node, , able re-create it's descendant tree ancestor. you should able walk subtree recursively through children() of dmtn. fwiw: maybe help little, exampledepot site java illustration code, , have lot of swing examples. here link set of jtree examples. hope find need. http://www.exampledepot.com/egs/javax.swing.tree/pkg.html java swing jtree

css - Using print stylesheet, page overflows to two pages in print preview -

css - Using print stylesheet, page overflows to two pages in print preview - i using css print stylesheet provide alternate style page elements when printed, , hide ones don't wish printed. when page previewed in browser (tested ie8), overflows onto sec page, though of elements appear fit on single page - please see screenshots. what has alter in print stylesheet prevent , maintain page single printed page? tried setting display:none bottom-most panels, yet page still broken two. also, how prevent display of border around page , page numbering? css stylesheet /* specify class items should not print */ .noprint { display: none; } /* ensure content spans total width */ .fullwidth { width: 100%; margin: 0; float: none; } /* print styles elements */ .newscript { position: absolute; float: none; margin: 0pt auto; clear: both; /* background-image: url( '../_images/blank_rx.jpg' ); */ width: 433pt; height: 400pt; ...

javascript - Problem with showing HTML tags in Android Email client -

javascript - Problem with showing HTML tags in Android Email client - i'm trying fill subject , body of android email (or gmail) client web. <button onclick="parent.location='mailto:?subject=prijatelj ti preporučuje ponudu&amp;body=Ćao, pogledaj ovu ponudu na grupovini! <br />http://localhost:8089/deal/skocite-sa-padobranom<br />skok sa padobranom<br />skocite'">pošalji @</button> so it's simple mailto script has "" html tags. works fine on iphone, have new lines not on android shows text (it not format html). so question how new line on android email / gmail client (\r\n not works either)? you can't. the specs of mailto specifies body param first line of mail service content... strange iphone that... or, found (not tested): mailto:?to=email%40example.com&subject=mailto%20uri%20scheme&body=line1%0d%0aline2&cc=email%40example.com&bcc=email%40example.com javascri...

javascript - Not getting a complete conversion of Yahoo's weather API - XML to JSON -

javascript - Not getting a complete conversion of Yahoo's weather API - XML to JSON - i'm new javascript hoping utilize json output of yahoo's weather api cool things website. problem reason i'm not getting total pull of json info , i'm not sure why. json should start @ "channel" instead starts @ "item". if follow link http://weather.yahooapis.com/forecastrss?p=usoh0293&u=c should able see finish (pre json) xml looks like. here's javascript i'm using (it add together current status body tag)... help appreciated. $(document).ready(function() { $.yql = function(query, callback) { var encodedquery = encodeuricomponent(query.tolowercase()), url = 'http://query.yahooapis.com/v1/public/yql?q=' + encodedquery + '&format=json&callback=?'; $.getjson(url, callback); }; $.yql("select * rss url='http://weather.yahooapis.com/forecastrss...

java - Serializing an object which has a non-serializable parent class -

java - Serializing an object which has a non-serializable parent class - how below code work? class { int = 10; } class b extends implements serializable{ } public class test { public static void main(string[] args){ b obj = new b(); obj.a = 25; //code serialize object b (b b= new b()), // deserialize , print value of 'a'. } } the code prints 10 though have changed value of 'a' in code. any explanation behaviour ? the default value of a 10 - set 10 when object created. if want have realistic test, set different value after instantiation , serialize it. as update - if class not serializable, fields not serialized , deserialized. fields of serializable subclasses. java serialization