Posts

Showing posts from April, 2010

localhost - Port 80 is listening but i can't start apache(this is after i installed moodle for windows, before it was all fine) -

i installed xampp 1.7.7 5 months ago , working right after installed moodle windows 7 v2.5 , 4 days ago (when im using moodle, start , stop localhost server using windows webmatrix, , pack mysql, php , iisexpress installed). i've stopped moodle's server, when try start apache in xampp replies busy. ran netstat -a, , says port 80 it's listening. don't want use xampp service , don't want turn off webserver, because said i'm working moodle , needs internet connection , read may lose data choosing these actions. i'm not using skype btw, used once when working in moodle , moodle's localhost still works when start it, xampp's not. reason im using xampp im working wordpress. wordpress work if copy , paste folder in windows webmatrix, , use webmatrix both moodle , wordpress, or stupid. i don't know if clear enough, need cause need finish thesis. thanks lot!

sql - List all columns referenced in all procedures of all databases -

is there way can columns , tables referenced in stored procedures in databases in instance? output should be: database procedure table column -------- --------- ----- ------ this list you're after, won't if have such column references embedded in dynamic sql (and may not find references rely on deferred name resolution). sql server doesn't parse text of stored procedure come dmv output. try collate clauses deal cases have databases on same server different collations. declare @sql nvarchar(max) = n''; select @sql += n'union select [database] = ''' + replace(name, '''', '''''') + ''', [procedure] = quotename(s.name) + ''.'' + quotename(p.name) collate latin1_general_ci_ai, [table] = quotename(referenced_schema_name) + ''.'' + quotename(referenced_entity_name) collate latin1_ge

assembly - storing a value into a data segment in MIPS -

hello brand new using mips , confused on wording, simple cannot find in notes or online question. here code: .data val1: .word 1 val2: .word 2 val3: .word 3 .asciiz "daniel" .asciiz "enter number " .asciiz "\n" .globl main .text main: addi $s0, $0, 23 # initializes register $s0 23 lui $a0, 0x1001 ori $a0, $a0, 19 ori $v0, $0, 4 syscall addi $v0, $0, 5 syscall addi $s1, $v0, 0 my question is: how a. store value in $s1 data segment labeled “val1” ?? know how store register not value please , thank you! la $t0, val1 sw $s1, 0($t0) $t0 chosen arbitrarily, doesn't matter register choose use hold base address of val1 array. la (load address) pseudo operation make sure able use first.

sql - Why does autovacuum: VACUUM ANALYZE (to prevent wraparound) run? -

i have autovacuum vacuum analyze query running on table, , takes many hours, couple of days finish. know postgres runs autovacuum jobs perform cleanup , maintenance tasks, , it's necessary. however, tables have vacuum, not vacuum analyze. why specific table require vacuum analyze, , how can resolve issue of taking long? on separate note, did not notice vacuum analyze query running before few days ago. when attempting create index, , failed prematurely saying ran out of open files (or that). contribute vacuum analyze running long? i think vacuum analyze red herring. table came due both vacuum , analyze @ same time, doing vacuum analyze, doubt analyze contributing problem @ all. i wonder if "vacuum (to prevent wrap around)" ever finishing, or if getting interrupted part way through , therefore restarting without ever making real progress. inspection of log files should clarify (as clarify thing running out of open files about). also, based on size of

c++ - Get the type of a function parameter with boost::hana -

i know how type of function's parameter old way, wondering if there nice new way hana? example, want this: struct foo { int func(float); }; auto getfunctype(auto t) -> declval<decltype(t)::type>()::func(type?) {} getfuntype(type_c<foo>); // should equal type_c<float> or similar how type here? edit 6/21/2016 - minor changes match current version of library (0.4). i'm author of callabletraits, library mentioned above @ildjarn (although not yet included in boost). arg_at_t metafunction best way know parameter type member function, function, function pointer, function reference, or function object/lambda. please keep in mind library undergoing significant changes, , linked documentation outdated (i.e. use @ own risk). if use it, recommend cloning develop branch . feature seeking, api not change. for member function pointers, arg_at_t<0, mem_fn_ptr> aliases equivalent of decltype(*this) , account implicit this pointer. so, c

java - Root immediate child nodes icons not visible when hiding root -

i have jtree structure shown below. have icons appear whenever node has child nodes, working properly. my problem need hide root node. when hide root node, icons maintop1 , maintop2 nodes not displayed, though have children. hide root node i'm using "setrootvisible(false)". also when root node hidden, icons topic1 , topic nodes displayed properly. anyone knows how display icons maintop1 , maintop2 when root hidden? in advance. below tree structure: root maintop1 topic1 subtopic1 subtopic2 maintop2 topic2 subtopic1 jtree#setshowsroothandles(boolean newvalue) controls state of handles root elements. normally, false . try changing true

debugging - Weird behavior of asp.net mvc application. -

Image
in asp.net mvc application, have call 1 user defined function. whenever page refreshed, function called. problem, first time, runs perfect. when refresh, have put breakpoint, goes , down repeatedly. that means, debugger goes line1, run more 1 time, goes second line, goes third line, goes first line, , on. have attached photos below. developing applications in mvc4. first image first time run. in second image, line connection.open() runs 3 times. happens every line. debugger goes , down abruptly. don't know wrong this. can explain this? thank you. it's because of multiple threads running simultaneously. use vs extension limit debugger hit on 1 of threads : https://visualstudiogallery.msdn.microsoft.com/54ef0f07-ed1d-4b89-b4ae-6506b196f843

r - Restructuring a large data matrix -

i have matrix of 187,727 observations of 27 variables. each row consists of species name , trait measurements associated name. there uneven observations each species. i'd make reviewing matrix easier. initial thought create loop identified number of unique species names, identify how many entries there species, shift on data list of information grouped under each species name. call each set of species information review separately. unfortunately, i've come roadblock in understanding of how this. here how far managed get: traits <- list() for(i in 1:length(unique(data.traits$accspeciesname))){ name <- data.traits$accspeciesname[i] for(j in 1:sum(data.traits$accspeciesname %in% data.traits$accspeciesname[name])){ traits[i,j] <- data.traits[j,] } } to see how user 42 suggesting solve this, try looking @ ?split divides data frames or matrices based on grouping factor f provide. here's small example: data(iris) myl

java - JAXB List as top level XML -

update: tried suggested here , seemed have progress api on engineered intended purpose , ran out of time, switched hard coding "student-list" in string response of /student call more enough proof of concept needed for. i working on simple rest service uses xml work student records. when on /student get: <?xml version="1.0" encoding="utf-8" standalone="yes"?> <students> <student> <grade>b</grade> <name>jane</name> </student> ... </students> however, output be: <?xml version="1.0" encoding="utf-8" standalone="yes"?> <student-list> <student> <grade>b</grade> <name>jane</name> </student> ... </student-list> here student.java snippet: @xmlrootelement(name = "student") public class student { private string name; private stri

Multi word search in PHP/MySQL -

i'm struggling create search searches multiple words. first attempt yielded no results whatsoever , follows: require_once('database_conn.php'); if($_post){ $explodedsearch = explode (" ", $_post['quicksearch']); foreach($explodedsearch $search){ $query = "select * jobseeker forename '%$search%' or surname '%$search%' order userid limit 5"; $result = mysql_query($query); } while($userdata=mysql_fetch_array($result)){ $forename=$userdata['forename']; $surname=$userdata['surname']; $profpic=$userdata['profilepicture']; $location=$userdata['location']; echo "<div class=\"result\"> <img class=\"quickimage\" src=\"" . $profpic. "\" width=\"45\" height=\"45\"/> <p class=\"quickname\">" . $forename . " &qu

sql - mysql procedure order by clause conditional -

good day, how make sql code below conditional 1 changing asc or desc value: order inventory_quantity.product_color_name desc i've tried case statement got error order case product_color_name_sort when product_color_name_sort = 'asc' inventory_quantity.product_color_name end asc also tried if statement still error order inventory_quantity.product_color_name if(product_color_name_sort = 'asc', 'asc', 'desc') is possible? procedure code delimiter // create definer=`root`@`localhost` procedure `stocks_quantities`( in `depot_id` int, in `qa` int, in `product_dimension_id` int, in `product_color_id` int, in `product_unit_name` int, in `product_status_id` int, in `product_name_sort` varchar(10) charset utf8, in `product_color_name_sort` varchar(10) charset utf8, in `product_dimension_name_sort` varchar(10) charset utf8, in `i_limit` int, in `i_offset` int ) no

c++ - How come a Qt mouseReleaseEvent won't fire? -

so, have custom qlabel class i'm using button. when label clicked, background color changes red green. on mouse release event, background goes red. however, if add slot widget's "clicked" signal, mouse release event appears never fired. label stays green. @ moment, have when label clicked, qmessagebox displayed. yet, after messagebox closed, label stays green. tried connecting it's focusoutevent same slot turned background red, yet it's still not working. how can button revert red background after mouse released? hope makes sense. ideas? #include "ubtn.h" qstring sty = "ubtn{background:red;}"; qstring styd = "ubtn{background:green;}"; qwidget *obj; ubtn::ubtn(qwidget *parent) : qlabel(parent) { this->setstylesheet(sty); connect(this, signal(onblur(bool)), slot(defaultbtn())); } void ubtn::defaultbtn() { this->setstylesheet(sty); this->repaint(); } void ubtn::downbtn() { this->setstyl

java - get value jtextfield from another class to actionperformed method -

i have 2 class, 1 swing , main class, 1 actionperformed method //class swing package system; import javax.swing.*; import java.awt.event.*; public class gui{ jframe frame = new jframe("frame"); jtextfield tx = new jtextfield(10); jbutton bt = new jbutton("button"); public void gettx(){ return tx.gettext(); } public void init(){ frame.setsize(200, 200); frame.add(tx); frame.add(bt); tx.setbounds(20, 20, 140, 50); bt.setbounds(20, 100, 120, 40); btaddcom.addactionlistener(new actionlistener(){ @override public void actionperformed(actionevent e){ control.btclicked(e); } }); } public gui(){ init(); } public static void main(string[] args) { java.awt.eventqueue.invokelater(new runnable(){ public void run() { new gui().frame.setvisible(true); } }); } } below other class package system; import java.awt;

php - How to Store the Parsed Values in Data base? -

i parsed matches page: $html = file_get_html('http://www.espncricinfo.com/rankings/content/current/page/211271.html'); $es = $html->find('table td[class=left]'); if print values: echo "matches: $es[37]"; its working fine: matches: 48 i want store value in data base: update table set column1=($es[37]) column2='123'; its not working. if data type int storing '0' , if data type varchar , storing table td[class=left] . how can store this?? you should use outertext value of td. what want is: update table set column1=($es[37]->outertext) column2='123'; you can see example of in http://simplehtmldom.sourceforge.net/manual.htm under "how access html element's attributes?" "tips". what you're doing accessing whole object , want value of text in html element (that's outertext comes in). in instances might want go further in php , convert string integer, think mysql i

java - Android Studio pass variable -

how pass double variable java class class in android studio , second class don´t extends appactivity .can use intent ?? intent messaging object can use request action app components. since other java class not activity , should try getters/setters instead of thinking of intent

javascript - Load Clicked Id's Website in iframe on Click for Website in Database -

current website: enter image description here i have website generated loop call database using php & mysql. have id, names, company website, address , image. displays name, description, , image displayed in stacked square boxes. on click of box, i'm trying load iframe of company website overlays box. have been able of website iframes load when load site, if there more 5-6 rows of data, site loads slow because it's loading ~7 websites. i've spent of day looking through jquery , iframe questions still have not been able iframes load on click individually when click on box. intention have user click on description/company box not iframe. load iframe , have appear on company box fills/hides content in box overlaying box content. how load website onclick opened within iframe without loading of iframes inside dynamically generated page. <?php require_once('include/header.php')?> <? require('include/navigation.php') ?>

java - hamcrest core, why need this? -

i using junit tdd in java , noticed there 2 components download junit.org. first of all, thought need junit component , downloaded, installed. when compiled , tried run test, complaining hamcrest classes not found. had download 1 again homepage. so, out of curiosity, why heck need 2 downloads 1 purpose usage beginning? know why hamcrest core separate junit, though used junit? thanks, javabug junit uses hamcrest. in past junit embedding hamcrest classes lead problems, projects evolving in different cycles. in recent junit versions (if i'm not wrong, since 4.11) has been changed , hamcrest not embedded. if add junit dependency project (maven, gradle, etc) implicit dependency hamcrest. i believe issue on hamcrest somehow related splitting. https://github.com/hamcrest/javahamcrest/issues/92

elasticsearch - Getting Sentiments Using Elastic Search -

i have big dataset of negative/positive/neutral sentiments in different languages. have 1 php api (based on naive bayes algorithm) sentiments based on give dataset. there 2 issues :- 1) extremely slow 2) not working non english languages such chinese , vietnamese i looking solution in elastic search because es @ language handling , can handle huge dataset , can use inbuilt tokenizers of es. is there way implement sentiment engine based on naive bayes algorithm in elastic search?

selenium webdriver - TypeError: WebElementCondition did not resolve to a WebElement: [object Object] -

Image
issue: in particular webpage want wait particular element , perform operation on element. code used: //official webapp url browser.driver.get('http://ubet-feature-qa.opal.dnb.com'); // variable particular element var usernamedisplayedonhomepagefield = element(by.css('[ng-if="authsrv.getusername()"]')); //function wait element , return element availability this.isloggedin = function(){ browser.driver.wait(protractor.until.elementisvisible(usernamedisplayedonhomepagefield)); return usernamedisplayedonhomepagefield.isdisplayed(); }; expected result: should return element availability either true or false actual result: getting below error message, not sure why this.. typeerror: webelementcondition did not resolve webelement: [object object] screenshot a selenium condition cannot resolve protractor elementfinder . you use protractor.expectedconditions instead of protractor.until cond

CF7 Wordpress Message Popup error -

i have form showing the requested content cannot loaded. please try again later. popup when submitted. not have clue causing error. new wordpress. everything seems perfect. using cf7 response message popup plugin.

java - saving blob into DB using spring - hibernate -

my entity class : @entity @table (name = "rs_production_dump") public class proddumpblob implements serializable{ /** * serial version id. */ private static final long serialversionuid = -3395282616292841663l; @column(name = "report_name") protected string reportname; @column(name = "report") protected blob report; @column(name = "mime_type") protected string mimetype ; /* getters & setters*/ } and dao layer method saving blob follows: public void saveproddumpblob(proddumpblob produmpblob, fileinputstream fis, long filelength){ try { loggerutil.infoapplicationlog(".... inside saveproddumpblob ...." + sessionfactory); session session = this.sessionfactory.getcurrentsession(); blob blob1 = hibernate.getlobcreator(session).createblob(fis,filelength); produmpblob.setreport(blob1); session.save(produmpblob); loggeruti

How to put Progress dialog in seperate class and call in every activity in android? -

i have progress dialog in every activity , in every activity write code progress dialog different message want.is there way put progress dialog code in seperate class , call class in activity want show progress dialog. here code progress dialog:- progressdialog m_dialog = new progressdialog(cloginscreen.this); m_dialog.setmessage("please wait while logging..."); m_dialog.setprogressstyle(progressdialog.style_spinner); m_dialog.setcancelable(false); m_dialog.show(); you can define class encapsulate operation , maybe other involving dialogs. use class static methods, this: public class dialogsutils { public static progressdialog showprogressdialog(context context, string message){ progressdialog m_dialog = new progressdialog(context); m_dialog.setmessage(message); m_dialog.setprogressstyle(progressdialog.style_spinner); m_dialog.setcancelable(false); m_dialog.show(); r

mysql - day difference between today's date and a specified date in SQL -

how find day difference between today's date , specified date in sql. specified date column(p.subscrpenddate__c) in date time format(12/1/2014 12:00 am). have used below query not works datediff(day,getdate(), p.subscrpenddate__c) 'subscriptionduedate' in mysql, datediff function, takes 2 arguments: end date , start date: datediff(now(), p.subscrpenddate__c) 'subscriptionduedate' according manual: datediff(expr1, expr2) returns expr1 − expr2 expressed value in days 1 date other. also, current date , time have use now() instead of getdate .

How to capture the output of one shell script into other in unix -

i running 1 shell script run_sftp.sh output either "done" or "failed" , calling script script execute command if run_sftp.sh output "done" if [ output(run_sftp.sh) = 'done' ] echo "run" else "stop running" fi this algorithm. please suggest. like this? retval=$(path/to/run_sftp.sh) now have done/failed in var retval . can if check logic.

c# - ASP.NET Core HTTPRequestMessage returns strange JSON message -

i working asp.net core rc2 , running strange results. have mvc controller following function: public httpresponsemessage tunnel() { var message = new httpresponsemessage(httpstatuscode.ok); message.content = new stringcontent("blablabla", encoding.utf8); message.content.headers.contenttype = new system.net.http.headers.mediatypeheadervalue("text/plain"); message.headers.cachecontrol = new system.net.http.headers.cachecontrolheadervalue { nocache = true }; return message; } if call postman accept header set text plain response: { "version": { "major": 1, "minor": 1, "build": -1, "revision": -1, "majorrevision": -1, "minorrevision": -1 }, "content": { "headers": [ { "key": "content-type", "value": [ "text/plain" ] }

javascript - Need dotnet regex to replace an underscore (_) with 0% -

we have card being scanned in has zzzz_ss16 printed on card , scans zzzz0%ss16 . users registering cards wrong number due misprint. card reprint great isn't option. i have javascript regex should job having trouble translating work dotnet. s/^(\w{4}).(\w{4})/\10%\1/ we need first 4 characters, replace _ 0% , followed last 4 characters. hope can assist. in case can use ^(\w{4})_(\w{4})$ and replace $10%$2 regex demo for .net use this var pattern = "^([a-za-z0-9_]{4})_([a-za-z0-9_]{4})$"; var template = "zzzz_ss16"; var replacewith = "${1}0%$2"; ideone demo

javascript - Difference between decorators and mixins in react -

i beginner react , finding myself confused between mixin , decorators. can elaborate? thanks. they both extend and/or override methods of react component. used share common functionality between components, in places extending class not work , not intended. an example purerendermixin, overrides shouldcomponentupdate method , compares props of component decide, if rerender should executed. however, mixins deprecated , not work es6 syntax of react anymore. options either use inheritance or decorators achieve same result. example here example of (kind of) purerendermixin, using decorator. used immutable.js. // pure.js import react 'react'; import assign 'object-assign'; import {is} 'immutable'; /** * pure render decorator * @param props * @returns {function()} */ export default (...props) => (component) => class purecomponent extends react.component { shouldcomponentupdate(nextprops) { if (!props.length) {

Eclipse Scout Neon unit test of execChangedMasterValue -

i have 2 fields connected master-slave relationship : public class slave extends abstractlistbox<string> { @override protected class<? extends ivaluefield> getconfiguredmasterfield() { return master.class; } @override protected void execchangedmastervalue(final object newmastervalue) { this.function() // -> here put debugging break point } } public class master extends abstractbooleanfield { @override protected void execchangedvalue() { super.execchangedvalue(); // -> break point 2 } } i write unit test relationship, inside unit test execchangedmastervalue never called. my unit test looks : @test public void test() { this.box.getmaster.setvalue(true) assert.assertfalse(... function slave ...) } unit tests failed, , if put breakpoints described above, debugger stops on second break point never on first one. in "real" world, function called , works should. is there reason execchangedmastervalue

java - Server closes TCP connection via FIN, ACK and RST immediatelly after establishing it -

on mac os x 10.8 machine have tomcat 7.0.40 server , client, both running locally. via 3-way-handshake tcp connection established, followed fin, ack , rst server. client receives "end of file server", or "connection reset". tcp sequence: client syn server syn, ack client ack server [tcp window update] ack server fin, ack client ack server [tcp dup ack] ack client /myurl/... server rst details - client , server both run locally - first request fails. following requests succeed. - no firewall in on - maxfiles increased, in vain what causes server closes socket? appreciate tips , ideas. edit: tomcat's log has following stack traces: fine: error parsing http request header java.net.socketexception: invalid argument @ java.net.socketinputstream.socketread0(native method) @ java.net.socketinputstream.read(socketinputstream.java:150) @ java.net.socketinputstream.read(socketinputstream.java:121) @ org.apache.coyote.h

javascript - Is it possible to get the xml_id from JS code in Odoo? -

i trying specific menuitem , store in variable in javascript: var menus = new openerp.web.model('ir.ui.menu'); now, can apply filter menus menuitem, example, name, thing there lot of menuitems same name. think attribute identifies menuitem , differences other xml id. but not know how javascript code. there built function obtain it? how can manage purpose? well, have found workaround. may there better solution, in case, please, post it. in database, there table named ir_model_data . table stores xml ids, under column name . columns model , res_id indicate model xml id record stored , id. there column named module , can used put before xml id extracted (column name ), module_name.xml_id notation. for example: i have record ir.ui.menu model id 303, , want xml id javascript: var menus = new openerp.web.model('ir.model.data'); menus.query(['name']).filter(['&', ['model', '=', 'ir.ui.menu'], ['res

Swift iOS: Firebase Paging -

Image
i have firebase data: i want query posts data through pagination. code converting js code swift code let postsref = self.rootdatabasereference.child("development/posts") postsref.queryorderedbychild("createdat").querystartingatvalue((page - 1) * count).querylimitedtofirst(uint(count)).observesingleeventoftype(.value, withblock: { snapshot in .... }) when accessing, data page: 1, count: 1 . can data "posts.a" when try access page: 2, count: 1 returns still "posts.a" what missing here? assuming or using childbyautoid() when pushing data firebase, can use queryorderedbykey() order data chronologically. doc here . the unique key based on timestamp, list items automatically ordered chronologically. to start on specific key, have append query querystartingatvalue(_:) . sample usage: var count = numberofitemsperpage var query ref.queryorderedbykey() if startkey != nil { query = query.querystartingatvalue(st

node.js - Need help in using mysql with nodejs -

hi have installed mysql nodejs in windows machine. default username , password this. , how see databases available? there phpmyadmin see dbs , tables in node? didn't explanation googling. please help? do want gui ? if yes use mysql gui tool here can download windows http://mysql-gui-tools.softpedia.com/

android - "can't find referenced class" with Proguard and Kotlin -

i having strange problem proguard , kotlin. gradually converting proguarded project kotlin - went fine far getting proguard errors when converting classes. not yet isolate special property of these classes breaks - seems no different other ones. example inputstreamwithsource just: package org.ligi.passandroid.model import java.io.inputstream class inputstreamwithsource(val source: string, val inputstream: inputstream) and works in ide - can deploy device - ui tests running fine. when trying assemblerelease project getting proguard errors not understand: warning: org.ligi.passandroid.ui.fileunzipcontrollerspec: can't find referenced class org.ligi.passandroid.model.inputstreamwithsource warning: org.ligi.passandroid.ui.fileunzipcontrollerspec: can't find referenced class org.ligi.passandroid.model.inputstreamwithsource warning: org.ligi.passandroid.ui.inputstreamprovider: can't find referenced class org.ligi.passandroid.model.inputstreamwithsource warning: org.li

excel - Comparing contents of two spreadsheets -

i have coped contents of 2 different spreadsheets 1 document – need compare results of 2 sheets (4 columns in each) in first group of 4 columns there 3 entries 17th may , in second group of 4 there 4 entries – patricia nightingale missing. is feasible write script highlights discrepancies in either sets? (ideally compare units) this quite long spreadsheets (i have coipied first 4 columns - d , second columns f - i) i not sure if possible if me? name date units service user alicia haines 17 may 2016 1.00 albert nightingale alicia haines 17 may 2016 0.50 eve reed alicia haines 17 may 2016 0.75 raymond watson (private) alicia haines 18 may 2016 0.50 albert nightingale alicia haines 18 may 2016 3.00 david poole alicia haines 18 may 2016 0.25 eve reed candidate date service user visit (mins) alicia haines 17 may 2016 albert nightingale 60 alicia haines 17 may 2016 eve reed

.net - Cannot disable proxy caching -

i've got c# web client application uses restsharp library access third party web service. in environments has work via proxy. i'm using webproxy framework class provide proxy details , works fine. except 1 edge case. the proxy (squid in case) configured require credentials. if code sends request with webproxy credentials , after (less minute) (exactly same in case) request without credentials, nevertheless receive ok response instead of 407 (authentication required) error. i've tried multiple suggestions found here , in other internet resources: using cachepolicy nocachenostore defining "cache deny all" in squid calling "deleteurlcacheentry" of wininet.dll providing random timestamp parameter make request url unique adding cache control headers request to no avail. i'm pretty sure restsharp not blame able trace execution inside library point uses underlying .net apis. restsharp respects both proxy , caching policy settings , pas

html - PHP File Serving using X-Sendfile -

i'm building website file serving script. script allows website deliver pdf, mp3 , mp4 files . pdf , mp3 files working. clicking on play video, i'im expecting video file play it's not. video controls have been disabled , unable play. files.php <?php error_reporting(e_all); $fid = $_get['fid']; $ftype = $_get['ftype']; // e.g. audios, videos, ebooks $fcat = isset($_get['cat']) ? $_get['cat'] . '/' : ''; // e.g. lessons, more $fext = ''; $fmime = ''; switch ($ftype) { case 'ebooks': $fext = '.pdf'; $fmime = 'application/pdf'; break; case 'audios': $fext = '.mp3'; $fmime = 'audio/mp3'; break; default: $fext = '.mp4'; $fmime = 'video/mp4'; break; } // example: audios/lessons/audio1.mp3 $file = $ftype . '/' . $fcat . str_replace('s', '&

android - Maintain the scroll position of a listview after getting new data -

i have listview after refreshing , getting new data. goes top of listview , not last scrolled to. i have set timer after 2 seconds, gets new data , puts listview. any appreciated. in advance :d here mainactivity @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); listview = (listview) findviewbyid(r.id.listview); listview.setonitemclicklistener(this); getjson(); handler.postdelayed(runnable, 3500); } private runnable runnable = new runnable() { @override public void run() { getjson(); handler.postdelayed(this, 2000); } }; private void showemployee(){ jsonobject jsonobject = null; arraylist<hashmap<string,string>> list = new arraylist<hashmap<string, string>>(); try { jsonobject = new jsonobject(json_string); jsonarray result = jsonobject.getjsonarray(config.tag_json_array);