Posts

sql server 2012 - Calculate daily use from running total in c# -

i have sql-table following columns , trying find way automatically calculate daily usage each entry. 'total usage' running total , there entry once per day per person. ultimately want able manipulate list in c# sql-query based method useful well. easy in excel hoping way automate it.... date | name | total usage | daily usage 2016-01-01 | john | 60 | ? 2016-01-02 | john | 63 | ? 2016-01-03 | john | 66 | ? 2016-01-01 | jane | 30 | ? 2016-01-02 | jane | 50 | ? 2016-01-03 | jane | 75 | ? pertinent question, can result table using following code snippet written in c#, utilizes system.data , system.data.sqlclient object library: strsql = "select [name], avg([total usage]) avrusage [yourtablename] group [name]"; // data table 2 columns: name , avgusage using (sqlconnection _connsql = new sqlconnection(connstring)) { using (sqlcommand _commandsql = new (sqlcommand()) ...

c++ - What is application footprint and how to calculate it? -

what term "application footprint" means application developed in c/c++. , how can calculate c/c++ application footprint. it size in code, data , heap application needs. in linux, can check size of "text" (code), "data" , "bss" size a.out (replace a.out whatever application called). there similar tools windows. as heap needs, it's more complex, example loading full model of boeing 747 (every nut, rivet, bolt, seat , button on "tv remote") autocad takes more memory model of 2 bolts corresponding nuts through 2 plates of metal in same autocad system - same thing loading latest novel ken follet word processor different loading letter water company complain water leak in street. rough estimate, using typical use-case (e.g. model of small, still sophisticated enough meaningful).

How to modify dft function in opencv? -

i need modify of variables inside dft function in opencv make suitable application. where can find dft source code? i've tried c:\opencv243\build\include\opencv2\core.hpp gives me description of dft: //! performs forward or inverse 1d or 2d discrete fourier transformation cv_exports_w void dft(inputarray src, outputarray dst, int flags=0, int nonzerorows=0); what procedure after source code modification? have give different name such dft2() ? where save new function? i'm using visual studio 2010 , opencv 2.4.3 installed on windows7 (32 bit). please note i'm new opencv , switched matlab. therefore if willing help, grateful if explain clearly. in matlab right-click on function , see source file (for open source functions only). thanks payam dft function can found in dxt.cpp source file. located in $opencv2.3$\opencv\modules\core\src if save same function overwrite function , wont able use original function. if want new functio...

PHP Paypal REST Billing Agreement combined with Digital Item -

in paypal sandbox, when create billing plan & agreement setup_fee , user can complete billing process paypal , plan created if user's paypal account has no funds available. it appears setup_fee can take minutes after creation of plan & agreement until charges account. i know classic digital goods api it's suggested combine billing plan checkout digital goods item, user have authorize payment digital goods item & billing agreement together. way user can create billing profile if able pay digital goods item. still best practice? if so, how using new rest php sdk? is viable way it?: set plan when user starts checkout first billing amount being discounted price set billing agreement user authorise start date in hour list item once first payment cleared, run cron job update plan amount undiscounted rate next month's billing seems unbelievably complicated me can't see other way without forcing user authenticate twice (once authorise ...

Error in python 3.5: can't add `map` results together -

i have piece of code using python 2.7 , trying convert can use python 3.5 error on flowing code due map. best way resolve ? file "/users/newbie/anaconda3/lib/python3.5/site-packages/keras/caffe/caffe_utils.py", line 74, in parse_network blobs = top_blobs + bottom_blobs typeerror: unsupported operand type(s) + : ' map ' , ' map ' def parse_network(layers, phase): ''' construct network layers making blobs , layers(operations) nodes. ''' nb_layers = len(layers) network = {} l in range(nb_layers): included = false try: # try see if layer phase specific if layers[l].include[0].phase == phase: included = true except indexerror: included = true if included: layer_key = 'caffe_layer_' + str(l) # actual layers, special annotation mark them if layer_key not in network: network[layer_key] = [] top_blobs = map(str, laye...

Running a python script with nose.run(...) from outside of the script's directory results in AttributeError: 'module' object has no attribute 'tests' -

i have python application few sub directories. each subdirectory has own tests.py file. i use nose run of unittests across of these files in 1 shot, creating script run_unit_tests.py calls nose.run(...) . if inside of directory containing run_unit_tests.py , works fine. however, if anywhere else on file system, fails attributeerror: 'module' object has no attribute 'tests'. here similar directory structure: myapp/ foo/ __init__.py tests.py bar/ __init__.py tests.py run_unit_tests.py in run_unit_tests.py : class myplugin(plugin): ... if __name__ == '__main__': nose.run(argv=['', 'foo.tests', '--with-my-plugin']) nose.run(argv=['', 'foo.bar.tests', '--with-my-plugin']) if run run_unit_tests.py while inside top myapp directory, works fine. however, if run script while in other folder on file system, fails with: =============...

machine learning - Adaboost with neural networks -

i implemented adaboost project, i'm not sure if i've understood adaboost correctly. here's implemented, please let me know if correct interpretation. my weak classifiers 8 different neural networks. each of these predict around 70% accuracy after full training. i train these networks fully, , collect predictions on training set ; have 8 vectors of predictions on training set. now use adaboost. interpretation of adaboost find final classifier weighted average of classifiers have trained above, , role find these weights. so, every training example have 8 predictions, , i'm combining them using adaboost weights. note interpretation, weak classifiers not retrained during adaboost iterations, weights updated. updated weights in effect create new classifiers in each iteration. here's pseudo code: all_alphas = [] all_classifier_indices = [] initialize training example weights 1/(num of examples) compute error 8 networks on training set in 1 t: find cl...