Posts

Showing posts from March, 2012

silverlight - Response object not usable in WCF? -

i'm creating silverlight-based email system, use wcf read emails, pass data sl app, i've used following codes in test web project save byte array file on client system (email attachments), works fine, when want use them in wcf (myservice.svc.cs), error: "the name 'response' not exist in current context", going wrong here? possible use response object in service? response.appendheader("content-disposition", string.format("attachment; filename={0}", messages[i].attachments[j].filename)); response.binarywrite(messages[i].attachments[j].filedata); how can save attachments? no, typically not use httpresponse object in wcf (though not 100% sure if could use in rest services or not). if want send file client, you'll need implement service operation returns byte array or file stream. post might that.

portlet - Link Liferay tag cloud links to a different page -

when putting liferay tag cloud portlet on page, clicking links in tag cloud render result in same page if , if have asset publisher portlet on same page. what want when click link in tag cloud, should take me different page showing results, eg. search result page. is there way of doing using standard components? or have write own tag cloud portlet support feature? you dont have create new portlet. please follow these steps 1) using hooks, modify links generated in tag cloud portlet tags. instead of current layout, redirect designated page (for eg. if on /web/guest/tag page, tags link start /web/guest/tag?..... make /web/guest/search?....) 2) on search page, put asset publisher so now, when click tag link, go search page, since page has asset publisher, reads parameters request url , session, , show results on search page.

Morphia Single dao for multiple collection MongoDB -

can morphia single basicdao handle/query multiple collection, may by overloading function class parameter. public class genericdao extends basicdao<t, k> { /* override count impl*/ public long count(class<t> clazz) { return ds.getcount(clazz); } } is there other way can query 2 different collection using single doa or better make separate dao each collection. example user , blogentry collections public class blogentrydao extends basicdao<blogentry, objectid> public class userdao extends basicdao<user, objectid> the simple answer no, the basicdao made made on assumption deal single collection/entity many of doa's function entity/class , _id/primary key type based. public class basicdoa<t,k> implements doa<t,k> t should specific class k should specific key (can separate different class) e.g objectid, string, long etc example function public class<t> getentityclass() public t get(k id) if want deal...

php - Using external variables in classes -

i have directory structure: app cofig config.php classes db.class.php index.php config.php: <?php define('db_host', 'localhost'); define('db_user', 'root'); define('db_pass', ''); define('db_name', 'db_name'); db.class.php: <?php include "config/config.php"; class db { private $conn; private $results; public function __construct() { $this->conn = mysql_connect(db_host, db_user, db_pass);//**this doesn't work** mysql_select_db(db_name, $this->conn); } } ?> when try create instance of $db class in index.php, errors (cannot obtain defined variables in class) having directory structure: app config config.php classes db.class.php index.php will force use: include('../config/config.php'); or define absolute path goes root , do: include(path.'config/config.php'); . your include "config/config.php"; interpreted include('r...

audio - Android AudioRecord filter range of frequency -

i using android platform, following reference question come know using audiorecord class returns raw data can filter range of audio frequency depends upon need need algorithm, can please me out find algorithm filter range b/w 14,400 bph , 16,200 bph. i tried "jtransform" don't know can achieve jtransform or not ? using "jfftpack" display visual effects works can't achieve audio filter using this. reference here help appreciated in advance. following code mentioned above using "jfftpack" library display may find library reference in code please don't confuse that private class recordaudio extends asynctask<void, double[], void> { @override protected void doinbackground(void... params) { try { final audiorecord audiorecord = findaudiorecord(); if(audiorecord == null){ return null; } final short[] buffer = new short[blocksize]...

parsing - How to parse soap object data android? -

i getting response java web service using ksoap2, like couponslistresponseparams{response=anytype{couponid=333; coupon_name=remedy2; coupon_amount=1500; coupon_expiry_date=2012-05-02 00:00:00.0; }; response=anytype{couponid=111; coupon_name=remedy; coupon_amount=500; coupon_expiry_date=2012-05-02 00:00:00.0; }; response=anytype{couponid=222; coupon_name=remedy2; coupon_amount=1000; coupon_expiry_date=2012-05-02 00:00:00.0; }; } please 1 me how parse data, want copon id, coupon name etc.. please me thanks in advance. if make problem read type of complex data use httppost method read soap service. httppost method return xml after read soap service. you can able parse return xml using xml dom parse.

Using objective-c blocks recursively with iOS Twitter API -

so i'm trying use built in twitter api in ios 5 retrieve list of followers given user. in example documentation can find, requests made api passing inline blocks executed when request returns, fine of simpler stuff, when i'm trying ~1000 followers, , request returning them paged in sizes ~100, i'm stuck on how recursively call request again using 'next paging address' returned , processed inside completion block. here code: - (void)gettwitterfollowers { // first, need obtain account instance user's twitter account acaccountstore *store = [[acaccountstore alloc] init]; acaccounttype *twitteraccounttype = [store accounttypewithaccounttypeidentifier:acaccounttypeidentifiertwitter]; // request access user access twitter accounts [store requestaccesstoaccountswithtype:twitteraccounttype withcompletionhandler:^(bool granted, nserror *error) { if (!granted) { // user rejected request ...

c# - Get question mark instead property name and value in Debug Mode in Visual Studio -

Image
my issue is: during debug mode in visual studio can not see property name , value. suggestions? upd bug/feature reproducible in college pc. upd(15.06.2012) the base class placed separated lib. base class abstract. and... 2 times debug working fine, after making changes in source file (in screen-shots) , running project. please notice immediate window can not evaluate expression. mailprocessingviewmodelcontext inherits base class have mentioned in top of upd. it's bug in visual studio that's caused when scroll through properties list mouse. click down arrow @ bottom of menu instead.

wso2 - URL Rewrite Mediator -

i using wso2 esb in project , want use url rewrite mediator . read article in documentation couldn't clear idea how use . can please suggest me link article or blog gives better explanation , example . thanx in advance .

search - Optimal Solr JVM/Virtual/Physical Memory Configuration -

our company has several different ways of getting leads, , several types of leads deal with. there slight differences between each type of lead , of information shared or related 1 or more other lead types. me , team trying build/configure index using solr handles each of these lead types , shared data .. customer data, resort data. etc (around 1.2 million records in all). we're hosting ubuntu server (12g ram, 8 core opteron), running tomcat 6 , solr 3.4. i'd index add records in live time when customer submits lead-gen form on our website(around 1500-2000 daily), update when employees add or modify data (around 2500-3000 times daily). in addition need customers on website , employees in house able search data filters, facets, auto-completes, highlighting , stuff 1 has come expect written search. this setup functioning, hangs updating records both on website , in our internal apps. commits done every 1000 documents or 5 seconds , optimize once daily. optimal jv...

ide - How to open 2 windows of File/Projects explorer in netbeans? -

is there way have 2 windows of files/projects open in netbeans? want have 1 of these windows pointed @ 1 folder, , other window pointed @ folder. when have lot of files , have switch between 2 folders, gets annoying have scroll each time. haven't found way have 2 project windows open have stacked project , file window in same pane. open both windows , drag 1 down half size. can undock (float) windows , put them ever want.

jQuery make variable out of links used in plugin -

this weird one, apologize. i'm working soundcloud's custom player , need make variable out of src of each link plugin initiated on. i've been digging around source , can't find takes links in , starts manipulating them. here source> so clear, there bunch of links on page: <a class="sc" href="link/to/soundcloud/">yeah!</a> the plugin initialized with: $('a.sc').scplayer(); i'd make variable out of each of links .attr('href'); use in special little gui piece i'm adding within guts of plugin. essentially, i'm building url make pop-out window , need give each instance of $player it's own link correspond subfolder on site. unfortunately, 1 digging around source , lot of techniques/methods involved on head. it's worth, did try myself long while before decided ask here. you'll find on line 134 player's source set. in html5 driver instead of flash one.. it's not quite ideal...

cmd - Execute multi command in batch -

i tried run multi-windows commands inside 1 opened window batch file. want opened command window perform 2 things in sequence: switch volume direct directory in volume. here's wrote: start cmd /k c: && cd 'c:\program files (x86)\aaa\' however, switches volume. second thing not executed. can please show me way? well, have @ least 2 options...: 1st, make sure && passed new cmd... start cmd /k "c: && cd c:\temp" 2nd, use /d switch on cd "get there" in 1 step... start cmd /k cd /d c:\temp kr bartek

asp.net membership provider change of domain -

we in process of moving new domain, using asp.net membership provider , have near 1000 plus members , need take care of issue before moving, or work fine. as in aspnet_application table keep record of current domain, need take care of it. hope not bad question regards moksha if understood question correctly, nothing worry moving different domain. membership provider gets application name membership providers section of web.config file. follows. (check web.config file) <membership> <providers> <clear /> <add name="aspnetsqlmembershipprovider" type="system.web.security.sqlmembershipprovider" connectionstringname="applicationservices" enablepasswordretrieval="true" applicationname="your_application_name" ... /> </providers> </membership> as long don't change your_application_name won't affect. hope helps ! ...

google apps script - How to delete blank pages in a multipage document? -

edit : added answer because edit have been long (see answer2) following former post document merging ended working script (thanks henrique ;) still have 1 small issue : final 'merged' document contains blank pages (depending of other docs content) remove. cannot find easy way this. script goes : function mergedocs(docids) { // parameter docids array of doc ids var basedocname = documentapp.openbyid(docids[0]).getname();// typical name = impression_page_07_07-06-2012__20:57 var modeldoc = docslist.getfilebyid(docids[0]); var newmodelname=basedocname.substr(0,11)+'multipage'+basedocname.substring(18); var basedocid = docslist.copy(modeldoc,newmodelname).getid();// make copy of firstelement , give new basedocname build serie(to keep margins etc...) var basedoc = documentapp.openbyid(basedocid) var body = basedoc.getactivesection(); // for( var = 0; < docids.length; ++i ) { var othercopy = documentapp.openbyid(docids[i]).getactivesection(); ...

css - Scrolling list appears different in Chrome -

works fine in firefox reason when it's run on chrome list seen scroll in (and in larger text) when it's loading. after it's loaded works normal it's bugging me doesn't load same firefox. can done? <div id="navcontainer"> <ul id="navlist"> <li><span>list</span><ul> <li><a href="#">1</a></li> <li><a href="#">2</a></li> <li><a href="#">3</a></li> <li><a href="#">4</a></li> <li><a href="#">5</a></li> <li><a href="#">6</a></li> <li><a href="#">7</a></li> <li><a href="#">8</a></li> <li><a href="#">9</a></li> <li><a href="#">10</a></li> <li><a href="#">11...

jquery - Changing variable during setInterval with key -

in animation "raining" dots random colors, want able change colors pressing enter. keypress i'm using following code: $(document).keypress(function(event){ var keycode = (event.keycode ? event.keycode : event.which); if(keycode == '13'){ // change variables colors } }); as see it, shouldn't wrong code, nothing happens when pressing enter. glad if me out here! you can find code here: http://jsfiddle.net/gsbcz/ why binding event on each animation call ? [event.which] jquery's crossbrowser way detect mouse , key events. this should help, fiddle html: <html> <head> <title>raining dots</title> <link href='http://fonts.googleapis.com/css?family=give+you+glory' rel='stylesheet' type='text/css'> <link href='http://fonts.googleapis.com/css?family=gloria+hallelujah' rel='stylesheet' type='text/c...

Simulation of templates in C (for a queue data type) -

i' m trying implement queue structure using c. implementation simple; queue can hold int s , nothing else. wondering if simulate c++ templates in c (probably using preprocessor #define ) queue can hold data type. note: not want use void* . think bit risky , can cause bizarre runtime errors. you can use subtle , ugly tricks in order create kind of templates. here's do: creation of templated list macro define list i first create macro - let's call define_list(type) - create functions list of given type. create global structure containing function pointers list's functions , have pointer global structure in each instance of list (note how similar virtual method table ). kind of thing: #define define_list(type) \ \ struct _list_##type; \ \ typedef struct \ { \ int (*is_empty)(const struct _list_##type*); \ size_t (*size)(const struct _list_##type*); \ const type (*front)(const struct _list_##type*); \ ...

android - PNG file won't display in ImageView if source is set programatically -

i have png file in res/drawable-ldpi folder. i'm working in eclipse emulator, i've tried on 2.2.1 android phone , same behavior. have imageview , want set src programatically, based on database call. if put src="@drawable.norusdpyr" in activity's xml file, file displays fine. but, if put string imageresource = "r.drawable." + parseddata[4].tostring(); chart.setimageuri(uri.parse(imageresource)); where parseddata[4].tostring() = "nor_usdpyr" don't see anything. i've tried string imageresource = "android.resource://" + getpackagename() + "/r.drawable." + parseddata[4].tostring(); chart.setimageuri(uri.parse(imageresource)); and inputstream = getclass().getresourceasstream("/drawable/" + parseddata[4].tostring()); chart.setimagedrawable(drawable.createfromstream(is, "")); and string imageresource = "r.drawable." + parseddata[4].tostring(); file file = new file(i...

wpf - Bind DataTemplate's parent's visibility (IsVisible or Visibility) to the ViewModel -

starting off classic datatemplate: <datatemplate x:key="regulartemplate"> <grid> ... </grid> </datatemplate> assume viewmodel object being rendered using above template has following property: private visibility _visibility; public visibility vmvisibility { set { if (value == _visibility) return; _visibility = value; if (value == system.windows.visibility.visible) { viewrefresher.twentysecondstick += tick; } else { viewrefresher.twentysecondstick -= tick; } } private { return _visibility; } } i want setter code somehow run when listboxitem not rendered panel containing it. it's custom panel hides/shows items during scrolling, need bind listboxitems's visibility somehow. i've tried stuff along lines of: <data...

python - How to convert Numpy array to PIL image applying matplotlib colormap -

Image
i have simple problem cannot find solution it. i want take numpy 2d array represents grayscale image, , convert rgb pil image while applying of matplotlib colormaps. i can reasonable png output using pyplot.figure.figimage command: dpi = 100.0 w, h = myarray.shape[1]/dpi, myarray.shape[0]/dpi fig = plt.figure(figsize=(w,h), dpi=dpi) fig.figimage(sub, cmap=cm.gist_earth) plt.savefig('out.png') although adapt want (probably using stringio pil image), wonder if there not simpler way that, since seems natural problem of image visualization. let's say, this: colored_pil_image = magic_function(array, cmap) thanks reading! quite busy 1 liner, here is: first ensure numpy array, myarray , normalised max value @ 1.0 . apply colormap directly myarray . rescale 0-255 range. convert integers, using np.uint8() . use image.fromarray() . and you're done: from pil import image im = image.fromarray(np.uint8(cm.gist_earth(myarray)*255)) with plt.sa...

c# - Autowiring with Ninject -

i have winforms application i've started using ninject with. majority of tutorials ninject show setup autowiring this: using (ikernel kernel = new standardkernel()) { kernel.bind<itaxcalculator>() .to<taxcalculator>() .withconstructorargument("rate", .2m); var tc = kernel.get<itaxcalculator>(); assert.equal(20m, tc.calculatetax(100m)); } that's great if intend on implementing class @ startup short script, i'm not sure how use objects in other classes , libraries in application. curious if ninject can handle dependencies similar spring in this article . package testbean; import org.springframework.beans.factory.annotation.autowired; import org.springframework.stereotype.service; import writer.iwriter; @service public class myspringbeanwithdependency { private iwriter writer; @autowired public void setwriter(iwriter writer) { this.writer = writer; } public void run() { ...

c# - Closing a database link in .NET, ORA-02080 -

i have code uses database link needs closed when it's done with. call dbms_session.close_database_link gives me error, ora-02080, though link no longer in use. when tried in sql*plus, worked great , closed after ran commit . in .net, if run commit doesn't close. using (var con = new oracle.dataaccess.client.oracleconnection(@"data source=firefly8;user id=user;password=pwd;pooling=false;")) { con.open(); var c = con.createcommand(); c.commandtext = "select tnoam@link_2"; using (var r = c.executereader()) { r.read(); } c.dispose(); var c2 = con.createcommand(); c2.commandtext = "begin commit; dbms_session.close_database_link ('link_2');end;"; c2.executenonquery(); } i'm pretty stuck one. please help based on comment @ben t...

serial port - How can i search for string in multiple line string variable? C# -

i save output of command console. the output can have more 1 line. how can search specific words in output ? here current code: string buff, ok; ok = "ok"; serialport p = ... // p initialization... p.write("at+cmgl=\"rec unread\" " + "\r"); system.threading.thread.sleep(1000); buff = p.readexisting(); if (buff.contains(ok)) // smth an example of output: +cmgl: 10,"rec read","0372022244",,"12/02/22,08:08:58+08" 2073692066616374757261207661206669206163686974617461206c612074696d702120446574616c696920696e206d6167617a696e656c6520566f6461666f6e6520736175206c612062616e6361206476732e ok will search lines buff ok ? or first line ? tried , seems can not find "ok" in output namespace serialtest { public class program { public static void main(string[] args) { string buff="0"; string ok = "ok"; serialpo...

php - mod rewrite with query -

possible duplicate: query strings & mod rewrite i'm attempting use mod rewrite make links prettier without www , go from: http://example.com/folder/page.html http://example.com/index.php?page=page&folder=folder i've managed basic version of top layer pages not in folders puzzeled how include rule , folder appear. query strings stay piwik analytic links work, such as: http://example.com/folder/page.html?piwik=something goes to: http://example.com/index.php?page=page&folder=folder&piwik=something any appreciated, i've got far: <ifmodule mod_rewrite.c> rewritecond %{https} !=on rewritecond %{http_host} ^www\.(.+)$ [nc] rewriterule ^ http://%1%{request_uri} [r=301,l] rewriterule ^([^/]*)\.html$ /index.php?page=$1 [l] </ifmodule> you want qsa flag ­docs , example code below: rewriterule ^/([^/]+/)?(.+\.html)$ /index.php?folder=$1&page=$2 [qsa,l] reference: found page http://httpd.apache.org/docs/2.0/mod/mod_...

unit testing - Mock objects for Grepping a binary file in Ruby -

for scenario, grep binary file manufacturer string in ruby. create associated mock object in rspec. tried following did not help: file.stub!(:exist?).with(<binary_file>).and_return(true) file.stub!(:read?).with(<binary_file>).and_return('xyz') what missing here? firstly, remove ! #stub , not used in newer versions of rspec. secondly, stub(:read?) should stub(:read) , since not predicate method. without seeing implementation code, changes should put in right direction. that said, avoidable, tend disagree stubbing class methods this, since there pretty big risk of state leakage through tests. instead design component searching in file accept instance of io , becomes easier pass in mock object entirely disposable.

css - How to set the height of an button (input-element) on webkit browsers? -

on mac webkit-browsers (safari , chrome, current version) can't set height of input-element. <input type="button" style="height:200px;" value="hello world!">​ won't work. jquerys $('input').css('height','200px');​ won't work either. http://jsfiddle.net/xms6m/ though setting width possible, either style-attribute or jquery. what reason inconsistency? , possible solution? display inline-block nothing, inputs have display set default. add border:none . when so, starts behaving want to. here's fiddle -> http://jsfiddle.net/joplomacedo/xms6m/1/

c# - Writing to a cell turns on ScreenUpdating in my VSTO add-in -

i have weird problem excel behaving differently on development machine , testing machine. in add-in, i've turned off screenupdating in several places long running processes. on machine works fine. on testing machine, excel sets screenupdating = true write cell. the following code demonstrates issue me. private void thisaddin_startup(object sender, system.eventargs e) { microsoft.office.interop.excel.application excel = globals.thisaddin.application; messagebox.show(excel.screenupdating.tostring()); excel.screenupdating = false; messagebox.show(excel.screenupdating.tostring()); workbook workbook = globals.thisaddin.application.activeworkbook; worksheet w = (worksheet)workbook.worksheets[1]; ((range)w.cells[1, 1]).value = "test"; messagebox.show(excel.screenupdating.tostring()); } on machine, opening excel gives 3 message boxes saying "true", "false", "false". on test machine say "true...

ios5 - Is face detection possible on iPad camera without showing camera feed? -

i creating ipad app used in public kiosk, , playing different ways of knowing when user present, has gone away or new user has come along. wondered therefore if possible using ios 5 core image detection script, need able use camera feed without showing user. in way possible?

VB6 memory leak from CreateObject -

i'm using eternal library (dll) load in file format , have found out load function doesn't load. load first time it's called same object if call again open new file doesn't load. has forced me call createobject each time want load new file. problem vb6 doesn't seem free old object @ , ram , vm usage bloats gbs. is there way force free up? setting variable "nothing" or "null" doesn't , app bloat run out of memory , crash. (i have run inside vm since ide old doesn't work on win7, couldn't work) i've looked circular references there aren't any, file loaded using object, properties of file read ado object, , actual file never referenced ado object, various fields it. whether have direct reference in vb6 project or use "createobject" instantiate object reference not matter. if third party component has memory leak you'll experience same behaviour either way. if instantiating unmanaged resource...

php - Sorting related models in a Yii findByPk() -

using yii framework, how can sort related model modifiervalues "sortorder asc, name asc"? have tried order->('modifiervalues.sortorder asc, modifiervalues.name asc') no avail <?php $item = item::model() ->with("modifiergroups.modifiervalues") ->findbypk($id); ?> try $item = item::model() ->with('modifiergroups') ->find(array( 'condition'=>'id = :id', 'params'=>array('id'=>$id), 'order'=>'modifiervalues.sortorder asc, modifiervalues.name asc' ) ); or (i haven't tried one, should work same) $item = item::model() ->with(array('modifiergroups'=>array('order'=>'modifiervalues.sortorder asc, modifiervalues.name asc'))) ->findbypk($id)); notes: if give with field, don't think can order field. s...

cloud - Implementing SSO between two WSO2 tenants -

i'm trying implement sso solution on wso2 between multiple tentants. possible? if so, kind of optoins should looking into? this not possible ootb currently. possible custom saml2 authenticator. check existing saml2 sso authenticator here. https://svn.wso2.org/repos/wso2/branches/carbon/3.2.0/components/authenticators/saml2-sso-authenticator/ but imo, complex. how define users can authenticate tenants ? -- thilina

How can I add a variable to a regexp? (Perl) -

so here's sample while (<fh>) { $line = $_; chomp($line); $marksearchpat= "href=\"\@x\@embeddedfile\.requesturlstub\@x\@bbcswebdav\/xid"; $markreplacepat= "href=\"http:\/\/www\.facepalm\.org\/bbcswebdav\/xid"; ## (mark) duplicate input file lines "altered" file, making substitutions necessary. $linenumber++; print "line $linenumber has been read\n"; $line2=$_; $line2=~s/$marksearchpat/$markreplacepat/eig; print whout $line2; print whlog 'at '.localtime().', replaced '. $marksearchpat .' '. $markreplacepat .' @ line '.$linenumber.' of file '.$file."\n"; how add regex variable (a regex match variable)to $marksearchpat , $markreplacepat you can't with s/$search_pat/$replace/ since interpolation not interpret interpolated values @ all. that's why added /e . s/$search_pat/$replace_code/e in above, ...

javascript - Displaying lists underneath each other with new data -

i having problem displaying lists flow neatly each other display data. here trying base lists from: http://www.about.com/#!/explore-topics/ i've ripped through style sheet , can't find out how making happen. wondering if able shine light on this, i've been ripping hair out trying replicate same thing , can't make happen. think may javascript thing, not sure. appreciated. from css: #explore-topics .viewport { -moz-column-width: 216px; -webkit-column-width: 216px; column-width: 216px; width: 7910px; } they using css3 column definition. read more here: http://www.w3schools.com/css3/css3_multiple_columns.asp

html - Phonegap page has wrong rotation, shows as portrait in landscape mode -

Image
i have (simple) web page packed in phonegap app. if start app shows page in portrait direction landscape page width. text starts left bottom left top. on right have gap page should end. this see: supported orientations landscape left , right in ...-info.plist : <key>uisupportedinterfaceorientations</key> <array> <string>uiinterfaceorientationlandscapeleft</string> <string>uiinterfaceorientationlandscaperight</string> </array> <key>uisupportedinterfaceorientations~ipad</key> <array> <string>uiinterfaceorientationlandscaperight</string> <string>uiinterfaceorientationlandscapeleft</string> </array> on ipad locked screen rotate. launch image shows correct in landscape. the page designed fit landscape fixed sizes. viewport: <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no...

Eclipse and Pydev plugin -

after installing , configuring pydev plugin on eclipse works fine. when close eclipse ide , open again , want run python program cannot because there no python run. what should do, there has encountered such type of error ? thanks i found problem, not know why eclipse changes default workspace , creating problem. when set workspace needed location error gone , able compile , run python program.

flex4.5 - CurrencyFormatter in Flex 4 with Euro -

i have currencyformatter : <s:currencyformatter id="currencyformatter" currencysymbol="€" usegrouping="true" groupingseparator="." decimalseparator="," fractionaldigits="2" usecurrencysymbol="true" locale="de-de" /> everything works fine, problem when enter value "24,50" not accepted. if enter "24.50" accepted , converted "€ 24,50" i need able enter currency comma decimal separator. could please help? had myself, , could'nt override value in currencyformatter class... can put sharedresources in local directory, locale/en_us/sharedresources.properties , , change/add decimalseparator variable value of comma. the file resides: *c:\program files (x86)\adobe\adobe flash builder 4.6\sdks\4.6.0\frameworks\projects\framework\bundles\en_us\sharedresources.properties* so can have @ it, want include override of in project, , include in swf gets buil...

java - Issue with applet code -

i new applet programming. iam trying when ever key pressed on key board, has display on applet. here code. public class sample extends applet implements keylistener { private graphics graphic; @override public void init(){ addkeylistener(this); } @override public void paint(graphics g){ graphic=g; g.drawstring("hello",20,30); } public void keytyped(keyevent e) { char key=e.getkeychar(); dis(key,graphic); } public void keypressed(keyevent e) { } public void keyreleased(keyevent e) { } private void dis(char key, graphics graphic) { graphic.drawstring(" "+key,50,60); } } but not displaying on key press. whats wrong code..??? please me find out it! do not save graphics object. try call repaint() method within handlers. public class sample extends applet implements keylistener { string msg=""; @override public void init(){ addkeylistener(this); } @override public void paint(graphics g){ g.drawstring(...

png - Android 9 patch drawables -

a simple little question: 9 patch drawables have created in 4 different sizes different screen resolutions , placed inside [drawables] - ldpi | mdpi | hdpi | xhdpi or 1 image , placed inside drawables folder? what's best pracatice? you don't have create in multiple sizes, may better if do, depending on image , how you're using it. the gain 9-patching gets in "stretching" of (probably-uniform) areas. non-stretched areas still benefit multiple resolution versions if weren't in 9-patch, e.g. if have low-res 9-patch "detail" areas of may unpleasantly scaled on high resolution screen.

c++ - Redirect std::cout to syslog on linux -

my code contains lot of std::cout . got call sysadmin telling me filling /var/log/messages folder , syslog filesystem. but, user id not have access either /var , requires root permissions writing, don't use syslog. assumption somehow, linux must configured redirect cout syslog server. my question settings in linux, makes above feasible (i.e. redirect cout syslog)? if pipe output of program logger , program send output syslog . see answer this question .

css - IE shows mirrored image as before/after content -

only ie shows img.png image mirrored. why? how cope without creating mirrored image ie? body { direction: rtl; } li:before { content: url(/img/img.png); } fiddle: http://jsfiddle.net/txza7/2/ well, problem solved: had set direction: ltr ruler li:before in order right. body { direction: rtl; } li:before { content: url(/img/img.png); direction: ltr; }

wcf - setting maxBufferPoolSize of basicHttpBinding programmatically -

i trying set maxbufferpoolsize along maxreceivedmessagesize , maxbuffersize. however, when try set it, got message "'maxbufferpoolsize' not member of 'system.servicemodel.basichttpbinding'." using vs 2010. ms documentation, maxbufferpoolsize member ( http://msdn.microsoft.com/en-us/library/system.servicemodel.basichttpbinding.maxbufferpoolsize ). why getting error??? please help. thank you. dim basichttpbinding basichttpbinding = new basichttpbinding() dim endpointaddress endpointaddress = new endpointaddress("/test.svc") basichttpbinding.maxreceivedmessagesize = "2147483647" basichttpbinding.maxbuffersize = "2147483647" **basichttpbinding.maxbufferpoolsize = "2147483647"** basichttpbinding.opentimeout = new timespan(0, 20, 0) basichttpbinding.closetimeout = new timespan(0, 10, 0) basichttpbinding.receivetimeout = new timespan(0, 10, 0) basichttpbinding.sendtimeout = new timesp...

java - How to perform an action programmatic like action performed of JButton? -

i have actionsave class extends abstractaction.i use save button. somewhere else want run same instant of used button. came conclusion use below not know pass argument? model.getactionsave().actionperformed("what should add here action event"); extract code of actionperformed() method method without argument, , call method instead: public void actionperformed(actionevent e) { save(); } public void save() { ... } ... model.getactionsave().save();

javascript - Maintain this in a method passed by reference -

in following example, send parameter method "lostthis" object "instobj", "this" window object. var obj = function() {}; obj.prototype.lostthis = function() { console.log('lostthis', instanceof obj, this); }; var instobj = new obj; var caller = { runfn: function(fn) { fn(); } }; caller.runfn(instobj.lostthis); console response: lostthis false window run example in following example (slightly more complex) there different ways call methods of "instobj" same , others can keep "this" object. var obj = function() {}; obj.prototype.methodrefhasthis = function() { var t = this; return function() { console.log('methodrefhasthis ', t instanceof obj, t); }; }; obj.prototype.methodreflostthis = function() { console.log('methodreflostthis ', instanceof obj, this); }; obj.prototype.methodrefmaybethis = function() { console.log('methodrefmaybethis '...

c# - rounding decimal to special number of digits -

i need create function rounds decimal numbers this: round("$32.95", 0) -> $33 round("85.86%", 1) -> 86.9% where first parameter string , second parameter number of decimal points required i using math.round converting 85.9 an algorithm can use (i don't know c#): get 10-to-the-power(number-of-significant-digits) (=p10) multiply decimal-number p10 add: 0.5 divide integer-portion of sum (p10) - answer rounded number

ruby - Sinatra design pattern -

i'm trying implement sintra design pattern, can't wrap head around current implementation. take code example. get "/path1" # stuff end "/path2" # stuff end how come first call get doesn't block main thread? i'm trying implement similar. work("some data 1") work("some data 2") work("some data 3") here, want add "some data n" kind of queue, when there isn't more work calls want start processing data. not want call app.start in end of file`.

c# - Text replace in VBA code of Excel files -

Image
we have several tens of macro enabled excel files, each of contains few vba modules , in each of modules there sql server names , userid/passwords of sql login. i wonder if write kind of c# utility loads files 1 one , either .net-office interop. or other approach replace strings else... because have repoint vba macros server name , use sql login name , password... wouldn't replacement hand :( :( :( thanks! to begin with sorry taking time in posting creating ui not helps else comes looking same functionality. you need first enable trust access vba project object model open excel , click on file tab | options | trust center | trust center settings | macro settings enable macro , click on trust access visual basic projects next in vba editor click on tool | options , under "editor" tab select checkbox require variable declaration next download sample file here , press run button in sheet1 launch userform shown below. simple select fold...

java - Swing timers basic functionality -

i'm new @ java graphic design, , you, if possible, me easy example me understand basic functionality of jframes, timers, swingcontrollers, , stuff. how implement following case: we have jframe jpanel inside. when execution starts, jpanel white, want change it's colour every 2 seconds: public class mijframe extends javax.swing.jframe { public mijframe() { initcomponents(); } public static void main(string args[]) { java.awt.eventqueue.invokelater(new runnable() { public void run() { new mijframe().setvisible(true); jpanel1.setbackground(color.yellow); jpanel1.setbackground(color.red); } }); } // variables declaration - not modify private static javax.swing.jpanel jpanel1; // end of variables declaration } at first, used sleep method of thread object between setbackgroud() methods doesn't work, shows last change. how use here timer object?...

image - isKeyDown not working in Java -

i playing around java programming , wanted picture move around screen when press key. how ever message saying "thu jun 14 13:14:23 edt 2012 info:controllers not available" code have page public class menu extends basicgamestate { image sun; int sunx = 200; int suny = 200; public void init(gamecontainer gc, statebasedgame sbg) throws slickexception { sun = new image("res/sun.png"); } public void render(gamecontainer gc, statebasedgame sbg, graphics g) throws slickexception { g.drawimage(sun, sunx, suny); } public void update(gamecontainer gc, statebasedgame sbg, int delta) throws slickexception { input input = gc.getinput(); if(input.iskeydown(input.key_up)); {suny -= 1;} if(input.iskeydown(input.key_down)); {suny += 1;} if(input.iskeydown(input.key_left)); {sunx -= 1;} if(input.iskeydown(input.key_right)); {sunx += 1;} } } right if run object in same sp...

apache - What is the SOLR plugin for Liferay meant for? -

i using liferay 6.1 , trying learn how incorporate search functionality liferay portal. able run apache solr inside liferay's tomcat container don't understand solr plugin liferay meant for. here link can please explain benefits using plugin (for liferay) , accomplishes on top of using solr? thanks per link externalize search function portal. using solr instead of lucene gives additional capabilities of solr such replication, sharding, result clustering through carrot2, use of custom analyzers/stemmers etc. it can offload search server processing separate cluster. opens possibilities of search driven ui (facetted classification etc) separate portal ui.

css3 - CSS on Site Navigation breaking across browsers (Updated) -

stackoverflow, i've been trying troubleshoot navigation on website. (sequoiawaste.com) problem arises iphones , internet explorer 7. i've used display:table-cell; css property keep tabs in single line. however, there seems 2 issues: 1) on mobile devices (iphones in particular, not ipads), row extends past blue background, , awkwardly hides search function of page. 2) on ie 7, disregards display:table-cell; , orients links vertically, similar table-row create. to knowledge, there handful of properties defining #globalnav in enhanced.css file cause issue. something i've noticed display values vary depending on state - table, table-cell, block. changing of them (or of them same display) has made problem worse. does have pointers on here? dont think exceedingly difficult problem, i'm hitting wall here. thanks help, charlie ** update ** i started using float:left , has been double edged sword - looks better, similar formatting i've had set each...

mysql - stop from outputting one item in dynamic ul list in php -

i have dynamic ul list database being outputted categories there 1 category don't want listed in particular list. there sql select stops showing 1 value in field? or can write if statement after select query targets list not show 1 item? if can i'd appreciate it! sql provides where clauses filter results you're selecting. assuming table called category , primary key id , add along lines of where category.id != <id of category don't want> query. if have where clause, append condition and instead: and category.id != ... .

Segmentation fault in C while using pointers -

i don't know what's happening here: #include<stdio.h> int main() { int i, j, *k, x,array[]={5,3,4,1,8,9,2,7,6,0}; int *ptr=array; for(j=1;j<10;j++) { printf("---------iteration %d--------------\n",j); *k=*(ptr+j); // segmentation error occurring here @ line printf("key=%d\n",*k); i=j-1; while( i>=0 && *k < *(ptr+i)) { *(ptr+i+1)=*(ptr+i); i--; } *(ptr+i+1) = *k; printf("%d\n",*(ptr+i+1)); for( x=0;x<10;x++) printf("%d,",*(ptr+x)); printf("\n"); } for( i=0;i<10;i++) printf("%d,",*ptr++); printf("\n"); } the error occurring right after printf statement in for loop , when remove * both sides works answer wrong. this insertion sort using pointers in c. the problem is, said, right after printf() : *k=*(ptr+...

Excel Charts name field auto edit -

i have .ppt linked .xls on charts. looking @ path of links, charts named xpto-1, name field on excel xpto. why excel adding "-1" tag?i don't have chart repeated name. happens on 2003 version , 2007. thanks i found answer guys. excel allows different charts have same name on same worksheet. way, when chart name, same, path looks xpto1 1st chart , xpto1-1 other. cases break of links when these files updated on office 2007 version because office 2007 can't handle these ids on situations. solution manual edit name of charts , make sure name not repeated on same worksheet.

javascript - Inverting how an object is coupled to other object's events -

i have object, volumeslider, affected 2 other controls' events: var volumeslider = $('#volumeslider'); $('#mutebutton').on('mouseenter', function() { volumeslider.fadein('fast'); } $('#controls').on('mouseleave', function() { volumeslider.fadeout('fast'); } i invert such volumeslider 'listens' events on mutebutton , controls instead of being told respond them. possible? like: //pseudo-code: volumeslider.on('#mutebutton.mouseenter'){ this.fadein('fast'); }.on('#controls.mouseleave'){ this.fadeout('fast'); } is jquery's http://api.jquery.com/bind/ useful here? here 1 suggestion: volumeslider.on('dosomething', function(e) { $(this).fadein('fast'); }); $('#mutebutton').on('mouseenter', function(e) { volumeslider.trigger('dosomething'); }