Posts

Showing posts from May, 2014

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

GPSd library for C++ -

i have application needs check current location every (configurable between 5 seconds , 5 minutes), have been checking calling python script , parsing terminal output in c++, not best solution. i able communicate gpsd within c++ cannot seem find suitable library, there obvious missing or have find way around this? from the gpsd homepage : the gpsd distribution includes linkable c service library, a c++ wrapper class , , python module that developers of gpsd-aware applications can use encapsulate communication gpsd . so there's no separate project, gpsd source download contains library you're looking for.

android - static variable is null after initilization -

i have action bar activity 3 tabs. have main activity, post xml webservice , xml in asynctaskj.i'm initializing static variable of main activity in asnctask. main activity activity called, action bar initialized. each action bar has listfragment, use static variable. have no issue accessing static variable 2 list activities in first listfragment m not able access initialized static variable. please help, thanks in advance edit 1 my main activity submit.setonclicklistener(new onclicklistener() { @override public void onclick(view v) { generatexml gx=new generatexml(); string requestxml=gx.generatexml(tv1.gettext().tostring(),tv2.gettext().tostring(),tv3.gettext().tostring(),tv4.gettext().tostring()); mynewtask = new mytask(requestxml); mynewtask.execute(); intent intent=new intent(getapplicationcontext(),tabactivity.class); startactivity(intent); } }); in asynctask doinb

Umbraco 6 and building a one page site? -

for time i've been interested in building 1 page site loads content via ajax (allowing me fancy transitions between pages). i've been looking @ example here: http://hashbang.envoyat.com/the-umbraco-approach/ but wonder whether has achieved same thing using umbraco 6 or 4.10 ie. version using mvc. are there tutorials doing in v6? has managed this? i'm looking pointed in right direction.. thanks! i created singlepage website umbraco 6 , mvc. not differ normal website. created normal content tree , separate view every functional part of website. render al functionalities @ once , use html , javascript navigate. maybe can use lazy loading of have large website

How do I remove Dynamics CRM sitemap customizations? -

i've got managed plugin can install / uninstall microsoft dynamics crm. within plugin's customizations.xml have included small section of sitemap customizations, particularly additional group , added sidenav area. the issue i'm running into, however, sitemap customizations not removed when uninstall plugin. additional group remains part of sidenav area, though causes sitemap errors because necessary webresources uses missing (they removed during plugin uninstall). are there ways force sitemap revert default when uninstall plugin or possibly mark customizations specific plugin removed on uninstall? actually, according crm 2011 sdk documentation sitemap modification thas part of managed solution should automatically removed system when managed solution removed. quoted sdk doc: when solution packaged managed, sitemap xml compared original sitemap xml , other customizations made sitemap. differences included in managed solution. these differences i

asp.net mvc - Mvc 3: displaying viewmodel items in a view -

i have class this public class ameinvoice { public datetime invoicedate { get; set; } public string invoicenumber { get; set; } public string accountnumber { get; set; } public double amount { get; set; } public double amountdue { get; set; } } i have viewmodel this public class ameinvoiceviewmodel { public list<ameinvoice> ppinvoices { get; set; } public double otheramount { get; set; } public double totaldue { get; set; } } my action result method in controller public actionresult index () { .... .... .... list<ameinvoice> prideinvoices = new list<ameinvoice>(); while (reader.read())

javascript - My script not working in IE 10 and chrome -

i have below script works in ie10 compatibility mode , below fails in ie 10 , not work in chrome. can 1 please @ , let me know should change make work? i have group of dropdown lists gets values source , @ last have 2 dropdown select option .. when both of these selected using below create table row , dropdown boxes select default selected value .. happening is taking first option in dropdown list , making selected. $(document).ready(function () { var = 0; var hiddencounterid = $('input[id$="hiddencounter"]').attr('id'); var hiddeniduse = '#' + hiddencounterid; $('.maintable1').on('change', 'tr:last select', function () { var $tr = $(this).parent().parent(); if ($tr.find('select :first').val() !== 'select' && $tr.find('select :last').val() !== 'select') $tr.clone(true).find('select').each(function () { $(this).val('&

Drupal Site with Existing Data, properly setting up Git Repo on server to push local code -

i had issues pushing updates via ftploy, decided set git on client's dedicated host. installation went beautifully. created --bare repo in /public_html directory drupal files stored. set repo remote, , attempted push new updates it. unfortunately, did not work. appears if sent fine, not case. check site, , no changes apparent. could issue configuration, or missing steps in process set repo , have recognize local changes? because of --bare option, repository created handles history no actual source code. pushes update history, changes never reflected on source files: git isn't aware of them, uses .git folder. bare repositories used share changes source code, see this article more information. to deploy site git, delete .git folder created , drop --bare option when re-creating repository. may want local backup first. one last tip : .git folder git uses internally should not accessible web, might have prevent this. have @ this question solutions.

postgresql - Multiple rows in subquery -

i trying create context of exclusion zone in layer. i trying following map file/sql combo data "geom public.data" filter "layer = %layer_id% , st_contains(all(select the_geom public.exclusion_zone layer = %layer_id%), geom) != true" obviously breaks when there more 1 exclusion zone, how do this? i've tried storedproc's told mapserver can't find it's srid doesn't appear in geometry table the error receiving thus query error. error (error: more 1 row returned subquery used expression ) executing query try this: data "geom public.data" filter " layer = %layer_id% , not exists ( select * public.exclusion_zone layer = %layer_id% , st_contains(the_geom, geom) )

ios - How do I programmatically retrieve device's mac address on the same WIFI network -

this question has answer here: how can programmatically mac address of iphone 12 answers i read post how can programmatically mac address of iphone , still not sure if can devices other iphone connected same wifi network. can able list of ip address these devices on same wifi network, can retrieve every mac address each ip address ? you have sniff network it, read random packets header infomation. if don't want reinvent wheel, apps netstumbler , ethereal should able want (they both open source)

ruby on rails - How to test a random uniq values with rspec -

i have code: def self.generate_random_uniq_code code = sprintf("%06d", securerandom.random_number(999999)) code = self.generate_random_uniq_code if self.where(code: code).count > 0 code end the goal create random codes new register, code can't exist in registers i'm trying test way, when mock securerandom return same value: it "code unique" old_code = code.new old_code.code = 111111 new_code = code.new expect(securerandom).to receive(:random_number) {old_code.code} new_code.code = code.generate_random_uniq_code expect(new_code.code).to_not eq old_code.code end i trying find if there way enable , disable mock behavior, not find it, i'm not sure i'm doing test right way, code seems no work fine me. welcome, thanks! tl;dr generally, unless testing prng wrote, you're testing wrong behavior. consider behavior you're trying test, , examine alternatives. in addition, six-digit number doesn't have enou

php explode to get last integer from url -

i trying last integer in url using php explode gives last value after / dont know how last integer before / my url http://way2enjoy.com/touch/w2et/quotesalphalist.php?page=124/abcd i interested in getting 124 above url. i can last value abcd below explode code dont know how 124 $c=explode("/",$_server[ 'request_uri' ]); $city=end($c); please suggest how 124 integer above url.please note 124 ma y change number number , before last / $c = explode('=',$_server[ 'request_uri' ]); $result = explode('/', end($c)); echo $result[0];

php - Get global array of arrays from Jquery $.getJSON method to REUSE array -

okay after searching stack overflow answers found 2 threads , tried them both did not work me. assign data jquery getjson array how json array file getjson? my issues want work data database mapping utility, elements of json dissappear after call jquery method $.getjson(). can create them 'ul' element fine. cannot them push array of array's method have tried yet. asking here curious doing wrong. have thought may have traverse dom elements once populated maybe seems silly me , wondering if there easier way potentially. novice @ javascript , jquery understand programming concepts. the concepts using this: i have sql server 2008 database values: placeid placename 1 place 1 2 place 2 3 place 3 4 place 4 i can create php script 'sqlsrv' driver values , output echo json_encode($data); i can confirm can return data php script in iis locally. (with special jerry rigging have iis make php) i can call php script , display it&

Figuring out dependencies of a python package -

is there way figuring out dependencies of python package without installing it? currently can using following 2 commands: pip install <package> pip show <package> the last command lists out dependencies other metadata. cheers try checking this stack overflow post. along lines of looking for?

excel - Autofill with variable number of rows -

i trying automate monthly report in excel vba final autofill based on variable number of rows change monthly change in # of clients. example: if month have 25 clients, hardcode want create 25 rows of report. in next month when have 30 clients, code still 25 , therefore miss 5 clients. one solution trying work on count number of rows , apply autofill formula. trying find code read this: autofill range a1 c "number of rows in worksheet x." now know doesn't work, poor best attempt: sub fillreport() sheets("sheet1").select range("d1").select activecell.formular1c1 = "=counta(a:a)" sheets("sheet2").select range("a1:c1").select selection.autofill destination:=range("a1:c(sheets("sheet1").range("d1").select)") i didn't expect work wanted try anyway. can see quite vba novice... if has insight helpful feel there should way accomplish missing on own. thanks. i using range va

mysql - Return id where one of two fields matches a value, but only the field other than that vaue -

i have messages table has both to_id , from_id given message. i'd pass user_id query , have return non-duplicate list of id's, representing users has message to/from supplied user_id. what have right (using 12 target user_id) : select from_id, to_id messages from_id = 12 or to_id = 12 this return records user_id exists, i'm not sure how have return non-duplicates, , 1 field user_id not 12. in short, return id's of users user 12 has existing message record with. i hope have explained enough, have believe it's relatively simple have not learned yet. edit : i should have specified while current sql has 2 fields, want 1 field returned --- contact_id. , there should no duplicates. contact_id not field in messages table, field name i'd query return, regardless of whether returning from_id or to_id you can use union : select from_id contact_id messages to_id = 12 union select to_id messages from_id = 12 also, the documentati

c# - Close .netslclient data provider within function -

i have listview bound function called getamountstyles(). when function fired creates 44 sql connections. no matter try close sql connection, won't close. , how can close these connections? protected string getamountstyle() { //makes sql connection sqlconnection testdbconn = new sqlconnection(configurationmanager.connectionstrings["testdbconn"].connectionstring); //sqlcommand cmd = new sqlcommand(); testdbconn.open(); system.data.sqlclient.sqlcommand currallsessions = new system.data.sqlclient.sqlcommand("select username tenhrslogins union select username permlogins ", testdbconn); sqldatareader dr = currallsessions.executereader(); string login = convert.tostring(eval("login")); while (dr.read()) { //if (login.contains(dr.getvalue(0).tostring()) == true) if (login.contains(dr.getvalue(0).tostring()) == true) { dr.dispose(); return "background-color: #f

Problems printing a page with JavaScript -

i have function @ end of .asp page (yes, older asp). <script language="javascript"> window.print(); printpage(); function printpage() { if (confirm("the page printed correctly?")){ window.location.replace('other.asp'); } else{ window.print(); printpage(); } } </script> the problem apper when execute page , never appear print options window. shows confirm window every time press no button never shows print windows. sorry english if mistake ... thanks lot !!!! gustavo argentina.- window.print() executing asynchronously, it's calls printpage() function. , on , on, if press 'no'.

c# - Microsoft report viewer joining mulitiple tables -

i'm working on microsoft report viewer vs2012 , tried generate report 1 table , succeeded, if have query containing join on 2 or more table , in cases how generate report ? i did in project. should create dataset has query want, can procedura has join. after can drag fields dataset inside of report.

c# - LoginAsync missing -

i wrote android application uses azure perform user login google, twitter , facebook; uses microsoft.windowsazure.mobileservices.android.dll , i'm able like await client.loginasync(context, mobileserviceauthenticationprovider.google); (in azure set ids , secrets use google, facebook , twitter). now i'm developing windows app (desktop app) using windows 7 , vs2012 , framework 4.5 , i'd perform same login (so can authentication token , use query sql database); used nuget import microsoft.windowsazure.mobile package , see referenced both microsoft.windowsazure.mobile , microsoft.windowsazure.mobile.ext . when try use loginasync , similar syntax used in android missing. according link http://www.windowsazure.com/en-us/develop/mobile/how-to-guides/work-with-net-client-library/#caching in extension package there should extension method lets me use user = await client.loginasync(mobileserviceauthenticationprovider.google); but vs cannot see , cannot use it.

ruby on rails - Combining virtual attributes to single class attributes in super class (STI) -

i'm trying combine start_date , start hour , , start_minute virtual attributes event form, in order create start_datetime attribute (which stored in database). i have (via sti) several subclasses of event ; let's call them trainingsession , worksession , personaltime . classes structured such: class event < activerecord::base ... end class trainingsession < event ... end class worksession < event ... end class personaltime < event ... end the relevant parts of event.rb : class event < activerecord::base attr_accessor :start_date, :start_hour, :start_minute validates :start_datetime, :presence => true before_validation :merge_attributes_for_datetime_string def merge_attributes_for_datetime_string start_datetime_string = "#{ start_date } #{ start_hour }:#{ start_minute }:00" end def start_datetime=(start_datetime_string) self.start_datetime = start_datetime_string end def start_date start_d

java - Can't save instance state in android -

in app try save arraylist state putserializable method in onsaveinstancestate. , restore in oncreate , onrestoreinstancestate. in app if there no saved instance of object create internet data. time try test solution arraylist start downloading network. can me? public class activity extends sherlockactivity { listview listview; slidingmenu slidingmenu; arraylist<hashmap<string, string>> newslist = null; string url = "/////here_my_url////"; public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); getactionbar().setdisplayhomeasupenabled(true); getactionbar().settitle(r.string.news_vatican); listview = (listview) findviewbyid(r.id.newslist); slidingmenu = new slidingmenu(this); slidingmenu.setmode(slidingmenu.left); slidingmenu.settouchmodeabove(slidingmenu.touchmode_fullscreen); slidingmenu.setfadedegree(0.35f); slidingmenu.attachtoactivity(this, slidingmenu

node.js - How do I update node and npm on windows? -

i tried this : sudo npm cache clean -f sudo npm install -g n sudo n stable ...but didn't work. so, how do on windows? this new best way upgrade npm on windows . run powershell administrator set-executionpolicy unrestricted -scope currentuser -force npm install -g npm-windows-upgrade npm-windows-upgrade note: not run npm -g npm . instead use npm-windows-upgrade update npm going forward. if run nodejs installer, replace node version. upgrades npm in-place, node installed it. easy updating, update latest running npm-windows-upgrade -p -v latest . does not modify default path. does not change default global package location. allows easy upgrades , downgrades. officially recommended npm team . a list of versions matched between npm , node ( https://nodejs.org/en/download/releases/ ) - need download node installer , run update node ( https://nodejs.org/en/ )

java - How do I display what system.out.println() shows in the console, in an Android Application's activity? -

for example, have simple coin flip program display single line of text. after running program java project, console display "there 473 heads , 527 tails." don't mean displaying in logcat, displaying when using application. //basic coin flip statistics program. package com.company.practice; import java.util.random; public class coinflip { public static void main(string[] args){ system.out.println("toss coin 1000 times"); int heads = 0; int tails = 0; random r = new random(); for(int flips = 0; flips < 1000; flips++){ //change # after < set amount of flips. int side = r.nextint(2); if(side == 0) heads++; else tails++; } system.out.println("there " + heads + " heads , " + tails + " tails."); } } how display line of code @ bottom says, "system.out.println(...)" text in android application's activity? you'd display in ui atta

html - PHP Coding $ variable -

i want place html code inside $ variable. so, have "sidebar.html" file, has got various "{$test1}" "{$test2}" , on. i can't work out how add html code that. so in short, want have {$fleet} in first html file, , in php code, need like $fleet = <div class="sidebar-content"> <div class="sidebar-header">find fleet</div> <div class="sidebar-link"> <a href="./index.php?a=profile&u=obsidianfleet">obsidian fleet</a> <a href="./index.php?a=profile&u=startrekfreedom">star trek freedom</a> </div> <div class="sidebar-link"> </div> </div> } thanks in advance you should use nowdoc : $fleet = <<<'php_str' <div class="sidebar-content"> <div class="sidebar-header">find fleet</div> <div class="sidebar-link"> <a

asp.net - MVC model binding to nested collection -

i have class: public class clientinformation{ public string username {get; set;} public icollection<regiondistrictcity> regiondistrictcity { get; set; } public class regiondistrictcity { public string region { get; set; } public string district { get; set; } public string city { get; set; } } } how should formated name attribute of input elements properties region, distirct, city in html in order make model binder populate collection "icollection regiondistrictcity"? i tried have action method parameter of type "clientinformation" , html name attributes formated "[index].propertyname" in case property "username" binded. i tried have action method parameter name "client" , have html names attributes formated "client[index].propertyname" doesn't work. (in tha case if there "list client" populated) thanks. in mvc4 should use for loop

c# - Func parameter in LINQ expression -

i have problem func delegate in linq expression. problematic part of method (repository.items iqueryable<t>) : public static actionresult xxx<t>(irepository<t> repository, func<t, int> keyextractor, int id = 0) { if (id == 0) return ... t item = repository.items.where(x => keyextractor(x) == id). firstordefault(); if (item == null) return ... try { repository.deleteitem(item); return ... } catch (exception e) { return ... } } but when run method, error type of node not supported in linq entities. tried version predikate had no luck @ all. any ideas how fix it? i find out 1 possible way. linq performs delayed execution must first enforce execution this: t item = repository.items.asenumerable().where(x => keyextractor(x) == id) if want work on iqueryable<t> , argument must expression<func<t, int>> , not fun

c++ - What happens to a dynamic array (on the heap) within a struct on the stack? -

my concern whether or not array should deallocated. here example: typedef struct { int *values; int length; } a_struct; void foo() { a_struct mystruct; mystruct.values = new int[num]; delete[] mystruct.values; // needed? return; } my understanding mystruct (which on stack) deleted automatically upon "return" statement. delete "values" well? it deallocate the pointer values , not points to - after all, a_struct know assigned pointer? maybe it's pointer stuff allocated on stack, or array shared struct . so, yes, need manually deallocate (although in modern c++ "smart pointers" used manage memory).

What is the difference between `ix` and `at` in the Lens library of Haskell -

all know 1 works , other doesn't. context: have 1 data structure f contains data.map.map k s data structure s . goal build lens given f , k describe field in s . the difficulty key k may not present in map. that's fine function can wrap return in maybe. not propagate lens through maybe using at . after reading lot of stack overflow answers, came across this one . it turns out replacing at ix solved type problems if replaced (^.) (^?) . question: seems at , ix same thing, @ least regard map . both take key , give 'lens' value @ key. however, ix seems play nice function composition operator (.) . difference between two? off topic rant: i infix operators as next guy control.lens package seems have gone little overboard. new user having english names , key somewhere lower learning curve. due huge number of wrapper classes used in lens library particularly difficult dig through type signatures if don't know going on. code starting

ios - How to load UIImage to UICollectionView from an array of UIImage -

so after saving uiimage nsmutablearray imagepickercontroller want load images uicollectionview, cells not displaying though array isn't nil. - (void)imagepickercontroller:(uiimagepickercontroller *)picker didfinishpickingmediawithinfo:(nsdictionary *)info { uiimage *image = [info objectforkey:uiimagepickercontrolleroriginalimage]; [_imgs addobject:image]; [picker dismissmodalviewcontrolleranimated:yes]; [self.collectionview reloaddata]; nslog(@"%d", [_imgs count]); //[self viewdidload]; } - (uicollectionviewcell *)collectionview:(uicollectionview *)collectionview cellforitematindexpath:(nsindexpath *)indexpath { icon *icon = [collectionview dequeuereusablecellwithreuseidentifier:@"icon" forindexpath:indexpath]; uiimageview *recipeimageview = (uiimageview *)[icon viewwithtag:100]; recipeimageview.image = [uiimage imagenamed:[self.imgs objectatindex:indexpath.row]]; icon.image = (uiimage*)[self.imgs objectatind

javascript - How to Handle delays that made by multiple timeouts (containing ajax calls) -

consider have multiple (sometimes more 12) ajax calls calling every 2 seconds or more. data gathered through calls set ui contained elements (like progress bars). after have delay on scroll while timers working . delay natural, how can handle it? note: calls destinations services provides data minimum spent time. point makes scroll sad, using multiple settimeout() , setinterval() methods. more familiar work, see below code: function filldata(accessurl, name) { var add = accessurl; $.support.cors = true; if (add) { $.ajax({ type: 'get', url: accessurl, crossdomain: true, contenttype: 'application/json; charset=utf-8', datatype: 'json', success: function (data) { update(name, data); }, error: function (xhr, status, error

maven - how to add my external jar file to class path -

i new maven environment, need ones help. added external jar file (directoryhelper.jar) in lib folder below in pom.xml <dependency> <groupid>com.test.directoryhelper</groupid> <artifactid>directoryhelper</artifactid> <version>1.0</version> <scope>system</scope> <systempath>${basedir}/lib/directoryhelper.jar</systempath> </dependency> compilation successful, during run time getting java.lang.noclassdeffounderror. how add directoryhelper.jar class path. maven out of box come jar file (default packaging). jar file contains ( main ) artifacts of project. if take , run it, dependencies missing -- design. typically maven artifacts reused in combination pom @ point of use it's know dependencies are. edit: if you're using apks , installing them on phone, there may mechanisms deal dependencies, i'm answering merely maven standpoint. if want create jar

apache - HTTPS .htaccess Rewrite for parked domain -

i have 2 domain 'domain.in' , 'domain.com'. domain.in parked domain.com. have ssl domain.com need 1) if user visit www.domain.com should redirect https://www.domain.com 2) if user visit www.domain.in should use http. i know can done through '.htaccess' file. can 1 me issue ? enable mod_rewrite , .htaccess through httpd.conf , put code in .htaccess under document_root directory: options +followsymlinks -multiviews # turn mod_rewrite on rewriteengine on rewritebase / # updated code fix. rewritecond %{https} off rewritecond %{http_host} ^(www\.)?domain\.com$ [nc] rewriterule ^ https://%{http_host}%{request_uri} [r=301,l] rewritecond %{https} on rewritecond %{http_host} ^(www\.)?domain\.in$ [nc] rewriterule ^ http://%{http_host}%{request_uri} [r=301,l]

c++ - How to create XML file in blackberry 10 device document directory through cascade QML? -

i have xml data stored in qstring/qbytearray , want write xml data in new sample.xml file , save file in device document directory. anyone please guide me on this. thanks in advance. you can use qxmlstreamwriter . here can find official example reads device , writes out. modify allow read qstring/qbytearray appropriate construct if understand query correctly.

android - admob -> ad network mediation with adfonic -

i getting error while using adfonic in admob. getting following error. cannot find adapter class 'com.google.ads.mediation.adfonic.adfonicadapter'. did link ad network's mediation adapter? skipping ad network. detailed exception bellow. cannot find adapter class 'com.google.ads.mediation.adfonic.adfonicadapter'. did link ad network's mediation adapter? skipping ad network. following caught , handled: java.lang.classnotfoundexception: com.google.ads.mediation.adfonic.adfonicadapter @ java.lang.class.classforname(native method) @ java.lang.class.forname(class.java:217) @ java.lang.class.forname(class.java:172) @ com.google.ads.g.a(sourcefile:133) @ com.google.ads.i.run(sourcefile:116) @ android.os.handler.handlecallback(handler.java:615) @ android.os.handler.dispatchmessage(handler.java:92) @ android.os.looper.loop(looper.java:137) @ android.app.activitythread.main(a

rename - Creating a Javascript Variable with the Length of an Array -

in function need create new variable called "dorfx". x length of array variable go in. instance, produce variable called "dorf5" parameters specified in function "makeadorf". however, doesn't want work because name of variable isn't identified. from can tell, either need rename variable somehow or figure out how make work. this has simple answer, i'm pretty new programming , grateful if help. thanks. function guildrecruit(){ var price = math.floor((math.random()*100)+1) + (dorves.length*50); var recruit = prompt("hello there friend. recruit adventurer?"); if(recruit == "yes"){ var dorf(dorves.length) = new makeadorf("testificate","123"); dorf(dorves.length).push(dorf(dorves.length)); }else{ confirm("thank visiting dragon slayer guild."); } } i think little confused on how set code. guessing wrote, looks want function either: creat