Posts

Showing posts from January, 2011

How can remove the bottom shadow of UINavigationBar? -

i using custom navigationbar within projects, it's giving bottom drop shadow of uinavigation bar, how can remove it, please provide answer if work on it. tia :) the easiest way remove shadow underneath uinavigationbar set custom background image , set shadow image blank uiimage . customviewcontroller.m - (void)viewdidload { [self.navigationcontroller.navigationbar setbackgroundimage:[uiimage imagenamed:@"background"] forbarmetrics:uibarmetricsdefault]; [self.navigationcontroller.navigationbar setshadowimage:[[uiimage alloc] init]]; } in above example, "background" png image in project.

c++ - Do I need to manually declare >= and <= operators? -

if have operator > , operator < defined (and operator == ), need define operator >= , operator <= , or compiler declare them me if intentionally don't declare them? also, if have operator == defined, compiler declare operator != me? no, compiler won't declare/define of operators did not define manually. however, boost.operators might liking - want compiler do.

addclass - jQuery add class remove when another is clicked -

having issues returning element start position after next item clicked. when user hovers on div.box 2 element transition in, when element clicked elements should stay in place. works fine when same item clicked on/off. issue when next item clicked span stays centered within a.blanket. code: http://jsfiddle.net/mhlwh/3/ html: <div class="box"> <div class="img"></div> <a href="" class="blanket"> <span class="arrow"></span> </a> </div> <div class="box"> <div class="img"></div> <a href="" class="blanket"> <span class="arrow"></span> </a> </div> css: .box { width:200px; height:200px; background:red; float:left; margin-left:10px; margin-top:50px; position:relative; /*overflow:hidden*/ } .blanket { width:100%...

Using PyPy Sandbox to refer to standard python modules? -

i working on project embed python interpreter in website--i users able execute own python code on server-side in secure python sandbox. have been using pypy's sandboxing features , have set virtual tmp/ directory (which corresponds real directory sandbox can read from) server-side files. ideally, users able run own code on server , use whatever libraries make available them (with no ability write of these files/make system calls/do in general mess files). the issue within server-side code use standard python libraries others have installed separately (e.g. "import datetime", "import pandas", etc.). while sandbox can read server-side code ends failing whenever try import additional libraries within code. have thought of setting virtual tmp/ directory include server-side files + standard python libraries + separately installed libraries such pandas. however, when tried setting python libraries ended not working, not mention solution seems pretty inelegant. ...

c++ - Error when running code -

Image
i have tried following code error when running it. have used debugger can't understand errors in call stack. #include <iostream> #include <fstream> using namespace std; int main() { int a[10][2],i,j, b[10],max, min; ifstream f("numere.txt"); for(i=1;i<=10;i++) { for(j=1;j<=2;j++) { f>>a[i][j]; b[i]=0; } } for(i=1;i<=10;i++) { for(j=1;j<=2;j++) { b[i]=b[i]+a[i][j]; } } max=b[1]; min=b[1]; for(i=1;i<=5;i++) { if(max<=b[i]) max=b[i]; if(min>=b[i]) min=b[i]; } cout<<"cea mai mare suma este:"<< max<<endl; cout<<"cea mai mica suma este:"<< min<<endl; f.close(); return 0; } please, me. beginner , have never worked files before. you have @ least 1 error: array index out of bounds: for(i= ...

UiWatcher example for Android UIAutomator not working -

import com.android.uiautomator.core.uiobject; import com.android.uiautomator.core.uiobjectnotfoundexception; import com.android.uiautomator.core.uiselector; import com.android.uiautomator.core.uiwatcher; import com.android.uiautomator.testrunner.uiautomatortestcase; public class uiwatcherdemo extends uiautomatortestcase { private static final string nointernet_string = "internetwatcher"; public void testwatcherdemotestexample() throws uiobjectnotfoundexception { // define watcher , register // uiwatcher internetwatcher = new uiwatcher() { @override public boolean checkforcondition() { uiobject noconnobj = new uiobject(new uiselector().text("no connection")); if(noconnobj.exists()) { uiobject retrybutton = new uiobject(new uiselector().classname("android.widget.button").text("retry")); try { ...

html - gettings values from checkbox group with jQuery only works once -

i'm trying build array of values of selected checkboxes in group (i have more 1 checkbox group on page, below 1 of them). when click on checkbox first alert value of '0' , alert value of '1'. expected. however, when check 2nd checkbox alert no longer shows up. don't see errors in chrome console. why? html <table id="cphcenter_cblfeatures" class="cblist textbox" style="width:100%;"> <tbody> <tr> <td> <input id="cphcenter_cblfeatures_0" type="checkbox" name="ctl00$cphcenter$cblfeatures$0" onclick="javascript:settimeout('__dopostback(\'ctl00$cphcenter$cblfeatures$0\',\'\')', 0)" value="6"> <label for="cphcenter_cblfeatures_0">arbor</label></td> <td><input id="cphcenter_cblfeatures_4" type=...

asp.net - using control states in server control -

i have server control trying save properties control states reason properties not persisting across partial postbacks. the psuedo code follows: public class fileupload inherits scriptcontrol implements inamingcontainer, ipostbackeventhandler public property newfileext() string dim foundlist string = directcast(viewstate(me.uniqueid & "_fileext"), string) if foundlist isnot nothing return foundlist else return string.empty end if end set(byval value string) viewstate(me.uniqueid & "_fileext") = value end set end property protected overrides sub oninit(byval e system.eventargs) mybase.oninit(e) page.registerrequirescontrolstate(me) end sub protected overrides function savecontrolstate() object dim controlstate(6) object controlstate(0) = mybase.savecontrolst...

reporting services - SSRS Url Access Specify Format Breaks Report When Parameter Page is Triggered -

i using ssrs (2008r2) url access render reports in web application. need specify format of report, , able using rs:format= option, long report doesn't have required parameters need specified. if report requires user enter parameter, fails. if remove rs:format option url, report's parameter page come fine , if make selections, report render. my url access url looks this: https://www.imnottelling.com/reportserver_sql2008r2/pages/reportviewer.aspx?/appreports/cool+report&rs:command=render&rc:linktarget=main note error message receive when attempting tells me parameter missing, varies, depending on report attempted run. this leads me believe either (a) not supported or (b) i'm missing in url. any appreciated. this should 'as designed' believe 'rs:' portion of url saying 'renderstate(something)'. if report has required parameters have 3 choices: set default pass them rest uri remove them if want autogenerate via r...

java - "request" in " request.getRequestURI();" -

i trying print browser url using java. have come across codes have used "request.getrequesturi();" retrieve url. "request" in "request.getrequesturi();" ? how define it? can example of code "request" defined? it httpservletrequest object. see: http://docs.oracle.com/javaee/6/api/javax/servlet/http/httpservletrequest.html . normally passed in method on controller.

Can I prevent a LINQ DataContext from using a transaction when a TransactionScope is present? -

i'm using transactionscope in model controller class coordinates several lower level, data access classes. data access classes each use own linq datacontext , , magic of transactionscope , participate in same transaction if 1 present. under normal circumstances, perfect , works. however, i've added activity logging class , 1 of places can write database. unfortunately, automatically picks on transactionscope , if transaction gets rolled back, log entries. i've checked transaction property of datacontext , it's null, expected, i'm not sure how tell ignore transactionscope . in logging class, wrap using(new datacontext()) into: using (var s = new transactionscope(transactionscopeoption.suppress)) { }

group mysql count values in comma separated field -

i have users table columns: user_id, mechanic_id and mechanics table id i count how many users have same mechanic. users table +-------------------------+ | user_id mechanic_id | +-------------------------+ | 1 1,2 | | 2 2,1 | | 3 2,1,8,16 | | 4 1,16,3 | +-------------------------+ mechanics table +------+ | id | +------+ | 1 | | 2 | | 3 | ... count $id1 is: 4 count $id2 is: 3 count $id3 is: 1 count $id8 is: 1 count $id16 is: 2 best solution: scrap table design , rebuild normalized once. simple join + group + count query work. worst solution: use mysql's find_in_set() function: select mechanics.id, count(user_id) mechanics left join users on (find_in_set(mechanics.id, users.mechanic_id) > 0) group mechanics.id

How to hide a field in node display if it's value is 0. Drupal 7. -

i using drupal installation rest server android application. store data in nodes , field blank, example location has no phone number. had standardize json coming out of drupal rest server specified class, forced add 0, value in field.. works great in andriod, when viewed on drupal site, looks bad.. so question is, if value of field 0, id change 'none'. i in d6 cck, dont know d7 field api. thanks you can in node.tpl.php file, in field.tpl.php file or template_preprocess_field function (recommended) , many other options if statement. see example first template , 1 second option preprocess function . if don't want edit tpl.php files or don't have access template.php file of theme can use field formatter conditions module allows condition. alternatives custom formatters , field_formatter_css_class .

performance - MySQL nested query speed -

i'm coming postgres background , trying convert application mysql. have query fast on postgres , slow on mysql. after doing analysis, have determined 1 cause of drastic speed difference nested queries. following pseudo query takes 170 ms on postgres , 5.5 seconds on mysql. select * ( select id inner join b ) first limit 10 on both mysql , postgres speed same following query (less 10 ms) select id inner join b limit 10 i have exact same tables, indices, , data on both databases, have no idea why slow. any insight appreciated. thanks edit here 1 specific example of why need this. need sum of max. in order need sub select shown in query below. select sum(a) ( select table2.b, max(table1.a) table1 inner join table2 on table2.abc_id = table1.abc_id , table1.read_datetime >= table2.issuance_datetime , table1.read_datetime < coalesce(table2.unassignment_datetime, date('9999-01-01')) table1.read_datetime between '...

android - Activity life cycle creating,starting and running procedure -

if first activity image, , second activity song , calculator. if start second activity , make sleep on first activity 5000ms , kill it... sound play while first activity's image on screen? , calculator during sleep period ? no. if "sleep" first activity , assuming talking ui thread , not background thread, whole ui sleep time...meaning second activity won't started yet , song won't play. what put in 1 activity , put image , calculator in same position, or wherever want in layout, , hide calculator beginning in xml android:visibility="invisible" // or gone depending on need then can change visibility of both views when need. don't know want don't know if solution suitable. you putting song in service

Django-disqus: disqus comment box on -

i've created blog django , trying use disqus comments. having similar problem have seen in other questions in when post comments entries(on single entry pages) show on main page under 1 entry. the main problem on main page of blog, have multiple entries, can 1 disqus comment box show on 1 entry. when @ source code javascript variables other blog entries seem showing correctly i'm not sure why comment boxes won't render under other blog entries. i'm in development mode i'm not sure if makes difference...i'm noob @ of this. this source code disqus javascript each entry...can me figure out why can't comment box render? <div id="disqus_thread"></div> <script type="text/javascript"> /* <![cdata[ */ var disqus_shortname = 'whometaxi'; var disqus_developer = "1"; var disqus_identifier = "3"; var disqus_title = "third"; /* * * don't edit below line * ...

javascript - Improve AJAX response handling function -

this code handles response rss feed. organizes , appends content. if there's video embedded separate rest of content. review on performance/efficiency i'm open other suggestions well. star selector nagging me don't know of better way iterate on contained elements. function getfeed(url, element, callback) { $.getjson("https://ajax.googleapis.com/ajax/services/feed/load?v=1.0&callback=?&q="+encodeuricomponent(url), function(response) { var content = "", $element = $(element); (var = 0; < response.responsedata.feed.entries.length; i++) { content = content + response.responsedata.feed.entries[i].content; //join feed entries } $element.find(".content").html(content).addclass($element.find("embed").length? "withvideo" : ""); $element.find("*").each(function() { var $this = $(this); $this.removeattr(...

java - Simulating clicks on items using Robolectric -

i figured type of question have been asked can't seem find answer need. have expandablelistview , last child in each group clickable. need simulate click on particular item, third child. i've tried variations of .performclick , .dispatchtouchevent haven't gotten work right. need call group's onchildclick listener , make sure item selected last one. ideas? let me know if can add information. note: i'm using code coverage calculator how know listener isn't being called. i'm using robolectric run unit tests. also, need similar graphicalview achartengine simulate click on region of doughnut chart. insight on appreciated well. looks similar q . try helper method performitemclick: robolectric.shadowof(expandablelistview).performitemclick(position);

c# - Microsoft XNA framework redistributable v4.0 Installed but cannot find reference assemblies -

i installed microsoft xna framework redistributable 4.0 not able find of assemblies work in visual studio 2010. window crashed , have downloaded net. before window crashed working fine. please me in issue! try if re-running installer xna not work (the file located here ) steps install xna game studio 4.0 without using setup bootstrapper additionally i'd recommend take @ monogame or xna implementation out in wild since microsoft no longer supporting xna .

linux - Adding SSH Key to authorized_keys: permission denied(publickey) -

i have id_rsa , id_rsa.pub on computer tied bitbucket account. as understand can use public key anywhere please (as long private matches). the problem : cannot figure out how server accept public key, see i've done wrong? $ cat id_rsa.pub >> authorized_keys $ service ssh restart (i suppose isn't needed) $ git pull origin master $ permission denied(publickey) what doing wrong? i've been stuck days. you need copy content of id_rsa.pub bitbucket avcount in settings page for more info https://confluence.atlassian.com/display/bitbucket/how+to+install+a+public+key+on+your+bitbucket+account

javascript - change background color of div using css -

is possible change background color of div using css? code far: css .div{ background-color: #000; } .live .div:not{ background-color: #ddd; } javascript function change(){ $("body").addclass("live"); } html <div onclick="change()">change</div> <div>...</div> everyone seems confused you're trying accomplish. @fedxc has right solution. if you're trying change color of div clicked, it: html: <body> <div> change div! </div> </body> css: div{ background-color: #000; color: white; } div.live{ background-color: #ccc; } javascript: $("div").click(function(){ $(this).addclass('live'); }); live example here: http://jsfiddle.net/7rbdg/1/

c++ - Copy / blend images of different sizes using opencv -

i trying blend 2 images. easy if have same size, if 1 of images smaller or larger cv::addweighted fails. image (expected larger) image b (expected smaller) i tried create roi - tried create third image of size of , copy b inside - can't seem right. please help. double alpha = 0.7; // int min_x = ( a.cols - b.cols)/2 ); int min_y = ( a.rows - b.rows)/2 ); int width, height; if(min_x < 0) { min_x = 0; width = (*input_images).at(0).cols - 1; } else width = (*input_images).at(1).cols - 1; if(min_y < 0) { min_y = 0; height = (*input_images).at(0).rows - 1; } else height = (*input_images).at(1).rows - 1; cv::rect roi = cv::rect(min_x, min_y, width, height); cv::mat larger_image(a); // not sure how copy b roi, or if necessary... , keep images same size cv::addweighted( larger_image, alpha, a, 1-alpha, 0.0, out_image, a.depth()); even cvsetimageroi - may work can't find c++ equivalent - may - don't know how use still keep image cont...

box api - Box v2 API - Basic questions -

i have basic question regarding new box api v2. i have developed firefox extension (febe) performs automatic, scheduled, unattended backups of user's firefox profile. these backups can (optionally) automatically uploaded user's box account. use v1 api , has been working fine several years. see v1 api being deprecated in december, 2013. mean no longer work, or no longer supported? if have re-write code (javascript) handle v2 api, still able provide upload capability without user intervention? febe securely stores user's box username , password , silently logs in initiate upload. i've been able research far, seems oauth 2 verification process requires interstitial page confirm users credentials. true? if so, remove 'unattended' aspect of backup. also, can recommend source of javascript code snippets show examples of box v2 api in action (preferably not jquery, plain, old-fashion javascript)? does mean no longer work, or no longer supp...

Javascript array push subarray -

Image
each newdata[x][0]] looks -> [95, 152, 174, 197, 261] when newgooddata.push([newdata[x][0]]) twice (x=0 , 1) i want be: i seem adding them wrong. , explanation? you putting newdata[x][0] array before pushing. newgooddata.push([newdata[x][0]]) // bad newgooddata.push(newdata[x][0]) // the [] around newdata[x][0] creates new array containing 1 element: newdata[x][0] .

javascript - Jquery get nth child of a matched row -

please see line prepend below. $('#area_code').keyup(function(){ var searchterm = $(this).val(); if(searchterm.length > 3) { var match = $('tr.data-row:contains("' + searchterm + '")'); var nomatch = $('tr.data-row:not(:contains("' + searchterm + '"))'); $('#sector1_result').prepend(match) match.addclass('selected'); nomatch.css("display", "none"); } else { $('tr.data-row').css("display", ""); $('tr.data-row').removeclass('selected'); } }); this gets row table , appends it, want cell row , not entire row. you can use combination of .children , .get or .eq . example if match jquery object containing row, nth child whith: match.children().get(n)

javascript - Search in Array makes browser crash -

basically i´m getting data 2 external sources , wish compare both. first i´m getting data xml using ajax , put in array inside array: var array1 = []; //outside ajax ... var valuetopush = new array(); valuetopush[0] = zz; valuetopush[1] = aa; array1.push(valuetopush); then i´m getting post php file scrapped html file, meanwhile i´m trying compare both data xml , scrapped html (using date time), using if statement limit search: if (lng < (-18)) { for(var i=0, len = array1.length; i<len; i++) { var date1 = array1[i][1]; if (date2 == date1) { alert("equal"); } else { //do else } } } well firefox starts getting >1gb of ram , browser crash (sometimes can stop script). problem (i think) in "for(var i=0, len = array1.length; anyone can point me out solution? thanks edit: live version of site crashing. removing 435-449..resolves issue of crashing, doesnt compare data. http://preview.tinyurl.com/mf9g9fq edit2 : following comments, edited code si...

Ruby: can the following array be generated with a one-liner using the step function: [1, 10, 100, 1_000, 10_000, 100_000, 1_000_000] -

i have thought of couple of different ways generate following array: [1, 10, 100, 1_000, 10_000, 100_000, 1_000_000] it seems might possible generate array step function in elegant manner, not able figure out. passes in second argument step function , says want last value times 10: 0.step(1_000_000, ???).to_a here solutions have come far: i don't inject solution because prefer specify 1_000_000 upper bound: (0..6).inject([]) { |memo, number| memo << 10**number; memo } this ugly step solution came with: result = [] 0.step(6) {|number| result << 10 ** number} result a while loop not feel right either, @ least lets me specify upper_bound (instead of math.log10(upper_bound)): result = [1] while result.last < 1_000_000 result << result.last * 10 end result thanks help. how this? 0.upto(math.log10(1_000_000)).map { |i| 10**i } it's going work powers of 10, lets specify upper bound, , computes powers of 10 iterate thro...

php script giving timeout or blank page after server update -

i have script calculates biorythm , shows graph result. unknown me reason, following script not seem work after server has been updated. <?php $now = gmdate('d, d m y h:i:s') . ' gmt'; header('expires: ' . $now); header('last-modified: ' . $now); header("cache-control: no-store, no-cache, must-revalidate"); header("pragma: no-cache"); error_reporting(0); $copyright = "by www.magnaromagna.it"; $name = $_post["name"]; $day = $_post["day"]; $month = $_post["month"]; $year = $_post["year"]; $cycle = $_post["cycle"]; $chartsize = $_post["chartsize"]; $name = strip_tags($name); if($chartsize == "small") { $chartwidth = 450; $chartheight = 252; $tablewidth = 500; } elseif($chartsize == "medium") { $chartwidth = 625; $chartheight ...

html - Make footer stretch bottom of page without using body tag -

i have been researching hours trying different solutions none of them have seemed work me, not sure if doing wrong or if template using. have tried cssstickyfooter , has not worked me either. i have got background image set within pages can't use solution of setting body tag background colour. debug div needs stretch way bottom of page. have zoomed out using chrome , not doing this. here css code: #rt-debug { background-color: #bf953f; padding-bottom: 15px; border-top: 4px solid #2a9685; } i added footer2 div around debug test cssstickyfooter solution here link website: http://www.humanenergygroup.com/oil-and-gas-uk the easiest way add following #rt-debug div: #rt-debug { position: fixed; bottom: 0; width: 100%; } this ensure full page width keeping "sticky" bottom of window.

c# - Creating a PivotTable programmatically from multiple database tables -

i have problem automating excel cannot solve. want mimic "import external data" feature. works flat tables, not pivottables, when select multiple database tables import. the manual way i have access database 2 tables (accounts , transactions), linked foreign key ("account" in transactions table). want import both pivottable. usual way click on "data" -> "external data", select both tables in dialog, choose "pivottable report" , click "ok". pivottable in active sheet , on right side there field list offers fields in hierarchy of imported tables. this want mimic mentioned database file. have idea how works? what tried i have tried record , adapt macro, no avail, records incomplete , flawed code. incomplete because recorded code not feature creation of data model, necessary (?). flawed because code not run, syntax incorrect. i can create pivottable 1 database table this: excel.pivotcaches pivotcaches = workbo...

angularjs - What should the Soundcloud redirect_uri be if I am running my grunt local server? -

i getting started soundcloud api , got snagged on authentication. have built angularjs project yeoman , use grunt server preview project in browser @ http://localhost:9000/#/ that url index.html main page of angularjs app. have added following callback.html file ( found here @ soundcloud api docs ) <!doctype html> <html lang="en"> <head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <title>connect soundcloud</title> </head> <body onload="window.opener.settimeout(window.opener.sc.connectcallback, 1)"> <b style="width: 100%; text-align: center;">this popup should automatically close in few seconds</b> </body> </html> in project's app directory index.html file located. additionally , in irrational desperation, have configured angularjs app serve callback.html file view @ url http://localhost:9000/#/callback ...

java - Getting an object out of Equinox/Eclipse -

i facing problem combination of "plain" java, equinox, , communication between two. have read other related questions ( here , here , , there other web sites, such this one , that one ) not find satisfying (or working!) solution. i have set of plug-ins: p1, p2, , p3. p1 export classes, used p2. p2 additionally exports other classes , interfaces, used p3. in particular, p2 defines , exports interface myinterface , implementation class myinterfaceimpl implements myinterface . p3 application and, thus, contains class launcher implements iapplication , defines public object start(iapplicationcontext) method. compiles fine. when run launcher eclipse application eclipse, runs fine. launcher uses myinterface , myinterfaceimpl fine. now, programmatically run application using following (simple) code, seems "okay" way of running equinox/eclipse application, according various posts: void callapplication() { final string[] args = new string[] { ...

How to combine data of rows in Excel -

Image
please see image i have cells: a1 -> a8, know function can use create result b11 (i want use cell ranges, don't need list specified cells) thanks , regards, tai i not think can done in formula out of box without morefunc plugin. this works (although specifies each cell not want): =concatenate(a1 & ",",a2 & ",",a3 & ",",a4 & ",",a5 & ",",a6 & ",", a7)

c++ - initializing an array of constants in a struct -

to stack overflow members, coding simulator requires multiple loops (sometimes on 1,000,000) each involves heavy calculations. thus, saving 10 millisecond on loop can lead saving on 160 minutes of calculations. fighting every code optimization can get. had imported system parameters file vectors. after awhile realized that: calling constant int/double/... faster calling regular int/double/... using arrays faster using vectors i did not need full functionality of std::string , make simple knockoff version of use originally naively thought convert std::vector<double> std::vector<const double> . i've been trying make cross-platform linux found visual studio express compiler ignores fact const can't declared (and linux throws ton of errors). i decided use constant arrays in structs initializing; however, not figure out how initialize properly. (most/all forums came across said declare static const int* , initialize global, don't think works...

c++ function syntax/prototype - data type after brackets -

i familiar c/c++ standard function declarations. i've seen this: int myfunction(char parameter) const the above hypothetical example , don't know if makes sense. i'm referring part after parameter. const. this? a more real example: wxgridcellcoordsarray getselectedcells() const this can found here text const doing @ end of line? the const keyword, when shown after function, guarantees function caller no member data variables altered. for instance given class, // in header class node { public: node(); void changevalue() const; ~node(); private: int value; }; // in .cpp void node::changevalue() const { this->value = 3; // error out because modifying member variables } there exception rule. if declare member data variable mutable, can altered regardless if function declared const. using mutable rare situation object declared constant, in practice has member data variables need option change. 1 potential example of use caching va...

java - How to stop console output for log4j ? Current code will output to file and console both -

in project intend have multiple log files , hence using categories. somehow getting output console well. have tried many options no success. want stop output console. file output should not affected. here configuration. #********************common configuration********************** log_path=./logs log_level_common=debug #********************logging configuration********************** #configure logging level engine_client log4j.category.engine_client_log=${log_level_common},engine_client log4j.appender.engine_client=org.apache.log4j.fileappender log4j.appender.engine_client.file=${log_path}/engineclient.log log4j.appender.engine_client.layout=org.apache.log4j.patternlayout log4j.appender.engine_client.layout.conversionpattern=%d{dd mmm yyyy hh:mm:ss,sss} %-5p %c{8} [%t] - %m%n here java code ... final static logger logger = logger.getlogger("engine_client"); propertyconfigurator.configure("./config/default.properties"); i've copy pasted ...

html - Attributing metadata to text -

i working on system generates content based on user's input. user input: first name: chris current state: helpless generated content: site chris , helpless . in order let user change first name or current state later on, need associate actual text in page input names so: this site <span class="first-name">chris</span> , <span class="current-state">helpless</span>. how can without using spans in example above? can't seem find html tag suitable this. edit: hard explain why can't use spans. unable use spans because using spans targets denote editable areas in page. using spans above purpose ends causing issues far complicated describe here. edit 2: (including code comments) the issue wrapping text nodes inside of <p> tags spans denote editable content. now, if put spans inside of of <p> tags (namely spans denote user inputs) end real bad results. it ends looking this: <p> <sp...

Jquery mobile javascript on another html not working -

so have 2 pages example page1.html , page2.html. there href link in page1 page2. seems javascript in page2.html ignored , not called. (tried document ready, body onload did not work) so jquery mobile accept javascripts on first page? how run javascript after page2.html called? new jquery mobile thanks. sample code on page2.html similar page 1: <meta name="viewport" content="width=device-width, user-scalable=no" /> <link rel="stylesheet" type="text/css" href="css/index.css" /> <link rel="stylesheet" href="css/jquery.mobile-1.3.1.min.css"> <script type="text/javascript" src="cordova-2.5.0.js"></script> <script type="text/javascript" charset="utf-8" src="js/imageresize.js"></script> <link rel="stylesheet" href="css/jquery.jcrop.min.css" type="text/css" /> ...

transactions - MySQL replication, auto_increment and rollbacks -

i have bunch of scripts perform transactional "simulations" against mysql slave replicant, rolled back. these simulations performed against slave, not affect performance of master database. i use auto_increment primary keys quite heavily throughout schema , i'm noticing rolling transactions, ids being lost , result on time ids in slave not match of master. i realise not rolling ids design, not temporarily disable feature (along replication) while simulations run, , turn feature on (along replication). or there better way of safely performing transactions on real time copy of mysql database?

c# - How to make HTML tag take effect automatically in mvc Razor View? -

i have following type of data stored in database field &lt;p&gt;sdf&#39;jsdfkl&#39;&#39;jksdl;fj/ sdfjklf&#39;&#39; hiee&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;dfgdgdgfgsd&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;fsfsfsf&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;dfsfsdff&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;img src=&quot;../scripts/tinymce/plugins/emoticons/img/smiley-cool.gif&quot; alt=&quot;&quot; /&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;hie text comes out texteditor.. &#39;sf&#39;fsfdfs&#39;df&#39;f&#39;&#39;&quot;&quot;&#39;&quot;sdfsfskfkf/lfdjklsfj\jslfjklff&lt;/p&gt...

r - How to set up line type in plot.xts? -

i have multiple (about 10) time series , want draw lines using plot.xts . don't know how set types of line, i.e., dashed line, solid line, etc., in function of plot.xts . have found discussions on color setting without findings on issue. can give me hint or directions? visual parameters of plot should know lwd - width of line lty - 1 = solid , 2 = dashed , 3 = dotted. if want draw multiple lines on same graph plot first 1 using plot , others using lines .

c# - lambda search in combined string -

here table data , areas cities ============================================================== area1 city1 , city2 , city3 , city4 area2 city5 , city6 , city7 , city8 area3 city9 , city10 , city11 , city12 area4 city13 , city14 , city15 , city16 if give value city1 , want area1 . (eg. city7 => area2 , city14 => area4) . there short way using lambra expression ? try code: yourdatatable.first(x => x.cities.split(',').any(y => y.trim() == "city1")) where search term string city 1

javascript - AngularJS push item to first or 0 index of $scope array -

please me implement function. have array of items in $scope . now, when click on add item button, want push new item first index or 0 index of array. in advance. :) here's working jsfiddle start with: http://jsfiddle.net/limeric29/7fh2e/ html: <div ng-controller="ctrl"> {{data}}<br/> <input type="button" ng-click="additem()" value="add item" /> </div> javascript: function ctrl($scope) { $scope.data = [ new string('item 5'), new string('item 4'), new string('item 3'), new string('item 2'), new string('item 1')]; $scope.additem = function () { var c = $scope.data.length + 1; var item = new string('item ' + c) $scope.data.push(item); }; } solved problem using splice() instead of push() , assigning array index insert. html: <div ng-controller="ctrl"> <pre>{{data}}</pre...

c - how to undo cvWarpPerspective -

Image
i found program change perspective, my question how can source image, , coordinates of red point draw in second image ? here's code : #include <opencv\cv.h> #include <opencv\highgui.h> int main(int argc, char** argv) { cvpoint2d32f srcquad[4], dstquad[4]; cvmat* warp_matrix = cvcreatemat(3,3,cv_32fc1); iplimage *src, *dst; src=cvloadimage("b.jpg",1) ; dst = cvcloneimage(src); dst->origin = src->origin; cvzero(dst); srcquad[0].x = 0; //src top left srcquad[0].y = 0; srcquad[1].x = src->width - 1; //src top right srcquad[1].y = 0; srcquad[2].x = 0; //src bottom left srcquad[2].y = src->height - 1; srcquad[3].x = src->width -1; //src bot right srcquad[3].y = src->height - 1; dstquad[0].x = src->width*0.05; //dst top left dstquad[0].y = src->height*0.33; dstquad[1].x = src->width*0.9; //dst top right dstquad[1].y = src->height*0.25; dstqua...

c# - How to monitor xml file for (add - edit - delete ) node(s) -

in solution have 2 projects (windows service , wpf mange service) , have sitting file (xml) service use ask : i want know when user make change in xml file out restart service , know xml node(s) has changed i have searched lot , found solution through filesystemwatcher listens file system change notifications , raises events when directory, or file in directory, changes. but how know xml node(s) has changed thanks i keep copy of original xml , run compare when filesystemwatcher triggers. have @ efficient algorithm comparing xml nodes suggestion on comparing xml nodes. file watcher example string folderlocation = system.configuration.configurationmanager.appsettings["folder_location"].tostring(); _watcher = new system.io.filesystemwatcher(); _watcher.path = folderlocation; _watcher.includesubdirectories = false; _watcher.notifyfilter = notifyfilters.size; _watcher.changed += new ...

Laravel 4 PHPUnit Sqlite Database, delete items before every test -

i have laravel 4 application sqlite db configured testing. i working in workbench package i have problem testing models in phpunit test, because defined unique properties on model. run artisan::call('migrate', array('--bench' => 'vendor/webshop')); basic test class extend other tests. i think runs database migrations, in opinion not delete models in database. because if public function setup() { parent::setup(); $this->order = order::create(array( "uniquekey" = "123" )); } i error saying, can not insert model because of violation of unique key rule. how should clean database before every test? you should define environment testing purposes. actually laravel have 1 - notice testing folder inside app/config . create app/config/testing/database.php (or modify if exists) , place this: return array( 'default' => 'sqlite', 'connections' => array...

c# - Online Quiz Application check selected Radio Button -

i developing online quiz..in use use 4 radio buttons. , bind answers in it..at time 1 ques ans displayed in page..by clicking next button next question ans bind in same fields...my problem user ans for every question..when user click previous button previous question answer bind.but radio button not in check..i want check radio buttons selected users.... my code next button bind is quesinsertbol bol = new quesinsertbol(); quesinsertbal bal = new quesinsertbal(); dt = bal.selectques(bol); viewstate["i"] = (int)viewstate["i"] - 1; int = convert.toint16(viewstate["i"]); int = 0; if (i >a) { if (dt != null || == dt.rows.count - 1) { lblquest.text = dt.rows[i]["question"].tostring(); rdbch1.text = dt.rows[i]["opt1"].tostring(); rdbch2.text = dt.rows[i]["opt2"].tostring(); rdbch3.text = dt.rows[i]["opt3"].tostring(); ...

android - Fragment crashes when resume to mainactivity -

i have main activity , 4 fragments.i using method ft.replace(r.id.listfragment, myfragment); switch between fragments in main activity. 1 of fragment (fragment a) contains list view , iam using array adapter fill data listview. problem is, when select "fragment a" visible , listview shown normal. when press home button , resume application app crashes. , error because of array adapter in "fragment a". providing logcat , "fragment a".thanks in advance.any appreciated... 07-24 14:00:12.695: e/androidruntime(25771): fatal exception: main 07-24 14:00:12.695: e/androidruntime(25771): java.lang.nullpointerexception 07-24 14:00:12.695: e/androidruntime(25771): @ android.widget.arrayadapter.init(arrayadapter.java:310) 07-24 14:00:12.695: e/androidruntime(25771): @ android.widget.arrayadapter.<init>(arrayadapter.java:128) 07-24 14:00:12.695: e/androidruntime(25771): @ com.glamzapp.saloon.appoinadapter.<init>(appoinadapter.java:47) 07-24 ...