Posts

Showing posts from January, 2010

sqlite - android reloading data from server makes duplicates -

i working on app , when try update of information user personal information call user information service once again updated data instead of updated data shows me old data. shows me updated data when logout app , sign in again, because @ logout delete table values , @ sign in fetches new values server. don't know happens please me in solving problem. here how saving data db comes server dbhandler class public boolean saveuserdata(contentvalues values , string tablename) { sqlitedatabase database = databasehundler.open(); try{ if(database != null) { if (values!= null) { database.insertwithonconflict(tablename, basecolumns._id, values, sqlitedatabase.conflict_replace); } return true; } }catch(exception e){} return false; } edit and tables class code public void insertdata(contentvalues values) { controller.hundle...

ruby on rails - cant write data to model/database -

i created order scaffold when go on localhost:3000/orders , type data want ( name, email, number ) template missing error . this controller: class orderscontroller < applicationcontroller def index @orders = order.all end def show end def new @order = order.new end def create end def order_params params.require(:order).permit(:name, :number, :email, :pay_type) end end and orders.rb model : class order < activerecord::base has_one :cart end thanks, michael you haven't implemented create action controller drops straight through render create view. however, there no create view standard, hence error missing template orders/create... the create action there create new record , redirect show or index view. for example: def create @order = order.new(order_params) @order.save redirect_to @order end note, example going; should handling errors save , going new action etc.

java - This is my code to print the jtable on frame -

i added mouselistener select particular row table,the content of row getting printed on console want print content on new frame should this. attached code along screenshot of table. help. this code. final jtable table = new jtable(data, columnnames); jscrollpane scrollpane = new jscrollpane( table ); cp.add(scrollpane,borderlayout.center); frame.add(cp); frame.setsize(300,300); frame.setdefaultcloseoperation( exit_on_close ); frame.pack(); frame.setvisible(true); table.addmouselistener(new mouseadapter() { public void mouseclicked(mouseevent e){ if(e.getclickcount()==1){ jtable target = (jtable)e.getsource(); system.out.println(target); int row = target.getselectedrow(); system.out.println(row); object [] rowdata = new object[table.getcolumncount()]; object [] coldata = new object[table.getrowcount()]; for(int j = 0;j < table.getrowcount();j++) for(int...

delete file - deleting Ant dirset using regex -

i trying delete set of directories using regex expression, not having luck @ all, can take @ target please: <delete failonerror="true" includeemptydirs="true"> <dirset dir="c:\users\martin\desktop\testing" includes="*"> <containsregexp expression="[0-9]*-0" /> </dirset> </delete> it won't delete files, want match folder [0-9]*-0 , if matches it, delete it the delete task delete individual directory not ones dirset. i have following directory structure: c:\dev\debug_investigations\purge_deployment\test\012345-0 c:\dev\debug_investigations\purge_deployment\test\012345-1 c:\dev\debug_investigations\purge_deployment\test\987565-0 c:\dev\debug_investigations\purge_deployment\test\012345-0\sometext.txt c:\dev\debug_investigations\purge_deployment\test\012345-0\subdir1 c:\dev\debug_investigations\purge_deployment\test\012345-0\subdir2 c:\dev\d...

Transfer Money through Paypal Android SDK -

i need integrate capability of transferring money through paypal 1 user via android mobile application. had gone through paypal sdk , documentation on developer website little bit confusing. so, can me out how can implement paypal sdk transferring money. that feature not supported sdk @ moment. (and rest apis) support case merchant/developer accepts money end user.

java - Refer the XSD located in a jar using schemaLocation? -

i using spring , maven. have projecta , projectb . projecta dependency projectb . trying refer xsd in projectb 's wsdl xsd part of projecta . how can refer xsd part of dependent jar? when did below: schemalocation="classpath:/src/main/resources/xsd/some.xsd" i got exception saying unknown protocol classpath . please me refer xsd? the wsdl transferred , interpreted client. classpath: isn't going work as, says, isn't valid protocol. have put url in there upon requesting translated url want. use spring resouce mapping (i.e. externally put http://.../xsd/some.xsd mapped spring mvc <mvc:resources mapping="/xsd/**" location="classpath*:/xsd" /> . you shouldn't include src/main/resources in src/main/resources put root of class path.

regex - How do I strip leading section of this string in perl -

i have following string: [bn_d]hostname=localhost how strip [bn_d] string using perl? give me string: hostname=localhost you can do: ^[^]]*.(.*)$ for that

How can function be defined via "fn" member in Javascript? -

i found following definition $.fn.flex = function ( options ) { var p = this.data("flex"), opts = options || {}; if (p) return p; this.each(function () { p = new flex( this, opts ); $(this).data("flex", p); }); return opts.api ? p : this; }; which defines function flex() in original code. unfortunately, stops defining function in environment, i.e. function call causes error flex not function. what critical here flex being function? update sorry, didn't modify anything. put javascript https://github.com/jasonenglish/jquery-flex/ environment (liferay) , code run script <script type="text/javascript"> $(function() { $(".flex").flex(); }); </script> caused error. replaced $ jquery everywhere did before , still not working. update 2 hmmm. error occurs in widget.js twitter. says typeerror: jquery(...).flex not function if rename flex flex1 every...

javascript - how to remove duplicate values from my select dropdown list? -

this jsp code: <form method="post" action="" > <table style="width: 100%;border: 0px;border-spacing: 0px;padding: 0px;"> <tr> <td style="height: 28px; font-size: 14px; width:80px; ">select state :</td> <td style="text-align: left; padding-left: 10px; width: 450px;"> <select name="city" onchange="consituteshow(this.value)"> <option value="">andhra pradesh</option> <% statement stmt=null; dbconnection db=new dbconnection(); connection con=db.dbconn(); try{ stmt = con.createstatement(); resultset rs = stmt.executequ...

android - how to create a gridview of images dynamically -

i working on app in have populate gridview of images dynamically. getting array of image ids server, decoding json array , getting image ids. have stored images in drawable folder, want show images of ids getting json, stuck @ point don't know how this. main activity public class mainactivity extends activity { gridview grid ; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); grid = (gridview)findviewbyid(r.id.grid_view); grid.setadapter(new adapter(this)); button play = (button)findviewbyid(r.id.play); play.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { try { playgame(); } catch (jsonexception e) { // todo auto-generated catch block e.printstacktrace(); } } }); protected void playgame() throws jsonexception {...

excel vba - How to loop through a range while already looping through another range -

Image
good day i'm trying loop through range , while in range need loop through another. although work, it'll give idea of i'm trying achieve: ' select cell m5, *first line of data*. range("m5").select ' set loop stop when empty cell reached. until isempty(activecell) strreg = activecell.value dtedate = activecell.offset(0, 1).value lngrate = activecell.offset(0, 2).value range("g5").select until blnfound or isempty(activecell) if activecell.value = strreg if activecell.offset(0, -3) <= dtedate , activecell.offset(0, -2) >= dtedate blnfound = true '... add more logic here end if end if ' step down 1 row present location. activecell.offset(1, 0).select loop ' step down 1 row present location. activecell.offset(1, 0).select ...

java - Download a zip file using Restful services -

im trying create , download zip file in java using restful service. not working me. please find code below: @get @path("/exportzip") @produces("application/zip") public response download(@queryparam("dim") final string dimid, @queryparam("client") final string clientid, @queryparam("type") final string type, @context uriinfo ui) { system.out.println("start"); responsebuilder response = null ; string filetype = ""; if(type.equalsignorecase("u")){ filetype = "unmapped"; }else if(type.equalsignorecase("m")){ filetype = "mapped"; } try { byte[] workbook = null; workbook = engineservice.export(dim, client, type); inputstream = new bytearrayinputstream(workbook); fileoutputstream out = new...

java - JAXB static marshalling vs JAXBContext createMarshaller() -

i wasted lot of time on following code snippet, finding out , put jaxb.index , how create jaxbcontext jaxbcontext jc = jaxbcontext.newinstance(new class[]{gena.class, genb.class, ...}); // or jaxbcontext jc = jaxbcontext.newinstance( "my.package.jaxb" ); marshaller m = jc.createmarshaller(); outputstream os = new fileoutputstream( "file.xml" ); m.marshal( object, os ); but there static method jaxb.marshal(object, "c:\\path\\file.xml"); making easy 1 expect. i read creating jaxbcontext resource intense. why should 1 use first method @ all? disadvantages of static method? a jaxbcontext represents processed metadata converting objects to/from xml. since thread safe can create once , reuse it. performance improvement on using static method.

java - Filepath in war -

i created sigleton applicationconfig settigs, reads xml config file. every time fails on path file. hierarchy: meta-inf src --application ----config.xml --engine ----applicationconfig web --web-inf ----web.xml i've tried file f = new file("../application/config.xml"); gives c:\weblogic\application\config.xml it's bad idea store configs in 'src'. it's better separate code , configuration. suggest read maven (or gradle). basic maven app has pretty simple structure: src --main ----java ----resources where in 'java' folder store code, , in 'resource' folder store configs. , have problem, because jvm trying find file relatively weblogic base folder. and if use maven, write: applicationconfig.class.getresourceasstream("/config.xml") of course, in case should put config 'resources' folder.

intellij idea - File size exceeds configured limit (2560000), code insight features not available -

i trying work on large javascript file in jetbrains webstorm 8 , getting message @ top of editing window says: file size exceeds configured limit (2560000). code insight features not available. how can increase 'configured limit' access features? in intellij 2016 , newer can change setting menu, edit custom properties (as commented @eggplantbr). on older versions, there's no gui it. can change if edit intellij idea platform properties file: #--------------------------------------------------------------------- # maximum file size (kilobytes) ide should provide code assistance for. # larger file slower editor works , higher overall system memory requirements # if code assistance enabled. remove property or set large number if need # code assistance files available regardless size. #--------------------------------------------------------------------- idea.max.intellisense.filesize=2500

gruntjs - How to include a folder when serve the project -

i generated scaffold of famo.us project yeoman (yo famous) i set small working project i tried launch 'grunt serve' command it works no image loaded because folder content/images not loaded how can include it? thanks i'm myles author of famous-generator. images in '/content/images/' should able loaded absolute or relative path... although have updated generated 'main.js' use absolute path sake of being explicit. remember when famous code run running inside of index.html, , therefore have same "relative path" included assets. well, since serving via development server, able reference absolute paths relative root directory of project. you should not have touch requireconfig @ honest. used add vendor code installed in 'lib' path within require can reference modules name rather path. 'underscore' rather '../lib/underscore'. becomes nice begin nest folders , don't want have manage relative paths....

c# - Getting the selected datalist by an array -

i going ask basic question , repeated 1 have bit different situation. want use "in" operator in linq. have rows table has id provided array , returns row if has. how can it. my array has var aa="1091","1092","1093" , on. and table uses these ids primary keys .i have rows id contained in array , not want use s.p. you can use enumerable.contains , var aa = new string[3] { "1091", "1092", "1093" }; var res = yourdatasource.where(c => aa.contains(c.id));

html - Having multiple IFrames in a single page -

i have application takes in users' html editor ckeditor , display them user in list. to safe, in avoid breaking container page's html structure mal-formed html input, want render each user's html input in iframe (iframe render url). the container page have list of frames each users html. sized height of 100px or accommodate multiple inputs in list. my question is: 1.) how of idea render potentially hundreds of iframes in single page ? memory usage blow-up end users browser ? 2.) there safer , easier way render user's html ? want put few restrictions possible on user's input. [i of course sanitize input on server before sending client.] the iframe looking for. why render 100+ iframes? understood, want paste content of users "page" page - make 1 site per "user site" ... if want display iframes on 1 site, potential huge ass website everying static, should'nt problem.

r - T-test with only one value in x and y -

i've been trying run t-test on familiarity data, in i'm trying see whether ape reacts more if familiar sound broadcasted. have 1 observation x , y in t-test, gives me following error message: error in t.test.default(ubt, uat) : not enough 'x' observations i've seen similar problem somewhere else ( error using t.test() in r - not enough 'y' observations ), here there 1 y observation , more x observations, whereas i'm dealing 1 observation in both x , y. i'm bit stuck here - know way around problem? data i've entered far. works time (hours minutes seconds) - hope won't issue... unfbeforet<-c("00:01:02") unfaftert<-c("00:22:20") ubt<-times(unfbeforet) uat<-times(unfaftert) t.test(ubt,uat) thanks in advance!

Java Lambda Expression for if condition - not expected here -

consider case if condition needs evaluate array or list. simple example: check if elements true. i'm looking generic way it normally i'd that: boolean alltrue = true; (boolean bool : bools){ if (!bool) { alltrue = false; break; } } if (alltrue){ // } but i'd hide if condition. tried using lambda expressions this, it's not working: if (() -> { (boolean bool : bools) if (!bool) return false; return true; }){ // } if working more complicated like if (() -> { int number = 0; (myobject myobject : myobjects) if (myobject.getnumber() != 0) numbers++; if (numbers > 2) return false; return true; }{ //do } is there better way syntax error? update i'm not talking boolean array, rather looking generic way achieve that. you can write, given instance list<boolean> : if (!list.stream().allmatch(x -> x)) { // not every m...

php - codeigniter destroying session after adding ckeditor latex code in cart -

i working on codeigniter project of online exams. creating optional question bank. adding multiple options single ck editor in after creating option inserting option in codeigniter cart. option html of ck editor. but when using latex equation in ckeditor option, logging out. destroying user login session. normal html works fine. overcome problem? <script> var option_html=ckeditor.instances['option'].getdata() $.post(base_url+"question_bank/questions/add_option", {option_html:option_html,is_correct:is_correct} , function(data) { //code } ); </script> php code $data = array( 'id' => uniqid(), 'qty' => 1, 'price' => "1", 'name' => $is_correct, 'options' => array('type' => 'quest...

javascript - Confusion performing 2 .finds() after cloning a div -

hi have following code seen below whch adds new row consisting of text field , radio button, have written js add new row, , use .find() append new input field blank value. new js , want perform .find() when cloning add value radio input, show me how please. <div id='1'> <div class="template"> <div> <label class="right inline">response:</label> </div> <div> <input type="text" name="responsetext[]" value="" maxlength="400" /> </div> <div> <input type="radio" name="responseradio[]" value="" /> </div> </div> <div> <input type="button" name="addnewrow" value="add row" /> </div> </div> js add ...

php - How to open browser for testing with DBUnit in CakePHP? -

i'm using cakephp , dbunit database testing. i'd achieve test whether form i've submitted on website, inserts data correctly db. have lot of ui tests, test page itself, i've small amount of db test: <?php class testschema extends phpunit_extensions_database_testcase { /* ** @return phpunit_extensions_database_db_idatabaseconnection */ public function getconnection() { $pdo = new pdo('mysql:dbname=job_manager;host=localhost','root','toor'); $pdo->exec("set foreign_key_checks=0"); return $this->createdefaultdbconnection($pdo, 'job_manager'); } /* ** @return phpunit_extensions_database_dataset_idataset */ public function getdataset() { $cascadetruncates = true; return $this->createmysqlxmldataset(dirname(__file__).'/default.xml'); } public function testrowcounts() { $this->assertequals(3, $this->getconnect...

ios7 - adding banner ads to collectionView ios -

i'm working ads first time,i want iad (banner ad) collection bottom.but happened ad scrolling along collection view how make fixed. make smaller uicollectionview , put iad view @ bottom of screen(add iad view parent of uicollectionview ). uicollectionview should have height=uicollecionviewheight-iadviewheight make iad view visible

matlab - How to forward test and plot? -

have received lot of help. more. learning lot going through code. i have far: loaded xlsx file using xlsread function. after calculated correlation coeff. assigned variable(?). then used(thanks @robert p.): buyx = x(find(apc < -2.9079,1,'first')) selly = y(find(apc < -2.9079,1,'first')) buyy = y(find(apc > 0.44,1,'first')) sellx = x(find(apc > 0.44,1,'first')) to first value meeting particular condition. now want forward test first value received till condition met. @ same time make plot results. i wondering start looking code/try this. please point me in direction of functions required. think has loop through elements after receiving entry. not sure right way go it. thanks context: i trying test statsarbitrage strategy. using excel work can't seem right functionality. basically, when have entry(any set of buy sell) want system automatically start calculating profit/loss next data point , give output new va...

How to send image with url in android -

image not able reach on database my doinbackground() method try { file file_name=new file("/storage/sdcard1/received/iaf-sarang.jpg"); defaulthttpclient mhttpclient; httpparams par = new basichttpparams(); par.setparameter(coreprotocolpnames.protocol_version, httpversion.http_1_1); mhttpclient = new defaulthttpclient(par); try { httppost httppost = new httppost("http://www.hugosys.in/www.nett-torg.no/api/rpcs/uploadfiles/?"); multipartentity multipartentity = new multipartentity(httpmultipartmode.browser_compatible); multipartentity.addpart("post_id", new stringbody("1368")); multipartentity.addpart("user_id", new stringbody("62")); multipartentity.addpart("files", new filebody(file_name, "content-type: image/jpeg\r\n\r\n")); ...

iOS 7 notification bright up the screen but randomly show up -

i send push notification on ios devices, when screen locked, brighter, doesn't show push notification i cannot figure out pattern push notification ok, , shows on 1 device, not on others (the other devices bright screen) setting ok, different 4 ios ipad devices notifications correctly delivered apple update note: random behaviour seems happen when badge number 0 , send 0 (doesn't happen when badge number not part of push, or > 0) is expected behaviour?

asp.net - Not authenticating custom domain using windows authentication in IIS 7.0 -

team, i facing sticky problem such have configured webapplication in iis 7.0 , able authenticate using windows challenge.able box enter usename , password.after entering credentials directs me home page. possible if accessing via url htt p://localhost/ now comes problem . need call web app not localhost custom domain name htt p://companyaonline/. edit binding , put hostname. put entry in hosts file under windows. when trying access site same windows authentication box. not able authenticate using same credentials since url has changed. i have tried numerous ways till date. setting impersonate =true, setting provider application pool ntlm...etc...but no hopes.. can please guide me..is there missing far ?

python - Installing Sage 6 and opening it on windows 8 PC with 64 bit -

this question installation of sage, figured i'd give here try: in general i'm bit confused regarding installation of sage: i went download page, after choosing server close location: sage-6.1.1.tar.gz and downloaded windows 8, 64-bit pc. however, file not opening (i double clicked on in order run it) in pc, after installing 7-zip, extract/convert .tar file. suggestion opening , getting sage work? thought installation simple of python itself, did not run opening/running problem. apologies if irrelevant question site! not irrelevant @ all, didn't read instructions windows. there virtualization option - 1 pretty popular, can tell. here 1 mirror might near you , , note says please read sage virtual machine manual. short version - download virtualbox , .ova file, , starts things off. i'm not sure why vm version hasn't been updated 6.1.1 yet, , i'll ask that. edit: see this link on sage-release list updated ova files hot off presses! ...

Configuring Android Steroids App to work with Facebook-Phonegap plugin -

i extremely grateful if walk me through process of configuring facebook app accept connections android scanner build of steroids app. specific areas not entirely clear on are: generating keystore app hashing keystore configuring android build settings configuring facebook settings within facebook. specific attention class name / activity want facebook launch, , how ensure class name , package name consistent android build settings. i've been fighting while, , can't feel though missing simple. i'm not sure if have gone through official documentation or not; have explained each steps you've mentioned step step: https://developers.facebook.com/docs/android/getting-started/ try once (if not tried yet), , if find specific problems post questions here (i don't think you'll find after reading doc)

asp.net - Unexpected request size for Asp.WebForms application after update of components -

i've got following problem: we've updated our components. before update page request size 22kb in size (140k characters, including whitespace). after update request size 180~kb (180k characters, including whitespace). i have assumed there's direct relation of request answer length , characters sent can't quite explain how 30%~ increase in characters results in 9 times request content sent. does ring bell anyone? can't quite see difference comming from. the reason was, old version has gzip compression enabled while new 1 not, despite configuration beeing set have enabled. it's matter of research why not returning gzip encoded content now.

php close session and delete data -

hy everyone, know there lot of posts regarding closing sessions have kind of "strange" situation. so, basically. come page, , don't have log in. start session , grab session_id. on page, can upload image , enter data, @ point (when click save button) php script makes folder named session_id , puts image , data (as generated html page) folder. now, want able delete folder once when live page. possible? if not, ok delete folder after let's 24 hours? know can use session_destroy destroy session, how can first delete folder , close session? advice? in advance! php session hander friend here. http://www.php.net/manual/en/class.sessionhandler.php the gc function can check , clean inactive sessions.

How to declare array of specific type in javascript -

is possible in java script explicitly declare array array of int(or other type)? something var arr: array(int) nice... var stronglytypedarray=function(){ this.values=[]; this.push=function(value){ if(value===0||parseint(value)>0) this.values.push(value); else return;//throw exception }; this.get=function(index){ return this.values[index] } } edits : use follows var numbers=new stronglytypedarray(); numbers.push(0); numbers.push(2); numbers.push(4); numbers.push(6); numbers.push(8); alert(numbers.get(3)); //alerts 6

javascript - Best practice to cache a Marionette View -

in application developing, have collectionview every itemview contains link item-details page. also, every itemview contains checkbox, because items can selected in collectionview perform bulk actions on them. when switching itemdetails view, want keep state of collectionview , ideally without having redraw (a bit gmail when switching inbox mail , back). our solution render 2 views in 2 different regions , hide 1 when switching 1 other . my perplexity solution marionette doesn't seem meant kind of use. it not memory-friendly , since dom elements never deleted. is there better solution achieve goal? storing state somewhere, close collectionview , redraw later possible solution, imply heavy computation overhead? (we quite scared redrawing views). marionette allows showing view in region without closing view rendered. pass in {preventclose: true} show() method of region. still need maintain reference collection view though can later re-show or close yourself....

c# - Get CPU ID with " ManagementObjectCollection moc = mc.GetInstances(); " doesn't work? -

i trying unique cpu id code : private string getcpuid() { string cpuinfo = string.empty; managementclass mc = new managementclass("win32_processor"); managementobjectcollection moc = mc.getinstances(); foreach (managementobject mo in moc) { if (cpuinfo == "") { //get first cpu's id cpuinfo = mo.properties["processorid"].value.tostring(); break; } } return cpuinfo; } private void button_click(object sender, routedeventargs e) { messagebox.show(getcpuid()); } worked fine me , more 600 other different systems during 1 year selling product. problem must run application administrator no problem. problem started 2days ago when built application first time in visual studio 2013. before vs 2013 using vs 2012. if run application administrator out of vs 2013 run, on buttonclick event a...

javascript - distorted Print page after click on print button -

after clicking on print button , on printview can see page style bad formed . can see demo : http://rogatech.somee.com/print.aspx?darkhastid=13921230 how can solve problem? test other codes form internet no 1 couldn't me... asp.net codes: <input type="button" onclick="javascript:printpartofpage('div1')" value="print" /> <div align="right" id="div1" style=" width:21cm; height:29.7cm; margin-top:20px; direction:rtl "> <div style="border-color: black; border-width:1px; border-style:solid; width:595; height:130px"><img src="roga arm.png" alt="" style=" width:110px; height:110px; margin-top:5px; margin-right:5px; margin-bottom:5px;" /> <span align="left" style=" float:left ;text-align:right;margin-left: 70px; margin-top:5px">شماره درخواست : <asp:label id="darkhastidlabel" runat="server" ...

Matlab: read time stamp in a loop -

i need read several hundred .csv data files, each of them fixed number of columns , variable number of rows of type: '%s %d %d %d %u:%u %d %s %s %s %s' which corresponds to: text1 2014 2 1 1:56 -2 text2 text3 text4 text5 i need correctly import timestamp distinguishing minutes , hours , store them in 2 separate columns. part of program: directory_name = 'c:\deutsche_bank\'; filepattern = [directory_name, filesep, '*.csv']; files = dir(directory_name); fileindex = find(~[files.isdir]); fileindex = fileindex'; df = 3:size(fileindex, 1)+2; %start 3 filename = files(df).name; tempfullname = [directory_name, filesep, filename]; fmt = '%s %d %d %d %u:%u %d %s %s %s %s'; fid = fopen('tempfullname'); mytimestamp = textscan(fid, fmt, 'delimiter', ','); fclose(fid); ... more matlab data analysis end unfortunately program output in mytimestamp set of empty cells, whereas if spec...

Validation in java Error log in register -

i trying set validation of confirm password , textfield must have value in it. im beginner sir im practicing build log in , register program. sorry english im not great in speaking english. my problem code not running fine. keeps telling "fill spaces" string username = usernamefield.gettext(); string password = passwordfield.gettext(); string cpassword = cpasswordfield.gettext(); if ((username != null) || (password != null) || (cpassword != null)) { if (password == cpassword) { db.insertdata(username, password); joptionpane.showmessagedialog(null, "data has been entered"); } else { joptionpane.showmessagedialog(null, "please fill spaces"); } } else if (password != cpassword) { joptionpane.showmessagedialog(null, "password mismatch"); } if((username != null) || (password != null) || (cpassword != null) ){ if(password.equals(cpassword)){ db.insertdata(username, password); joptio...

html - ul padding not applying next to a floating img -

Image
i have basic css problem. i have floating image in top-left corner margin-right . content made of paragraphs , lists bullets. want lists have padding-left more visibility , bullets appear in " list-style-position: outside " (text must aligned). my problem is, when list displayed next floating image, ul padding not applying. here annotated screenshot comprehension : this kind of behavior happens ff , chrome. ie, worse because bullets appear @ left of floating image... edit : css property " ul{overflow: hidden;} " not option because want avoid : i'm sorry can't show piece of code because drupal website , content of node generated wysiwyg module , written webmaster , editors. have no access generated structure. content not fixed , lists appear everywhere in text. this fiddle represents situation: http://jsfiddle.net/34cuf/ lists have initial left padding on them (so there enough space show bullet) unless give ul padding greater ...

java - Error transcoding SVGGraphics2D to PNG -

i'm trying rotate svggraphics2d , export png format , i'm having problems. can me? exception in thread "main" org.apache.batik.transcoder.transcoderexception: null enclosed exception: "xmlns" attribute specified element "svg". @ org.apache.batik.transcoder.xmlabstracttranscoder.transcode(xmlabstracttranscoder.java:136) @ org.apache.batik.transcoder.svgabstracttranscoder.transcode(svgabstracttranscoder.java:156) @ inclan.icon.svg.rasterizer.svgrasterizer.transcodetopng(svgrasterizer.java:382) @ inclan.icon.svg.rasterizer.svgrasterizer.main(svgrasterizer.java:370) my code: protected transcoderinput input; protected transcoderoutput output; public static void main(string [] args) throws exception { svggraphics2d gra = getsvggraphics2d(new bytearrayinputstream(getxml().getbytes())); tilt(gra); fileoutputstream ops = new fileoutputstream(new file("c://users//pablosouz...

ios - Decode base64 string for image -

i have encoded string in base64 , want decode getting nil in nsdata *decodeddata . nsstring *images contains encoded string. nsstring *images = encoded string; nsdata *decodeddata = [[nsdata alloc] initwithbase64encodedstring:images options:0]; uiimage *myimage = [uiimage imagewithdata:decodeddata]; perhaps have unknown characters? try passing nsdatabase64decodingignoreunknowncharacters options: parameter.

c# - Coroutine call crashes -

i'm getting strange crashes: exception type: exc_bad_access (sigabrt) exception codes: kern_invalid_address @ 0x00000004 crashed thread: 0 thread 0 name: dispatch queue: com.apple.main-thread thread 0 crashed: 0 libsystem_kernel.dylib 0x3b1cc350 __pthread_kill + 8 1 libsystem_c.dylib 0x3b14311e pthread_kill + 54 2 libsystem_c.dylib 0x3b17f96e abort + 90 3 _example 0x0161cd74 mono_handle_native_sigsegv + 312 4 _example 0x0160c6e4 mono_sigsegv_signal_handler + 256 5 libsystem_c.dylib 0x3b14ce90 _sigtramp + 40 6 _example 0x01707114 g_hash_table_lookup_extended + 172 7 _example 0x01707154 g_hash_table_lookup + 20 8 _example 0x016a3144 mono_metadata_parse_type_full + 636 9 _example 0x016a2e70 mono_metadata_parse_generic_inst + 88 10 _example 0x016a...

Best Practice for changing the model of a Marionette.ItemView -

in application have collectionview itemview next (they're both visible @ same time). when item clicked in list, itemview displays details. the easy solution trigger biglayout.itemdetailsregion.show(new itemdetailsview({ model: modelofclickeditem }); but makes itemview instance rendered closed , garbage-collected while new instance of same class being created , rendered in same place. me , team smells bad practice (deleting , re-creating view seems useless overhead), right? at time being, added changemodel(model) method itemview class that unbinds events previous model assigns new model view re-renders view binds new events model but not satisfied (many times switching model more complex , solution not scalable). is there call "best practice" kind of need? standard way (as described above) practice? honestly don see why first approach bad. it's same you're doing manually using changemodel method. i suppose 'expensive' a...

ios - How to use a nib to configure DetailViewController? -

i have multiple cells in table referring same detailviewcontroller. how can use nibs redirected same detailviewcontrollers different content? you can selected indexpath method. - (void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath { } from method can load detailviewcontroller this, detailviewcontroller *detailviewcontroller = [[detailviewcontroller alloc] initwithnibname:@"detailviewcontroller" bundle:nil]; uinavigationcontroller *tableviewnavigationcontroller = [[uinavigationcontroller alloc] initwithrootviewcontroller:detailviewcontroller]; [self.navigationcontroller presentviewcontroller:tableviewnavigationcontroller animated:yes completion:nil]; in above method can assign values want change when select different cells.

css - Webkit transform: rotate -

i've got code: html: <section class="progress"> <div class="spinner icon-spinner" aria-hidden="true"></div> <p class="label">loading</p> </section> css: @font-face { font-family: 'icomoon'; src:url('http://s3.amazonaws.com/icomoonfonts/4/6/f.eot'); src:url('http://s3.amazonaws.com/icomoonfonts/4/6/f.eot?#iefix') format('embedded-opentype'), url('http://s3.amazonaws.com/icomoonfonts/4/6/f.woff') format('woff'), url('http://s3.amazonaws.com/icomoonfonts/4/6/f.ttf') format('truetype'), url('http://s3.amazonaws.com/icomoonfonts/4/6/f.svg#icomoon') format('svg'); font-weight: normal; font-style: normal; } .icon-spinner:before { font-family: 'icomoon'; speak: none; font-style: normal; font-weight: normal; line-height: 1; -webkit-font-smoothi...

events - Threading wxPython app with background process for multitouch detection -

so have code multitouch detection , run separate thread sends custom events wxpython gui upon multitouch event. now post code multitouch tracking use require trackpad, server app , detection code, think it's better consider simple example sake of question. so example lets assume event simulator sending event every 10 seconds: import wx import wx.lib.newevent import time multitouchevent, evt_multitouch = wx.lib.newevent.newevent() class eventsimulator: def __init__(self): self.eventdata = 0 def start(self): self.runtuio() def runtuio(self): while true: time.sleep(10) wx.postevent(gui, multitouchevent(self.eventdata)) self.eventdata += 1 if __name__ == '__main__': multitouchtracker = eventsimulator() multitouchtracker.start() now receive these events whenever occur within wxpython gui (something this): import wx class frame(wx.frame): def __init__(self, title): ...

Creating a new Android Project in Terminal-IDE -

is there script or creates new android project in terminal ide on android? how r file updated new resources? this might : http://developer.android.com/tools/projects/projects-cmdline.html it create project can used...with ant. maven has archetype system can create new android project : https://github.com/akquinet/android-archetypes there doesn't seem gradle equivalent (yet).

android - How to get file name and real path of Google drive document? -

i using following code file name , path of files in file manager. not return path google drive files. idea how obtain actual path? my code - public string getfilepath() { if (uri.getscheme().equalsignorecase("file")) { return uri.getlastpathsegment(); } cursorloader.seturi(uri); cursorloader.setprojection(projections); cursor cursor = cursorloader.loadinbackground(); int column_index = cursor.getcolumnindexorthrow(mediastore.files.filecolumns.data); cursor.movetofirst(); string realpath = cursor.getstring(column_index); cursor.close(); if (realpath == null || realpath.isempty()) { return null; } return null; } you have use uri. through uri can getcontentresolver.query(theurithatyouhave, null, null, null, null) . have cursor, can check column names etc. for google drive there column name _display_name . give file name. now want access file? can open inputstream uri via getcontentresolver().ope...

c# - MVC 404 For Simple Route -

i specifying custom route , action. doing wrong? getting 404 error. set similar example: http://www.codeproject.com/articles/190267/controllers-and-routers-in-asp-net-mvc url: http://localhost:14133/scansummary/mywebsite.com route: routes.maproute( "scansummary", "scansummary/{domain}", new { controller = "scansummary", action = "get" } ); controller: public class scansummarycontroller : controller { public actionresult get(string domain) { return view(); } } because of .com extension, iis thinks file on disk , attempts serve directly instead of going through pipeline. one way fix issue running managed modules requests: <system.webserver> <modules runallmanagedmodulesforallrequests="true" /> ... </system.webserver> another (and imho better way) explicitly map mvc handler endpoint: <system.webserver> <modules runallmanagedmodule...

Octave: Findfiles gives error -

i trying use findfiles command in octave: names= findfiles('c:\users\user1\desktop') which returns: 'findfiles' undefined near line 16 column 7 although first time ran it, told me undefined @ line 9 column 5. i assume it's referring findfiles code(?). am doing dumb? code work? i'm trying run on windows 7. i've tried adding path using addpath. findfiles invalid command in gnu octave 3.8. can achieve same effect other built-in functions or try unmaintained multicore package.

ios - UITabBar disables when simulraneously click 2 buttons -

i have following "controller tree": uitabbarcontroller ┣━ uiviewcontroller ( a ) ┃ ┗ mkmapview ┣━ uinavigationcontroller ┃ ┣━ uitableviewcontroller ( x ) ┃ ┗━ uitableviewcontroller ( b ) ┣━ uiviewcontroller (not interesting) ┗━ uiviewcontroller (not interesting) in second view (b) have button connected ibaction: - (ibaction)mapbuttontapped:(uibarbuttonitem *)sender { uiview *startview = self.tabbarcontroller.selectedviewcontroller.view; uiview *endview = ((uiviewcontroller *)[self.tabbarcontroller.viewcontrollers objectatindex:elmapviewcontrollerindex]).view; elmainmapviewcontroller *carparkvc = [self.tabbarcontroller.viewcontrollers objectatindex:elmapviewcontrollerindex]; [uiview transitionfromview:startview toview:endview duration:elanimationduration options:uiviewanimationoptiontransitioncrossdissolve completion:^(bool finished) { ...

android - Animate TextViews one by one in Queue -

background: have view dynamically added textviews. graph/tree implementation each textview graph. maintaining adjacency list of these textviews(their ids maintained , can findviewbyid). what want: have play button. want animate textviews such see root, children, next level. know: have made them invisible on pressing of play button. doing bfs such that put root textview in queue make visible put direct children of root in queue while(!q.isempty()) { remove first element queue // animate // after end of animation loop through adjacency list of node // , put of children in queue } problem: whatever try, first element gets removed, q populated again children , animation of elements in qeueue starts @ once , finishes @ once. in other words, animation doesn't start till code finishes. have tried putting code population of children in onanimationend of animationlistener. doesn't work. tried thread.sleep, doesn't work. i suppose problem treat sta...

highcharts - Own back button for drilldown charts -

i have pie chart drilldown data. is possible hide default button , trigger function own button? yes, it's possible. create own button , after click call chart.drillup() function. see docs . to disable default button, set text empty string, see: http://jsfiddle.net/zzluq/ highcharts.setoptions({ lang: { drilluptext: '' } });

sqlite3 - Python sqlite Internal Server Error -

i'm working on website powered python @ end. following script receives values javascript , should write same database. import cgi import sqlite3 form = cgi.fieldstorage() brand = form['brand'].value model = form['model'].value db = sqlite3.connect("dbase.db") query = "insert requests (brand, model) values (?, ?)" db.execute(query, (brand, model,)) db.commit() db.close() but invoking script returns 500 internal server error . surprise, following code, run independently on terminal works perfect. import sqlite3 brand = 'nokia' model = 'lumia 625' db = sqlite3.connect("dbase.db") query = "insert requests (brand, model) values (?, ?)" db.execute(query, (brand, model,)) db.commit() db.close() i'm using python 2.7.5 , running on lighttpd server. also, db.execute() portion error occurs. how can correct problem? this might happen not having database dbase , table requests .you need datab...

d3.js - Data lines disappearing when using rangePoints on x-axis ordinal scale in line chart with D3 -

i've adapted code multi-line line chart example here . biggest issue i'm having after researching changes needed make data lines disappear when use .rangepoints on x-axis ordinal scale. .range, x-axis displays nothing , data lines bunched along left side of y-axis. has fact altered original code time scale ordinal, i'm stumped further changes need make. code below: var margin = {top: 20, right: 80, bottom: 30, left: 50}, width = 500 - margin.left - margin.right, height = 280 - margin.top - margin.bottom; var x = d3.scale.ordinal() .rangepoints([0, width]); var y = d3.scale.linear() .range([height, 0]); var color = d3.scale.category10(); var xaxis = d3.svg.axis() .scale(x) .orient("bottom"); var yaxis = d3.svg.axis() .scale(y) .orient("left"); var line = d3.svg.line() .interpolate("linear") .x(function(d) { return x(d.episodes); }) .y(function(d) { return y(d.season); }); var svg = d3.select("body").append("svg...

c# - How can I avoid unnecessary concurrency exceptions in my EF 6 scenario? -

i using ef 6. have 2 tier application using wcf soap , dtos transfer data. send object graph across wire user update, , send persist changes. in between, use automapper convert , dtos , entities. on persistence side, receive dto , unpack (it contains lists of entities). unpack appropriate entities , check whether adding or editing checking if id 0. far have blindly updated every entity id > 0. however, have learned not best way because throws unnecessary concurrency exceptions. if call update on entity, rowversion gets updated, if no fields changed values in database. causing unnecessary concurrency exceptions. need avoid these. need somehow check see if entity needs updated or not. way know how check whether entity needs updated, query database , property property check. my question: on right track? in fact need check entity property property find out if needs updated? there easier or more automatic way? i feel frustrated need query database each entity before saving ch...

How do I show a Test_Question (String) per page?? (PyQt/Python) -

i creating pyqt application creates , sets tests user. however, when setting test questions wanted 1 question viewed per page. example, if user start test, question appear. once have answered question, click button 'proceed' presents next page showing 2nd question , on... however, in case, unaware how many questions there in each test, number of pages vary. using switching layouts rather switch layouts opposed open new windows means have create class per question , because questions per test vary, unsure how present questions???? i not going copy out entire application code provide basic example below: import sys pyqt4 import qtcore, qtgui class starttest(qtgui.qmainwindow): def __init__(self, parent=none): super(starttest, self).__init__(parent) self.central_widget = qtgui.qstackedwidget() self.setcentralwidget(self.central_widget) question1 = question1(self) self.central_widget.addwidget(question1) self.central_wid...