Posts

Showing posts from June, 2012

excel - Want to read Worksheets from a workbook using Python Wincom32 -

i want read worksheets workbook using python wincom32 module not able read if number of sheets more. example have excel workbook total 150 worksheets in , trying read 89th excel worksheet using python wincom32 module giving me sheet name not present in excel workbook @ all. using below python code import win32com.client dispatch = win32com.client.dispatch excel = dispatch("excel.application") excel.visible = 1 wb = excel.workbooks.open('<path excel>') count = wb.sheets.count # count stores total number of worksheets present print count ws_name = wb.sheets[ 89 ].name """ supposed read name of 89th worksheet instead giving me garbage name """ print ws_name there mistakes in code: 1) instead excel.visible = 1 should excel.visible = 1 , 2) instead excel.workbooks.open('<path excel>') - excel.workbooks.open('<path excel>') 3) instead wb.sheets.count - wb.sheets.count , 4) instea

arrays - Trouble sorting and aggregating cell data in excel using VBA -

i have updated this update highlights changed part of code remove unnecessary commas in resultant sheet8.l5 field. also implemented suggestion suggested feelththis. now returns "1,9" instead of desired "1, 9, 29, 37, 50, 61" original (slightly changed post) i trying cell data 3 sheets, 5 cells per sheet total of fifteen cells. remove 0 values. numerically order remaining. insert single cell on sheet comma delimited. cell data should contain positive, whole numbers. i have provided sample of data looks , code below. if there better way of approaching way attempting open other solutions. the code below return error in aggregateseptember() line returns error has comment explaining it. thank feelththis. after execution sheet 8 l5 should = "1, 9, 29, 37, 50, 61" i totally stumped , haven't written vb before, appreciate this. thanks in advance time , consideration, tim the data below before vba runs. after code runs sheet8.l5.val

c++ - Performing string operations on data that might contain null \0 -

i'm implementing pluggable mime filter ie (this question concerns iinternetprotocol::read(void*, ulong, ulong*) ) , i'm intercepting incoming html view modify html. the html generally utf-8 encoded, except there \0 (null) characters, , sits inside char buffer. want load inside std::string instance can perform string operations such std::string::find inserting content (by copying substrings destination buffer around injected string, this: string received( this->buffer ); size_t index = received.find("<p id=\"foo\">"); if( index != string::npos ) { memcpy( destination , received , index ); memcpy( destination + index , "injected content" , 17 ); memcpy( destination + index + 17, received.substr(index), received.size() - 17 - index ); } else { memcpy( destination , this->buffer , this->buffersize ); } the problem buffer might contain null bytes (it&#

.net - when a method is called , which thread will be run in c# and java? -

everybody knows using multi threading platforms , developing multi threading applications. way, couldn't recognize thread issue. when call static method (that in class.) , thread run ? gui thread go jobs , run method ? i.e: (i gonna give vb code sample . logic same java.) private sub runvaluestest_click(sender system.object, e system.eventargs) handles runvaluestest.click dummyclass.instance.dojob() end sub() this vb syntax not matter . main logic same c# , java. when click button, new thread run ? or gui thread go job ? if new thread run, why , when use new thread our jobs ? if gui thread goes, see lots of time more 1 thread run in program. how can threads different in program? why , when thread exceptions occurs somehow ? example: doing file operation in method: (this may different question) private _file system.io.streamwriter private sub runvaluestest_click(sender system.object, e system.eventargs) handles runvaluestest.click if not directory.exists("

eclipse - display a label after the Button is clicked in Java swing -

i want display label, when button clicked. using eclipse juno. have label added , setting visible part... wlabel = new jlabel("you , me"); wlabel .setvisible(false); wlabel .setbounds(80, 35, 100, 25); wlabel .setfont(new font("meiryo", font.plain, 9)); wlabel .setforeground(new color(255, 102, 21)); add(wlabel); the button wbutton = new jbutton("w"); wbutton .setactioncommand("mybutton"); wbutton .addactionlistener(this); wbutton .setfont(new font("meiryo ui", font.plain, 11)); wbutton .setbounds(10, 33, 70, 35); wbutton .setbackground(new color(102, 51, 20)); add(wbutton); and here actionperformed. implemented actionlistener public void actionperformed(actionevent e) { // todo auto-generated method stub if (e.getactioncommand().equals("mybutton")) { wlabel.setvisible(true); } } initially can set visibility false of label , after clicking

node.js - How to sort, select and query subdocument in mongoose -

so i'm trying sort subdocument, select , everything. seems can't regular query tried w/ aggregate mongoose = require("mongoose"); mongoose.connect("localhost:27017", function(err) { mongoose.connection.db.dropdatabase(); story = mongoose.model("story", { title: string, comments: [{ author: string, content: string }] }); sample = new story({ title: "foobar", comments: [ { author: "a author", content: "1 content" }, { author: "b author", content: "2 content" } ] }); sample.save(function(err, doc) { story.aggregate([ { $match: { _id: doc._id }}, { $unwind: "$comments" }, { $project: {"comments": 1}}, { $sort: {"comments.author": -1}} ], function (err, result) { if (err) { console.log(err);

ios - xcode compilation errors after xcode 6 update -

since upgraded xcode 6 project not compile anymore, cleaned several time, restarted, deleted derived data didn't help so went xcode 5 , have errors on xcode 5 project working project repository , it's working on colleague's mac... i didn't change don't understand , aprreciate help the errors error: unable open executable '/users/mobiledev/library/developer/xcode/deriveddata/myapp-bqkgvjwrncaywqgcyydyxfwxsvio/build/products/debug-iphonesimulator/myapp.app/myapp' ld: framework not found avkit architecture x86_64 clang: error: linker command failed exit code 1 (use -v see invocation) had same trouble, i've set target membership in file inspector of framework. find avkit framework in project , try method, may help.

entity framework - Calling two WCF services in one transaction. Both talk to the same database. Is MSDTC is the only option -

i have wcf service servicea. that in turn has call 2 individual wcf services serviceb , servicec 2 different things, if call servicec fails want rollback serviceb did. i did implement using transactionscope (i using ef 6.0) without enabling msdtc not working. there workaround this? not want go through msdtc route because afraid cause lot of performance issues , web admins against it. what want distributed transaction, because transaction contains cross boundary participants. best of knowledge, solution distributed transaction in windows platform msdtc, there no way around this. i would, however, recommend try seek more eventual consistent solution, rather strictly transactional, because solution perform , scale better. granted, have deal special cases data not consistent, lead more complex code. from experience, worth it, you.

linux - java getabsolute() fails for path with spaces? -

in code, call getabsolutepath path file. works totally fine, if file path doesnot contain spaces. example: ~/desktop/data/a.txt but got totally wrong file path if space exists, example ~/desktop/data set/b.txt is bug in java? way absolute path right , without spaces? code like: public void loaddatafile(java.io.file f) { system.out.println("f.getabsolutepath "+f.getabsolutepath()); ... } is: /home/xx/humans_d/results/a1/a.txt should be: /home/xx/desktop/data/hrv pilot humans_d/results/a1.a.txt thanks lot. lj

c - Opengl shapes not drawing in callback function -

in opengl program, want make screen turn red when user hits key. in my_keyboard function, have following: void my_keyboard( unsigned char key, int x, int y ) { int feedback_code=0; if (key == 49) { feedback_code=1; } if (feedback_code==1) { flash_screen(); } my flash_screen method follows: void screen_flash() { float mat[16]; glgetfloatv(gl_modelview_matrix,mat); glcolor3f(1.0f,0.0f,0.0f); glbegin(gl_polygon); glvertex2f(0.0f, 0.0f); glvertex2f(0.0f, 640.0f); glvertex2f(888.0f, 640.f); glvertex2f(888.0f, 0.0f); glend(); } by glgetfloatv call, know transformation matrix @ lower left corner should be, @ point (0,0). draw function should draw red square 888x640px, size of window. when run program , hit '1' key, however, don't shape! i've used breakpoints , determined glbegin-glend statements run, don't seem produce anything. the other shapes have done in main display function, cal

php - Laravel Eloquent - Order by Enum Field -

i need order results enum field. field, called status can either open , close , or edit . now, want entries, edit , open , , close order. is possible laravel eloquent? tried (which sounds ridiculous, thought i'd give try), , didn't work: survey::orderby('status', 'edit', 'open', 'close')->get(); try this: survey::orderbyraw("field(status, \"edit\", \"open\", \"close\")")->get();

Display image in imageview in android -

i've set onclicklistener on imageview layout , trying display image phone. everywhere looked process , similar. should work image not displaying in imageview. maybe i'm not handling in right way happening in fragment. in fragment code displaying image. need suggestion overcome. public class userprofile extends fragment { private imageview profileimg; @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { view v = inflater.inflate(r.layout.fragment_user_profile, container, false); profileimg = (imageview) v.findviewbyid(r.id.imageview_profile); profileimg.setonclicklistener(chngimghandler); return v; } onclicklistener chngimghandler = new onclicklistener() { @override public void onclick(view v) { intent intent = new intent(); intent.settype("image/*"); intent.setaction(intent.action_get_content);

Ember.js: programmatically load hasmany relationship -

disclamer: started using ember.js few days ago suppose having these 2 models: app.question = ds.model.extend({ text: ds.attr('string'), answers: ds.hasmany('answer', {async: true}) }); app.answer = ds.model.extend({ question: ds.belongsto('question'), text: ds.attr('string') }); for reasons got json (without "answers" list) { ... "questions": [ {"id": 1, "text": "foo?"}, ... ] } in template want load , show answers if explicitly needed {{#each questions itemcontroller="question"}} <div class="answer-wrapper"> {{text}} <button {{action "loadanswers"}}>load answers</button> <ul> {{#each answers}} <li>{{text}}</li> {{/each}} </ul> </div> {{/each}} how can in controller's loadanswer action? app

javascript - Using d3.js in Wix.com -

i want embed d3 visualizations wix.com website using add > html. i found awesome geojson file of coordinates of chicago community areas need. perfect. http://www.chicagohealthatlas.org/map/healthcare_providers_dentists.json so next step wanted achieve create script geodata in website make interactive map display information each community depending on 1 selected. however, wix.com not support d3, , receiving blank html text box. here code tried: <script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script> <script> var width= 960, height = 500; var path = d3.geo.path().projection(projection); var svg = d3.select("chicago_b&w.jpg").append("svg").attr("width",width).attr("height", height); d3.json("http://www.chicagohealthatlas.org/map/healthcare_providers_dentists.json", function(json)) { svg.selectall("path").data(json.features).enter().append("path&

sorting - How to preserve the order of a vector in a table in R? -

pretty simple question, assume. trying different type of object (with class 'acf' , type 'list'), assume answer extendable vector (class numeric, type 'double'): x<-c(4, 5, 6, 1, 2, 10, 15) table(x) x 1 2 4 5 6 10 15 1 1 1 1 1 1 1 i output of table in same order vector (4, 5, 6, 1, 2, 10, 15). how can achieve this? table(factor(x, levels=unique(x)))

javascript - Run command in particular directory with NodeJS -

i building desktop app in html, css , typescript brackets core. question is: possible run command node.js? want go cd directory , run grunt serve. i have searched google , node site, couldn't find anything. thanks sven http://nodejs.org/api/child_process.html child_process.exec('shell command', {cwd: 'current work dir'}, function(err, stdout, stderr) {});

double - C program not printing values -

i writing program converts decimal degrees degrees, minutes, seconds. supposed do: -118.1406209154 = 118 degrees 8 minutes 26.2342 seconds west. w if negative either west longitude or south latitude 118 degrees left of decimal place 8 multiply decimal portion (0.140620915) 60 decimal minutes (8.4372549). minutes left of decimal place. 26.2353 multiply decimal portion (0.4372549) 60 decimal seconds. this code have far, however, problem when run prints decimaldegrees value , nothing else. cannot figure out why. tip/help appreciated. double decimaldegrees = -118.1406209154; double degrees; double minutes; double seconds; char longitude; char latitude; double temp; int main(int argc, char **argv) { minutes = decimaldegrees - (int)decimaldegrees; //get decimal portion of decimaldegrees degrees = decimaldegrees - minutes; //get degrees removing decimal portion minutes = minutes*60.0; temp = minutes - (int)minutes; //get decimal portion minutes

html - Center crop img to fill div -

i have 3 column holy grail layout width of left , right columns fixed , center column fluid. height of layout defined center column's contents. in right column need full bleed center cropped image. that's hard part. have sample of i'm going here i'm explicitly defining height of image 180px , i'd grow height of center column. also, i'd avoid using javascript if @ possible , not necessary use flexbox, that's best come far. unless explicitly need use <img> tag use inline css styles control background-image of div rather placing element within div for example : <div class="container"> <div class="col1"></div> <div class="col2"> lorem ipsum dolor sit amet, consectetur adipiscing elit. duis nec rhoncus orci, eget eleifend risus. maecenas suscipit arcu et aliquet tristique. quisque venenatis est maximus consectetur. nam id fringilla odio. mauris lobortis nec lorem ne

paging - UICollectionView - start viewing from a particular indexpath -

i creating uicollectionview paging enabled. each collection view cell full screen image. default able view cells index 0 (first cell). want start viewing cell particular cell index. can tell me how that? got working. from first view controller pass index path of photo have scroll. in viewdidload of collection view set collection view , use method - scrolltoitematindexpath:atscrollposition:animated: set animated no , atscrollposition uicollectionviewscrollpositionnone

node.js - Blob storage in parse sdk -

can store blob files in parse collection if in mysql. found out can upload file parse , save url in collection. thinking of storing blob in record itself. can save parse collection q- can store blob files in parse collection if in mysql? a- no . can save files on parse, in return image, it'll give direct link (url) , name image have uploaded. that's requires. if want how save files on parse, see these links: parse.file and upload files via ajax (javascript)

Change the color of the bar of histogram in Matlab -

Image
i trying print histogram need values bigger specific value(250 example) in orange. the output is: and need : help, code: fh = figure; hist(pz); saveas(fh, strcat('figures\window), 'jpg') close(fh); one way go using bar plot data, in case limited colors provides, are: 'b' | 'r' | 'g' | 'c' | 'm' | 'y' | 'k' | 'w' . here's sample code that: %// generate data data = randn(2000,1); bins = -5:5; [n,x] = hist(data,bins); %% //color count limit_val = 500; figure(); bar(x,n,'b');hold on; bar(x,n.*(n<limit_val),'r'); hold off; %% //color bin position limit_val = 2; figure(); bar(x,n,'b');hold on; bar(x(abs(x)>=limit_val),n(abs(x)>=limit_val),'r'); hold off; another way modifying patch color mentioned @lakesh.

Easy way to send PHP language array files to translation? -

i'm using laravel php framework, , else have language files php files big array in them. does know friendly way of getting these files translators? there editor or service maybe? what google proposed: https://github.com/barryvdh/laravel-translation-manager it can import php translation files , has neat interface easy editing of translations. simply install package through composer, , translate away!

AT command to know own phone number -

i have been working lately on @ commands testing. had difficulties in finding own number when sim not subscribed sms , voice calls(in special cases sim used lab experimenting). there way know own phone number using @ command. airtel(india) ussd code own msisdn number *121*9#. if dial atd*121*9#, message displayed on @ command user interface. or there way know own phone number? appreciated. at+cnum should return own phone number.

Can I use additional directories for grouping Android resources -

Image
creating of large android project lead numerous layout files in res folder. can group them creating subfolders? is possible in android? for example have now: res/ /layout/ /some large list there and wanted achieve: res/ /layout/ /subfolder1/ /layout1.xml /view1.xml ...... /subfolder2 /another_layout.xml /another_view.xml i tried got error of compilation. appreciate help. the answer yes , but if you're using android studio , gradle build system . btw: there's thread on code.google.com discussing issue ( issue 2018: r.java should recognize resources in sub-directories ). has been closed project member following statement: marking released. largely possible in gradle build system exists today, , won't implementing other build systems. so how can realise in android studio? here's how: right click on layout-folder --> new --> directory --> name e.

php - Adding a condition that would return subtracted values when going to a specific page -

how create condition automatically return or re-add values subtracted when moving specific page. for example. bought 3 apples, 5 in inventory, 3 automatically deducted inventory after pressing checkout. however, user cancels order , value made still 2, though order cancelled, what fix problem? here code, , triggers when user presses checkout , goes page. kind of automatic, if can fix better one, more thanks. hehe. // these codes automatically deduct quantity available inventory when going page. $qry = "update inventory set prod_quantity = prod_quantity - $q prod_id = '$pid'"; $result = @mysql_query($qry); how create condition return subtracted values inventory? $q quantity ordered user. $pid product id. thank much. hope guys can me. after have subtracted value, have add in case when user cancels this: // these codes automatically deduct quantity available inventory when

javascript - Why are the gradients in this SVG displaying as black? -

Image
i have made svg , added page has rather unusual behaviour, page loading can see svg on page(looks fine gradients showing, see below image. have 2 svg files 1 logo , other 'k' gets hidden after loading). after page loads reason gradients disappear , left black ascenders , descenders. (see below) but things weirder still if click green circle button, causes side bar collapse angular hides 'logo' svg , displays 'k' svg. have hit toggle once , correctly gradient issue. can hide 'k' & show 'logo' again , fine. see below image of after toggling hide/show of sidebar. here svg code perhaps it? love strange behaviour , not sure how solve it. logo svg: <!-- begin logo svg --> <div class="logo" ng-hide="sidebarcollapsed"> <svg version="1.1" id="logo" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px&q

apache camel - Enabling tracing at a single processor -

i using apache camel in combination hawt.io administration console. can enable tracing @ route level, need enable tracing @ single processor level. is possible in apache camel enable tracing @ single processor? how ? tracing default entire route, cannot want trace specific processor. you can use interceptors or other ways own tracing , capture information 1 processor. http://camel.apache.org/intercept but out of box tracing functionality per route.

java - Spring Boot Starter Integration and Starter WS not playing well together? -

i'm working on spike try exercise number of technologies spring boot (1.1.6.release), gradle (2.1) , java 1.8. looking @ supporting old style soap web service calls spring integration. off ground looking @ working example producing web service ( http://spring.io/guides/gs/producing-web-service/ ) , adding spring integration mix. when did though , try hit wsdl location seeing stack trace : 2014-09-22 09:53:17.823 error 15188 --- [nio-8080-exec-1] a.c.c.c.[.[.[.[messagedispatcherservlet] : servlet.service() servlet[messagedispatcherservlet] in context path [] threw exception [request processing failed; nested exception java.lang.abstractmethoderror: org.apache.xerces.dom.deferreddocumentimpl.getxmlstandalone()z] root cause java.lang.abstractmethoderror: org.apache.xerces.dom.deferreddocumentimpl.getxmlstandalone()z @ com.sun.org.apache.xalan.internal.xsltc.trax.dom2to.setdocumentinfo(dom2to.java:377) @ com.sun.org.apache.xalan.internal.xsltc.trax.dom2to.pa

php - Unique visitors from Google Analytics -

is there way display on each page/post in wordpress counter unique visitors google analytics? thanks help! you should out google analytics api, have php example in doc https://developers.google.com/analytics/solutions/articles/hello-analytics-api#query_profile you have wordpress plugin can achieve that https://wordpress.org/plugins/google-analytics-post-pageviews/

How to get row details of MySql table just after that row inserted to an Android App -

i want column values of row specific android app* after new row inserted mysql database table in server. specific android app* - identify each app uniquely phone number. table structure follows. id     fromphonenumber     clientphonenumber     messagebody 1        +3434354546             +484844646245         test123 when kind of row inserted, want messagebody column value app way normal sms appear. can please explain way , suggest tutorial refer. thank in advance

jquery datatables - how to get the totalRecords to display during the pagination -

im using datatables plugin pagination. i'm trying server-side pagination working, start with, im facing issue of not been able display totalrecords entires in 'showing 1 15 of 15 entries' text. im using display records: var resultstable = tableel.datatable( { "aadata": tabledata, "aocolumns": tablecolumns, "aasorting": [[1,'asc']], // "bserverside": true, "processing": true, "serverside": true, "sajaxdataprop": "api/1.0/accounts", "bprocessing": true, "pagingtype": "simple_numbers", "blengthchange": false, "bautowidth": false, "bscrollcollapse": true, "itotalrecords": 34, "itotaldisplayrecords":15, "idisplaylength": 15 } ); but still shows me 'showing 1 15 of 15 entries' instead of 'showing 1 15 of 34

Apache2 Virtual Host 503 error -

here apache2 virtual host config - <virtualhost *:80> servername a.b.com proxypreservehost off proxypass / http://<serverip>:<appport>/<app>/ timeout=3600 keepalive=on proxypassreverse / http://<serverip>:<appport>/<app>/ proxytimeout 3600 </virtualhost> <location "/"> order allow,deny allow </location> i have route 53 entry a.b.com pointing machine (the 1 apache2) i have ran a2ensite.. getting 503 service unavailable on hitting a.b.com however, a.b.com:appport/app working.. this means missing in apache2 configuration.. can point me out? proxypreservehost off should on, , not need mention http://, in route can mention http://. further please check , paste error logs.

c++ - Why is iostream::eof inside a loop condition considered wrong? -

i found comment in this answer saying using iostream::eof in loop condition "almost wrong". use while(cin>>n) - guess implicitly checks eof, why checking eof explicitly using iostream::eof wrong? how different using scanf("...",...)!=eof in c (which use no problems)? because iostream::eof return true after reading end of stream. not indicate, next read end of stream. consider (and assume next read @ end of stream): while(!instream.eof()){ int data; // yay, not end of stream yet, read ... instream >> data; // oh crap, read end , *only* eof bit set (as fail bit) // stuff (now uninitialized) data } against this: int data; while(instream >> data){ // when land here, can sure read successful. // if wasn't, returned stream operator>> converted false // , loop wouldn't entered // stuff correctly initialized data (hopefully) } and on second question: because if(scanf("...",...)!

class - Python Classes did I make a mistake or did my teacher [easy] -

my teacher told make clock class take hours , minutes , seconds instance variables. gave bunch of different methods had make complete objectives gave regarding clock class. one of our tasks implement method called print12() prints out time colons , appends or pm end. asked test entering print12(myclock) . mine works if enter myclock.print12() . i'm not sure if made error or implemented code wrong. here code: class clock: def __init__(self, hour, minute, second): self.hour = hour self.minute = minute self.second = second def __str__(self): return '%02d'%self.hour+':'+'%02d'%self.minute+':'+'%02d'%self.second def print12(self): if self.hour >= 13: print(self,"p.m.") else: print(self,"a.m.") def advance(self,s1): if s1 == 'sec': self.second += 1 elif s1 == 'min': sel

ios - UILabel change height, animation expands from center -

i'm trying increase labels height using animation, animation causes label first expand center, , jump in place correct y point. looks terrible. bottom expand. [uiview animatewithduration:0.5 delay:0.0f options:uiviewanimationoptiontransitionnone animations:^{ [self.about increaseheightfromtopleft:deltaheight]; [self.scrollview increasecontentheight]; } completion:nil]; - (void)increaseheightfromtopleft:(cgfloat ) increased { cgrect newframe = cgrectmake(self.originx, self.originy, self.framewidth, self.frameheight + increased); self.frame = newframe; } the label called about, can see video of animation here. https://www.youtube.com/watch?v=dcqktiz9moy&feature=youtu.be faced same problem! try set label' contentmode top in code: label.contentmode = uiviewcontentmodetop;

How do you redirect a URL with a port number in Apache Tomcat 8.0.9 so that user cannot see port number -

i using redhat , trying redirect url in apache tomcat. example have web address http ://example:8282. want redirect page when type http ://example/alfresco shows http ://example/alfresco in browser, user cannot see port number. have been successful in redirecting not redirecting , keeping url want redirected actual url, not want seen. things have tried in /etc/httpd/conf/httpd.conf # redirect permanent /alfresco http://<ip address>:8282/ # i tried # redirectmatch ^/tomcat/(*)$ http://<ip address>:8282/$1 # i tried # rewriteengine on rewritecond %<ip address>:8282 !^1.1.33.201\/tomcat rewritecond %<ip address>:8282 !^$ rewritecond %8080 !80$ rewriterule ^tomcat/?$ http://<ip-address> [pt] # thank you, appreciated because think there fundamental mistake, first try redefine important points @ first , point solution: redirects: can not hide port or url using redirects because redirects doing - redirec

javascript - Adding and triggering a bootstrapvalidator on result from ajax query -

i have following login form : <form accept-charset="utf-8" class="form-horizontal" id="login_form" action="/login.json" method="post" data-validate="true"> <div class="content"> <h4 class="title">login appname</h4> <div class="form-group"> <div class="col-sm-12"> <div class="input-group"> <span class="input-group-addon"><i class="fa fa-user"></i></span> <input type="text" placeholder="username" id="username" name="username" class="form-control" required data-bv-notempty-message="username must not empty." maxlength="255" data-bv-stringlength-message="username cannot exceed 255 characters.">

Jquery syntax information required -

i learning jquery , on first example of chapter 4 of learning jquery. have 2 queries. 1) while checking id of button clicked using this.id , not $(this).id, use $ sign not in this. please explain. 2) while using $speech, tried using $(speech).css , did not work. please let me know reason well. below code. <html lang="en"> <head> <title>page 87</title> <link rel="stylesheet" href="04.css" type="text/css" /> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script> $(document).ready(function(){ var $speech=$("div.speech"); $("#switcher-default").click(function(){ $("#switcher button").removeclass("selected"); $(this).addclass("selected"); $speech.css('fontsize','1em');

html - Disabled Textarea can't be Scroll on Windows Phone -

i have tried adding overflow: auto; & overflow: scroll; still no effect on that. similar question; disabled textarea can not scroll in ie8 no answer question. needs work in windows phone & ie9 , + . using readonly instead disabled not feasible solution me. i think ideology set control disabled say, dont wont have events , actions run it.

maven - spring boot war without tomcat embedded -

i want create war file without embedded tomcat maven. here relevant part of pom ... <parent> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-parent</artifactid> <version>1.1.6.release</version> </parent> <dependencies> <dependency> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-web</artifactid> </dependency> <dependency> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-thymeleaf</artifactid> </dependency> <!-- add tomcat if want run directly --> <dependency> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-tomcat</artifactid> <scope>provided</scope> </dependency> </dependencies> <build>

android - Wearable watchface not installed on LG G Watch -

i'm trying develop watchface app. works while install wearable module on watch directly launching wearable configuration. able installed play store need package handheld (mobile) module dependency wearable module. here build.gradle of modile module apply plugin: 'com.android.application' android { compilesdkversion 20 buildtoolsversion "20.0.0" defaultconfig { applicationid "com.example.mvl.myapplication" minsdkversion 18 targetsdkversion 20 versioncode 1 versionname "1.0" } buildtypes { release { runproguard false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile filetree(dir: 'libs', include: ['*.jar']) wearapp project(':wear') compile 'com.google.android.gms:play-services:+' } wearapp project(':wear

html - JQuery get option text based on same li element -

i working on select option not know how can text option base on option value. for example text "danish" if value da, the html of option select below <div id="language" class="dd-container" style="width: 333px;"> <div class="dd-select"> <input class="dd-selected-value" name="language" type="hidden" value="en"> <a class="dd-selected"><label class="dd-selected-text">english</label></a> <span class="dd-pointer"></span> </div> <ul class="dd-options dd-click-off-close"> <li><a class="dd-option dd-option-selected"> <input class="dd-option-value" type="hidden" value="en"> <label class="dd-option-text">english</label></a> </li>

java - Getting an absolute path on the local file system from an IResource -

what better approach absolute path on local file system iresource? iresource res; ... res.getlocation().makeabsolute().tostring(); or iresource res; ... new file(res.getlocationuri()).getabsolutepath(); (i skipped null checks in example.) probably: res.getlocation().toosstring(); the location should absolute no need call makeabsolute (although not cost when path absolute). use toosstring() path in format used os (so \ on windows, / on mac, linux). you can use toportablestring() standard format path useful data interchange not suitable use file .

.htaccess - Replace spaces with hyphen in query string in htaccess -

i need when type url this: http://www.example.com/fountain%20hills-condos-townhouses %20 or space replaced hyphen. htacces is: #options +followsymlinks options +symlinksifownermatch -indexes rewriteengine on rewritecond %{http_host} ^example.com rewriterule (.*) http://www.example.com/$1 [r=301,l] rewriterule (.*)-condos-townhouses$ index.php?cond_option=and&page=1&nextprev=0&searchbtn=0&displaylim=30&search_by=$1&search_cat_type=city&keyword=city&proptype=2&listing_types=2&sortby=&searchpost=1&popup_in_seconds=1&is_popup_show=1&last_neighborhood=20&last_school=50&last_zips=20 i should value of $_request['search_by'] fountain-hills try adding right below rewriteengine on : rewritecond %{query_string} ^(.+)(?:\ |%20)(.+)$ rewriterule ^(.*)$ /$1?%1-%2 [l,r]

android - Item getting bigger when sliding ListView -

Image
i implement list effect in android 1 displayed in ultravisual iphone app : the similar effect can view on expo milano 2015 app in android. i top item bigger when sliding down listview. i have no idea how can done... animation on first item in current view? if has example or clue achieve this, great! thanks well tried achieve effect , looked this: first need start defining max , min font size. did this: private final int max_fontsize=50; private final int min_fontsize=12; next need save screen total height. on oncreate save this: windowmanager wm = (windowmanager) getsystemservice(context.window_service); display display = wm.getdefaultdisplay(); point size = new point(); display.getsize(size); mscreenheight = size.y; then override listview onscroll event , this: @override public void onscroll(abslistview view, int firstvisibleitem,int visibleitemcount, int totalitemcount) { if(listview.getchildcount(

io - How to call an external program and pass a string as a stdin to it in lua? -

i'm writing simple script in lua. here's got stuck: i'd call external program , pass string it, sees stdin . how it? you can use io.popen mode "w" , returns file handler can write data to. --test lua interpreter local f = io.popen("lua","w") f:write("print 'hello lua'") f:close() note function system dependent , not available in platforms.

subset - R: Warning when subsetting dataframe with a factor, but not with a character -

let's start data: set.seed(0) data <- data.frame('group' = rep(c('control', 'disease'), 10), 'sv_ml' = rnorm(20), 'co_l' = rnorm(20)) now let's create factor out of 2 variables of interest, sv_ml , co_l . var <- as.factor(colnames(data)[colnames(data) != 'group']) subsetting based on sv_ml works whether first convert character or not: mean(data[data$group == 'control',var[1]]) # 0.2077689 mean(data[data$group == 'control',as.character(var[1])]) # 0.2077689 but subsetting based on co_l works if first convert character: mean(data[data$group == 'control',var[2]]) # na mean(data[data$group == 'control',as.character(var[2])]) # 0.194133 in line returns na , following warning: warning message: argument not numeric or logical: returning na i understand can avoid problem converting factors characters before using them subset dataframe.

adding custom image to jquery button -

i trying add image button using jquery, tried same example https://forum.jquery.com/topic/custom-icons-on-jquery-ui-button , not working me. link plunker http://plnkr.co/edit/pjsmczsr0fag2sgo6utk?p=preview updated url image file. here code <!doctype html> <html> <head> <link rel="stylesheet" href="http://code.jquery.com/ui/1.9.1/themes/smoothness/jquery-ui.css" /> <script src="http://code.jquery.com/jquery-1.9.1.js"></script> <script src="http://code.jquery.com/ui/1.9.1/jquery-ui.js"></script> <style> .ui-wp-icon { background-image: url(http://findicons.com/files/icons/1714/dropline_neu/128/edit_undo.png) !important; } </style> <script> $(document).ready(function(){ $( "#wpbutton" ).button({ icons: { primary: "ui-wp-icon"} }); }); </script> </head> <body> <button id="wpbutton">

ios - App installation failed on iPhone 6 device in Xcode 6 -

Image
i have of provisional profiles ready on devices , it's added developer portal.however when tried run app xcode 6 new iphone 6 ios 8 on it, throws me error. any ideas how fix it? of provisioning profiles valid , active. code signing identity correct. when tried run on ipad ios 8, throws me error: seems setting provisional profile automatic trick instead of app store or ad hoc profile

How to use Guard to manage a ruby file? -

i have ruby file runs indefinitely. started ruby file.rb . stopped ctrl-c. how use guard start, stop , restart it? i using guard-process, starts file correctly. however, when exiting guard, raises exception: nomethoderror: undefined method `kill' guard::process:class this should fixed if upgrade version of guard (2.10.3 latest) , guard-process (version 1.1.0 released). if not, submit issue at: https://github.com/guard/guard-process along backtrace you're getting.

Preventing runaway SQL in Oracle -

in existing application there several dynamically generated sql statements being executed. of slow in performance , block ui. without changing code generates sql wondering if there way prematurely stop oracle/sql statement exceeds a) execution time threshold b) number of result rows while b) sounds easy, not easy in application infrastructure dealing with, because not recordset can iterate on sql being executed. guess in ways huge number of result rows trigger time threshold. i read using oracle resource manager, wasn't sure if can address a) , b) , if easiest way solve this. hoping there session/connection options me. thanks in advance! create profile limit cpu time on single sql call. assign profile application user. --create profile limits cpu per call 1 second. create profile temp_profile limit cpu_per_call 100; --create user, assign profile. create user profile_test_user identified "asdf1234!"; alter user profile_test_user profile temp_profil

c++ - Allocating an object of abstract class type when trying to create a SceneNode -

i have issue don't manage solve in c++. i have class called scenenode. in class, there isn't virtual function , in private members, have vector of unique_ptr , raw pointer scenenode object. when try allocate new scenenode, following error: allocating object of abstract class type "scenenode". here's code: class scenenode : public sf::drawable, public sf::transformable, private sf::noncopyable { //overview: scenenode node scene graph. represents graphical element //a typical scenenode (parent, children, transform) //with transform containing several information: //transform.pos = position of //transform.rotation = rotation of //the transformation of relative parent //therefore, transform.pos position of this, relatively parent //nb: - scenenode not copyable ! // - it's abstract class public: //-------------------------------------------- //typedefs //---