Posts

matlab - How to Bode plot an array of transfer functions? -

Image
i have transfer functions corresponding llc converter. each 1 different, i'm changing single parameter visualize changes in frequency response. have this: v(1)=voutput; v(2)=voutput2; v(3)=voutput3; then plot them using: figure(1) optsv = bodeoptions('cstprefs'); optsv.frequnits = 'khz'; bode(v, optsv) the problem every transfer function being plotted in different chart: how can plot them in single chart? use bode(v(1),'r',v(2),'g',v(3),'b', optsv) where v1,v2,v3 various transfer functions. they plotted 3 lines 3 colors red, green, blue. edit, in reply comment: if write in comments many, can create figure, call hold on , , plot transfer functions in loop, this: first_tf = tf(1,[1,1]); %your example of many tf. v = [first_tf,2*first_tf,3*first_tf]; figure hold on j=1:length(tfdata(v)) bode(v(j)) end with output like:

C# unable to catch all exceptions -

i'm writing c# application (in linux mono shouldn't matter) , programming duplicati dlls. want program never crashes tried catch every exception. problem exception thrown , can't catch it. maybe thread?!? sidenote: testing purposes intentionally tried backup location don't have permission. if give permission, no error. the code looks following: try { interface = new interface(backend, options); result = i.backup(folders.toarray()); } catch (exception e) { //write log. //here no throw; !! } i following stack trace: error : system.exception: failed retrieve file listing: access path "/home/pi/test" denied. ---> system.unauthorizedaccessexception: access path "/home/pi/test" denied. @ system.io.directory.getfilesystementries (system.string path, system.string searchpattern, fileattributes mask, fileattributes attrs) [0x00000] in <filename unknown>:0 @ system.io.directory.getfiles (system.string path, system.str...

javascript - Get all duplicate values from object array -

i have following object deserialised json data [{ "employeenumber": "169", "employeenumbererror": "", "employeefirstname": "saj" }, { "employeenumber": "169", "employeenumbererror": "", "employeefirstname": "carlton" }, { "employeenumber": "1002", "employeenumbererror": "", "employeefirstname": "stanley" }] i want duplicate 'employeenumber' object using javascript or jquery. can 1 me? try this $(document).ready(function() { var v = [{ "employeenumber": "169", "employeenumbererror": "", "employeefirstname": "saj" }, { "employeenumber": "169", "employeenumbererror": "", "employeefirstname": "c...

unable to access google spreedsheets values using php -

i'm installed google api oauth2 php lib; here: https://code.google.com/p/google-api-php-client/ google spreadsheet api php lib; here: https://github.com/asimlqt/php-google-spreadsheet-client created credentials on api console using service account https://console.developers.google.com/ here php script used in combination above: require_once('vendor/autoload.php'); require_once('vendor/composer/autoload_classmap.php'); require_once('vendor/composer/autoload_real.php'); require_once __dir__.'/vendor/google/apiclient/src/google/auth/assertioncredentials.php'; use google\spreadsheet\defaultservicerequest; use google\spreadsheet\servicerequestfactory; use google\spreadsheet\spreadsheetservice; const g_client_id = 'my_client_id'; const g_client_email = 'email address'; const g_client_key_path = 'key.p12'; const g_client_key_pw = 'notasecret'; $obj_client_auth = new google_client (); $obj...

Calabash - Android - Finding Ids and handling placeholders -

i'm new calabash, have spent day learning (including getting setup). one thing need how find ids ease. have android app, contains placeholder text username. i've tried following not working (i keep getting timeout error presume down not being able find): when enter "some@user.com" "username" so questions: 1- above correct if want enter email field username 2- if didnt have placeholder above how can obtain references or ids , use in then /^i enter "([^\"]*)" input field number (\d+)$/ many thanks. to find locators should use calabash console. if run calabash-android console your_app.apk once starts reinstall_apps , then start_test_server_in_background . once it's running can use calabash query syntax find elements want interact - https://github.com/calabash/calabash-ios/wiki/05-query-syntax . to started query("*") return on screen. query("id:'usernamefield'") return elem...

c# - Odd LINQ/EF Behavior when Grouping by DateTime -

i have bit of code i've been using months without problem , today datetime overflow error. the original code looks this var payments = (from p in context.payments p.paymenttype == "direct" && p.exportfile == null group p new { p.customer, p.debtorid, p.receiptnumber, p.paymentdate } g select new { g.key.customer, g.key.debtorid, amount = g.sum(b => b.amount) * -1, receiptnumber = g.key.receiptnumber ?? default(long), paymentdate = g.key.paymentdate != null ? (datetime)g.key.paymentdate : datetime.minvalue }).tolist(); whats odd is, in particular instance, code selecting 1 row of data looks this: id customer debtorid amount receiptnumber exportfile paymenttype paymentdate 99 183245 672 ...

asp.net mvc - How to make a .NET MVC Form inside a Modal using jQuery with validation -

i struggling knowing how put together. i've built forms inside .net mvc pages plenty of times, , without validation. , i've built forms using jquery, , without validation. , i've built forms inside of modal, never mvc. i understand original question because form inside modal i'll need use jquery handle submit. having heck of time figuring out how put these moving pieces together. far, i've not found tutorial (or combo of tutorials) puts together. here's need: inside of mvc view, there button opens modal. (this working fine.) once modal opens, contains form several text fields , dropdowns. each required. (to make fields required, define these in view's model, mvc form? or create requirements in jquery?) if user attempts submit form , empty or invalid, modal stays open , validation messages appear. (i understand, original question , not possible using straight mvc because of modal, , jquery needed. i'm lost here.) if user attempts ...