Posts

Showing posts from August, 2010

android - Dynamic Detection of Hand Movement using Accelerometer -

i want detect movement of hand dynamically , modify sound accordingly. phone in hand in fixed orientation not change. example, holding phone in stretched hand , moves right or left, music volume changes dynamically; if move , down speed of playing changes , moving @ intermediate angle changes both speed , volume accordingly. charted accelerometer data while doing these motions , there seems pattern not sure how filter those. have looked @ lot of posts - high pass/low pass filters, kalman filters, gesture recognizers difficult understand appropriate method. of posts don't seem detect dynamically - when gesture finished. need use accelerometer , not gyroscope , other sensor. correct approach here? there existing libraries this? if activity implements sensoreventlistener and use variables private sensormanager sensormanager; private sensor maccelerometer; in oncreate() instantiate them , register listener this: sensormanager = (sensormanager) getsystemservice(co...

elastic beanstalk - How to access file storage from web application on Amazon EC2 -

i in process of hosting dynamic website on amazon ec2. have created environment , deployed war on elasticstalkbean. can connect mysql database too. not sure how web application read/write disk , @ path? per understanding, amazon provides 3 options file storage s3 ebs (persistant) instance storage i upload files on s3 creaing bucket how can web application read or write s3 bucket path on differnt server? i not sure how should upload files or write file ebs. connecting ec2, cannot cd /dev/sd* directory ebs attached environment instance. how can configure web app use directory images etc instance storage lost if stop or recreate env. , non persistant. not interested store files here. can me on this? upload file read application? can application write files? your question: "how can web application read or write s3 bucket path on different server? i'm newbie user of aws too, can offer limited help, understand: webapp running in ec2 instance can access s3 stor...

iphone - iOS push notification and distribute the application inhouse -

i want make ios mobile application in house company use. new ios. studying. got doubts is necessary buy ios developer account developing such application. readings found necessary. got push notification in application. can develop , test push notification out purchasing developer license ? i know these beginners question. when googled found someone's saying provision certificate making , make application uid , all. confused. please 1 give me little idea. in advance. you need buy developer license creating application. below few things not possible without purchasing developer license, , compulsory. create certificate create application id add device identifier adhoc development (testing) create provisioning profiles so without developer account won't able test code well. hope helps.

How to return value to console in javascript? -

i trying write javascript return value of toasty.png , bready.png when user clicks on respective text. i'm able return "toast" , "bread" not other text. advice? <script> $(document).on('vclick', '.changepagebutton', function() { console.log(this.text); //console.log(value within image) }); </script> <a class="changepagebutton" value="toast" data-transition="slide"> <input type = "hidden" name = "image" value = "toasty.png"> <input type = "hidden" name = "video" value = "video1.mpg"> test </a> <a class="changepagebutton" value="bread" data-transition="slide"> <input type = "hidden" name = "image" value = "bready.png"> <input type = "hidden" name = "video" value = "video2.m...

python 2.7 - How to select following sibling tag with xpath -

i have html file this: <div id="note"> <a name="overview"></a> <h3>overview</h3> <p>some text1...</p> <a name="description"></a> <h3>description</h3> <p>some text2 ...</p> </div> ` i retrieve paragraph, each header. example, overview: text1 description: text 2 ... want write in python using xpath. thank you. find h3 tags, iterate on them, , on each step of iteration loop, find next sibling tag p : import urllib2 lxml import etree url = "http://www.kb.cert.org/vuls/id/628463" response = urllib2.urlopen(url) parser = etree.htmlparser() tree = etree.parse(response, parser) header in tree.iter('h3'): paragraph = header.xpath('(.//following-sibling::p)[1]') if paragraph: print "%s: %s" % (header.text, paragraph[0].text) prints: overview: ruby on rails 3.0 , 2.3 jso...

c# - Automapper returns only Matched property values -

here using automapper class match "userdetails" class "finalizeddetails" class. have tried getting last name value namefirst , booksinfo returns nothing. how fix issue strange automapper. didn't understand complete usage of automapper class. homecontroller: public actionresult index() { userdetails objdao = setdata(); mapper.createmap<userdetails, finalizeddetails>(); finalizeddetails objdetails = mapper.map<userdetails,finalizeddetails >(objdao); return view(objdetails); } [httppost] public actionresult index(string id) { return view(); } private userdetails setdata() { userdetails daoobj = new userdetails(); daoobj.firstname = "mike"; daoobj.lastname = "castillo"; daoobj.salary = 6000; daoobj.certified = true; daoobj.bookdetails = new books(); daoobj.bookdetails.bookname = "auto mapper tuts"; daoobj.bookdetails.bookprice = 200; da...

api - Lossless reproduce of Image in Java -

i working on 1 sample image algorithm, read complete image matrix format , re-produce same image matrix data. i searching similar api in java, couldn't find one. if read image[mxn pixel] in matlab, producing of image[m][n] size , in similar fashion, read , write image matrix/file in java without loss of data. read image java.awt.bufferedimage using 1 of read() methods of java.imageio.imageio . can access color values of each pixsel using getrgb(int x, int y) .

bash - Copy all typed command in a linux console & their result to a file -

i'm trying make script automatically install programs , configure them on fedora 19 linux distribution. create it, made vm , i'm typing command manually in "terminal" application. i'd able log i've typed , output (stdin & stderr & stdout if understood well) can use log make script. is there way ? you can use script command record session: $ script session.txt script started, file session.txt $ ls session.txt $ exit script done, file session.txt $ cat session.txt script started on wed 31 jul 2013 07:36:40 cest $ ls session.txt $ exit script done on wed 31 jul 2013 07:36:42 cest

bash - Immediate subdirectory of a given argument or the current directory if no argument is given -

everyone. quick question pretty embarrassing. how pass directory argument bash shell script , how written within actual script? script supposed work in current directory if given argument (another directory), should work given parameters. i've checked around internet last 3 hours , keep finding complicated solutions end confusing me. question follows: the script should list disk storage occupied each immediate subdirectory of given argument or current directory (if no argument given) subdirectory names sorted alphabetically. also, list name of subdirectory highest disk usage along storage size. just need first sentence. have far. i've done of program directory issue has me stumped. #!/bin/bash ls -xl > file.txt cut -d ' ' -f 5- file.txt > file2.txt echo "list in alpha order: " cat file2.txt echo "largest dir is: " du -ab | head -1 any assistance appreciated, please. parameter substitution. searchdir="${1:-$pwd...

Quickblox: how find out whether the user is online? -

is there way find out whether quickblox user online? i'm using quickblox ios sdk. there 2 ways: using rest api - here guide http://quickblox.com/developers/simplesample-users-ios#online.5coffline_status using chat contact list http://quickblox.com/developers/simplesample-chat_users-ios#contact_list

Removing a part of url in php -

i want remove % , + , ascii codes url . example: from http://prexprint.com/laminated%20business%20cards to http://prexprint.com/laminated business cards there go js: var orgurl = 'http://prexprint.com/laminated%20business%20cards'; var requrl = decodeuri(orgurl); console.log(requrl); edit: var orgurl = 'http://prexprint.com/laminated%20business%20cards'; var requrl = decodeuri(orgurl) requrl = requrl.replace(/\ /g, '-'); console.log(requrl) window.location.href = requrl

html - How do I add a CSS3 transition to an image overlay? -

i'm trying figure out how give semi-transparent image overlay (that appears on :hover) css3 transition (ease). it's not working. i'm not sure if it's because i'm missing something, or if transitions don't work display property. ideas css workaround (i don't know javascript)? in advance. relevant html , css: <div class="thumbnail"> <figure> <img src="images/dude.jpg" alt=""/> </figure> <div class="thumbnail-overlay"> <h2>project name</h2> <h3> skills skills skills</h3> <p>this project description.</p> </div> </div> .thumbnail { position:relative; float:left; width:40%; margin:1.5% 1.5% 0 0; } .thumbnail-overlay { background-color: @dark-gray; display:none; opacity:.9; position:absolute; top:0; left:0; width:100%; height:100%; overflow:hidden; -webk...

AngularJS forms with Google Cloud Endpoints -

i created api backend: @apimethod(name = "create", path = "properties", httpmethod = httpmethod.post) public void create(realestatepropertyapi property, user user) throws exception { } with following data model: public class realestatepropertyapi { private long id; private string name; private addressapi address; public realestatepropertyapi() { } public long getid() { return id; } public void setid(long id) { this.id = id; } public string getname() { return name; } public void setname(string name) { this.name = name; } public addressapi getaddress() { return address; } public void setaddress(addressapi address) { this.address = address; } } public class addressapi { private long id; private string street; private string city; private string state; private string zip; private string country; pub...

.net - Can I implement Entity Framework 5 TPT on Windows XP? -

Image
examples of ef5 table per type have found, such this one use [table("tablename")] attribute mark class defining table. when add attribute errors: error 1 type or namespace name 'tableattribute' not found (are missing using directive or assembly reference?) e:\eshared\syrius6\syrius_syrius\sbd.syrius.domainclasses\classes.cs 599 6 domainclasses error 2 type or namespace name 'tableattribute' not found (are missing using directive or assembly reference?) e:\eshared\syrius6\syrius_syrius\sbd.syrius.domainclasses\classes.cs 599 6 domainclasses i have line using system.componentmodel.dataannotations; in namespace and using framework 4 because want app run on windows xp. [update] had @ link flagged possible duplicate here , , consequence added reference system.data.linq , using system.data.linq the error messages error 1 type or namespace name 'tableattribute' not found (are missing using directive or ass...

matlab - Merge 2nd to last columns for duplicates in 1st column -

i want merge a's 2nd end column if a's 1st column duplicate from a = [2 3 1; 3 4 2; 2 6 8] to b{1}=2 3 1 6 8 b{2}=3 4 2 nan nan or b = [2 3 1 6 8; 3 4 2 nan nan] row ordering doesn't matter. my first plan was a=sortrows(a,1); % sort 1st col and divide various matrices according 1st col (i.e. different matrix different 1st column element) then horzcat each 2:end elements each matrices. and join them 1 object in way. this plan or imagination though can't figure out if possible. here method started. pad 0 instead of nan though: b = sortrows(a,1); c = b(1,:); row = 2:size(b,1) if b(row,1) == c(end,1) c(end, end+1:end+2) = b(row, 2:3); else c(end+1, 1:3) = b(row, :); end end or same thing using cell array , not have pad @ all: b = sortrows(a,1); c = {b(1,:)}; row = 2:size(b,1) if b(row,1) == c{end}(1) c{end}(end+1:end+2) = b(row, 2:3); else c{end+1...

c# - Issues with Lucene.NET version 3.0.3 -

i've been using lucene.net v3.0.3 on project several of weeks ago, library in addition facetedsearch wonderful; there points need regarding version, , wish tell me best practice tackle: it not support nested documents (relation between documents), [as in lucene java latest versions], example on domain model have (request, applicant), 1 request contains many applicants. a. in indexing phase:i indexed 1 request 1 applicant per document,in order search particular information on request , applicant will; makes: redundant request information on different documents, difficult use faceted search on (request) on such document can tell me if there (way, plugin, code) handle issues? not using solar library. how can return unique result (distinct), way return whole result implement code distinct on result; makes performance problem on 1 million document. any implementation on cache level, example caching document field (requestid) fast performance querying. any news regardin...

Multiple option of payment on paypal -

i did button of 3 options payment (buy now) on paypal, , when pasted code on website. looks ok until click on buy now, it's transfer error code on paypal. link website: http://compx.co.il/?page_id=43 the error code is: 1.can not process request @ time. return compx services , try option. 2. paypal can not process transaction because of problem on site of seller. contact seller directly resolve issue. any suggestion? regards, dvir it's character set issue. default character set doesn't recognize them can fix problem changing text of option values or changing "charset" you're posting paypal. you can follow these steps modify character set within paypal account: - log paypal account @ https://www.paypal.com - click profile link - click 'language encoding' link under selling preferences column - click gray 'more options' button - choose same encoding using data off site - select 'yes' 'do want use same encodi...

visual studio 2012 - Publishing Web.Config to Azure removes Azure storage connection string -

i've got web.config contains sql connection string , azure blob storage connection string. a web.config transformation replaces local sql connection string azure one. when publish site azure, blob storage connection string deleted , replaced duplicate sql connection string, blob storage string's name. the way i've found fix log in via ftp , manually change erroneous storage connection string correct 1 local machine. how vs publish web config azure , leave alone!!! web.config <connectionstrings> <add name="defaultconnection" connectionstring="data source=(localdb)\v11.0;attachdbfilename=|datadirectory|\.mdf;integrated security=true" providername="system.data.sqlclient" /> <add name="storageconnectionstring" connectionstring="defaultendpointsprotocol=https;accountname=;accountkey=" /> </connectionstrings> web.release.config <connectionstrings> <add name=...

android - Why does image goes to its original size? -

when galleryview first displays image shows scaled max possible size fit screen(as want) . after tap creen image goes original size. how can keep image scaled? class imageadapterr extends baseadapter { /** parent context */ private context mycontext; /** simple constructor saving 'parent' context. */ public imageadapterr(context c) { this.mycontext = c; } matrix savedmatrix = new matrix(); /** returns amount of images have defined. */ public int getcount() { return uilapplication.photo_buffer_big.size(); } /* use array-positions unique ids */ public object getitem(int position) { return position; } public long getitemid(int position) { return position; } /** * returns new imageview displayed, depending on position * passed. */ public view getview(final int position...

django - Error importing module -

i'm developing application using django 1.2 on google-app-engine (sdk 1.7.5). when test application locally using dev_appserver works, , works when upload on google's servers. problem application doesn't work if try newer sdk (i tried version 1.8.0) locally. error reported: improperlyconfigured: error importing middleware authentication.middleware: "no module named authentication.models" in middleware_classes import: 'authentication.middleware.accessfiltermiddleware' that i've developed. problem inside module import "models" in root directory (the folder in contained authentication package), tries search inside authentication package. i've tried use import .. models but in case error thrown is: valueerror: attempted relative import beyond toplevel package thank you

java ee cdi: catch exception thrown by producer method -

is possible catch exception thrown producer method in java cdi? have following producer method @produces public user getloggedinuser() throws usernotloggedinexception { if(...){ throw new usernotloggedinexception(); } user user = ... ... return user; } and want inject user object somewhere. cannot write method this: private void dosomethingwithuser(){ try { user loggedinuser = user.get(); // throws exception } catch (usernotloggedinexception e){ // compiler compains ... } } as compiler says usernotloggedinexception not thrown in method. if catch generic exception , works fine. there more elegant solution problem? thanks as stated in cdi spec ( http://docs.jboss.org/cdi/spec/1.0/html/contexts.html#contextual ), exception thrown when instantiating bean should unchecked exception (extends runtimeexception ), guess it's not case of usernotloggedinexception since complier checked ;). if change usernotlo...

php - Add element to if else statement. Wordpress -

i have if else statement gives me <img src=""..../> element result. problem want statement give me result <li><img src=""..../></li> i wrap if stament around <li> element loose purpose of im trying do. there way can add <li> elements inside if statement ? function <?php if(class_exists('multipostthumbnails') && multipostthumbnails::has_post_thumbnail('post', 'secondary-image')) { multipostthumbnails::the_post_thumbnail('post', 'secondary-image', null, 'post-secondary-image-thumbnail'); }else { } ?> result <img src="..."/> desired result <li> <img src="..."/></li> the source code is if (class_exists('multipostthumbnails')) { new multipostthumbnails(array( 'label' => 'secondary image', 'id' => 'secondary-image', 'post_type' => ...

doctrine2 - Symfony WebTestCase: File upload not deleted, assertion passing anyway -

thanks this cookbook recipe , have file upload form works great. doesn't test coverage, i've written own assertions, upload image, check image has been uploaded , deletes image , checks image not show on page. they pass first time, including final assertion check image (or name of image) not exist, doesn't delete , still see on webpage. tests run after fail because crawler finds old entry. why happening? test public function testuploadscenario() { // upload image $crawler = $client->click($crawler->selectlink('upload')->link()); $this->assertequals(1, $crawler->filter('html:contains("upload file attachment")')->count()); $pathtotestuploadfile = static::$kernel->getrootdir().'/../src/acme/mybundle/resources/public/logo.gif'; $uploadform = $crawler->selectbutton('upload')->form(); $uploadform['upload[name]'] = "logo test"; $uploadform['upload[fil...

How set watermark in word file using Aspose.Word for Java -

here code. not working. private static void insertwatermarktext(document doc, string watermarktext) throws exception { // create watermark shape. wordart shape. // free try other shape types watermarks. shape watermark = new shape(doc, shapetype.text_plain_text); // set text of watermark. watermark.gettextpath().settext(watermarktext); watermark.gettextpath().setfontfamily("arial"); watermark.setwidth(500); watermark.setheight(100); // text directed bottom-left top-right corner. watermark.setrotation(-40); // remove following 2 lines if need solid black text. watermark.getfill().setcolor(color.gray); // try lightgray more word-style watermark watermark.setstrokecolor(color.gray); // try lightgray more word-style watermark // place watermark in page center. watermark.setrelativehorizontalposition(relativehorizontalposition.page); watermark.setrelativeverticalposition(relativeverticalpositio...

java - eclipse autogenerates !=null recursive calls -

given java code such as: something v = a.getb().getc().getd().gete(); is there way in eclipse (templates or external plugins) generate safe chain call as: if(a!=null && a.getb()!=null && a.getb().getc()!=null && a.getb().getc().getd()!=null && a.getb().getc().getd().gete()!=null){ v = a.getb().getc().getd().gete(); } have given thought try{} catch(nullpointerexception e){} block? might feel less elegant, stop code if of method calls fails because previous 1 returned null , , give chance give default value if null. another option this: something v = /*default value*/ // overwritten if subsequent methods succeed. object temp = a.getb(); // use whatever object type getb() returns. if(temp != null){ temp = temp.getc(); /* if getc() returns different type of object, * either use different variable or make temp variable broader * (such generic object type) */ if(temp !=...

c# - Why can't I set both XmlAttribute and XmlElement as generic constraint? -

i'm trying set xmlattribute , xmlelement allowed types generic type when i'm setting both of them same time i'm getting error during compilation: the class type constraint 'system.xml.xmlelement' must come before other constraints example of code: interface testclass<t, t2> : ienumerable t2: xmlattribute, xmlelement { ... } why wouldn't allow me set constraints this? the constraint using not represent list of allowed types. means "anything inserted t2 must inherit ." this compiler can sure inserted t2 provides public interface - properties , methods -, namely inherited specified type. if list more 1 alternative there, interface taken granted? depending on inserted, t2 have either methods , properties offered xmlattribute or methods , properties offered xmlelement , none of them sure.

list - LinkedList Delete End in C -

i trying program simple text editor in c , using linkedlist. have problems deleteend function. did go wrong? #include <stdio.h> #include <stdlib.h> #include<conio.h> i store character, , coordinates of character in structure this: struct node { struct node *previous; char c; int x; int y; struct node *next; }*head; this called whenever letter typed in. void characters(char typed, int xpos, int ypos) //assign values of node { struct node *temp,*var,*temp2; temp=(struct node *)malloc(sizeof(struct node)); temp->c=typed; temp->x=xpos; temp->y=ypos; if(head==null) { head=temp; head->next=null; } else { temp2=head; while(temp2!=null) { var=temp2; temp2=temp2->next; } temp2=temp; var->next=temp2; temp2->next=null; } } print new node if there changes. void printer() ...

java - Implementation of Setter and Getter without using switch -

a pet can either cat or dog. each pet needs have name, owner’s name, color, doctor’s name , breed. of pets can cry, eat , sleep. without using switch method, tried use setter , getter function scanner. dont know how identify if user inputs dog user input dog else cat. is possible? package petexercise; import java.util.scanner; public class petcatdog { public static void main(string[] args) { scanner scan = new scanner(system.in); petcat cat = new petcat(); petdog dog = new petdog(); system.out.print("enter dog or cat word:"); string pet = cat.nextline(); } } the other subclasses made setter , getters so have - user - class represent user. has name, pet info, etc. user can have many or no pets pet - pet represents type of animals. have common attributes name, age..some common actions eat. dog - extends pet has attributes name, age, color, breed, actions specifially dog barks, fetches balls cat - extends pet has attributes na...

tomcat7 - javax.el.ELException: Cannot convert bottom-left of type class java.lang.String to class org.richfaces.component.Positioning -

i in process of upgrading jsf 1.2 jsf 2.x. in process wanted upgrade every page in application 1 one. have set every dependency , configurations. component libraries such richfaces 4.x , primefaces 3.5 working properly. while trying convert 1 of pages, encountered following error. javax.el.elexception: cannot convert bottom-left of type class java.lang.string class org.richfaces.component.positioning @ org.apache.el.lang.elsupport.coercetoenum(elsupport.java:182) @ org.apache.el.lang.elsupport.coercetotype(elsupport.java:405) @ org.apache.el.expressionfactoryimpl.coercetotype(expressionfactoryimpl.java:47) @ com.sun.faces.facelets.tag.beanpropertytagrule$literalpropertymetadata.applymetadata(beanpropertytagrule.java:88) @ com.sun.faces.facelets.tag.metadataimpl.applymetadata(metadataimpl.java:81) @ javax.faces.view.facelets.metataghandler.setattributes(metataghandler.java:129) @ javax.faces.view.facelets.delegatingmetataghandler.setattributes(delegatingmetataghandler.java:102) @ ...

python - How to make click-through windows PyQt -

i make window in pyqt can click through; ie click on window , click passed through can interact whatever behind it, while window remains on top. example of effect trying achieve notifications on ubuntu appear in top-right hand corner default, can click through. i able in pyqt ideally; if not, platform linux windows solutions welcome! cheers in advance! i've been giving bit of thought , research, great able this. edit: trying make window can use tracing paper window behind here solution on windows using pyqt4. you need override eventfilter in front widget (on windows winevent) , forward events window. i'm not sure, there must similar approach can used on other platforms (instead of winevent, maybe x11event?) good luck! from pyqt4 import qtcore, qtgui import win32api, win32con, win32gui, win32ui class front(qtgui.qpushbutton): def __init__(self,text="",whndl=none): super(front,self).__init__(text) self.pycwnd = win32ui.cr...

Routes tutorial : Sencha Touch 2.2.1 -

i wanted learn concept of routes in sencha touch 2.2.1 . can me providing me easy , live tutorial or demo. appreciated. in advance. did try google? first result exact same question site: using routes in sencha touch 2 the sencha touch docs provide pretty guide: http://docs.sencha.com/touch/2.2.1/#!/guide/history_support

javascript - Netbeans 7.4beta complains about JSF </ui:repeat> in <script> -

i have xhtml file backing ejbs , javascript tag, contains jsf tag. follows: <script> ... <ui:repeat value="#{sections.listcontrolsnames}" var="listname"> { id: '#{listname}', name:'#{listname}', parent: 'controls'}, </ui:repeat> <-- netbeans has problem here ... </script> in fact, there's more 1 repeat tag , irritate netbeans in same long in script tag. what netbeans says expected operand found < </ui:repeat> ^ i've been using version of netbeans in ubuntu repo before , didn't has problem. ideas on how make either stop complaining or satisfy anyone? it should fixed in latest dev builds (after 7.4 beta), can download here

javafx - Java FX - Data FX - Loading a CSV file into a TableView -

i'm trying load content of csv file tableview using datafx. i've created new javafx project, nothing loading file in background. in controller, have following code file file = new file("test.csv"); if (file.exists() && file.canread()) { datasourcereader dsr1 = new filesource(file); string[] cols ={"fname","lname","address"}; mycsvdatasource ds1 = new mycsvdatasource(dsr1, cols); tableview tableview = new tableview(); tableview.setitems(ds1.getdata()); system.out.println("csv : " + ds1.getdata().size()); ds1.getdata().size() returns zero. i've taken care of spaces, column names, etc. csv extremely simple , i've wrote notepad++: fname,lname,address frank,noris,42 iopus drive ann,coleman,po box 12345 thomas,test,1 bills drive since not figure problem, i've downloaded source code of csvdataso...

javascript - Unable to call getFile() from ActiveXObject -

hi created file upload kind of thing, in provide upload file size validation wrote following code worked fine in chrome , firefox. $('#file').change(function() { filesizeerror = (this.files[0].size/(1024*1024) > 1) ? true:false; }); but code not working in ie, implement same in following fashion var myfso = new activexobject("scripting.filesystemobject"); var filepath = $('#file')[0].value; var thefile = myfso.getfile(filepath); alert('rajaram'); var size = thefile.size; alert(size + " bytes"); here myproblem myfso.getfile() notworking .the alert not prompted here problem myfso.getfile() not working thank heaven that! otherwise, browsing websites ie in lot of trouble quickly, malicious sites access files. access local file system through wide-open api filesystemobject not allowed internet zone content. (the way use unsafe script...

objective c - New line textfield- iPhone -

this question has answer here: how create multiline uitextfield? 9 answers is possible put new line in textfield placeholder? like: comment1= [[[uitextfield alloc]initwithframe:frame2]autorelease]; comment1.placeholder = @"write maximum 200 \r characters here"; use uitextview multiline text

javascript - Handlebars templates, access context variables with a string key -

let's have handlebars template this: <script id="entry-template" type="text/x-handlebars-template"> <div class="entry"> <h1>{{i18n.title}}</h1> </div> </script> what this: var source = $("#entry-template").html(); var template = handlebars.compile(source); var context = {"title.t":"my new post"} console.log(template(context)); when try parse in context above string key, hanslebars acts key not available. understand normaly structure should this: var context = { i18n:{ title:'test' } } but because i'll 118n strings external source, easier use them keys. ah , yes, know projects i18n.js, actual question is: can use string-key in context object dots in , if yes, how can access them handlebars template? no cannot use keys dots in them. because part of syntax. if use dots how access children of element? i...

c# - Split the string based on regular expression -

i've array of strings name , groups[0].id , types[11].name . i want filter string has square brackets , split them 2 parts. ex., groups[0].id groups , id . how can find strings has square brackets using regular expression? you can try this regex.split(input,@"\[.*?\][.]");

SoapUI request response content externalize -

i need set request/response content of test request dynemically external xml folder(requestfolder, responsefolder) using groovy. there mockservice running. need kind of implementation because there number of mockservices , multiple responses within it. want externalize them , call them dynemically through groovy is have done before? amit why have multiple request xmls? because have different data in them? in case suggest put data in excel or csv , based on data in data source generate xml. if using pro version should able read xml files local drive , present response mock service. all can done using groovy.

WSO2 ESB 4.7.0 download on server -

how download 4.7.0 release of wso2 esb directly on server? have ssh terminal server, no gui. i tried wget. , without auth. tried --save-cookies method wget without success. i tried elinks & logging in wso2 site account there, got no way of downloading latest version through terminal. wonder why should open source project make difficult download product build? can me link or method download via terminal? please try this: wget --user-agent="testuser" --referer="http://connect.wso2.com/wso2/getform/reg/new_product_download" http://dist.wso2.org/products/enterprise-service-bus/4.7.0/wso2esb-4.7.0.zip

plugins - vim temporary disable undo? -

i followed add-custom-header-to-your-file create own custom header plugin. when save file auto. update current date time last-modified field. add edit history undo list. how can disable undo temporary ? you cannot disable undo without losing undo history. think undo implementation; pretty hard if had gap in there. if don't worry losing history, :set undolevels=-1 (and restoring previous value) do. also, :undojoin can used fuse 2 otherwise separate entries together. in situation, it's best keep (automated) change inside undo history.

jsf/primefaces load indicator during init of the bean -

in jsf/primefaces project, have lot of data loading in init (postconstruct) method of beans. that's why show gif indicator during bean load. i tried primefaces , ajax status (programmatic version of showcase) http://www.primefaces.org/showcase/ui/ajaxstatusscript.jsf so added template of project <p:dialog modal="true" widgetvar="loadwidget" header="status" draggable="false" closable="false"> <p:graphicimage value="../images/ajaxload.gif" /> </p:dialog> i able call loadwidget.show(); @ beginning of init method of bean , loadwidget.hide(); @ end. do have idea , how fire javascript display loading gif? thanks edit i add tried this. here part of template include content of page. it's not working either p:dialog included before or after content. <div class="content"> <script>loadwidget.show();</script> <ui:insert name="body...

Using powershell to return folder permissons -

i new powershell , trying use script found return folder permissions : function get-secgroups($path) { $a = @{}; get-acl -path $path | %{write-host `n $path; $_.access} | %{ #only show permissions on folder, not files #check see if user/group has "list" permission if ($_.inheritanceflags -eq "containerinherit") { write-host `t $_.identityreference "list"; } else { write-host `t $_.identityreference, $_.filesystemrights; } } } #end get-secgroups get-childitem -path "d:\*\*\" | {$_.psiscontainer} | %{get-secgroups($_.fullname)} | out-file c:\output.txt the problem have creates output.txt no data. data displayed on screen. going wrong? juste replace write-host write-output in function.