Posts

Javascript: calculating remaining time (and then rent) on a tenancy (Rent Calculator) -

i work @ corporate estate agency , i'm creating internal page staff use contain few small tools them use among other things. one of things i've been trying put rent calculator, which, given rental amount , lease expiry date user, needs determine time left (from today) on lease , advise how rent left pay on lease. i've got working, mostly, can see it's long (i'm assuming extent has be) , feel reasonably messy: //calculates remaining rent left pay terminated leases $("input[name='calcrent']").click(function() { //gets rent , daily rent later calculations var rent = $("input[name='rentrent']").val(); var dailyrate = (rent * 12) / 365; var leaseexpiry = $("input[name='leaseexpiry']").val(); var remrent = $("input[name='remrent']"); //breaks down lease expiry date , today's date day, month, year parts //so units can used in calculations var ldd = leaseexp...

ios - uitableview inside multiple view controllers -

i have 'repeat' uitableview 2 or more view controllers. using uitableviewcontroller methods inside view controllers using methods/delegates/datasources uitablewviewcontroller. example: i've uitableviewcontroller wich displays twitter feed own style, need table in more 1 view controller , maybe changing twitteruser in each view controller (just example). try: i've done create (with storyboard) uiviewcontroller , uitablewviewcontroller, both own methods. , on uiviewcontroller viewdidload, try add uitablewviewcontroller.tableview subclass. , works! result empty table. tried set delegates/datasources ddnt work.. -(void)viewdidload { [super viewdidload]; //add table subview thetable *t = [[thetable alloc] init]; [self.view addsubview:t.tableview]; t.tableview.frame = cgrectmake(0, 100, 320, 2000); t.tableview.backgroundcolor = [uicolor bluecolor]; } this code works, displays empty uitable inside view controller.. *thetable uitableviewc...

wordpress - Is it possible to deep link to Buddypress pages via login? -

i have wordpress installation on i'm using buddypress plugin. using plugin send daily digest e-mails users offer them links forums have had new posts. the problem if user follows 1 of these links when they're not logged in, they're taken 404 'page not found' page. is there way redirect them login page redirects them desired location after logging in? thanks! just take control of 404.php page theme's file. implement in theme's 404.php page redirect specific users page: if( http-referer == 'you-know-how-to-detect-buddypress-users' ) $redirect_to= 'http://example.com/'; //redirect_to main part here. details on parameter, see here: http: wp_redirect($redirect_to); exit(); /* rest of file 404.php, remain unchanged */ ref: http://codex.wordpress.org/function_reference/wp_redirect

Numerical integration in C++ -

hello need integrate function (of 2 variables). know can using fubini theorem integrate 1 variable functions using numerical methods such rectangle method or trapezoidal rule . but there pre-built functions in c++ ? need integrate on the unit r2 triangle ((0,0), (1,0), (0,1)) . you can use gnu scientific library , supports many "numerical analysis" functions including integration. a simple example of integration manual few lines of code: #include <stdio.h> #include <math.h> #include <gsl/gsl_integration.h> double f (double x, void * params) { double alpha = *(double *) params; return log(alpha*x) / sqrt(x); } int main (void) { double result, error; double expected = -4.0; double alpha = 1.0; gsl_integration_workspace * w = gsl_integration_workspace_alloc (1000); gsl_function f; f.function = &f; f.params = &alpha; gsl_integration_qags (&f, 0, 1, 0, 1e-7, 1000, w, &res...

Realtime android Google analytics without EasyTracker -

i'm trying figure out how track page views in real time without using easytracker singleton. i have following code: /** * how create tracker instance... */ private void createtracker() { if (tracker != null) return; tracker = googleanalytics.gettracker(googleanalyticssiteid); tracker.setanonymizeip(trackinglevel.isanonymous()); tracker.setappinstallerid(configuration.getinstallationuuid()); tracker.setsamplerate(dispatchintervalinseconds); trackupgradedapp(); } ... void someothermethod(activity activity){ tracker.sendview((string) activity.gettitle()); // easytracker.getinstance().activitystart(cyborgscreen.getactivity()); } while uncomment easytracker line, can track pages visited in realtime, after adding analytics.xml project (obviously). once commenting line, not receive realtime information... if following code here , should have done trick. am missing obvious, or there bug? thanks, adam. well, after tones of p...

database - MySQL Workbench for SQL Server? -

Image
i use mysql workbench making er diagrams. now, have make diagram sql server. workbench have sql server export feature? if not, there free er diagram software should take at? edit 1: (screen shot) hake @ database diagram tool sql server in dbforge studio sql server. view , modify existing database online. you can try feature in free express or trial version.

sublimetext2 - Switch current tag to another -

i have tag like <p>this pa|ragraph</p> i want press button , change p tag. how can that? install emmet(previously zencoding) plugin. has shortcut super + shift + k (for mac, other oses, should ctrl instead of super) this. { "keys": [ "super+shift+k" ], "command": "rename_tag", "context": [ { "key": "emmet_action_enabled.rename_tag" } ] }, just highlight tag, press combo , both opening , closing tags selected simultaneously. can type new tag.