Posts

Showing posts from May, 2012

python - Saving session on IPython with both input and output -

saving input in ipython session has been asked few times : how save python interactive session? i wish save both input , output session (which includes error messages). the command saving input %save <filename> <line start>-<line end> . there similar command saving output along input ? in [39]: import numpy np in [40]: = np.linspace(0,1) in [41]: a.size out[41]: 50 in [42]: print 'apparently default size 50' file "<ipython-input-42-484cde9a53d0>", line 1 print 'apparently default size 50' ^ syntaxerror: missing parentheses in call 'print' in [43]: print('need used python3 print function!') need used python3 print function!

r - Convert date without year into Julian day (number of days since start of the year) -

i have date need convert julian days. data have date <- c("21-jul", "14-jul", "08-jul", "08-jul","16-jul") class(date) [1] "character" i want convert date julian days. above dates, julian days be: date 202,195,189,189,197 i found function as.posixlt converts date julian day. e.g. tmp <- as.posixlt("16jun10", format = "%d%b%y") tmp$yday # [1] 166 but needs date in particular order including year not have. there way convert dates characters , not have year in julian? also, year not leap year. julian days imply day of year 1st jan 1, 2nd jan 2 , on.... base r has function julian can produce looking paste0 , as.date . julian(as.date(paste0("1970-", date), format="%y-%d-%b")) [1] 201 194 188 188 196 attr(,"origin") [1] "1970-01-01" note counted number of days january 1, 1970 (it starts @ 0), can add 1 desired result. julian(a

google maps - set the center as Europe at zoom level 1 -

Image
i try set of coordinates display. done google maps api, somehow ends center of world. tried map.setcenter( latlngbounds.getcenter(), map.fitbounds( latlngbounds ) ); and var dor24 = new google.maps.latlng(52.519325,13.392709); map.setcenter( dor24); map.fitbounds( latlngbounds ); but somehow setting center ignored when @ zoom level 1. due inner workings of google maps or there way world map centered on europe , points showing? these exmples talking about: http://hpsg.fu-berlin.de/~stefan/vortraege/ http://hpsg.fu-berlin.de/~stefan/vortraege/talk-map.html edit: without fitbounds this: don't call both map.setcenter , map.fitbounds , map.fitbounds resets map center. proof of concept fiddle code snippet: function initialize() { var map = new google.maps.map( document.getelementbyid("map_canvas"), { center: new google.maps.latlng(37.4419, -122.1419), zoom: 1, maptypeid: google.maps.maptypeid.roadmap })

xsd - Crystal Reports Header Subreport Data vanishes when new field is added to DataTable -

Image
i apologize if example little vague; unfortunately, can't use same field names in example without giving away both company name , purpose of data. given following: a crystal report populated dataset , bound xsd schema file; a .net 1.1 program populates dataset , binds report; data tables foo , bar; xsd schema: ----foo---- stuff (pk) things gunk ----bar---- stuff (fk) details widget relationship: 1 foo can have 1 or more bars, inner join on stuff. this report works. there's been request add new "code" field report indicate value tied contracts. there list of codes, , list of parts have specific codes. meant, on database side, adding table "widget" , "codeid" linking table, indicating code goes widget, , table "codeid" , "codedescr" hold codes , definitions. able add field modifying schema file add "codedescr" bar , populating simple query based on row's value in "widget". works.

java - Passing a query to hibernate as a parameter to another query -

why isn't legal? - im new java/hibernate. query query = session.createsqlquery("select round(count(*) * 0.25) x carecube.scheduledprocedure"); query query1 = session.createsqlquery("select scheduledprocedure.id carecube.scheduledprocedure order scheduledprocedure.id limit 1 offset :q1"); query1.setparameter("q1", query ); i want execute 1 query holds number of rows multiplied quarter.. then want execute query, , pass result parameter on second query object. is possible open multiple query objects same session above? when try pass in query object (which should hold number of rows) parameter query1, receive following error: "could not determine type class: org.hibernate.internal.sqlqueryimpl" could hibernate guru shed light? thank immensely.

filter - Spagobi - Setting Up Cockpit Parameter Using LOV and Analytical Driver -

i newbie on spagobi. want achieve simple, seems difficult find detailed , thorough step-by-step instruction. thought i'd give shot asking guys. let's have simple contains following column: -country -state -city -**and other columns my cockpit report simple table showing columns. have filter parameter prompts user select country, , based on selected country, next filter show states associated selected country (cascading parameter), , based on selected state, next filter show cities within selected state. based on research did various forums, need create lov , set analytical driver. , set parameter filter in cockpit report. however, can't find step-by-step instruction. there indeed similar sample report comes spagobi server: analytical documents >> reports >> infographic2. know how create similar filter parameter. for familiar this, please kindly provide step-by-step instruction. me tremendously. direction find resources accomplish task appreciated.

python - Plotting high precision data as axis ticks or transforming it to different values? -

Image
i trying plot data histogram in matplotlib using high precision values x-axis ticks. data between 0 , 0.4, values close like: 0.05678, 0.05879, 0.125678, 0.129067 i used np.around() in order make values (and made them should 0 0.4) less didn't work quite right of data. here example of 1 worked right -> and 1 didn't -> you can see there points after 0.4 not right. here code used in jupyter notebook : plt.hist(x=[advb_ratios,adj_ratios,verb_ratios],color = ['r','y','b'], bins =10, label = ['adverbs','adjectives', 'verbs']) plt.xticks(np.around(ranks,1)) plt.xlabel('argument rank') plt.ylabel('frequency') plt.legend() plt.show() it same both histograms different x plotting, x values used between 0 , 1 . so questions are: is there way fix , reflect data is? is better give rank values different labels separate them more 1 example - 1,2,3,4 or lose precision of data , useful info?

jquery - Multiple Objects in an array -

im not jquery, need learn can realize projects im working on. i use datatables select-extension multiselect table-rows. afterwards need work values of rows in php. of allready works charm, problem can use 1 table within form. means results of first table class "table_select" $_post-variable. i tried change jquery-code iterate on objects class, made array , tried push array [array.length], still values in array[0]. what doing wrong? var table = []; table[table.length] = $('.table_select').datatable( { 'initcomplete': function(){ var api = this.api(); api .rows() .every(function(){ var data = this.data(); if(data[1] === '1'){ api.cells(this.index(), 0).checkboxes.select(); } }); }, order: [[2, "asc"]], paging:false, info:false, filter:false, language: { "url": "//cdn.datatables.net/plug-ins/9dc

vb.net - Reusable function to adjust the width of combobox items to longest item in the list -

Image
my intent able use function adjust width of drop down items included in drop down shown (length wise). i'm trying create function i'll able use multiple comboboxes. being called load cbo function, after data has been loaded not adjusting .dropdownwidth. private sub adjustcombobox(byval comboboxname combobox) dim maxwidth = 0 dim temp = 0 each item object in comboboxname.items temp = textrenderer.measuretext(item.tostring(), comboboxname.font).width if temp > maxwidth maxwidth = temp end if next comboboxname.dropdownwidth = maxwidth end sub edit: comboboxload function dim da new sqldataadapter(sql, objconnection) dim ds new dataset da.fill(ds, "prov") if ds.tables("prov").rows.count > 0 c .datasource = ds.tables("prov") .valuemember = "no" .displaymember = "name"

matlab - Ploting Confidence interval from only mean and standard deviation -

Image
i trying plot confidence interval mean , standard deviation (std) of data. here piece of code wrote: meana=1.876; %mean of stda=0.018; % std of meanb=1.821; stdb=0.039; meanc=1.735; stdc=0.023; meand=1.667; stdd=0.039; y = [meana meanb ; meanc meand ]; erry= [stda stdb; stdc stdc ]; if plot normal distribution cofidence inteval seems overlap alpha = 0.05; % significance level tt=1:length(y) figure mu = y(tt,1); % mean sigma = erry(tt,1); cutoff1n = norminv(alpha, mu, sigma); cutoff2n = norminv(1-alpha, mu, sigma); xn = [linspace(mu-4*sigma,cutoff1n), ... linspace(cutoff1n,cutoff2n), ... linspace(cutoff2n,mu+4*sigma)]; yn = normpdf(xn, mu, sigma); plot(xn,yn) mu = y(tt,2); % mean sigma = erry(tt,2); cutoff1 = norminv(alpha, mu, sigma); cutoff2 = norminv(1-alpha, mu, sigma); x = [linspace(mu-4*sigma,cutoff1), ... linspace(cutoff1,cutoff2), ... linspace(cutoff2,mu+4*sigma)]; y = normpdf(x, mu, sigma); hol

android - Execute method when specific log appear -

in activity, wish trigger specific method when specific log appear. their log want detect : 11-17 15:35:41.626 8473-12293/com.planetvision.androidtv d/vlc: [a12f67b4] mpeg_audio decoder: emulated startcode (no startcode on following frame)

oracle12c - Passing a dataset from Oracle to C# gives me an instruction pointer error -

Image
i've got following block of c# code pass variable oracle 12c procedure , return dataset: public void show_data() { try { oracleconnection conn = getconnection(); { conn.connectionstring = configurationmanager.connectionstrings["conncst"].tostring(); oraclecommand cmd3 = new oraclecommand(); cmd3.commandtype = commandtype.storedprocedure; cmd3.commandtext = "cst_feedback"; cmd3.connection = conn; cmd3.parameters.add("lineid", oracletype.number).value = hlineid.value; cmd3.parameters.add("emp_out", oracletype.cursor).direction = parameterdirection.output; //connection2.open(); var searchadapter = new oracledataadapter(cmd3); var ds = new dataset(); searchadapter.fill(ds); responserepeater.datasourc

javascript - google map set styles dynamically of map object -

hey know if can change styles property of map object dynamically later. looking method of setstyles of map, didn't find 1 work me. adding code in jsfiddler: the code function initmap() { // styles map in night mode. var map = new google.maps.map(document.getelementbyid('map'), { center: {lat: 40.674, lng: -73.945}, zoom: 12, styles: [ { featuretype: "road", elementtype: "labels", stylers: [ { visibility: "off" } ] }, { featuretype: "administrative.locality", elementtype: "labels", stylers: [ { visibility: "off" } ] } ] }); } /* set map height explicitly define size of div * element contains map. */ #map { height: 100%; } /* optional: makes sample page fill window. */ html, body { height: 100%; margin: 0; padding: 0; } <script sr

python - DBN deep network does not recognize many classes -

i using python code dbn downloaded deeplearning.net ( http://deeplearning.net/tutorial/code/ ). using dataset pamap2 downloaded uci archives. follow following steps: normalizing data set have no negative values i pass dataset unmodified neural network calculating confusion matrix on results the confusion matrix on validation set is: [[1816 0 0 0 0] [ 0 326 0 0 0] [ 0 298 0 0 0] [ 0 305 0 0 0] [ 0 426 0 0 0]] ranking first , second class, other not ranked well, how should do? there paper can read? other datasets (eg. mnist) network fine

Sonarlint 2.3 eclipse issues shown on parent project -

i used sonarlint 2.2.1 eclipse luna, working quite since i've upgraded sonarlint 2.3, nothing works before. i use sonarlint standalone eclipse plugin without sonarqube server. i work on project kind of structure : parent | |-> module1 |-> module2 |-> ... | in v2.2.1 sonarlint show issues of modules if close or delete parent project project. in v2.3 sonarlint, no issue displayed on sonarlint view. if open /module1/src/main/.../someclass.java , issues of current opened class shown in list not inside opened class. , when double-click on issue in list, opens file link /parent/module1/src/main/.../someclass.java not considered file in build path. in path column of issues view, path /parent/module1/src/main/.../someclass.java . if open second class, issues of class come feeding sonarlint issues view list. if close parent project in eclipse, got error telling me resources /parent/module1/src/main/.../someclass.java not exist. if delete parent pr

c# - IntelliTest tests not working on async await methods -

i'm using visual studio enterprise 2015 , trying use feature call intellitest. intellitest seems work fine when testing tradition synchronize methods. however, of methods async , return task, require awaited. when create these intellitest unit tests, results result = "{not yet computed}". intellitest not support async methods, or missing something? thanks

javascript - use jquery to change a link on a button when two options are selected -

hi want create simple search form when user selects option 1 displays specific options. want link on button take them page on website. i have code thread works great (without button) how make button if animal selected in first box wolf selected in second box button link change www.mysite.com/wolf.html? thanks $("#select1").change(function() { if ($(this).data('options') == undefined) { /*taking array of options-2 , kind of embedding on select1*/ $(this).data('options', $('#select2 option').clone()); } var id = $(this).val(); var options = $(this).data('options').filter('[value=' + id + ']'); $('#select2').html(options); }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script> <select name="select1" id="select1"> <option value="1">fruit</option> <option value="2

java - WeakReference to a RecyclerView's View never breaks? -

i have weakreference recyclerview's view in asynctask (the task loads image show in view). (if use listview) view collected gc when disappears task won't use it, in case (with recyclerview) view never collected gc task yet has weakreference pointing view, has new role (another image show). how solve it? right understanding of situation? thanks! i hope u understand though english not native... edit: code asynctask: class loadpicturetask extends asynctask<string, void, bitmap> { private final weakreference<imageview> mimageviewreference; private final int mimagesize; loadpicturetask(imageview imageview, int imagesize) { // use weakreference ensure imageview can garbage collected mimageviewreference = new weakreference<>(imageview); mimagesize = imagesize; } @override protected bitmap doinbackground(string... params) { string path = params[0]; return decodesampledbitmapfromfile(path, m

Virtualmin and Procmail - send incoming emails to PHP script -

i'm running centos 7 server virtualmin/webmin , virtual hosts configured. want send emails addressed 1 specific email address hosted on system (belonging 1 virtual host) php script processing. research, assume procmail simplest way this. assume need create .procmailrc file in user's home directory. however, .procmailrc file not executed. found instructions enabling local .procmailrc files: go virutalmin -> email messages -> spam , virus scanning , turn on "allow mailbox users create mail filters" however, can't work. every time try save change, error: libclamav warning: ************************************************** libclamav warning: *** virus database older 7 days! *** libclamav warning: *** please update possible. *** libclamav warning: ************************************************** error: can't write temporary directory i don't know directory it's trying write, , second, if try update clamav ("yum upd

javascript - Why strict comparison(===) when checking typeof equality? -

this question has answer here: which equals operator (== vs ===) should used in javascript comparisons? 48 answers what's reason use === instead of == typeof in javascript? 5 answers say wanted function checked whether or not variable string, interwebs advised me follows: function is_string(s) { return typeof s === 'string'; } but can't think of scenario "typeof s" return "string" without s being string. is there reason === operator instead of ==? reason being, want check types in switch statement, afaik, switch statement uses loose comparison operator. since i'm looking known types , don't need check undefined, should fine, right?

gis - Reverse cluster analysis; identifying empty space or a lack of density in R with longitude and latitude? -

Image
i'm working on project have large amount of points , looking identify regions (defined lack of clustering) density of these points statistically less relative others. visual enough have many points difficult tell these empty spaces , density heat map doesn't me 0 in on smaller regions. maybe i'm missing simpler here, hoping can @ least send me in right direction of look. below reproducible sample quick , dirty lets take these points open data , map them borough file nyc: #libraries-------------------------- library(ggplot2) library(ggmap) library(sp) library(jsonlite) library(rjsonio) library(rgdal) #call api data-------------------------- df = fromjson("https://data.cityofnewyork.us/resource/24t3-xqyv.json?$query= select lat, long_") df <- data.frame(t(matrix(unlist(df),nrow=length(unlist(df[1]))))) names(df)[names(df) == 'x2'] = 'x' names(df)[names(df) == 'x1'] = 'y' df = df[, c("x", "y")] df$x = a

c# - Trying to throw a BadRequest to my ExceptionFilterAttribute -

currently log our errors using custom attribute filter this: public class logexceptionfilterattribute : exceptionfilterattribute { // private properties private readonly logprovider _logger; /// <summary> /// our default constructor /// </summary> /// <param name="logger"></param> public logexceptionfilterattribute(logprovider logger) { this._logger = logger; } /// <summary> /// invoked when exception has been thrown /// </summary> /// <param name="context">the context</param> public override async void onexception(httpactionexecutedcontext context) { // our user var requestcontext = context.request.getrequestcontext(); var user = requestcontext.principal.identity; // create our response var message = await _logger.error(context.exception, user); var content = new httpresponsemessage {

jquery - up and down scroll with javascript -

i tried put following codes doesn't work. when down scroll, page button appears , when click it, scroll top of page. when scroll top of page, page down button appears , when click it, same action page scroll. var amountscrolledtop = 200; var amountscrolleddown = 50; $(window).scroll(function() { if ( $(window).scrolltop() > amountscrolledtop ) { $('a.back-to-top').fadein('slow'); } else { $('a.back-to-top').fadeout('slow'); } if ( $(window).scrolltop() < amountscrolleddown ) { $('a.down1').fadein('slow'); } else { $('a.down1').fadeout('slow'); } }); $('a.back-to-top').click(function() { $('html, body').animate({ scrolltop: 0 }, 'slow'); return false; }); $('a.down1').click(function() { var objdiv = document.getelementbyid("mid");

php - Codeigniter Session Sets 2nd time during login -

<?php class login_model extends ci_model { public function login() { $username = $_post['uname']; $password = $_post['pw']; $query = $this->db->get_where('test_logins', array('name' => $username, 'password' => $password)); $count = $query->num_rows() > 0; if ($count == 1) { foreach ($query->result_array() $row) { $exam_id=$row['id']; } $query2 = $this->db->get_where('candidates', array('email' =>$_post['email'])); $count2=$query2->num_rows(); //echo($count2); if($count2==1){ foreach ($query2->result_array() $row2) { $candidate_id=$row2['id']; $part1=$row2['part1']; $part2=$row2['part2']; $part3=$row2['

xdebug - Drupal 8 in visual studio code -

i'm using visual studio code different web development. i'm using drupal 8 develop new websites. drupal 8 has theme file place php code in changes parts of theming. how can debug theme files in visual studio code? can't place breakpoints in code. if want use drupal vscode suggest install vs-code-drupal extension. makes .module files recognizable php files. if want debug php code suggest install vscode-php-debug extension. it's bit tricky configure, if follow guide succeed. another useful extension vscode-code-runner . runs portions of code testing on fly. unfortunately have not found yet extension php intellisense.

ios - OCMockito how to capture block and match any other primitive arguments? -

method signature: - (void)updatefeaturesbuttons:(nsinteger)gameid category:(featruescategory)category parentid:(nsinteger)parentid success:(void (^)(nsdictionary* featuresjson))success failure:(void (^)(nserror* error))failure i try capture success block argument , ignore other arguments that: hcargumentcaptor* captor = [[hcargumentcaptor alloc] init]; [verify(mockmanager) updatefeaturesbuttons:0 category:0 parentid:0 success:(id)captor failure:anything()]; i want call success block json: successblock block = captor.value; block(json); but argument(s) different! error. can other arguments? in ocmockito documentation, see how specify matchers non-object arguments ? so you'll need specify [[[[verify(mockmanager) withmatcher:anything() forargument:0] withmatcher:anything() forargument:1] withmatcher:anything() forargument:2] updatefeaturesbuttons:0 category:0 parentid:0

javascript - What Cordova plugin or Cordova native process supports reading / writing to a file located on an OTG connected USB drive? -

i've searched quite while now, , none of current options explicitly state support access external media such usb drive on otg android. know of such module? i've found snippets , examples accessing external sd card, no other mounted devices far. thanks

jquery - Add/Remove values to field from checkbox values in Javascript -

i have 2 fields: 1 checkbox (built scala), 1 input/text field. trying add , remove values checkbox input field. trying take multiple values , string comma. here html fields: <div class="column column1"> @for(service <- serviceslist) { <label><input type="checkbox" name="selectservices" value=@service.name><span>@service.name</span></label> } </div> <input name="services" id="services"> i using jquery in tag try record onchange event: $(document).ready(function(){ var $services = $('#services'); var $selectservices = $('#selectservices'); $selectservices.change(function(){ (var = 0, n = this.length; < n; i++) { if (this[i].checked) { $services.val($services.val() + this[i].value); } else { $services.val($services.val().replace(this[i].value, "&

permissions - Specific rights for a role in symfony 3 -

i newbie in symfony framework , have create web application. problem have autorization of defined actions in code. i load users out of database roles (many-to-many). in security.yml work acls different routes. teacher told me, should implement specific rights roles. means, have roles rights (many-to-many), can create new roles adding rights. example might "editing users" in database. can specify granually rights "editing", "persisting" , on. how can implement in controllers/twig-templates? in twig work isgranted()-function, there can check roles? thanks :-)

regex - "+","[","]" in Regular expression did not take effect in Linux C -

i got program written in c language apply regular expression string. however,it works regular expression \\w ('\\' means single '\' in string). \\w+ \\s+ \\s or [^\\s]+ did not take effect. it seems that, "^","[","]","+" was not recognized program. the program running format below: ./program {regular expression} then input line of string,the program apply regular expression string , give result. i check program , have not found wrong. /* function substring string */ static char* substr(const char*str,unsigned start, unsigned end) { unsigned n = end - start; static char stbuf[256]; strncpy(stbuf, str + start, n); stbuf[n] = 0; return stbuf; } /* main program */ int main(int argc, char** argv) { char * pattern; int x, z, lno = 0, cflags = 0; char ebuf[128], lbuf[256]; regex_t reg; regmatch_t pm[10]; const size_t nmatch = 10; /* complie regular expression*/ pattern = argv[1];

java - How many shaders should i use? -

i've written own 3d game engine in java want rewrite optimization. my engine looks this: there abstract superclass called rendersystem. code : public abstract class rendersystem<t> { public abstract void addelement(t element); public abstract void enablesystem(); public abstract void disablesystem(); protected abstract void cleanup(); } every rendersystem extends "rendersystem". every different material there render system , therefore shader. i've created enum stores parts of material enabled (bump_map, displacement_map etc.) it looks this: (i missed out getter , setter stuff) code : public enum materialtype{ color_mat (1,false,false,false,false,masterrenderer.entity_system,null); private materialtype(int index, boolean use_bump_map, boolean use_displacement_map, boolean use_normal_map, boolean use_specular_map, rendersystem<?> default_system, rendersystem<?> instanced_system) { this.index = index; t

big o - Time complexity of the algorithm by counting the comparisons and we need to give a big o estimate -

Image
time complexity of algorithm counting comparisons , need give big o estimate how can do? := 1 m // loop 1 j:= 1 n // loop 2 c ij := 0 q := 1 k // loop 3 c ij := c ij + a iq b qj return c note within loop 2, there k + 1 assignments, while j loops 1 n , there in total n * (k + 1) assignments. adding on top of that, while i loops 1 m there in total m * n * (k + 1) assignments. so time complexity of code o(m * n * (k + 1)) = o(mnk) .

java - Guess Attempts loop issue -

okay have loop isssues first if enter invalid character want program loop , re-ask user input public boolean isvalid(){ if (letter1.equals('a')|| letter1.equals('b')|| letter1.equals('c')|| letter1.equals('d')|| letter1.equals('e')){ boolean isvalid = true; } else if(letter2.equals('a')|| letter2.equals('b')|| letter2.equals('c')|| letter2.equals('d')|| letter2.equals('e')){ boolean isvalid = true; } else if(letter3.equals('a')|| letter3.equals('b')|| letter3.equals('c')|| letter3.equals('d')|| letter3.equals('e')){ boolean isvalid = true; } else { boolean isvalid = false; } while (isvalid == false){ system.out.println("invalid input try again"); system.out.println("enter guess #1"); guess = keyboard.nextline(); guess.tolowercase(); letter1 = guess.charat(0); letter2 = guess.charat(1); letter

c++ - What are the disadvantages of having one base class for all exceptions? -

i'm doing exercises stroustrup's c++ programming language 4th edition. 1 of tasks formulated this: consider using class exception base of classes used exceptions. should like? how should used? might do? what disadvantages might result requirement use such class? the answer looks pretty std::exception , save disadvantages part - 1 can imagine cost of __vptr considered negligible. missing here? the disadvantage if try catch exception @ bottom of inheritance tree, catch exceptions derived one, , of them might indicate things different expecting. worse, developer used lot of functions may throw exceptions, , doesn't know of them mean, might catch base class, exception, , return unspecific exception instance when encountering errors, making difficult debug code, , possibly causing whole program fail because of fixable exception shouldn't cause problems.

c# - Web.PageInspector.Runtime.NativeMethods.CloseHandle -

sehexception (0x80004005): een extern onderdeel heeft een uitzondering veroorzaakt.] microsoft.visualstudio.web.pageinspector.runtime.nativemethods.closehandle(intptr hhandle) +0 microsoft.visualstudio.web.browserlink.runtime.arteryconnectionutil.mappedfileexists(string filename) +39 microsoft.visualstudio.web.browserlink.runtime.arteryconnectionutil.readalllinesfrom(string filename) +66 microsoft.visualstudio.web.browserlink.runtime.arteryconnectionutil.getallinstancefilenames() +67 microsoft.visualstudio.web.browserlink.runtime.arteryconnectionutil.findarteryconnection(string applicationphysicalpath, arteryconnectiondata& connection) +48 microsoft.visualstudio.web.pageinspector.runtime.tracing.pageinspectorhttpmodule.onprerequesthandlerexecute(object sender, eventargs e) +351

javascript - AngularJS - Url format -

i'm having trouble angularjs's url i need this: /api/menu/3 but im getting this: /api/menu?menuid=3 i need format beacuse i'm using laravel. app.js : var app = angular.module('mainmodule', ["ngroute", "ngresource", 'mainmodule.services', 'mainmodule.controllers']) .config(function($routeprovider, $locationprovider) { $routeprovider .when("/", { templateurl : "templates/dashboard.html", controller : "contentcontroller" }) .when("/:id", { templateurl : "templates/dashboard.html", controller : "contentcontroller" }) .when("/config/:id", { templateurl : "templates/config.html", controller : "configmenucontroller" }) .when("/

Pass parameter to function if passed by user python -

this 1 should simple. have function , call function package within function. want customize passing arguments package of function on whether user has passed arguments function. example code: import somepackage sp def myfunc(foo, bar, baz=none, xad=false): # code stuff... # finally: if baz not none: sp.somefunc(data=foo, method=bar, aux=baz) else: sp.somefunc(data=foo, method=bar) is there way replace last 4 lines 1 neat pythonic line? like: def myfunc(foo, bar, baz=none, xad=false): # code stuff... # finally: sp.somefunc(data=foo, method=bar, [aux=baz if baz not none]) you can use argument unpacking this: def func1(one, two, three): args = {"one": one, "two": two, "three": three} func2(*args) def func2(one, two, three): print "one = %s, 2 = %s, 3 = %s" % (one, two, three) if __name__ == "__main__": func1(one="does", two="this", three

python - AttributeError: 'str' object has no attribute 'inWaiting' -

from of community able install al new backend matplotlib , run code arduino serial output of python window. i able make pretty graph , displays, crashes when following error: attributeerror: 'str' object has no attribute 'inwaiting' this remedied of @elethan however, have error: pulse = float(dataarray[0]) valueerror: not convert string float: this error not happen everytime as if wasn't enough, output on plotted graph shows value of 10 of plot, not value output arduino serial. i unsure why: 1) error intermittend (maybe grabbing ',' , not value) 2) why steady value of 10 when graph plot the code follows: import time import serial import matplotlib.pyplot plt import numpy drawnow import * import os,sys pulsearray = [] plt.ion() clippingcounter = 0 # configure serial connections (the parameters differs on device connecting to) ser = serial.serial( port='/dev/ttyacm0', baudrate=115200, parity=serial.parity_odd,

Can't return an XML formatted string, using stringbuilder in C# and a DB Template, For a PlaceHolder -

good afternoon, i have function builds string template in db outputs xml structure. takes in order class parameter , template, having troubles trying populate placeholder tag named [[items]], based on number of items in table should build xml list portion. this template, returning 1 instance of string should return (n) instances based on what's in table. <items> [[items]] </items> this should populated other tags item <item> <sku>[[item_sku]]</sku> <prod_name><![cdata[[[item_product_name]]]]></prod_name> <description><![cdata[[[item_name]]]]></description> <attributes><![cdata[[[item_attributes]]]]></attributes> <quantity>[[item_qty]]</quantity> <unitprice>[[item_price]]</unitprice> <inkcolor>[[item_inkcolor]]</inkcolor> </item> and want populate this <items> <item> <sku>7z-brpa-k79a</sku> <pro