Posts

Showing posts from April, 2015

video - Skipped Frames. Application may be doing too much work on it's main thread” error on android 4.3 nexus 7 -

import java.io.bufferedreader; public class main extends activity implements surfaceholder.callback, mediaplayer.oncompletionlistener, view.onclicklistener, oninitlistener { string srcpath = ""; mediaplayer mp; surfaceview msurfaceview; private surfaceholder holderrrr; boolean play = false; string t_alarm1 = "alarm.xml", t_alarm2 = "alarm2.xml", text; // texttospeach private texttospeech mtext2speech; @override protected void oncreate(bundle savedinstancestate) { strictmode.threadpolicy policy = new strictmode.threadpolicy.builder() .permitall().build(); strictmode.setthreadpolicy(policy); super.oncreate(savedinstancestate); setcontentview(r.layout.main); addlisteneronbutton(); mtext2speech = new texttospeech(main.this, main.this); } // menü @override public boolean oncreateoptionsmenu(menu menu) { // inflate m...

Does Jmeter record any file download/save files on my desktop? -

i have application report files (xls type) being generated. want download them first , want save them on desktop folder. is possible it? ...next time please try search across existent questions , answers first: jmeter - file upload , file download scenario how save file dynamic value in jmeter jmeter not recording download scenario

c# - Constant length for gridview -

recently came accross 1 issue. issue though not impacting process make gui if resolved. issue is...i have search screen on basis of search criteria records filtered displayed in gridview having itemtemplate defined. problem grid's length adjusting according number of records in grid. need have constant height of grid page length remains constant searches. height should increased when user wishes show more 10 records per page. please me problem. since requirement is: you have button " show more", when clicked displays next more 10 rows. one way use list of objects , call list<t>.getrange() method. can return required number of records using take(n) extension in linq , in case using already. had counttodisplay variable save current number of records display, intially set 0 (zero) getemployees method protected list<employee> getemployees(int counttodisplay) { list<employee> employees= new list<employee>(); // sample co...

visual studio 2010 - How to keep VS change history after saving? -

when 1 makes few changes code in visual studio, undoes of them ( ctrl + z ) , saves code ( ctrl + s ) whole change history point onward (all undone changes) lost - 1 can't redo these changes ( ctrl + y ). history point backward kept vs forward part of unknown reason dropped. any way keep whole history? use source control (or local source control on desktop if that's not feasible), , can roll backwards or forwards tons of changes, check in more often. with git example can check in every few minutes , able roll or forward individual lines or commits. they using vss here, i'm using git local undo/redo extensions. source control best way handle more lengthy change histories referring to.

cakephp - Poedit - what does "end-of-line within string" mean? -

when load catalogue file, following errormessage: 12:39:07: /var/folders/l_/10kq10v961s1hxrvldh2x85c0000gn/t/poedittghuhb/1input.po:7859: end-of-line within string 12:39:07: /applications/poedit.app/contents/macos/msgmerge: found 1 fatal error 12:39:07: katalogeinträge sind möglicherweise ungültig. 12:39:07: aktualisierung des kataloges fehlgeschlagen. klicken sie für weitere informationen auf 'details >>'. does know means? thx help! it means in file somewhere, have newline within quoted string -- error says. because don't provide other information, it's impossible more. p.s. there better places discuss poedit issues (be sure include all relevant information ).

javascript - Hiding a div on specific page with CSS -

i have wordpress page biult-in search function. results show in sidebar, , when link clicked, content of link shows in main content part. the problem when use site on small screens, 800px , down. when such screen used, sidebar shows under content (the search results still on top of page unless link clicked, since there no content then). however, when link clicked, hide sidebar, since search results no longer needed, "back" button provided on small screens instead. my question is, there way hide sidebar when user on specific page, in case page shows when search result clicked? have looked of css pseudo-selectors without getting anywhere. if not achievable via css, javascript fine. the page can found here: http://stilius.se/wilink/ and version performed search here: http://stilius.se/wilink/store/products/category/stockholm_nacka_tullen_ica/?cat=41 the <body> has different classes on different pages , in different conditions. can hide or show usi...

java - Display in a tabular format by merging two lists of unequal size in jstl -

sorry if question not clear. let me explain - have 2 lists, model.list1 & model.list2 of unequal sizes . however, still need display model.list2 in such way that, list elements appear under territory column. how merge these 2 lists? somehow need iterate list2 within block marked ** ** edit: can see, list 1 has 5 entries while list 2 has 3 entries. if iterate second list within first list, each iteration of list1, getting 3 territories (please see sec1). not want.. <table> <thead> **<tr>** <th>user</th> <th>title</th> <th>role</th> <th>territory</th> **</tr>** </thead> <tbody> <c:foreach items="${model.list1}" var="list"> <tr> <td>${list.name} </td> <td>${list.title} </td> <td>${list.role} </td> </tr> </c:foreach> <c:foreach items="${model.list2}" var="terr"> <td>...

c++ - Delete timer-queue timer -

i can't delete timer queue properly. following error: unhandled exception @ 0x77a915de in timer.exe: 0xc0000005: access violation reading location 0x00000020. i have simple timer callback function: void callback timerproc(void* lpparameter, boolean timerorwaitfired) { cout << "the timer working!" << endl; } and here main function create , delete timer: int main(int argc, char *argv[]) { handle htimer; // create timer createtimerqueuetimer( &htimer, // timer handler null, // default timerqueue (waitortimercallback)timerproc, // callback function 0, 0, (dword)2000, // period value = 2 seconds wt_executeintimerthread ); /...

objective c - Local Notification ios 6.0 and newer -

Image
i'm making alarm ios. wanted use local notification schedule , pass alarm sound. the current code like: uilocalnotification *localnotification = [[uilocalnotification alloc] init]; / [localnotification setfiredate:firedate]; [localnotification setalertaction:@"view"]; [localnotification setalertbody:[alertbodyfield text]]; [localnotification sethasaction: yes]; [localnotification setsoundname:@"sound.wav"]; [localnotification setapplicationiconbadgenumber:[[uiapplication sharedapplication] applicationiconbadgenumber]+1]; [[uiapplication sharedapplication] schedulelocalnotification:localnotification]; in ios 5.0 works well, want window appears in middle of screen buttons , remains there until there user interaction in ios 6.0 notification went top of screen , not allow existence of buttons. know change? this not possible via code. user can change way notification presented him/her. the default @ top of screen banner, alert style in ava...

Spring MVC 3: return a Spring-Data Page as JSON - issue with PagedResourcesAssembler -

so, i'm new spring , java in general what try have on same rendered view form post data filter result list displayed under form. i have simple domain class follows: @entity @table(name = "sec_person") public class person { @id @generatedvalue(strategy = generationtype.sequence, generator = "seq_sec_person") @sequencegenerator(name = "seq_sec_person", sequencename = "seq_sec_person") @column(name = "id") private long id; @column(name = "code", nullable = false) private string code; @column(name = "firstname", nullable = false) private string firstname; @column(name = "surname", nullable = false) private string surname; @column(name = "creationdate") private datetime creationdate; //getters , setters a dto because want domain decoupled presentation public class persondto { private long id; @notempty private string code; @notempty private string firstname; @notempty private...

xml parsing - Android Runtime exception : An error occur while executing doinbackground -

Image
i parsing online xml using xmlpullparserfactory , showing details in listview. have put condition checking internet, takes time fetch data , crashes.the code using below. private void runningabackprocess() { handler mhandler = new handler(looper.getmainlooper()); runnable myrunnable = new runnable() { public void run() { try{ //thread.sleep(5000); new dosometask().execute(); }catch(exception e){} // mypd_ring.dismiss(); } }; mhandler.post(myrunnable); } private class dosometask extends asynctask<void, void, void> { @override protected void doinbackground(void... arg0) { try { isinternetpresent = icd.isconnectingtointernet if(isinternetpresent){ url url = new url(...

Corona + objects are not cleared between levels despite removeSelf + set to nil -

i have multilevel game , objects stay 'empty' in memory between levels mean if set physics hybrid, when come again in level, (or level) shows box without picture. (and physics act on these empty boxes) in destroyscene have made sure myobj:removeself() myobj = nil and print message prove it. also in menu in enterscene, in case local prior_scene = storyboard.getprevious() storyboard.purgescene( prior_scene ) and tried storyboard.removeall() and storyboard.purgeonscenechange = true nothing works when go next level, or same level again, previous objects still here, don't it ok, it's gonna bit long here entire level. go through destroyscene somehow display objects not removed. -- scene5 ---------------------------------------------------------------------------------- local storyboard = require( "storyboard" ) local scene5 = storyboard.newscene() function scene5:createscene( event ) local group = self.view puppetjco...

.htaccess - Giving parameters to php with RewriteRule -

i need rewriterule call php file parameters specified in url entred ex : if url entered http://www.example.com/folder1/sub1 to make call go.php?p1=folder1&p2=sub1 try using rewriteengine on rewritebase / rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule (.*)?/(.*) /go.php?p1=$1&p2=$2 where rewritecond %{request_filename} !-f , !-d tell mod_rewrite apply rule paths not mapped existing files , directories. see official documentation .

temperature - Time proportional control -

i developing application time proportional control. know output proportional error. example, if setpoint 20 , proportional band 2, in case if actual temperature (at) 19, output 50%. however, can not figure out happens if @ higher 20? example if @ 21, output again 50%, not make sense.

jquery - Alternative to multiple if else statements in javascript -

my question similar reduce multiple if else statements i have multiple if else statements , i'd use jquery each function make code more efficient, can't figure out how it. i'm running jquery in wordpress believe runs in noconflict mode, can't lot of more (what consider) advanced topics give examples work me, can't understand right function syntax use. if , explain how me amazing. here code: var $h6p = $("h6 + p"); var $h5p = $("h5 + p"); var $h4p = $("h4 + p"); var $h3p = $("h3 + p"); var $h2p = $("h2 + p"); var $h1p = $("h1 + p"); var $fullercolor_bg = "rgba(240,234,222,0.9)"; if($h1p.mouseisover()) { $h1p.prev().css("background-color", $fullercolor_bg); } else { $h1p.prev().css("background-color", ""); } if($h2p.mouseisover()) { $h2p.prev().css("background-color", $fullercolor_bg); } else { $h2p.prev().css("background-colo...

Jersey matches regex pattern before the method type -

is possible define 2 methods in jersey same regex different type? ( get , put ..): @get @path("{key: .+}") @produces(mediatype.text_plain) public response root(string key) { } @put @path("{key: .+}") @consumes(mediatype.multipart_form_data) @produces(mediatype.text_plain) public response publish(string key, formdatamultipart data) { } the first method should reply key (with or without slashes) curl -x "http://localhost/key jersey respond 200 ok since went method curl -x "http://localhost/key/ jersey respond 200 ok since went method curl -x put -t file.txt "http://localhost/key jersey respond 200 ok since went put method curl -x put -t file.txt "http://localhost/key/ jersey respond 200 ok since went put method curl -x put -t file.txt "http://localhost/key/folder/folder jersey respond 405 method not found since went method instead of put (the respond 1 folder level 'key' expected jersey go directly put since suppose ch...

sorting - Merge files with sort -m and give error if files not pre-sorted? -

need out here. i have 2 files, file1.txt > 5555555555 1111111111 7777777777 file2.txt > 0000000000 8888888888 2222222222 4444444444 3333333333 when run, $ sort -m file1.txt file2.txt > file-c.txt output file-c.txt merged within file1 , file2 not sorted. file-c.txt > 0000000000 5555555555 1111111111 7777777777 8888888888 2222222222 4444444444 3333333333 when happens need error saying files (file1 , file2) not sorted , merge can't merge files before has been sorted. when run $ sort -m file1.txt file2.txt > file-c.txt have error saying cannot merge file1 , file2 file-c because not yet sorted. hope guys understand me :d if understand you're asking, this: diff1=$(diff <(cat file1.txt) <(sort file1.txt)) diff2=$(diff <(cat file2.txt) <(sort file2.txt)) if [ "$diff1" != "" ]; echo 'file1 not sorted' elif [ "$diff...

django how to create TemplateView instance with code -

i have function view,and want create templateview instance in function,such as def myview(request): #view =templateview(request) #view =templateview.as_view() #view =templateview.as_view()(request) return view but,all of them wrong. how create view? urls: mysite/widget1/ mysite/widget2/ mysite/widget3/ views: class basewidgettemplateview(templateview): pass class widget1view(basewidgettemplateview): pass class widget2view(basewidgettemplateview): pass class widget3view(basewidgettemplateview): pass the request pass function view , pass templateview diffent object type request pass function is module 'django.http.request and request in templateview is wsgirequest again, class based views page on django docs: (r'mysite/widget1/', widget1view.as_view()), (r'mysite/widget2/', widget2view.as_view()), (r'mysite/widget3/', widget2view.as_view()), this need define in urls.py file.

Azure SDK 2.0 installation on VS 2012 -

i have tried install windows azure sdk 2.0 on vs 2012 ultimate. have both vs 2010 , vs 2012 on widows 7 machine . getting below error web plat form log downloadmanager information: 0 : moving downloaded file 'c:\users\gowdes\appdata\local\temp\tmp8ff1.tmp' to: c:\users\gowdes\appdata\local\microsoft\web platform installer\installers\windowsazuretoolsonlyvs2012_2_0_baselocale\5abbb9f724a085d924844401579bc11ad8e16d73\windowsazuretools.vs110.exe downloadmanager information: 0 : downloading file 'http://download.microsoft.com/download/f/4/9/f49d8cf8-bcdb-4f3a-8b8a-8d00077d7df2/windowsazuretools.lightswitch.vs110.exe' to: c:\users\gowdes\appdata\local\temp\tmpdd28.tmp downloadmanager information: 0 : install exit code product 'windows azure emulator - 2.0' '0' downloadmanager information: 0 : install return code product 'windows azure emulator - 2.0' success downloadmanager information: 0 : product windows azure emulator - 2.0 done install com...

git - How can I checkout specific folder and its content from a specific commit to external folder? -

how retrieve complete subfolder git (version 1.7.0.4) repository local folder without checking out whole repo in first place? thought solution: git --work-tree=/home/tmp/testcheckout checkout commitid -- images/* example repo structure directories: /git/project1/sourcecode /git/project1/images /git/project1/howto /git/project1/readme.txt so example command should checkout files under /git/project1/images /home/tmp/testcheckout have been committed git repo commit commitid checks out files have been committed @ given commitid, ignoring other files have been committed before that. problem: command above files subfolder have been committed commitid. question : want retrieve files commitid. solution this? important : don't want clone whole repository (700gb) able retrieve 1gb of files later. there must way directly files out of repo without cloning whole repo. here working solution this. solution has following features: - not checkout whole repo, ch...

javascript - Unable to Move the List of values from Right Combo bx to Left Combo bx (Multiple List of values) -

function listbox_moveacross(sourceid, destid) { var src = document.getelementbyid(sourceid); var dest = document.getelementbyid(destid); var errcount = 0; (var count = 0; count < src.options.length; count++) { if (src.options[count].selected == true) { var option = src.options[count]; var newoption = document.createelement("option"); newoption.value = option.value; newoption.text = option.text; newoption.selected = true; try { dest.add(newoption, null); // standard src.remove(count, null); } catch (error) { dest.add(newoption); // ie src.remove(count); } count--; errcount++; } } if (errcount == 0) { alert("no element selected or have no element move"); } } hi can body on javascript given code moving list of values ri...

xml - Invoking libxml2 for XSD validation -

i using libxml2 c validate following xml document: <?xml version="1.0"?> <charms ver="0.02"> <header seqn="1184" type="bandwidth"/> <bandwidth band="2.130000" latency="12.234000" jitter="123.456078"/> <trailer method="md5" digest="838da77ca83abd70a13a18b82afb4820"/> </charms> and xsd file contains: <?xml version="1.0" encoding="utf-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/xmlschema"> <xs:element name="charms"> <xs:complextype> <xs:sequence> <xs:element name="header"> <xs:complextype> <xs:attribute name="seqn" type="xs:int"/> <xs:attribute name="type" use="required" type="xs:st...

python - Display pydoc's description as part of argparse '--help' -

i using argparse.argumentparser() in script, display pydoc description of script part of '--help' option of argparse. one possibly solution can use formatter_class or description attribute of argumentparser configure displaying of help. in case, need use 'pydoc' command internally fetch description. do have other ways (possibly elegant) it? you can retrieve docstring of script __doc__ global. add script's help, can set description argument of parser. """my python script script process file """ p = argparse.argumentparser(description=__doc__, formatter_class=argparse.rawdescriptionhelpformatter) p.add_argument('foo', help="name of file process") p.parse_args() then like: $ python tmp.py --help usage: tmp.py [-h] foo python script script process file positional arguments: foo name of file process optional arguments: -h, --help show message , exit ...

c# - sqlParameterCollection error -

i have definiton of procedure public int add_nastavenie(out int typnastav, int nastavid, string hod) { resetparameters(); cmd.commandtext = "add_nastav"; cmd.commandtype = commandtype.storedprocedure; sqlparameter sqlparameter; var sqlparameterout = new sqlparameter("@typnastav", sqldbtype.int); sqlparameterout.direction = parameterdirection.output; sqlparameter = new sqlparameter("@nastavenieid", sqldbtype.int); sqlparameter.direction = parameterdirection.input; sqlparameter.value = nastavid; cmd.parameters.add(sqlparameter); sqlparameter = new sqlparameter("@hodnota", sqldbtype.nvarchar, 100); sqlparameter.direction = parameterdirection.input; sqlparameter.value = hod; cmd.parameters.add(sqlparameter); var sqlparameterret = new sqlparameter("retvalue", sqldbtype.int); sqlparameterret.direction = parameterdirection.returnvalue; cmd.executenonquery(); t...

Adding values to existing cursor SQL Server -

is possible add values cursor exists? while processing (between begin , fetch next)?? edit 1: i have list of values in cursor. on doing logic , selecting few records.i need perform same logic on newly selected records may lead other new records , on. recursive drill down.

c# - Returning a validation error -

i have logincontroller . loginmodel able provide validation on string lengths , required fields. displayed fine in razor page. public class logincontroller : controller { public actionresult index() { return view(); } [httppost] public actionresult index(loginmodel model) { if (modelstate.isvalid) { if (membership.validateuser(model.username, model.password)) { formsauthentication.setauthcookie(model.username, model.notpublicpc); var url = formsauthentication.getredirecturl(model.username, model.notpublicpc); return redirect(url); } else { //here want throw own validation message or otherwise //give feedback login unsuccessful } } return view(); } } public class loginmodel { [required] [stringlength(50, minimumlength = 4)] public string username { g...

resteasy - JBoss REST with SIP Servlet - Class Not Found due java.lang.LinkageError -

i working on war module has run on jboss 7.1 sip (mobicent). my project structure: package: sip.multimediaconference -jaxrsactivator.java -multimediaconferenceimpl.java -servletsipmultimediaconfernece.java ... multimediaconferemcimple.java @path("multimediaconference") public class multimediaconferenceimpl implements multimediaconference { ... @get @path("/test") @produces(mediatype.text_plain) public string say() { return "hello jersey"; } ... via http://localhost:8080/conffirstconvert/rest/multimediaconference/test i should "hello jersey" displayed. instead of 2 errors: 15:37:56,523 info [org.jboss.resteasy.spi.resteasydeployment] (http-localhost/127.0.0.1:8080-1) deploying javax.ws.rs.core.application: class sip.multimediaconference.jaxrsactivator 15:37:56,525 warn [org.jboss.modules] (http-localhost/127.0.0.1:8080-1) failed define class sip.multimediaconference.multimediaconferenceimpl in module "deplo...

c++ - Serializing a derived class from an interface -

new: can use this, access.hpp? template<class archive, class t> inline void serialize_adl(archive &, t &, const unsigned int); this suggests can define different serialize takes object parameter. thus code change below work? i think question how add serialize method on interface class, invoke serialize method on derived sub-class. class interface { public: virtual void avirtual() = 0; private: friend class boost::serialization::access; template<class archive, class t> void serialize_adl(archive & ar, t & object, const unsigned int version) { // work????? ar & object; } }; template<class t> class derived : interface { public: derived(t in) : m_data(in) {} virtual void avirtual() { // } private: t m_data; friend class boost::serialization::access; template<class archive> void serialize(archive & ar, const unsigned int version) { ar & m_data; } }; ...