Posts

Showing posts from April, 2011

ios - How to set custom background color of UITableViewCell even there's no data inside -

Image
i want accomplish : see there's 1 data but, background color continue until end. i understand can inside tableview delegate of tableview:willdisplaycell:forrowatindexpath: . doesn't go empty cell, hence empty cell white. i used following code display cell alternative color if cell not initialized.i have done work on scrollviewdidscroll showing below:-- - (void)scrollviewdidscroll:(uiscrollview *)scrollview { uiview *view=[[uiview alloc] initwithframe:tblview.frame]; view.backgroundcolor=[uicolor greencolor]; uiview *cellview; int y=0; int i=0; (uiview *view in tblview.subviews) { if ([nsstringfromclass([view class]) isequaltostring:@"_uitableviewseparatorview"]) { cellview=[[uiview alloc] initwithframe:cgrectmake(0, y, 320, 44)]; if (i%2==0) { cellview.backgroundcolor=[uicolor redcolor]; }else{ cellview.backgroundcolor=[uicolor greencolor]; ...

How to release android update version of app for regular and pre-installed app -

recently released updated version of app, works good. first version pre-installed app, during update version released updated version problem on pre-installed app having traking id google analytics when released new version pre-installed version got override. there way release update version pre-installed app , need know how trackid. thanks in advance let's pre-release app has versioncode=1 . first version of deployed on google play app 1 . you've said, have 2 updates on , google play forced increment version number, let's 3. in conclusion, if user has pre installed app - version code 1. if updated market - have latest version number -3. or @ least two. the point can pretty sure @ moment of time, when published 2 updates, users, have version=1 users preisntalled app, while users version>1 users app market. considering this, can use app version number ga differentiate these users. does make sense?

c++ - Runtime error for double dimensional vector -

i have problem using double dimensional vectors. have declared double vector extern in header file , again (not extern) in main.cpp file before main() call. call upon function dynamically allocate memory double vector. given code gives no compilation error. @ runtime if access vector, gives vector subscript out of range exception. checked using debugger , found vector allocated memory in function, comes (out of function scope) vector size goes 0. have attached code color.h: #ifndef __color__ #define __color__ class color{ public : int r,g,b; color(void); color(int r, int g,int b); }; #endif color.cpp #include"color.h" #include <iostream> color::color(void){ r=g=b=0; } color::color(int r, int g,int b){ if(r<=1 && g<=1 && b<=1){ r=r;g=g;b=b; } else{ std::cout<<"error in rgb values"; } } header.h: #ifndef __header__ #define __header__ #include...

javascript - Mousenter and mouseout event to show border -

i have following html structure: <div> <p>name <img src="url" alt="image a"></p> <p>age <img src="url" alt="image b"> </p> <p><img src="url" alt="image c"></p> </div> when mousenter happens element in html, want show red border element mouse over. current code is: $("*").mouseenter( function(){ $(this).css("border","solid red"); }).mouseleave( function(){ $(this).css("border","none"); }); however when mouse enters image paragraph holds image comes border image a. want image have border. can suggest how can go doing this? working demo i think want hover on p , create borders on p $("div p").mouseenter( function () { ...

asp.net - getting checked checkbox out of grid -

i have checkboxes @ grid header row. i wanted find checkboxes clicked. my check boxes named : chk1 chk2 chk3 chk4 chk common , 1,2,3,4 gets increament per column. to checked box,i did following code: for integer = 0 gvsearch.columns.count - 1 if ctype(gvsearch.headerrow.findcontrol("chk"& i+1 ,checkbox).checked) 'some logic end if next but, ctype(gvsearch.headerrow.findcontrol("chk"& i+1 ,checkbox).checked) giving me error as: syntax error in cast operator;two arguments separated comma required. please me. your brackets placed incorrect ctype(gvsearch.headerrow.findcontrol("chk"& i+1),checkbox).checked

java - Extending classpath and Tomcat Plugin -

the project working @ moment standard web application , want start embedded tomcat (mvn tomcat7:run). within meta-inf/context.xml there entry <loader classname="org.apache.catalina.loader.virtualwebapploader" virtualclasspath="${home}/lib"/> to extend classpath of web application. when starting web application mvn tomcat7:run lot of classnotfoundexceptions, e.g. java.lang.classnotfoundexception: org.apache.catalina.deploy.servletdef are thrown. is there way embedded tomcat tomcat plugin work while extending classpath in context.xml? the answer problem set tomcat plugin use separate class loader maven. done setting useseparatetomcatclassloader parameter plugin true. can either done in tomcat plugin configuration: <plugin> <groupid>org.apache.tomcat.maven</groupid> <artifactid>tomcat7-maven-plugin</artifactid> <configuration> <contextreloadable>true</contextreloadable...

internet explorer - Force IE8 not to use compatibility mode, using MetaData in Theme not working -

as question title tells have problems forcing ie8 not use compatibility mode. i found 2 solutions on web 1 michael gollmick , wich adds code beforerenderresponse: if (context.getuseragent().isie()) { var response = facescontext.getexternalcontext().getresponse(); response.setheader("x-ua-compatible", "ie=8"); } this solution works fine compatibility mode button in browser disapears , page looks should. b ut don't want add code every xpage, tried solution per henrik lausten add metadata theme: <resources> <metadata> <httpequiv>x-ua-compatible</httpequiv> <content>ie=8</content> </metadata> </resources> but seems metadata in theme has no efect. when taking @ html source code found meta tag in header of sourcecode ie8 seems ignore it. <meta content="ie=8" http-equiv="x-ua-compatible"> so how can metadata theme working? or maby other solution automatica...

PyCUDA Complex Matrix Multiplication - C code vs Python code -

based on reading of pycuda documentation, samples , book on cuda kirk , hwu, have implemented cuda c-based complex matrix multiplication program , have written version in pycuda. c code produces correct results, python code doesn't. to clear, python code taken samples (matrixmultiled) , has been modified handle complex numbers using cucomplexfloat "cucomplex.h". before modification, correctly multiplying real-valued matrices. so can't figure out error. python code is # attempt matrix multiplication complex numbers import pycuda.autoinit pycuda import driver, compiler, gpuarray, tools import numpy np time import * kernel_code_template = """ #include <cucomplex.h> __global__ void matrixmulkernel(cufloatcomplex *a, cufloatcomplex *b, cufloatcomplex *c) { const uint wa = %(matrix_size)s; const uint wb = %(matrix_size)s; // block index const uint bx = blockidx.x; cons...

extjs - Sencha combo box display value issue -

when configure combo box have add following properties.i need send selected id end. displayfield : 'displayvlaue', valuefield : 'id', after setting these properties can send id end correctly. but when changed value in combo box, display value instead of name. need display name , need send value end other thing is, combo box placed inside grid column { xtype: 'gridcolumn', id: 'batchclass', minwidth: 150, width: 200, dataindex: 'batchclassid', text: 'batchclass', editor: { xtype: 'combobox', autorender: false, emptytext: 'select batch class', size: 40, displayfield: 'displayvlaue', store: 'allbatchclassstore', valuefield: 'id', valuenotfoundtext: 'refresh page , try again', listeners: { select: { fn: me.oncomboboxselect, scope: me ...

jsf - p:commandButton action throws javax.el.PropertyNotFoundException -

the error in: javax.el.propertynotfoundexception: /index.xhtml: property 'validar' not found on type fya.beanpages.indexbean its looks doesnt find validar method. , thinks attribute. this xhtml: <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.org/ui"> <h:head> <title>fya web</title> </h:head> <h:body> <ui:composition template="/base/base.xhtml"> <ui:param name="title" value="fya web login"/> <ui:define name="content"> <h:form id="form"> <p:panel ...

c# - Select distinct items with a specific field in an array -

i have 2 dimensional array ics .each row contains 3 fields category,name,description.i want distinct category array.i had tried this var cs = ics.distinct(t => t.category); but not working.can 1 give me hand on this? ics.select(t=>t.category).distinct()

Can Wordpress search an external website? -

can standard wordpress search or 1 of search plugins index (external wordpress) website? not inherently, create search engine, or easier embed google custom search . i haven't used plugin, cannot if works or - might place start. google custom search plugin

java ee - Dropdown with multiple option does not populate on iPAD -

i need solution how can fix multiple drop down ipad safari browser. have tried piece of code ... <select multiple="multiple" size="5" > <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> </select> .... it shows 0 items , not populating. normal dropdown without multiple works fine. which ios version safari running onto? if using jquery mobile, maybe may try example in documentation: http://jquerymobile.com/demos/1.2.1/docs/forms/selects/custom.html (go multiselect section).

caching - Pdf files are not getting updated after docusign -

we using embedded signing of docusign rest api e-sign files.to sign file, upload required file our web app , display viewer in browser. file can signed or later. what happening when file signed , process completed, return same file view updated file not reflected. when refresh page 3-4 times, shows sign on file. this issue comes files uploaded , signed later. fresh file uploaded , signed immediately, updated file view. it appears browsers cache files (not html page, embedded files). recommended solutions suggest either add parameter in request when file reloaded after signing- works intermittently. other rename file browser picks updated file. renaming file not option us. is there other alternative? have other docusign api users ever faced similar? (i believe issue not come if use email request mode e-signing) thanks. there have been no similar reports anyone... not discounting yours when write web app think of few things web app doing out of sequence see behavio...

python - CertificateError when trying to install packages on a virtualenv -

hey i'm trying install packages requires file on new virtual environment (2.7.4), keep running following error: certificateerror: hostname 'pypi.python.org' doesn't match either of '*.addvocate.com', 'addvocate.com' i cannot seem find helpful on error when search. going wrong here? in world addvocate.com , doing here? the issue being documented on python status site @ http://status.python.org/incidents/jj8d7xn41hr5

ubuntu - Email error message using crashmail with supervisor -

i have server supervisor running eventlistener, on event when process crashes, managed crashmail send email me. email content states "process adnode04 in group adnode04 exited unexpectedly (pid 1255) state running". i want crashmail able take content last 10-20 lines of log file , email me contents. able that? absolutely, have fork crashmail yourself. the message around line 112 . can use xml-rpc api call tailprocessstderrlog . so you'd add like: rpc = childutils.getrpcinterface( os.environ ) log = rpc.supervisor.tailprocessstderrlog( %(groupname):'%(processname)' % pheaders, 16000 ) msg += '\nlog:\n%s' % log['bytes'] the above simple proof-of-concept, untested , contains mistake. let me know how goes.

Rounding of double value VB.net -

when execute following code variable avg stores 78.8751432.. tot = val(txttot1.text) + val(txttot2.text) + val(txttot3.text) + val(txttot4.text) + val(txttot5.text) + val(txttot6.text) + val(txttot7.text) + val(txttot8.text) avg = tot / pcount lblcrtot.text = tot lblcravg.text = avg i need round of value 78.875 i tried out math.round(3, avg) didn't work. i need suggestions you need switch arguments math.round() math.round(tot, 3) http://msdn.microsoft.com/en-us/library/system.math.round.aspx

Parsing CUDA code with clang -

this question has answer here: compiling cuda clang 2 answers how compile cuda llvm ir? 1 answer i new clang. possible parse cuda code clang , emit llvm ir? don't find proper support on web. cuda has llvm compiler: https://developer.nvidia.com/cuda-llvm-compiler if want llvm compiler, can use it. if want use clang parse cuda code, think couldn't it.

php - doctrine2 select in from -

how query in doctrine 2 querybuilder: select avg(x.distance) avg_distance (select r.* result r r.place_id = ? group r.place_id order r.id desc limit 100 i try this: $dql = $qb ->select('r.*') ->from('corebundle:result', 'r') ->where('r.place = :place') ->orderby('r.id', 'desc') ->setmaxresults(100) ->setparameter('place', $place) ->getdql() ; $result = $qb ->select('avg(x.distance) avg_distance') ->from($dql, 'x') ->getquery() ->getarrayresult(); but not work select r.* from': error: class 'select' not defined. $sql = "select avg(x.distance) avg_distance (select r.* result r r.place_id = :place_id order r.id desc limit 100) x "; $stmt = $this->em->getconnection()->prepare($sql); $stmt->bindvalue(':place_id', $place...

.net - MessageBox inside paint event high CPU -

i have custom listview, , wanted debug inside ondrawsubitem function displayng messagebox. expected gui freezing trying repaint item. weird thing cpu goes 100% when click subitem (after messagebox). can explain in loop has fallen this? class listviewex : listview { public listviewex() { this.setstyle(controlstyles.allpaintinginwmpaint | controlstyles.optimizeddoublebuffer | controlstyles.resizeredraw, true); } protected override void ondrawcolumnheader(drawlistviewcolumnheadereventargs e) { e.drawdefault = true; } protected override void ondrawsubitem(drawlistviewsubitemeventargs e) { messagebox.show("test"); e.drawdefault = true; } } edit if same paint event of button have not high cpu (just repeated messagebox) private void btntest_paint(object sender, painteventargs e) { messagebox.show("test"); } i know it's not right display mbox inside paint events. i'...

sql - Unexpected output from using "create database" -

my current task create .bat file can manually create oracle database, database configuration assistant no longer necessary. i following this guide . i stuck @ "creating database". upon typing: sql> create database ora10 i not expected output described on guide: sql>create database ora10 logfile group 1 ('d:\oracle\databases\ora10\redo1.log') size 10m, group 2 ('d:\oracle\databases\ora10\redo2.log') size 10m, group 3 ('d:\oracle\databases\ora10\redo3.log') size 10m character set we8iso8859p1 national character set utf8 datafile 'd:\oracle\databases\ora10\system.dbf' size 50m autoextend on next 10m maxsize unlimited extent management local sysaux datafile 'd:\oracle\databases\ora10\sysaux.dbf' size 10m autoextend on next 10m maxsize unlimited undo tablespace undo datafile 'd:\oracle\database...

javascript - How to execute a undefined number of funcA() and funcB() before starting funcC()? -

i have app writed in javascript. work, need download bunch of files. since can have lot of file wich can long, made download asynchronous: function download_all(xml, callback){ var i=0; while(i<xml.smil.length) { download(xml.smil[i]); i=i+1; } i=0; while(i<xml.video.length) { download(xml.video[i]); i=i+1; } callback(xml); } my question is: download have callback, since there can 5 smil , 30 videos, how can make sure of download made before callback of download_all called? i thougth of incrementing variable after each complete download (in callback) , like while(smildlcompleted<xml.smil.length && videodlcompleted<xml.video.length) { sleep(1000); } like have in c, can t find sleep function , seems opposite rigth syntax of js/node.js. is there way wait download complete before callback? i did have @ how execute javascript function after multiple other functions have completed? ,...

apache - Godaddy Shared server gives 500 and 404 error while using .htaccess mod_rewrite -

this question has answer here: .htaccess mod_rewrite > 500 internal server error 7 answers getting error on godaddy shared hosting account: internal server error - 500 server encountered internal error or misconfiguration , unable complete request. please contact server administrator , inform them of time error occurred, , might have done may have caused error. more information error may available in server error log. apache server @ pp.mywebsite.com port 80 have these values in .htaccess` file rewriteengine on errordocument 404 http://pp.mywebsite.com/p1/sm/ errordocument 403 http://pp.mywebsite.com/p1/sma/ #rewritecond %{request_filename} !-d #rewritecond %{request_filename}\.php -f #rewriterule .* $0.php rewritecond %{request_filename} !-d rewritecond %{request_filename} !-f rewritecond %{request_filename} !-l rewriterule ^(.+)$ index.php?url=$1...

php - Refresh webpage at specific time while hiding it from the user -

i need refresh content of site @ specific time (hour:min:sec), don't want user know when refreshed. i don't want refresh page every 30 seconds. want reload content on specific date, including seconds, , don't let user know date. what options have? please use node.js or server side push model.i guess purpose. check ajax push model(reverse ajax)

ios - renderInContext image drawing with specified size -

how draw smaller image size of context without using cgaffinetransform? uigraphicsbeginimagecontext(size); cgcontextref context = uigraphicsgetcurrentcontext(); // center image cgcontexttranslatectm(context, placement.origin.x, placement.origin.y); [imageview.layer renderincontext:context]; the problem if imageview.image.size bigger size drawn centered, cut @ borders (bigger image drawing area). want image fit, decrease size of imageview.image.size . there way achieve using renderincontext ? via [imageview.layer renderincontext:context]; can't change size (or didn't find way). option so, create image drawimage (on requested size), allocate new uiimageview , draw layer. uiimage *resizedimage = [self createnewimagefrom:currentimage withsize:size]; uiimageview *imageview = [[uiimageview alloc] initwithimage:resizedimage]; // ... [imageview.layer renderincontext:context]; - (uiimage*)createnewimagefrom:(uiimage*)image withsize:(cgsize)size { uigraphicsbe...

retrieveduplicaterequest dynamic crm 2011 for a certain rule -

is possible retrieve duplicate entities detect duplication rules using retrieveduplicaterequest? for example, have 2 duplicate detection rules account: rule 1: based on exact match name rule 2: based on exact match mobile phone can query duplicates account that caused rule 1 only ? in results can other accounts exact same name, none of other accounts exact same mobile phone. i not aware of method achieve goal, because duplicate detection feature works different. the application not evaluate rules define directly. rules define fields , elements of them used create sort of hash. duplicate detection creates or uses hash determine if there similar or exact matches. not evaluate rules directly. based on hash, created whole record, unable rule(s) have led hash.

java - How can I get Play Google accounts? -

how can play google accounts? if use accountmanager manager = (accountmanager) getsystemservice(account_service); account[] list = manager.getaccounts(); it gives device accounts list. account lists not same. this how : http://developer.android.com/reference/com/google/android/gms/plus/plusclient.html#getaccountname() there documentation around setting up.

Neo4j Spatial 'WithinDistance' Cypher query returns empty while REST call returns data -

i have appears correctly configured spatial layer , index , can query node using findgeometrieswithindistance rest api call. post /db/data/ext/spatialplugin/graphdb/findgeometrieswithindistance {"layer":"geom","pointx":15.0,"pointy":60.0,"distanceinkm":100.0} however, when querying using cypher, no results (i have tried reversing order of 60.0 , 15.0 without luck): start n=node:geom('withindistance:[60.0, 15.0, 500.0]') return n; cyper returns: ==> +---+ ==> | n | ==> +---+ ==> +---+ ==> 0 row ==> ==> 13 ms rest: 200 ok ==> [ { ==> "paged_traverse" : "http://localhost:7474/db/data/node/14472/paged/traverse/{returntype}{?pagesize,leasetime}", ==> "outgoing_relationships" : "http://localhost:7474/db/data/node/14472/relationships/out", ==> "data" : { ==> "lon" : 15.2, ==> "bbox" : [ 15.2, 60....

java - How many Handlers I need when multithreading -

i have tried googling while couldn't found clear answer. have android software should listen multiple udp ports. if i'm not mistaken, have create own thread each port. after port receives data, should passed ui-thread. after research concluded should use handlers provide data ui-thread. however, i'm bit confused how many handlers i'd need. each thread require own handler or single shared 1 enough? for background info, i'm trying create timed threads check received udp-packets every 100ms , update contents ui-thread's views. i create handler on ui thread , pass handler reference each thread (so need 1 handler object). in way since handler created on ui thread, handlemessage executed on ui thread - careful each message processed through handlemessage executed fast.

Source for learning TDD -

i'm fascinated tdd. looked stuff on internet, saw video of uncle bob made bowling application , want go further. in normal jobs don't build bowling applications. build crud/data heavy applications. build in multiple layers etc.etc. does knows book, video, tutorial etc describes use, , dont's etc tdd in crud centered applications? one of best resources real-world tdd know james shore's free let's play tdd video series. let's play: test-driven development screencast series featuring java, test-driven development, , evolutionary design. chronicles development of real software project, warts , all.

java - Transitive project dependencies not found -

i have flat project hierarchy 4 projects. lets call them b,c,d,m , have following linear dependencies : b -> c -> m -> d -> = "depends on" projects b,c , m have build.gradle , settings.gradle. settings.gradle includeflat on dependent projects. in case of b includeflat('d', 'm', 'c'). build.gradle defines defines dependency project depends on. in case of b compile project('c'). if try build project b run problem after parsing b, gradle tries parse build.gradle of c , fails because can't find m. * went wrong: problem occurred evaluating project ':c'. > project path 'm' not found in project ':c'. i think relevant part of debug output is: included projects: [root project 'b', project ':c', project ':d', project ':m'] it seems gradle sorts include in alphabetical order, despite defined in other settings.gradle files , in build.gradle dependencies. when ...

sql - Oracle group orders by date and sum the total -

my orders table looks like: order_id (number) order_total (number) created_date (timestamp) status (varchar2) my goal set of rows each row represents orders on date, i'm trying group orders date , sum of order_total . i'm limiting results selecting orders last 30 days. to clarify, example if there 30 orders in last 30 days on unique days 30 rows in result. example: if there 10 orders on 30th july, , 1 order on 31st july i'm aiming 2 rows in result set, order_total summed 10 orders in first row, , second row of course have order_total of single order on 31st. my attempt far: select sum(order_total) total_amount, to_char(created_date, 'dd/mm/yyyy') grouped_date orders status = 'complete' , created_date >= (sysdate-30) group to_char(created_date, 'dd'), to_char(created_date, 'mm'), to_char(created_date, 'yyyy') order created_date asc this gives error: ora-00936: missing expression i ...

sql - query to get most matched likes first in mysql -

i have table like: user : uid | course_id | subjects --------------------------- 1 | 1 | html,php 2 | 1 | java,html,sql 3 | 1 | java 4 | 1 | fashion,html,php,sql,java i want run query can return liked subjects in query , second , on... for example : select * user subjects '%java%' or '%php%' or '%html%'; this query return data this: uid | course_id | subjects --------------------------- 2 | 1 | java,html,sql 3 | 1 | java 4 | 1 | fashion,html,php,sql,java but want output : uid | course_id | subjects --------------------------- 4 | 1 | fashion,html,php,sql,java 2 | 1 | java,html,sql 1 | 1 | html,php 3 | 1 | java so matched subjects 1st 2nd matched subjects , on.... there modification in query can type of sorted output. never, never, never store multiple values in 1 column! like see give headaches. ...

php - Autosuggestion works too slow -

i have more 100,000 records in books table, database mysql. creating autosuggestion using php. working slow. think because of bulk data. there solution searching data in effective manner , how can improve speed of searching process? here code: <?php $search=$_requet['searc']; $qry="select book_name books book_name '%$search'"; $result=mysql_query($qry); echo "<ul>"; while($rows=mysql_fetch_array($result)) { echo "<li>".$rows['book_name']."<li>; } echo "</ul>"; ?> apply indexing or can use fulltext indexing , search http://dev.mysql.com/doc/refman/5.0/en/fulltext-search.html

android - How to wait for ACTION_DELETE action in asnyctask -

i have following codes : private class uninstallapptask extends asynctask<string, string, string> { @override protected void onpreexecute() { toast.maketext(getapplicationcontext(), "starting ", toast.length_short).show(); } @override protected string doinbackground(string... strings) { uri uri = uri.fromparts("package", mapplist.get(position).getpackagename(), null); intent = new intent(intent.action_delete, uri); startactivityforresult(it, 2); return null; } @override protected void onpostexecute(string s) { thread t = new thread(mloadapploadandsortapplist); t.start(); } } @override protected void onactivityresult(int requestcode, int resultcode, intent data) { if (resultcode == result_ok) toast.maketext(getapplicationcontext(), "succesfull", toast.length_long).show(); } when called uninstallapptask, first writes "starting" ra...

c# - Cancel a static async function with a timeout -

i need cancel updatedatabase() function if takes more 2 minutes. 've tried cancellationtokens , timers couldn't manage solve (couldn't find appropriate example). could please me on this? app.xaml.cs protected override async void onlaunched(launchactivatedeventargs args) { await performdatafetch(); } internal async task performdatafetch() { await localstorage.updatedatabase(); } localstorage.cs public async static task<bool> updatedatabase() { await ..// download files await ..// check files await ..// run controles } edited classes according answers. app.xaml.cs stays same. updatedatabase() edited , new method runupdate() added in localstorage.cs : public static async task updatedatabase() { cancellationtokensource source = new cancellationtokensource(); source.cancelafter(timespan.fromseconds(30)); // how time has update process task<int> task = task.run(() => runupdate(source.token), source.token); awa...

PHP/MYSQL with google maps -

i need extract data mysql table , create markers displayed on google map. php code outputting xml <?php function parsetoxml($htmlstr) { $xmlstr=str_replace('<','&lt;',$htmlstr); $xmlstr=str_replace('>','&gt;',$xmlstr); $xmlstr=str_replace('"','&quot;',$xmlstr); $xmlstr=str_replace("'",'&#39;',$xmlstr); $xmlstr=str_replace("&",'&amp;',$xmlstr); return $xmlstr; } $connection=mysql_connect (localhost, $username, $password); if (!$connection) { die('not connected : ' . mysql_error()); } $db_selected = mysql_select_db('data1', $connection); if (!$db_selected) { die ('can\'t use db : ' . mysql_error()); } $query = "select * health_block"; $result = mysql_query($query); if (!$result) { die('invalid query: ' . mysql_error()); } header("content-type: text/xml...

sql - Compare to all columns -

is possible compare vector of values columns of table in sql, more in ms sql server? for example, have table, example, 3 columns: example: cola, colb, colc and want check if columns match specific vector: ('val0', 'val1', 'val2') i know can sentence this: select * example cola='val0' , colb = 'val1' , colc = 'val2' but i'd know if there function, allequal allow me like: select * example allequal('val0', 'val1', 'val2'); i understand if function exists syntax may quite different between different rdbmss , focused on ms sql server. nevertheless more happy if can give me examples in other databases managers. declare @foo table ( cola int, colb int ); insert @foo ( cola, colb ) values ( 1, 1 ), ( 1, 2 ), ( 2, 1 ); select * @foo; select * @foo intersect select * ( values ( 2, 1 ) ) bar( cola, colb );

android - Can't open database on 2nd user account, error EACCES (Permission denied) -

i have problems app of mine , galaxy nexus 10 multi user support. app has copy database, works fine when logged in first user of tablet, fails java.io.filenotfoundexception: /data/data/packagename/dbname.db: open failed: eacces (permission denied) when logged in second account. second account seems have no rights write /data/data... so, can done it? read of topics concerning problem, still no answer satisfies me. there folder can used share data between users?! the second account seems have no rights write /data/data... correct. so, can done it? i guessing hard-coded path. if so, not this. use getdatabasepath() find proper path database for current user . is there folder can used share data between users?! not aware of. external storage separate between users. in effect, separate user accounts on device if users on separate devices.

java - ThreadLocal and Memory usage -

threadlocal created have separate copy of objects operate on in threadsafe manner. this means number of objects in process increase number of threads. because, each thread create own copy of threadlocals. does not increase memory requirement of process ? you seem imply threadlocal s specific culprit increases memory usage, in fact question not particularly related threadlocal s per se . in situation describe, merely object have been allocated @ point , go unreacheable when thread dies @ latest.

angularjs - Initializing @attr in Angular directive -

i have directive this: can see equivalent plunker here http://plnkr.co/edit/0e2nmyatamd3m3qtctls app.directive('bptest', function() { return { restrict: 'a', templateurl: 'directivetemplate.html', scope: { bptype: '@' }, link: function($scope, $elem, $attrs) { console.log($scope, $elem, $attrs); $scope.bptype = $scope.bptype || 'text'; } // link function }; }); in directivetemplate.html: <div> {{ bptype }} </div> in index.html: <div bp-test bp-type="text"></div> <!-- results in <div>text</div> --> <div bp-test bp-type="number"></div> <!-- results in <div>number</div> --> <div bp-test></div> <!-- results in <div></div> ????? --> since initialize $scope.bptype = $scope.bptype || 'text' , expect third directive <div bp-test></div> display ...

linux - MySQL 'user'@'%' is not including 'user'@'localhost' -

i've seen other questions little different. i've created mysql user '%' , granted permissions. on mac , windows: i'm able login using this. mysql -u user -p<password> on linux fails invalid password 'user'@'localhost'. any idea why? hoping 'user'@'%' hosts including localhost behaving in mac , windows different on linux. i asked question myself while back. using % host when creating mysql user localhost special mysql, it's connection on named pipes or unix socket. using % host not include localhost.

sql - "database locked" error in ios while updating query -

i using below code to update query using sqlite . getting "database locked error" . tried searching link , suggested close database, did again getting same error. have mentioned getting error in code. const char *dbpath = [databasepath utf8string]; if (sqlite3_open(dbpath, &database) == sqlite_ok) { nsstring *locationno =null; nsstring *querysql = [nsstring stringwithformat:@"select count(*) code"]; const char *query_stmt = [querysql utf8string]; if (sqlite3_prepare_v2(database,query_stmt, -1, &statement, null) == sqlite_ok) { if (sqlite3_step(statement) == sqlite_row) { locationno = [[nsstring alloc] initwithutf8string:(const char *) sqlite3_column_text(statement, 0)]; int count= [locationno intvalue]; sqlite3_close(database); nslog(@"%@",locationno); if(0==count) { nsstring *insertsql = [nsstring stringwithformat:@...

hadoop - Pig Cross product reducer key -

when perform crossproduct operation (followed filtering) reducer sizes imbalanced, reducers writing 0 output , others taking several hours complete. basic example following code: crossproduct = cross tweets, clients; result = filter crossproduct text matches concat('.*', concat(keyword, '.*')); store result 'result' using pigstorage(' '); in case reducer key? this difficult question answer. cross implemented in pig join on synthetic keys. best resource understand cross programming pig - page 68 in example, cross like a = foreach tweets generate flatten(gfcross(0,2)), flatten(*); b = foreach clients generate flatten(gfcross(1,2)), flatten(*); c = cogroup ($0, $1), b ($0, $1); crossproduct = foreach c generate flatten(a), flatten(b); as explained in book, gfcross internal udf. first argument input number, , second argument total number of inputs. in example, udf generates records have schema of (int, int). field same first argument...

python - How to control test case run through an excel sheet? -

my question design problem. using python + selenium automation. pyunit unit framework used. have sheet in excel have 2 columns- testcaseid , run. testcaseid have testcase id in , run have either y or n signifying whether test case should runnable or not. trying read particular test case id sheet , see have it's run value, y or n. if y, test case executed unit framework else not run. here excerpt of test case have written: `class test_id_94017(unittest.testcase): ex = excel() def setup(self): self.ex.setupasheetinexcel('select_test_cases_to_run') if self.ex.gettestcaserunstatusfromexcel("94017") == "y": self.driver = browser().createbrowserdriver() self.driver.maximize_window() self.driver.implicitly_wait(15) self.ex.setupasheetinexcel('login') else: return def test_ccpd_regression001_per_custom_check(self): //do the definition gettestcaserunstatusfromexcel(testcaseid) method is...

google maps - Android SupportMapFragment did not create a view error -

im struggling figure out weird issue. in android app have fragment contains support map fragment. google maps works fine when gps turned on , fragment creates fine. when gps turned off app wont instantiate, crashes upon opening it. here stack trace: 07-31 22:35:47.905: e/androidruntime(32324): fatal exception: main 07-31 22:35:47.905: e/androidruntime(32324): android.view.inflateexception: binary xml file line #9: error inflating class fragment 07-31 22:35:47.905: e/androidruntime(32324): @ android.view.layoutinflater.createviewfromtag(layoutinflater.java:704) 07-31 22:35:47.905: e/androidruntime(32324): @ android.view.layoutinflater.rinflate(layoutinflater.java:746) 07-31 22:35:47.905: e/androidruntime(32324): @ android.view.layoutinflater.inflate(layoutinflater.java:489) 07-31 22:35:47.905: e/androidruntime(32324): @ android.view.layoutinflater.inflate(layoutinflater.java:396) 07-31 22:35:47.905: e/androidruntime(32324): @ au.net.gokart.fragments.trackinfofragm...

android - how to move to new fragment at on OnItemClickListener() -

in application want put listview in first fragment , want move new fragment when clicked on item such each item has own details in code. i implemented move activity, manager says must go fragment instead of other activity. i'm new fragment world , don't know how this. manager says can use list fragment have not found useful code. this code: public class mainactivity extends fragmentactivity { sectionspageradapter msectionspageradapter; static progressdialog pd ; viewpager mviewpager; list<fragment> fragments ; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); // create adapter return fragment each of 3 // primary sections of app. fragments = new vector<fragment>(); fragments.add(fragment.instantiate(this, fragmentone.class.getname())); fragments.add(fragment.instantiate(this, fragment...