Posts

Showing posts from July, 2011

Forbidden location when using alias in nginx for relative urls -

i trying set roundcube / phpldapadmin / ... nginx on relative urls, e.g.: example.com/roundcube example.com/phpldapadmin first of all, working fine apache 2.4. have following folders: # roundcube /var/www/roundcube # phpldapadmin /usr/share/phpldapadmin i have following location roundcube : location /roundcube/ { root /var/www; index index.php; location ~ \.php$ { try_files $uri =404; include /etc/nginx/fastcgi_params; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; fastcgi_param script_filename $document_root$fastcgi_script_name; } } which works fine, following phpldapadmin not work: location /phpldapadmin/ { alias /usr/share/phpldapadmin/htdocs; index index.php index.html index.htm; location ~ \.php$ { try_files $uri =404; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; include /etc/nginx/fastcgi_params; fastcgi_para

Android notifications on background service -

i'm developing app shows notifications recursively. user can define how want receive notifications , background service controls recursive handler time know when send notifications. the problem when android's memory manager destroys service when deems necessary , application stops sending notifications. how can send notifications background service , avoid android's memory manager destroys it? idea? you can use startforeground() mark service important system. you can set flag if killing service disruptive user, such if service performing background music playback, user notice if music stopped playing.

python - How to speed up a .py script refering to millions of files? -

i have 2.5m files process .py script. i'm using super calculator problem not power, python process open , close every time , loosing time. i'm using loop every files in folder want convert script. ${line} refers file every line referring every files of folder. is there way process files after opening .py script instead of looping python script? there loop code : ### loop ### while : pythonsh ${ramdisk}/script.py -l ${ramdisk}/${line}.pdb -u '' -a hydrogens done exit the python script tool convert .pdb .pdbqt files i've found autodocktools comes autodock4. i modified script, adding -i commandline option. this let specify text file containing ligand filenames (one per line) , process them without restarting python. you should able call as pythonsh ./newscript.py -i ./list_of_files.txt -u '' -a hydrogens note: untested! should work given, cautious! #!/usr/bin/env python # # # # $header: /opt/cvs/python/packages/share1.5/au

OptaPlanner + Drools - how to create specific rule -

i'm working on kind of "employee rostering" application. i'm using optaplanner , ability work drools. i have 3 classes: employee , shift , shiftassignment . shift class has property called length means how many hours shift lasts. as can figure out, shiftassignment @planningentity class has properties of employee , shift types. shiftassignment class has method returns shift lenght. employee @planningvariable . i have rule checks if every single employee has worked @ least 160 hours in total. problem have no idea how implement such rule in drools. can please me , provide me such rule? grateful.

symfony - Pre-filling form data -

i have form using symfony2. here excerpt: $comment = new comment(); $form = $this->createformbuilder($comment) ->add('user_id', 'hidden') ->add('node_id', 'hidden') ->add('comment', 'textarea', [ 'attr' => [ 'style' => 'width:100%; background-color:inherit; color:white;', 'rows' => '5' ] ]) ->add('save', 'submit', ['label' => 'send']) ->getform(); (note, these of fields, keep short. then prefill of data in form. $form->get('user_id')->setdata($user_id); $form->get('node_id')->setdata($video->getid()); but when load page, , fill out comment field , submit, error user_id , node_id haven't been filled out. what should these? how should render them? can render them these preset values? well, stupid of me,

android - How to have a textview transition to the title in a collapsing toolbar? -

Image
i have collapsingtoolbarlayout contains textview , ratingbar under textview . possible have textview somehow transition title? my current layout looks this: i want "title" transition toolbar collapses. there button, how ensure textview transitions proper place (to right side of button)? edit: here xml <android.support.design.widget.coordinatorlayout android:id="@+id/main_content" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:fitssystemwindows="true"> <android.support.design.widget.appbarlayout android:layout_width="match_parent" android:layout_height="@dimen/detail_view_app_bar_height" android:fitssystemwindows="true" android:theme="@style/themeoverlay.appcompat.dark.actionbar"> <an

ruby - Reading a line from a text file, splitting the string version of that line into two parts -

newbie learning ruby. i trying take txt file , on each line take first 3 characters , assign them key, , rest of string that's keys value. f = file.open("textfile.txt", "r") finalhash = {"key" => "data"} linestring = "" while f.gets != nil linestring = f.gets part1 = linestring.slice(0, 2) part2 = linestring.slice(3, linestring.length) finalhash[:part1] = part2 end puts finalhash any advice appreciated! the 2nd parameter of slice length, not end-index, change: part1 = linestring.slice(0, 2) to: part1 = linestring.slice(0, 3) if passed start index , length, returns substring containing length characters starting @ index also don't need second parameter here (this not bug though): part2 = linestring.slice(3, linestring.length) this enough: part2 = linestring.slice(3)

javascript - Jquery if statement based on input values -

i'm making simple form , i'm having trouble getting want. on form submission need detect if multiple inputs of category have values greater 0 (because 1 should selected). here's html of form <form onsubmit="calctime();"> <table> <tr> <p>how long task take perform? (choose one)</p></tr> <tr> <p> <input type="text" style="width: 3em;" id="seconds">&nbsp; seconds (enter integer 1-60) <input type="text" style="width: 3em;" id="minutes">&nbsp; minutes (enter integer 1-60) </p> </tr> <br> <tr> <p>how perform task? (choose one)</p></tr> <tr> <p><input type="text" style="width: 3em;" id="day">&nbsp;x per day&nbsp; <input type="text" style=&quo

jquery - How do I add collision detection to my javascript game? -

so, here's deal, have been building little runner game in javascript seems working ok(ish). have both players able move simultaneously , have object constructor building objects array have. objects moving direction , speed want having trouble designing collision detection them. know javascript rather wonky on stuff , built game in weird way there's figure there has way add it. here of code. if knows stuff can explain can do? var obstacles; var $char1 = $('#character1'); var $char2 = $('#character2'); var object = [{name: 'jerry', width: '10px', height: '30px', position: 'absolute', left: '100%', bottom: '0px', background: 'green'}, {name: 'tammy', width: '9px', height: '25px', position: 'absolute', left: '100%', bottom: '0px', background: 'yellow'}, {name: 'mr. meeseeks', width: '10px', height: '35px', p

mysql - Counting a row within an overall listing of data -

this question has answer here: mysql row position in order by 6 answers i have table contains matches particular competition. when select matchidauto 4050, need know match 15 of total 29 matches in competition. i can determine there 29 matches simple select count(*) match2 competitionidauto = 669 does know of way of determining without needing loop through example 4050 match 15? -- -- table structure table `match2` -- create table if not exists `match2` ( `matchidauto` int(10) not null auto_increment, `competitionidauto` int(10) not null default '0', `teamhome` varchar(100) not null default '0', `teamaway` varchar(100) not null default '0', `matchdate` date not null default '0000-00-00', `matchtime` time not null default '00:00:00', `matchstarttime` datetime not null default

arm - Process address space and PTE's User/Kernel bit -

most of modern processors implement paging (for memory management) , in paging ptes (page table entry) including user/kernel bit restrict unwanted access. why bottleneck? there reason why don't way: process address space divided on user , kernel space, of course. , direct reason implement 2 ptprs (page table pointer register) can see on arm. simple logic on hw level can divide logical address user , kernel space. now, both modes have own page table entries except want share (i assume wouldn't share pages want access restricted kernel). so, there no reason implement user/kernel bit, isn't so? missing something?

Bootstrap spacing to center 4 boxes -

i have design want site , involves 4 boxes have in row. i want these 4 boxes centred have space left , right of page. so thought clever , use 6 columns leaving far left , right empty. this looks great on full browsers on mobile looks terrible has spaces not required. can offer , advice on way fix this? http://legaleye.16mb.com/members/index.php it's still work in progress link shows mean if open in mobile vs desktop browse. thanks guys apologises i'm not near desktop otherwise i'd mock out thought i'd @ least point in right direction. i'd create 2 css classes, 1 left column padding-left , right 1 padding-right , i'd put inside @media query set padding 0 classes on mobile (min 480px) assume want columns vertical on mobile (like standard bootstrap)? think simplest solution , yea takes away complexity of managing 6 columns. edit: css should need: .left{ margin-left:2%; } .right{ margin-left:2%; } @media screen , (min-width: 4

python - How to avoid bug in numpy.place while calculating inverse cumulative distribution function of large numpy array? -

i have come across bug in scipy or numpy, has seen following issue or has workaround? from scipy.stats import distributions import numpy np distributions.norm.ppf(np.ones((30000, 10000)) / 2.0) results in array([[ 0., 0., 0., ..., 0., 0., 0.], [ 0., 0., 0., ..., 0., 0., 0.], [ 0., 0., 0., ..., 0., 0., 0.], ..., [ nan, nan, nan, ..., nan, nan, nan], [ nan, nan, nan, ..., nan, nan, nan], [ nan, nan, nan, ..., nan, nan, nan]]) smaller runs (like 20000 rows) work fine. using numpy 1.10.4. edit problems seems deeper, appearing inside numpy: na = np.zeros((30000, 10000)) * np.nan np.place(na, np.ones((30000, 10000)), np.ravel(np.ones((30000, 10000)))) resulting in array([[ 1., 1., 1., ..., 1., 1., 1.], [ 1., 1., 1., ..., 1., 1., 1.], [ 1., 1., 1., ..., 1., 1., 1.], ..., [ nan, nan, nan, ..., nan, nan, nan],

javascript - Use Polymer elements in Chrome extension -

at moment i'm writing chrome extension , in popup.html want use polymer elements, problem none of them rendered in popup. popup.html looks this: <!doctype html> <html> <head> <title>getting started extension's popup</title> <script src="js/popup.js"></script> </head> <body> <paper-tabs id="tabbar" class="bottom fit" selected="{{selected}}"> <paper-tab>tab 1</paper-tab> <paper-tab>tab 2</paper-tab> <paper-tab>tab 3</paper-tab> </paper-tabs> </body> </html> this popup.js window.onload = function() { chrome.tabs.query({active: true, currentwindow: true}); } and here content script: function loadres(res) { return new promise( function(resolve, reject) { var link = document.createelement('link&

excel - passing range on another sheet to vlookup -

Image
i can't reference range sheet function can =vlookup. this works: =mvlookup(a2,b:c,2,",",", ") isn't: =mvlookup(a2,sheet3!b:c,2,",",", ") the code: public function mvlookup(lookup_values, table_array range, col_index_num long, input_separator string, output_separator string) string dim in0, out0, in0 = split(lookup_values, input_separator) redim out0(ubound(in0, 1)) = lbound(in0, 1) ubound(in0, 1) out0(i) = application.worksheetfunction.vlookup(in0(i), table_array, col_index_num, false) next mvlookup = join(out0, output_separator) end function i don't know basic , i'm not planning learn it, use excel, sorry lame question. guess basic "basic" took me 30 minutes point reference(reading included), other 60 minutes in frustration because above problem. me can go vba free life! edit: although code above worked after excel restart, jeeped gave me safer solution , more universal functionality.

c++ - What does "cannot Convert vector<int>* to int" mean? -

i have error: error 1 error c2664: 'int practicemergesort(int,int,std::vector>)' : cannot convert argument 1 'std::vector> *' 'int' i have no idea may cause of error or error telling me. edit: function prototypes int practicemergesort(int, int, vector<int>); int practicemerge(vector<int>, int, int, int); int main() { int numofitems; srand(int(time(0))); // initialize random number generator printf("algorithm comparison\n\n"); printf("selection sort\n"); //selectionsort(); practiceselectionsort(); // functioning version //------------------------------------------------------------------ cout << "\nmerge sort\n"; cout << "enter number of items sorted: "; cin >> numofitems; vector<int> mergearray(numofitems); cout << "value of numofitems: " << numofitems << "\n"; cout

Determining age of a file in Java -

i have requirement determine how long file has been on ntfs file system. i can read file creation time, , system time in millis, 2 not add up. off number of years. ntfs epoc 1 jan 1601 @ 0000 hrs utc, whereas java epoc 1 jan 1970. also, ntfs time given in 100's of nanoseconds. taking account, still doesn't add up. going wrong? public static final double secondsperjulianyear = 316880878; public static final double minutesperjulianyear = 5281347.966666667; public static final double secondsperminute = 60.0; public static final double millispersecond = 1000.0; public static final double yearsjavatimeahead = 369.0; public static long ntfsfilecreationtime(final file file) { filetime filecreationtime = null; try { path filepath = paths.get(file.touri()); if (files.exists(filepath)) { basicfileattributes attributes = files.readattributes(filepath, basicfileattributes.class); filecreationtime = attributes.creationt

arrays - Remove values of an entire row java -

i have string array has 10 rows , 4 columns holds contact information. if user wants remove contact, maintain 10 rows , 4 columns - without using lists in fashion - how done? instance: contacts[0][0] = fname; //charlie contacts[0][1] = lname; //brown contacts[0][2] = pnum; //(309)555-1212 contacts[0][3] = age1; //10 contacts[1][0] = fname1; //sally contacts[1][1] = lname; //brown contacts[1][2] = pnum; //(309)555-1212 contacts[1][3] = age3; //8 now user wants remove charlie brown contacts, , move other rows fill in empty space, maintaining total of 10 rows , 4 columns. the lastest attempt is: private void removecontact(string[][] contacts) { scanner input = new scanner(system.in); string lname; string fname; int findex; int lindex; system.out.println("what first name of contact remove?"); fname = input.nextline(); system.out.println(&quo

spreadsheet - Google Docs make custom function refresh -

Image
so have 1 code takes range , reference cell, , returns number of cells same background color ref. works great, want usable when color of of cells changes. put on every minute time based trigger, , tried use spreadsheetapp.flush() uncache current number. did not have desired affect. i tried make second function used flush() , returned first function. did not work. way know make refresh take " = " beginning of cell function in it, , replace it. code works below. function countbgcolor(range, ref) { var sheet = spreadsheetapp.getactivesheet(); var color = sheet.getrange(ref).getbackground(); var range = sheet.getrange(range); var rangeval = range.getvalues(); var count = 0; var allcolors = range.getbackgrounds(); (var = 0; < allcolors.length; i++) { (var j = 0; j < allcolors[0].length; j++) { if (allcolors[i][j] == color) count += 1; }; }; return count; } i couldn't find direct way this.

autolayout - White Box Appears Over iAdBanner? -

Image
i'm trying implement iadbanner @ bottom of application. worked fine first few times ran it, , see white box above iadbanner : all have done in terms of layout has been put banner on blue lines left , bottom container margins. haven't given constraints. how can rid of white box? i fixed centring adbannerview horizontally , giving vertical spacing of 0 bottom layout guide. placing on left container margin , bottom layout guide not enough. let iad handle width , height.

php - Laravel - root directory routing behaves strangely in a nested route group -

i have following route definition in laravel 5. when group routes in following way, seems route admin.proposals.home not work if provide "/" path, , work if trailing (like home ) provided: /** * routes system administrators. */ route::group(['prefix' => 'admin', 'middleware' => 'admin'], function() { route::group(['prefix' => 'people'], function() { route::get('/', ['as' => 'admin.people.home', 'uses' => 'personcontroller@index']); route::get('/profile/{username}', ['as' => 'admin.person.profile', 'uses' => 'personcontroller@view']); route::get('/organization/{id}', ['as' => 'admin.people.organization', 'uses' => 'personcontroller@indexbyorganization']); }); route::group(['prefix' => 'projects'], function() {

html - How to set background color for a boxed link? -

i have link on website borders. html: <p id="hero4"><a href="menu.html">explore our menu</a></p> css: #hero4 { border:1px solid white; border-radius:5px; width:150px; height:30px; margin:auto;} i'd entire "box" turn grey when user hovers on it, "create yours" button on starbucks website. right now, have: #hero4 a:hover { background-color:grey;} but small rectangular area around text turns grey. how can change css entire area within border changes color? you can move style <p> <a> tag, , set display:block; . #hero4 { border: 1px solid blue; border-radius: 5px; width: 150px; height: 30px; margin: auto; display: block; /*added*/ text-align: center; /*extra: center text horizontally*/ line-height: 30px; /*extra: center text vertically*/ } #hero4 a:hover { background-color: grey; } <p id="hero4"><a href="menu.html">e

laravel 5.1 - Pagination doesn't work after perform search -

i have form in laravel. used pagination in form , search option too. pagination works fine when didn't search anything. if search has records more 10 (my pagination record limit 10), shows result in first page in second page or third page shows records of whole database. it's ignore search criteria. controller code: public function index() { if (input::has('invoicenumber')) { $invoicenumber = input::get('invoicenumber'); $invoices = invoice::where('invoicenumber','like', '%'.$invoicenumber.'%')->orderby('date','desc')->paginate(10); } elseif (input::has('client')) { $client = input::get('client'); $invoices = invoice::where('client','like', '%'.$client.'%')->orderby('date', 'desc')->paginate(10); } elseif (input::has('startdate') && input::has('enddate')) {

How to check request.form.get value null or not in python flask? -

i'm starting simple curd operation python flask framework , want when user submit form how check users selected value null or not? i tried this if request.method == 'post': name = request.form.get('name') city = request.form.get('city') if name == '' , city == '': print('its null') else: print('success') but when i'm submit without fill value give output success i'm try none , null can't work.

python - How to get RDKit working with ipython3? -

i'm trying module imolecule working ipython3 (which i've installed). imolecule included part of rdkit (which apparently works python 3) first step install rdkit. used command: sudo apt-get install python-rdkit librdkit1 rdkit-data found here in section 2.2 of rdkit documentation. when did 'import rdkit' in python 2 worked didn't in python 3 or ipython3, , when removed original rdkit installation , tried redo 'python3-rdkit' didn't work. how can solve problem? i think installs old version of rdkit (the repos not updated, follow installation instructions here http://www.blopig.com/blog/2013/02/how-to-install-rdkit-on-ubuntu-12-04/ also, rdkit supports python 3 since on year now... http://rdkit.blogspot.com.mt/2014/11/switching-to-python-3.html

linux - How to solve below scenario related to svn branching? -

my project structure this, trunk/x/ trunk/k/ trunk/x/y trunk/x/z trunk/x/y/a trunk/x/z/b i created branch particular x/z/b folder. my branch structure x x/z x/z/b i have made changes in branch , committed branch. now due reason, need full project(trunk) in same branch . please understand there difference in code in branch , want retain it. how can that? as understand want trunk of particular revision in branch x. for can create new branch of trunk revision number(which used branch x creation) & merge branch x newly created branch. you code in 1 branch. to create new brach refer

arduino - HC06 not able to connect to Samsung Note4 Bluetooth even it is paired -

i using arduino uno r3 connect hc06 bluetooth module referring below article, using mac book http://tronixlabs.com/news/tutorial-using-hc06-bluetooth-to-serial-wireless-uart-adaptors-with-arduino/ i able connect hc06 using serial monitor of arduino ide hc06 led static. but unable connect note 4 bluetooth paired using password 1234 never able connect , show on terminal on android. wrong? led keep blinking after pair, please guide added sketch url: https://codebender.cc/sketch:238653

html - Display 404 document from htaccess after sending 404 header in PHP -

in php use following code indicate page not found: header("http/1.0 404 not found");exit(); in .htaccess file have following line handle 404 custom document: errordocument 404 /404.html now when send php 404 header expect show custom 404.html defined in .htaccess instead shows message "this link appears broken". doesn't show custom 404 page , if remove line .htaccess still won't display regular 404 page of server , shows broken link message. so how make show 404 page when send header in php? the problem here custom error document denoted errordocument isn't processed unless url processing pipeline can't find file (or handler) url points to. in case, processing pipeline does find file, php file, never reaches 404 on own errordocument never applied. when apache uses php handler run php file, , php file decides return 404 , not need provide 404 response code, html error document well. don't see default apache error do

javascript - jQuery: Find element outside of class -

i want select first element matches criteria outside of container. know how find if it's inside when it's outside, i"m not sure. want select very first element finds also, attempt: $('.text').click( function(){ $(this).css('font-size', '50px'); $(this).next('span').css('color','red'); }); .one{ background:orange; border:1px solid black; height:200px; width:200px; } span{ display:block; } <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <span>first</span> <span>second</span> <div class="one"> <p class="text"> text </p> </div> <span>first</span> <span>second</span> <div class="one"> <p class="text"> text </p> </div> <span&

How to customize the entries rows of Table Component in CDE PENTAHO? -

i have 12 rows in resultset rendering in table component in cde pentaho. default 10 entries shown , next 2 rows goes next page , 2 rows need use pagination. question how make default show rows customize , show 20 rows default. want rows seen @ once in first page. no need of pagination or next see remaining 2 rows. set 'page length' in advanced properties of table

c# - WPF Auto Complete Text box property -

i new c# , wpf. have been developing , application in need use auto complete text box. that, follow article in link. http://net-informations.com/q/faq/autocomplete.html but when code, visual studio gives me error saying, 'system.windows.controls.textbox' not contain definition 'autocompletesource' , no extension method 'autocompletesource'.... as think reason might be, wpf not contain definition auto complete textbox. therefore found in comment second answer in this question, added wpf toolkit , added reference project(as described here ). but still don't see autocomplete text box getting appeared in tool box , above mentioned error getting disappeared. why , how can autocomplete text box tool box? wpf doesn't have in-built autocomplete textbox . need use third-party software, try this; wpf textbox autocomplete 1.0.2 or wpf autocomplete the article following uses winforms , wpf new version of.

c - Passing a HANDLE to a DLL -

i'm new win32 programming. i'm trying pass handle obtained using createfile() function in dll. upon trying read bytes, dwbytesread says 0. allowed pass handles dll entries? read here [writing dlls] resources of caller not belong callee, , hence should not call closehandle() or things free() malloc() in caller. understanding correct? kindly point me in right direction. here's code: main.c #include <windows.h> #include <tchar.h> #include <stdio.h> #include <strsafe.h> #define buffersize 5 int __declspec( dllimport ) hello( handle ); void __cdecl _tmain(int argc, tchar *argv[]) { handle hfile; printf("\n"); if( argc != 2 ) { printf("usage error: incorrect number of arguments\n\n"); _tprintf(text("usage:\n\t%s <text_file_name>\n"), argv[0]); return; } hfile = createfile(argv[1], // file open generic_read, // ope

android - SELinux policy for running "ps" command from APP -

i wish run ps command find number of running processes in system. selinux violation in m private int read_procs() { int nprocs = 0; string line = null; // "ps" output try { process p = runtime.getruntime().exec("ps"); bufferedreader in = new bufferedreader(new inputstreamreader(p.getinputstream())); if (in == null) { mlog.e("cmd output _in_ null"); return 1; } while ((line = in.readline()) != null) { nprocs++; } in.close(); mlog.i("processes :" + (nprocs-1)); } catch (exception e) { e.printstacktrace(); } return nprocs; } how set policy allow "ps" command access : avc: denied { getattr } path="/proc/2" dev="proc" ino=9461 scontext=u:r:system_app:s0 tcontext=u:r:kernel:s0 tclass=dir permissive=0 ppid=3853 pcomm="thread-52" tgid=3761 tgcomm="test:app

css - how to auto play, full screen and no controls on mobile devices -

Image
is there way full screen video auto play, no controls, work on mobile devices? the methods have used have displayed play button black background. <video poster="#url#" id="backgroundvideo"> <source src="#url#" type="video/mp4"> <source src="#url#" type="video/ogg"> <source src="#url#" type="video/webm"> </video> backgroundvideo { position: fixed; top: 50%; left: 50%; min-width: 100%; min-height: 100%; width: auto; height: auto; z-index: -1000; -ms-transform: translatex(-50%) translatey(-50%); -moz-transform: translatex(-50%) translatey(-50%); -webkit-transform: translatex(-50%) translatey(-50%); transform: translatex(-50%) translatey(-50%); background: url(#url#) no-repeat; background-size: cover; background-size: 100%; background-position: center; } the bellow autoplay source: <video width="320" height="240" autoplay> <sourc

c# - How to reflect the changing of my entities names to the navigation properties names -

i have set of entities generated according db first work flow in entityframework. the entities have in proper names decide change them when change entity name, navigation property keeps pluralization , singularization of old name following : 2 entities ( sremp ,srpic ) sremp srpic id id name content phone note - - - - - - srpics sremp now when change names of entities ( employee,empphoto ), navigation properties didn't change !! as know, when use db first approach, you're using t4 template extracts information database create model entities. so, model entities names , properties information in databse. so, if need customize names of properties, there 2 ways it, , both involve customizing t4 template: if cannot modify database in way, because don't want or don't have permissions, modify t4 template including dictionary maps database table names desired entity names. then, along t4 template code, use dictionary

android - update textviews on different fragments based on asyntask result -

i've activity on create calls async task. public class sync extends baseactivity implements onclicklistener{ @override public void oncreate(bundle savedinstancestate) { // todo auto-generated method stub super.oncreate(savedinstancestate); setcontentview(r.layout.activity_sync); checkfordevicetask(sync.this).execute(constants.device_address); } } now result of async task determines fragment load inside activity able do. not figure how update textviews inside fragments. please take @ onpostexecute() method. after loading fragment how update textviews based on result? public class checkfordevicetask extends asynctask<string, integer, string> { private static final string tag = "checkfordevicetask"; public static final int connected_device_exists = 1; public static final int waiting_temp_password = 2; private activity activity; // private dialogfragment dialogfragment; public checkfordevi