Posts

android - ImageSwitcher in fragment throws illegalstateexception but works in an activity -

my code works when in activity. however, decided change fragment, , throws illegalstateexception viewswitcher. can't figure out wrong. in summary, have images use placeholders. when upload image button clicked, fetches uri returned path , uses replace placeholder image in imageswitcher. here's code: private button buttonupload; private imageswitcher imageswitcher; private imagebutton imagebutton0; private imagebutton imagebutton1; private imagebutton imagebutton2; private imagebutton imagebutton3; private imagebutton imagebutton4; private arraylist<string> photoarray; int counter = 0; private static int load_image_results=1; private static int placeholder_image = r.drawable.placeholder_2; int[] imgs = {r.drawable.pic1, r.drawable.pic2, r.drawable.pic3,r.drawable.pic4,r.drawable.pic5}; @override public view oncreateview(layoutinflater inflater, viewgroup container,bundle savedinstancestate) { // todo auto-generated method stub view rootview = inflater.in...

How to put screen reader focus on colorbox popup with jQuery? -

for 508 purposes, need screen readers focus go color box popup. how can jquery? i need know code can put on on load of page make focus go colorbox when user clicks on link , opens. i put class on link within colorbox popup content , added tpl <script> (function($) { $(document).ready(function() { $('a.colorbox-load').click(function(event) { $(".colorbox-link").focus(); }) }) })(jquery); </script>

python - matplotlib figure inset whitespace -

Image
i'm making figure includes inset. cannot figure out how whitespace on removed. i've tried using tight_sublot() still leaves whitespace near inset i'd remove. suggestions? import numpy np mpl_toolkits.mplot3d import axes3d import matplotlib.pyplot plt import silicon2_data data = silicon2_data.out fig = plt.figure() ax = fig.add_subplot(111, projection='3d') temperature in data: xs = temperature[:,0] ys = temperature[:,1] zs = temperature[:,2] ax.scatter(xs, ys, zs) ax.set_zbound(0, 1.4) ax.set_xlabel(r'$2\theta$ (degrees)') ax.set_ylabel('temperature (k)') ax.set_zlabel(r'intensity ($10^5$cts/sec)') #inset ax2 = fig.add_axes([0.15, 0.62, 0.25, 0.25]) ax2.plot(data[3,:,0], data[3,:,2],'bo') ax2.plot(data[7,:,0], data[7,:,2],'rx') ax2.legend(('16k', '18k'), loc=0, fontsize ='small') ax2.set_ybound(0, 1.4) plt.tight_layout() plt.show() this i'm trying make: aft...

javascript - Doesn't work the onclick event in my Phonegap app -

my name borja , started programming phonegap , first issue related non-existent executing of .js files. index.html code : <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, user-scalable=no"> <link href="css/jquery.mobile-1.4.3.min.css" rel="stylesheet" type="text/css" /> <link rel="stylesheet" href="css/font-awesome.min.css" /> <link rel="stylesheet" href="css/jquerymobile.nativedroid.css" /> <link rel="stylesheet" href="css/jquerymobile.nativedroid.light.css" id='jqmndtheme' /> <link rel="stylesheet" href="css/jquerymobile.nativedroid.color.green.css" id='jqmndcolor' /> <link rel="stylesheet" href="css/custom.css" /> <script src="js/jquery-1.9.1.min.js"></script> ...

ios - enterprise provision vs ad hoc provision -

here situation: enterprise provision profile doesn't seem work on particular app. actually, seems work because starts quit after launch screen. have verify app work if use ad-hoc provision profile. have verify same enterprise provision profile works different apps well. i don't know info should put here :-( wondering maybe need include entitlement files enterprise provision not needed ad-hoc? === tks matt's suggestion. following error: dyld error message: library not loaded: @rpath/libswiftcore.dylib referenced from: /private/var/mobile/containers/bundle/application/90ef4c24-3bdb-4c14-9fe3-5b29ebf53b6b/mapview.app/mapview reason: no suitable image found. did find: /private/var/mobile/containers/bundle/application/90ef4c24-3bdb-4c14-9fe3-5b29ebf53b6b/mapview.app/frameworks/libswiftcore.dylib: mmap() error 1 @ address=0x100118000, size=0x0018c000 segment=__text in segment::map() mapping /private/var/mobile/containers/bundle/application/90ef...

preg_replace multiple strings between brackets (php/regex) -

i have string [test](test\\-test\\-abc) abcde\\- i have [test](test-test-abc) abcde\\- i need replace \\- - regex/preg_replace. need replace string between parenthesis. found solution replaces first occurance. $result = preg_replace("/(\[.*?\])(\(.*?)(\\\\-)(.*?\))/", '$1$2-$4', $str); you can use preg_replace_callback : $str = '[test](test\\\\-test\\\\-abc) abcde\\\\-'; $txt = preg_replace_callback('~\([^)]+\)~', function ($m) { return str_replace('\\\\-', '-', $m[0]); }, $str); echo $txt; //=> [test](test-test-abc) abcde\\-

javascript - jQuery Each Loop Not updating HTML in variable -

i have variable html stores html: <tr class="odd"> <td class="charge1">0</td> <td class="nc1">0</td> </tr> <tr class="even"> <td class="charge2">0</td> <td class="nc2">0</td> </tr> <tr class="odd"> <td class="charge3">250</td> <td class="nc3">0</td> </tr> basically need add values td class starting charge values td class starting nc , replace value in td class starting nc sum. values in both td 's in each row change, code needs dynamic. example, resulting hmtl in variable should be: <tr class="odd"> <td class="charge1">0</td> <td class="nc1">0</td> </tr> <tr class="even"> <td class="charge2">0</td> <td class="nc2"...