Posts

Listview in Android while getting data from a server -

i trying populate data listview asynchronously i retrieving data server json response mainactivity.java public class mainactivity extends activity { // url make request private static string url="http://54.218.73.244:7002/"; listview yourlistview; list<item> yourdata = new arraylist<item>(); progressdialog progressdialog; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); yourlistview = (listview) findviewbyid(r.id.listviewid); //instantiating progressdialog oncreate method progressdialog=new progressdialog(mainactivity.this); new parsingasync().execute(); } private class parsingasync extends asynctask<void, void, void> { @override protected void onpreexecute() { // todo auto-generated method stub super.onpreexecute(); ...

jquery - selecting the id of a child element of a dynamically created link -

i trying select id of <li> element being created under dynamic element, <a> tag. cannot seem handle on id of <li> . closest i've got this: $("a li:first-child").attr('id'); but give id of first li, not 1 being clicked. here script, have truncated, because first part important: $.each(... $("#inventorydiv").append("<ul id='invlist'></ul>"); $("#invlist").append("<a href='javascript:void(0);' name='invlink'><li id='" + this.inventory_id + "'> ... and listener is: $("#inventorydiv").on('click','a',function(){ console.log($("a li:first-child").attr('id'); } any thoughts? $("#inventorydiv").on('click','a',function(){ console.log($(this).find('li').attr('id')); });

css - Remove a class property with a media query on a mobile first design? -

i have tab elements either display: inline or none depending if selected. eg: <div class="tab" style="display:inline;"></div> <div class="tab" style="display:none;"></div> then class in stylesheet overrides display property tabs shown in mobile devices: .tab { display: block !important; } my problem need prevent condition apply screen bigger 600px cannot use max-width queries. need override display: block !important min-width media query without applying other particular style. eg: @media screen , (min-width: 600px){ .tab { display: /*don't anything*/ !important; } } if mark selected tab class name class='selected' , can try way: html: <div class="tab selected">1</div> <div class="tab">2</div> <div class="tab">3</div> css: .tab { display: block; } @media screen , (min-width: 600px){ .tab { dis...

c# - How to convert PCM data to wav file? -

i have data in rawdata1 aray short array. have converted byte aray.then created wav file header , header , byte array data written in file. getting error "windows media player getting problem while playing file".can body me? public void save file { byte[] byte_array = new byte[rawdata1.length * 2]; (int = 0; < rawdata1.length; ++i) { //byte_array[2 * i] = getbyte1(rawdata1[i]); //byte_array[2 * + 1] = getbyte2(rawdata1[i]); byte_array[2 * i] = getbyte2(rawdata1[i]); byte_array[2 * + 1] = getbyte1(rawdata1[i]); } uint numsamples = 44100; ushort numchannels = 2; ushort samplelength = 1; // in bytes uint samplerate = 22050; storagefolder storagefolder = knownfolders.musiclibrary; storagefile file = await storagefolder.createfileasync("sample.wav", creationcollisionoption.generateuniquename); stream stre...

jQuery was not called error with Cached WCF -

i have spun wcf service jquery ajax call. error is "jquery182021375292306765914_1377272303506 not called" it works fine, until try add caching wcf, here .net code [operationcontract] [description("gets session list")] [webget(bodystyle = webmessagebodystyle.bare, requestformat = webmessageformat.json, responseformat = webmessageformat.json, uritemplate = "getsessionlist")] [aspnetcacheprofile("cachefor60seconds")] list<session> getsessionlist(); and web.config <caching> <outputcachesettings> <outputcacheprofiles> <add name="cachefor60seconds" duration="3600" varybyparam="none"/> </outputcacheprofiles> </outputcachesettings> </caching> i have aspnetcompatibilityenabled="true" and here js code var location = json.stringify(j$("#filter option:selected").val()); j$.ajax({ ...

c# - Specflow test results accessible from AfterScenario hook? -

is there way access test results (success/fail, maybe asserts, etc) specflow afterscenario hook? don't see anything, seems included. you can hold of test result peeking scenariocontext.current. there's testerror property may you. see wiki ( https://github.com/techtalk/specflow/wiki/scenariocontext ) more information.

java - Set focus to other jframe -

my question related java swing frame. have 2 jframe. jframe1 , jframe2. there jbutton in jframe 1 when user click jbutton want focus frame 2(frame 2 loaded in application.) without closing frame1. please this you can use window.tofront() bring current frame front: import java.awt.window; import java.awt.event.actionevent; import java.awt.event.actionlistener; import javax.swing.jbutton; import javax.swing.jframe; public class myframe extends jframe implements actionlistener { public myframe(string title) { super(title); setdefaultcloseoperation(exit_on_close); jbutton button = new jbutton("bring other myframe front"); button.addactionlistener(this); add(button); pack(); setvisible(true); } public static void main(string[] args) { new myframe("1"); new myframe("2"); } @override public void actionperformed(actionevent e) { (window win...