Posts

Showing posts from June, 2010

python - Django: where is settings.py looking for imports, and why? -

i have django app common directory structure: project ---manage.py ---app ---__init__.py ---settings.py ---settings_secret.py ---a bunch of other files app that settings_secret.py file contains variables secrets.py not want send github. reason, cannot seem import settings.py. first 5 lines of settings.py: # django settings project. debug = true template_debug = debug import os settings_secret import * which fails partial stacktrace: file "/foo/bar/project/app/settings.py", line 5, in <module> settings_secret import * importerror: no module named 'settings_secret' to debug, created test file inside /project/ so: from settings_secret import * print(variable_from_settings_secret) which worked charm. clearly, settings.py isn't looking in right place settings_secret. looking? in settings.py , should do: from .settings_secret import * it works . because proper syntax supposed be: from app.settings_secret import * r...

arrays - C++ string appending problems -

i'm having issues right now, attempting append char array onto c++ string after setting of values of c++ string, , don't see why. wondering if of know what's going. here's code i'm trying run: string test = ""; test.resize(1000); char sample[10] = { "hello!" }; test[0] = '1'; test[1] = '2'; test[2] = '3'; test[3] = '4'; test += sample; running through debugger, seems test "1234", , "hello" never added. thanks in advance! it added, after 1000 characters have in string (4 of them 1234, , 996 '\0' characters)`. the resize function allocate 1000 characters string object, sets length 1000. that's why want instead use reserve this do: string test = ""; test.reserve(1000); // length still 0, capacity: 1000 char sample[10] = { "hello!" }; test.push_back('1'); // length 1 test.push_back('2'); // length 2 test.push_back('3...

javascript - How to validate a form when not scrolled down using angularjs? -

i trying validate form page called 'agree information'. here, user has scroll down in order move forward(remember no checkbox @ bottom of box, instead user has scroll down way till scroll ends), if user clicks continue/agree button without scrolling, div element/error must displayed saying 'scrolling bottom of information required'(must anchor link, clicking on should highlight box color). here code , image (function(){ angular .module('agreetoinfoapp',[]) .directive('execonscrollonbottom', [function () { return { restrict: 'a', link: function (scope, elem, attrs) { var fn=scope.$eval(attrs.execonscrollonbottom), clientheight=elem[0].clientheight; elem.on('scroll',function(e){ var el=e.target; if ((el.scrollheight-el.scrolltop) === clientheight) { ...

ios8 - converting from UISearchDisplayController to UISearchController -

i have app moving ios8 , want ride of deprecated methods. the app have ipad app , have search bar in navigation bar , search result should appear in popover under search bar in navigation item. i have found property stops search bar hiding navigation bar. but still stuck. can point me sample code or describe steps need take in order achieve this. regards christian this answer not step-by-step one, question , answer might helpful? uisearchcontroller showing fullscreen instead of popup on ipad [self.searchcontroller setmodalpresentationstyle:uimodalpresentationpopover];

javascript - PHP referencing functions not in a script -

can please explain me can php script functions from, have php script has few lines: <?php $args1 = array(); $gethosts = get_xml_host_objects($args1); //grabbing internal xml data backend $args2 = array(); $gethoststatus = get_xml_host_status($args2); $args3 = array(); $getparenthosts = get_xml_host_parents($args3); so not understand , how php script referencing functions, give me few examples suggestions of look? maybe, there file includes 2 scripts. somethings that <?php include 'file_with_function.php'; include 'your_file.php'; ?> these lines can help. place them @ beginning of file echo '<pre>'; debug_print_backtrace(); echo '</pre>';

if statement - How can I tell a for loop in R to regenerate a sample if the sample contains a certain pair of species? -

i creating 1000 random communities (vectors) species pool of 128 operations applied community , stored in new vector. simplicity, have been practicing writing code using 10 random communities species pool of 20. problem there couple of pairs of species such if 1 of pairs generated in random community, need community thrown out , new 1 regenerated. have been able code if pair found in community community(vector) labeled na. know how tell loop skip vector using "next" command. both of these options, not of communities needing. here code using na option, again ends shorting me communities. c<-c(1:20) d<-numeric(10) x<- numeric(5) for(i in 1:10){ x<-sample(c, size=5, replace = false) if("10" %in% x & "11" %in% x) x=na else x=x if("1" %in% x & "2" %in% x) x=na else x=x print(x) d[i]<-sum(x) } print(d) this result looks like. [1] 5 1 7 3 14 [1] 20 8 3 18 17 [1] na [1] na [1] 4 7 1 5 3 ...

sql - Issue while ALTER COLUMN in Postgresql -

this question has answer here: how convert primary key integer serial? 1 answer i have table id , name id primary key bigint datatype. want alter column, id primary key auto incremented value. my table: create table test( testid bigint not null, testname character varying(255), constraint test_pkey primary key (testid) ); alter query: alter table test alter column testid bigserial primary key; after executing query i'm getting following error, error: syntax error @ or near "bigserial" line 1: alter table test alter column testid bigserial p... ^ ********** error ********** error: syntax error @ or near "bigserial" sql state: 42601 character: 50 you can try command alter table your_table alter column key_column type bigserial primary key; i hope helpful...

tomcat - SEVERE: Error finishing response java.lang.StackOverflowError -

in catalina,out getting below error , tomcat goes down frequently. feb 26, 2016 3:03:34 pm org.apache.coyote.http11.abstracthttp11processor endrequest severe: error finishing response java.lang.stackoverflowerror @ java.net.socketoutputstream.socketwrite0(native method) @ java.net.socketoutputstream.socketwrite(socketoutputstream.java:92) @ java.net.socketoutputstream.write(socketoutputstream.java:136) @ org.apache.coyote.http11.internaloutputbuffer.realwritebytes(internaloutputbuffer.java:215) @ org.apache.tomcat.util.buf.bytechunk.flushbuffer(bytechunk.java:480) @ org.apache.coyote.http11.internaloutputbuffer.endrequest(internaloutputbuffer.java:159) @ org.apache.coyote.http11.abstracthttp11processor.endrequest(abstracthttp11processor.java:1784) @ org.apache.coyote.http11.abstracthttp11processor.process(abstracthttp11processor.java:1126) ...

python - How to split a text file into multiple text files -

here text file. oh , yeah , got puppy . idea . elliot looks little green . no . and contains many lines. i want split file 2 text file way using python or other ways being able use in linux. input.txt : oh , yeah , got puppy . elliot looks little green . response.txt : this idea . no . so, 2 text files; 1 has odd-numbered line, other has even-numbered line. how can do? try this: with open("your_file") f, open("input.txt", "w") inp, open("output.txt", "w") out: i,line in enumerate(f): if (i+1)%2 == 0: out.write(line) else: inp.write(line)

load testing - PerfMon plugin throwing error (with use of variables) in JMeter distributed Mode -

Image
i have implemented perfmon metrics collector (listeners) in jmeter scripts. these listeners have host , port fields. have defined variables these in test plan , using them in listeners. i tested these scripts in non-distributed mode , worked perfectly. now, converted scripts distributed mode. works fine except perfmon listeners throw following error message: 2016/02/29 09:06:35 error - kg.apc.jmeter.perfmon.perfmoncollector: perfmon plugin error: java.net.connectexception: connect: address invalid on local machine, or port not valid on remote machine this error seemed related invalid value (may these listeners not handle special characters {} $ in distributed mode!!). so, removed variables host/port , instead used hard coded values , worked fine. so apparently, these listeners not work in distributed mode (if used variables). is there workaround issue have plenty of perfmon listeners in setup , manually changing them tiresome job. go jmeter prope...

xsltforms - How to use the 'if' attribute in xforms with html elements? -

i have <div> element want use based on xforms instance value. something like: <xf:trigger appearance="minimal" > <xf:label > .. <div if="instance('scope')= 'user'"> <!-- know doesn't work --> </div> .. </xf:label> .... </xf:trigger> is 'if' attribute check instance values available <xf:action>,<xf:submission> etc . elements , not regular html elements ? or there way missing ? for conditional html elements, xforms allows define xf:group element ref attribute. the trick emulate "if" use predicate in ".[instance('scope') = 'user']": way, context node remains same xf:group content disabled if condition in predicate false.

c# - How to remove registry keys on uninstall msi using WIX -

i need remove registry keys when user uninstall application. these registry keys in hkey_current_user\software. i using wix tool. please note keys not getting registered on install after login based on action performed user. thanks in advance windows installer can access registry hive of user it's running as. it's technically possible write custom action enumerate user profile list , load each ntuser.dat causes sorts of problem. short answer isn't practical. besides, microsoft standards state leave user data behind on uninstall. if want it, best way know use custom action write registry during uninstall (something msi doesn't support). have registry value set activesetup command invoke reg.exe delete. when each user logs in next time key deleted.

Downloading email attachments using python django -

i trying develop mail client in python i able parse email body attachment , display in django template. now need download attachment when click on attachment name. all find way download file specific folder using python. how download default downloads folder of system when click on filename on browser below code sample tried def download_attachment(request): if request.method == 'post': filename=request.post.get('filename','') mid=request.post.get('mid','') mailserver = imap_connect("mail.example.com",username, password) if mailserver: mailserver.select('inbox') result, data = mailserver.uid('fetch', mid, "(rfc822)") if result == 'ok': mail = email.message_from_string(data[0][1]) part in mail.walk(): if part.get_content_maintype() == 'multipart': continue ...

javascript - upload file with python - where is the file? -

i'm trying "cross origin upload" example of course "html 5 power" andy olsen (lynda.com , video2brain). i can upload, , on server says "upload server complete". file not on server. why ? thanks helping. here's have in server console : c:\cou>c:\python27\python corsserver.py 9999 serving http on 0.0.0.0 port 9999 ... 127.0.0.1 - - [24/sep/2013 10:40:28] "get /crossoriginupload.html http/1.1" 200 - received options request. 127.0.0.1 - - [24/sep/2013 10:40:43] "options /upload http/1.1" 200 - received post request. read post data 127.0.0.1 - - [24/sep/2013 10:40:50] "post /upload http/1.1" 200 - upload server complete the file corsserver.py : #!/usr/bin/python import basehttpserver simplehttpserver import simplehttprequesthandler class corsrequesthandler(simplehttprequesthandler): def do_post(self): print "received post request." content_length = int(self.headers['co...

Rails comparison not working -

in rails, have workorders table. each workorder can have children workorders. i'm trying create dropdown links sibling workorders. i'm testing looking @ workorder.id = 30. has sibling workorder.id = 20. don't want display link same workorder user looking @ (30). so put in test <% if child.id != @workorder %> . but, 30 link still displays. added logger code see what's going on. this code: <li class="dropdown-header">siblings links</li> <% workorder.find(@workorder).parent.children.each |child| %> <%= logger.info 'look here ' %> <%= logger.info child.id %> <%= logger.info @workorder %> <% if child.id != @workorder %> <li><%= link_to child.id_desc, tasks_index4_path(:workorder_id => child) %></li> <% end %> <% end %> the log shows: look here 30 30 here 30 20 yet link_to 30 shows up. thanks he...

.net - What is time consuming using Dotfuscator? -

i have obfuscate large solution (~200 assemblies) using dotfuscator pro 4.10. last run took ~4hr, , quite long, longer build itself. time consuming? mean, can modify settings. maybe ask perform job takes long time not essential me. any idea? thanks. update : code in c++/cli native calls. there things can try: don’t run build in dotfuscator gui. instead, run @ command line or msbuild. on settings tab > global options, under general, set build progress “quiet”. on settings tab > reports > smart obfuscation, set report verbosity “warnings only”.

php - Combine 2 queries from different tables with different fields names -

i select , retrieve results 2 separate database tables , loop them within 1 html table. commands , name them separately, combine results , loop through them. there way of doing 1 query though? the example below not work, logic behind i'd achieve. $sql = "select * table3 column5 = 'yes'"; $data = mysql_query($sql); $sql = "select * table1 column1 = 'yes'"; $data = mysql_query($sql); // loops through records displaying in table format for($loop = 0; $loop < mysql_num_rows($data); $loop++) { $row = mysql_fetch_assoc($data); $ref = $row["ref"]; // rest of fields } note: know mysql deprecated. moving on pdo when rebuild site need use mysql function. select * table3 join table1 on table3.column5=table1.column1 , table3.column5='yes' or,change mysqli , use http://docs.php.net/mysqli.multi-query

javascript - Disable 'Next' button temporarily in Bootstrap Tour -

i'm using bootstrap tour build rather restrictive tour in user can proceed next step after spending 3 seconds on current step. in order to this, gave 'next' button id nextbtn in tour template, , hope can enable/disable this: var tour = new tour ({ name: "my-tour", template: "...", onnext: function(tour) { $("#nextbtn").prop("disabled", true); }), onshow: function(tour) { window.settimeout(next, 3000); }); function next() { $("#nextbtn").prop("disabled", false); } however, not working. should right approach here? there typos, main problem have use correct selector access "next" button, not #nextbtn , it's nesting of classes $(".popover.tour-tour .popover-navigation .btn-group .btn[data-role=next]") . in onshow , onnext event popover not accessibile because boostrap destroy , recreate it, correct event onshown : function...

php - How to create a confirm dialog box before submit in Yii framework -

i'm new yii framework, need create confirm dialog pop before submit form. below code of form used approve , reject. need pop appear before submit confirm whether approved or rejected. <div class="row"> <?php echo $form->labelex($model,'approved'); ?> <?php echo $form->radiobuttonlist($model, 'approved', array( 1 => 'approved', 0 => 'rejected', ), array( 'labeloptions'=>array('style'=>'display:inline'), // add code 'separator'=>' ', ) ); ?> <?php echo $form->error($model,'approved'); ?> </div> edit <div class="row buttons"> <?php echo chtml::submitbutton($model->isnewrecord ? 'create' : 'save'); ?> </div> how can achieve this you can add htmloptions submit...

c++ - Performance impact of variadic templates -

in latest refactoring round of code, replaced bunch of template classes fixed number of template arguments variadic counterparts. quite bit puzzled find out specific performance test case had seen drop in performance of 20-30%. a few git bisect roundtrips later, offending commit identified. literally consists of single change from template <typename t, typename u> class foo {}; to template <typename t, typename ... args> class foo {}; i have confirmed experimentally applying single change produces slowdown mentioned above. yet more puzzlingly, switching compiler version (from gcc 4.7 gcc 4.8) moves slowdown occurrence similar commit (i.e., switch fixed variadic arguments, in different class bar ). to give bit of context, specific performance test case sparse computer algebra problem memory-bound , hence susceptible efficient cache memory utilisation. test case has been problematic spot in code (e.g., around gcc 4.4/4.5 used have manually tweak compiler optio...

c++ - Inheritance resolution -

i thought types automatically resolve deepest part of hierarchy could . if cat : animal , call cat->talk() , if cat overrides talk() class animal , cat "meow", not weird general animal grumbling provided in base class animal . so i'm confused this: struct animal { virtual void talkto( animal* o ) { puts( "animal-animal" ) ; } } ; struct cat : public animal { virtual void talkto( animal* o ) { puts( "cat-animal" ) ; } virtual void talkto( cat* o ) { puts( "cat says meow cat" ) ; } } ; here's calling code: cat *cat = new cat() ; cat->talkto( cat ) ; //cat says meow cat animal *animalcatptr = cat ; cat->talkto( animalcatptr ) ; //cat-animal the last line here, send cat cat->talkto , i'm using animalcatptr . animalcatptr still refers cat , yet resolving animal in function call. how can make pass pointer resolve deepest type in hierarchy is ? don't want ser...

c# - How to determine if XML has unclosed strings -

i have many xml files , of them might have unclosed strings this <ns0:info infotyp="53" infoid="/> those unclosed strings dont appear last part of tag is there way in notepad++ or in c# detect when file has kind of strings ? how can detect other kind of error in xml file make invalid xml ? need try parse detect ? with c# can try load xml file xdocument (or xmldocument): using system.xml.linq; // include in using directives try { var xdoc = xdocument.load(path_to_xml); } catch (xmlexception e) { // xml invalid } xmlexception contains information line number , position caused error. exception message pretty informative. e.g. xml say: unexpected end of file has occurred. following elements not closed: line 1, position 35.

ruby on rails - Setup fake data just once -

i'm working on rails application no models. have class in lib, fakemaker , builds bunch of fake entities display purposed. i want test out deletion functionality problem fake data set re-initializes every time hit controller. i'd run data test creator once have 1 set of fake data. i have tried using ||= , before_filter , class methods in fakemaker , sessions storage seem have issue of reinitializing data set everytime controller hit. controller code: class homecontroller < applicationcontroller include fakemaker before_filter :set_up_fake_data def index @workstations = @data[:workstations] @data_sources = @data[:data_sources] end private def set_fake_data @data ||= session[:fake_data] end def initialize_data session[:fake_data] = set_up_fake_data end end fakemaker in lib: module fakemaker include actionview::helpers::numberhelper source_cidne = "cidne" source_dcgs = "dcgs" types_cidne = f...

ios - How to set a NSTimer with a changing delay? -

i want set timer changing delay stored in variable. how this, if set timer within timer update delay doesn't work @ all. thanks don't have repeating timer. use run once timer, , when completes/runs, create timer new delay. or... @steve wilford noted in answer, use setfiredate: on nstimer. docs "adjusting firing time of single timer incur less expense creating multiple timer objects, scheduling each 1 on run loop, , destroying them."

php - setting up Yii1.13 on shared server error -

want upload web site shared server. structure public_html yii(folder) index.php (inside root folder) i'm getting message "server error".please can tell me problem or should change in code make work.here index code: <?php // yii directory paths<br/> $yii=dirname(__file__).'/yii/yii.php'; $config=dirname(__file__).'/protected/config/main.php'; // remove following lines when in production mode<br/> defined('yii_debug') or define('yii_debug',true); // specify how many levels of call stack should shown in each log message<br/> defined('yii_trace_level') or define('yii_trace_level',3); require_once($yii); yii::createwebapplication($config)->run(); ?> if install welcome yii application problem of index.php file in app itself. 1 easy method copy index.php file generated demo app , copy paste in original app. ...

C++ Boost::bind: a pointer to a bound function may only be used to call the function -

i like template<typename instancetype> void add_test(void (instancetype::* test_method )(void*), std::tr1::shared_ptr<instancetype> user_test_case) { boost::function<void ()> op; op = boost::bind<instancetype>(test_method, *user_test_case); but says: 1>d:\boost\boost/bind/mem_fn.hpp(359): error: pointer bound function may used call function 1> return (t.*f_); what wrong here? the 1st template argument of bind return type. so, should void . or omit it. boost::function signature doesn't match 1 of bound function. make function<void(void *)> . the functor create should accept 1 argument, provide appropriate argument placeholder. finally, can bind shared_ptr , directly. the bottom line: boost::function<void (void *)> op = boost::bind(test_method, user_test_case, _1);

css - The hover state doesn't work properly on animations -

Image
i have element when user hover on ( :hover ), animate left right, element off mouse. :hover state should normal state, won't happen. wrong? #test { position: absolute; top: 0; left: 0; width: 100px; height: 100px; background: red; z-index: 20; transition: left 1s linear; } #test:hover { left: 200px; background: green; } here jsfiddle demo . within #test:hover { left: 100px; background: green; } you tell element go outside width of , transition forces so. if change hover transition left: 100px; work. the transition master , hover slave ;)

c# - Retrieving a Deeply Nested Value in an XML File -

i'm trying read property in xml file using c# , linq xml , can't retrieve value nested in tree. value i'm trying contents of <value> near <displayname>add comments</displayname> . every <orderproduct id=???> may have own comments. i can read other properties in xml file using linq, i'm confused how go reading nested. thanks. <?xml version="1.0" encoding="utf-16"?> <orderxml> <order> <orderproducts> <orderproduct id="1"> . . . </orderproduct> <orderproduct id="2"> <propertyvalues> <propertyvalue> <property id="10786"> <displayname>base</displayname> </property> <value /> </propertyvalue> <propertyvalue> <property id="10846"> ...

Cassandra's secondary index Vs DSE solr indexing -

i know performance difference cassandra's secondary index vs. dse's solr indexing placed on cf's. we have few cf's did not place secondary indices on because under impression secondary indices (eventually) cause significant performance issues heavy read/write cf's. trying turn solr allow searching these cf's looks loading index schema modifies cf's have secondary indices on columns of interest. would know if solr indexing different cassandra's secondary indexing? and, cause slow queries (inserts/reads) cfs w/ large data sets , heavy read/writes? if so, advise custom indexing (which wanted avoid)? btw -- we're using (trying use) solr spatial searching. thanks advice/links can give. update: better understand why i’m asking these questions , see if asking right question(s) – description of our use case: we’re collecting sensor events – many! storing them in both time series cf (eventtl) , skinny cf (event). because writing (inserting ,...

spring - NotInTransactionException when adding to mapped set -

i have 2 @nodeentities mapped via sdn using simple mapping, personnode , familynode . familynode has @relatedto collection, children. have familyservice (using spring's @service annotation) @transactional annotation on updatefamily method. method loads familynode given id, , uses callback interface modify node. in 1 implementation of callback, adding personnode children collection, , generating notintransactionexception , @ point neo4j attempting create relationship between familynode , personnode . source code can found @ github , in particular failing test . here relevant bits of code: familynode.java: @nodeentity public class familynode implements family { @indexed(indexname = "families", unique = true) private string id; @graphid private long identifier; @relatedto(elementclass = personnode.class, type = "child") private set<person> children; void addchild(person child) { if (this.childr...

html - bootstrap inline input and button -

how create login form on bootstrap 3.0 http://joxi.ru/zcbbutg5cbb8elto5ca my code: <form role="form" class="form-inline"> <input type="email" class="form-control input-sm" placeholder="Адрес электронной почты"> <div class="form-group"> <input type="password" class="form-control input-sm" placeholder="Пароль"> <button class="btn btn-primary btn-sm">Войти</button> </div> </form> http://jsfiddle.net/mborodov/ls684/ but, need padding between inputs , inline password input , submit button. try jsfiddle : http://jsfiddle.net/ls684/2/ <form role="form" class="padding-15 black round-5 form-inline"> <input type="email" class="form-control input-sm" placeholder="Адрес электронной почты"> <div class="form-group">...

vb.net - How do I tell in code if the current process is a deployed version of my application? -

i have added 'about' form project that's been around while have taken control over. part of i've made changes, first revamp versioning, , second implement click-once deployment. my question is: how can tell in code if application running 'deployed version'? possible? i ask because i've got deployment set 'automatically increment revision each publish', , want reflect in form. so, had add following code: try me.labelversion.text = string.format("version {0}", my.application.deployment.currentversion.tostring) catch ex exception me.labelversion.text = string.format("version {0}", my.application.info.version.tostring) end try the deployment version doesn't work if it's ran through devenv or in standalone copy manually setup. need second info.version . i rather not use try-catch block here, seems messy. however, don't know how check in if statement. thanks. well seems should h...

C++ is static typed language, why can we get type at runtime -

type& dynamic_cast<type&> (object); type* dynamic_cast<type*> (object); for example can type this. c++ static typed language, why can type @ runtime variables in c++ have statically determined type. objects don't necessarily. need handle objects through variables of statically known type. examples: int * p = new int[argc]; // there object dynamic type int[argc] base * p = new derived; // *p has dynamic type derived base * q = rand() % 2 ? new derived1 : new derived2; // ???

java - LockException: Failure obtaining db row lock: No operations -

i have working spring application , trying add quartz job scheduling it. i've copy/pasted/modified spring configuration project have working, 1 keeps throwing exception when starting up. i'm using quartz 2.2 , spring 3.2.1. i've included spring configuration , exception stack trace. diagnosing appreciated. <!-- task scheduling --> <bean id="emailorganizerlink" class="it.cause.cron.emailorganizerlink" /> <bean id="emailorganizerlinkjob" class="org.springframework.scheduling.quartz.jobdetailfactorybean"> <property name="jobclass" value="it.cause.cron.emailorganizerlinkjob" /> <property name="durability" value="true" /> </bean> <bean id="emailorganizerlinktrigger" class="org.springframework.scheduling.quartz.crontriggerfactorybean"> <property name="jobdetail" ref="emailorganizerlinkjob" /...

Can't delete Tortoise SVN meta file after Java writes to it -

i made simple java utility simple operations on source project folder (checked out svn). reason after java copies or changes files, can't delete svn meta data files. use tortoise svn , i'm running win7. can copy/delete folder file explorer before java touches it. things i've tried: using fileutils read , write using plain java io (closing files streams) rebooting (still can't delete!) turning off cache on svn , rebooting i can't clean-up, update or checkout on project because tortoise svn says meta data corrupt now i've got 8 folders on machine can't delete , rebooting doesn't help. if have 7-zip file manager in machine, try use delete

java - Android - How to start a new activity -

i'm trying make bull's eye random color, , instead of circles use squares. but thing when run app on emulator , when starts new activity stops responding. this main activity, 1 starts drawactivity. public class mainactivity extends activity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); intent coiso = new intent(this, draw.class); startactivity(coiso); } @override public boolean oncreateoptionsmenu(menu menu) { // inflate menu; adds items action bar if present. getmenuinflater().inflate(r.menu.main, menu); return true; } } and draw activity, 1 want start. (it doesn't have things want do. because can't, problem ahead) public class draw extends view { public draw(context context) { super(context); // todo auto-generated constructor stub } @override ...

javascript - google maps Autocomplete with building not working for routing -

here small application i'm writing check taxi fare in country. working well, including autocomplete. if type building/mall name, route not showing. if type road name, route showing. road name example in city : "jalan salemba raya" , "jalan medan merdeka timur" mall name example : "amaris hotel mangga dua square" where problem ? <html> <head> <meta name="viewport" content="initial-scale=1.0, user-scalable=no"/> <title>distance calculator</title> <script type="text/javascript" src="http://maps.google.co.id/maps/api/js?v=3.exp&sensor=true&libraries=places"></script> <script type="text/javascript"> var directiondisplay; var directionsservice = new google.maps.directionsservice(); var map; function initialize() { directionsdisplay = new google.maps.directionsre...

c# - Make onetime page Windows Phone 8 -

i making application in vs2012 windows phone 8, c#/xaml. now, want make page run when app installed , user opens app first time. not anytime after that. kindly help, thanking you you can use xml file write value says whether or not page has been displayed. in page's constructor (or more appropriately in it's onload event) can write value xml file , it's been displayed. in startup logic can read file , if value has been set, can skip different page. xml file <startupvalues> <hasfirsttimepagedisplayed>true</hasfirsttimepagedisplayed> </startupvalues> page-you-want-to-show-once xaml <page loaded="onloaded" ... /> xaml.cs public void onloaded( object sender, routedeventargs args ) { var xml = new xmlserializer( typeof( startupvalues ) ); using( var writer = new streamwriter( "config_file_path_here.xml" ) ) { xml.serialize( new startupvalues { hasfir...

php - Unable to get the facebook access token? -

i'm trying post url/status facebook page after executing script php (codeigniter). @ moment getting following error uncaught oauthexception invalid oauth access token signature. know problem fact access token wrong no matter how documentation read on facebook can't seem figure out. give me solution how access token? include('system/libraries/facebook.php'); if($this->session->userdata('level') == "admin"){ $role = $this->input->post('role'); $company = $this->input->post('company'); $location = str_replace( '+', ' ', $this->input->post('location') ); $category = str_replace( '+', ' ', $this->input->post('category') ); $type = str_replace( '+', ' ', $this->input->post('type') ); $description = $this->input->post('description'); $extract = $th...

.net - Update gridview row with separately bound dropdownlist -

i have ddl in gridview bound separately rest of gridview. want update sql database based on ddl, error, "could not find control 'ddlusers' in controlparameter ''." public sub bindgridview() 'bind gridview sqldatasource1.selectcommand = "select * leadership left outer join customer on leadership.customerid = customer.customerid" sqldatasource1.databind() 'binding dropdownlist inside of gridview sqldatasource2.selectcommand = "select lname + ', ' + fname name, customerid customer active = 'true' , probation = 'false' order lname asc" sqldatasource2.databind() end sub protected sub gridview1_rowupdating(sender object, e gridviewupdateeventargs) dim ddl dropdownlist = directcast(gridview1.rows(e.rowindex).findcontrol("ddlusers"), dropdownlist) dim constr string = "data source=mydatasource" dim cn new sqlconnection(constr) cn.open() dim updc...