Posts

Showing posts from August, 2015

javascript - getUserMedia does not fire first time -

i have simple getusermedia function in javascript. reason, on mobile devices only, not fire first time. have close app reopen work. see why? in advance! getusermedia( { "audio": { "mandatory": { "googechocancellation": "false", "googautogaincontrol": "false", "goognoisesuppression": "false", "googhighpassfilter": "false" }, "optional": [] }, }, myfunc); i using intel xdk cordova app build this, if relevant.

data structures - Adding to a Binary Tree C++ -

i need in inserting nodes binary tree. program reads .cpp , .h file information on baseball player. information contained within 1 node of binary tree. when 1 node read in need insert function read information , sort accordingly. need basic code me along process. have insert function far: bool tree::insert(player player) { node *pnew; node *root, *next; pnew = new node(player); if(pnew == null) { return false; } root = proot; next = null; while (root != null && next -> item.lessthan(player)) { root = next; next = next -> pcurrent; if(next < root) { } } } this full thing main.cpp #include <iostream> #include <fstream> #include <string> #include "binarytree.h" using namespace std; int main(void) { const int file = 100; char input[file]; char output[file]; ifstream infile;

Why doesn't the docker volume in Windows Server show up when I run this command? -

i have folder setup on host machine @ c:\testvol. docker image not have folder @ c:\testvol. when run: docker run --rm -d --name {name} {imagename} --v c:\testvol:c:\testvol why doesn't volume show on container? it appears in docker command need specify image name last parameter unless want pass arguments processed docker file. also, --v should -v or --volume --v not recognized docker command. the command want is: docker run --rm -d --name {name} --volume c:\testvol:c:\testvol {imagename}

razor - Areas' View Tag Helper Intellisense no use in Asp.Net Core VS2017 -

i using asp.net core 's areas feature in project use newest vs2017. it's fine use tag helper intellisense in normal default 'views' folder,but no intellisense in areas' view how solve issue? just add code @ top of cshtml file: @addtaghelper *, microsoft.aspnetcore.mvc.taghelpers

c# - Crystal report COM exception error -

in crystal report, i'm using ufl function exdllclsexdllconvertlocal . function working fine in formula field. whenever try insert formula field text object, project showing following error. (sorry bad english) custom tool error: "code generator 'reportcodegenerator' failed. exception stack = crystaldecisions.shared.crystalreportsexception: load report failed. ---> system.runtime.interopservices.comexception: ) missing. details: errorkind error in file crptmoneyreceipt 12048_21920_{da2fed10-3d68-4e52-93b6-717b7b875d8d}.rpt: error in formula test: 'totext(mid(exdllclsexdllconvertlocal ({sp_getmoneyreciept.transactionamount}),1,instr(exdllclsexdllconvertlocal ({sp_getmoneyreciept.transactionamount}),".")-1))' ) missing. details: errorkind @ crystaldecisions.reportappserver.clientdoc.reportclientdocumentclass.open(object& documentpath, int32 options) @ crystaldecisions.reportappserver.reportclientdocumentwrapp

apache spark - Pyspark dataframe write to single json file with specific name -

i have dataframe want write single json file specific name. tried below df2 = df1.select(df1.col1,df1.col2) df2.write.format('json').save('/path/file_name.json') # didnt work, writing in folder 'file_name.json' , files part-xxx df2.tojson().saveastextfile('/path/file_name.json') # didnt work, writing in folder 'file_name.json' , files part-xxx appreciate if 1 can provide solution. you need save on single file using below code:- df2 = df1.select(df1.col1,df1.col2) df2.coalesce(1).write.format('json').save('/path/file_name.json') this make folder file_name.json . check folder can single file whole data part-000

javascript - Dropdown overlapping other nav items -

my drop-down overlapping on navigation in mobile view , wondering if knew how fix this. appreciated! also, in desktop view know how expand header when hover on drop-down not fall off header? (function ($, document, window) { var defaults = { label: 'menu', duplicate: true, duration: 200, easingopen: 'swing', easingclose: 'swing', closedsymbol: '&#9658;', openedsymbol: '&#9660;', prependto: 'body', appendto: '', parenttag: 'a', closeonclick: false, allowparentlinks: false, nestedparentlinks: true, showchildren: false, removeids: true, removeclasses: false, removestyles: false, brand: '', animations: 'jquery', init: function () {}

c - Movement & starting point of s1->top in the following functions, push, display & pop -

can me understand whats happening in following functions? use of s1->top? , movement of s1->top in functions push &pop & display? because if in function push, s1->top moves right whenever number pushed? why in display function, says s1->top first in traversing, while in push s1->top n right, while in printing values, need firstly in left , traverse..why? typedef struct node* nodeptr; typedef char dataitem; typedef struct node{ dataitem data; nodeptr next; }node; typedef struct{ int count; nodeptr top; }stack_head; typedef stack_head* stack; stack createstack() { stack s1; s1 = (stack) malloc(sizeof(stack_head)); s1 - > count = 0; s1 - > top = null; return s1; } nodeptr createnode(dataitem item) { nodeptr temp; temp = (nodeptr) malloc(sizeof(node)); temp - > data = item; temp - > next = null; return temp; } void push(stack s1, dataitem item) { nodeptr temp = createnode(item); temp - > next = s1 - > top; s1 -

php - Allow user to use Text input to create folder director and upload multiple images at the sametime -

how allow user use text input create folder director name , upload multiple images @ same-time. have use http://www.phpgang.com/how-to-upload-multiple-images-jquery-ajax-using-php_453.html , simple php code creating director couldn't pass folder folder director name through jquery.fileuploadmulti.min or jquery.form . check upload.php code below require 'dbconnection.php'; //the name of directory need create. $directoryname = $_post['folder']; //check if directory exists. if(!is_dir($directoryname)){ //directory not exist, lets create it. mkdir('imagefolder/'.$directoryname, 0755); } $output_dir = 'imagefolder/'.$directoryname.'/'; if(isset($_files["myfile"])) { $ret = array(); $error =$_files["myfile"]["error"]; { if(!is_array($_files["myfile"]['name'])) //single file { $randomnum = time(); $imagename = str_repla

How to remove unwanted line breaks in html/css -

working on django templates theme bought on themeforest. problem i'm having that, whenever use base template, header automatically adds line breaks top when using hardcoded template files, seems fine. the white space @ top example of im talking about i'd glad if me on how remove unwanted space. here's code of header base template: {% load static %} <div id="mainmenubaranchor"></div> <header class="white_header"> <nav class="navbar navbar-default bootsnav"> <div class="container"> <div class="row"> <div class="col-sm-12"> <div class="attr-nav"> <div class="upper-column info-box first"> <div class="icons"><i class="icon-telephone114"></i></div> <ul> <li><strong>phone number

c++ std::stack content will not be free when leaving function -

i think in function err_fun, stack em free when leave err_fun(), content of em free in same time, , why can still right answer in main function stack st? thanks. #include <stack> stack<int> st; void err_fun() { stack<int> em; st.swap( em ); } int main() { err_fun(); //... operation stack st. return 0; } the content of em copied on that's asked when did swap . since st global in scope it's not destroyed.

asp.net mvc - How to extend ASP IdentityRole in EF DbFirst -

how can extend identityroles work extended aspnetroles table? in asp mvc 5, identity 2.2 looked here & here answers not db first ef step 1: extended/added companyid & descrole (to make role unique company/tenant) create table [dbo].[aspnetroles] // extended role table [id] [nvarchar](50) not null, [name] [nvarchar](50) not null, [description] [nvarchar](50) not null, // extended [companyid] [nvarchar](50) not null, // extended company/tenant step 2 : create new role issue, create role fails, , cannot find extended companyid / desc properties on identityrole (its dbfirst ef strategy ) //create role class public actionresult createrole(formcollection collection) { try { var context = new applicationdbcontext(); // rolestore // var newrole = new aspnetroles(); // ontext.roles.add(new applicationrole) { // not visible... context.roles.add(new microsoft.aspnet.identity.entityframework.identityrole()

java - Spring Boot: working with HotSwap restarts Spring Boot - member variables get initialized -

i using spring boot in intellij idea. in java project, use flag compiler.automake.allow.when.app.running in registry ). whenever change in code during debugging, spring boot gets restarted. as consequence, loose contents of member variables of other classes. how can prevent this?

mongodb - How to fill missing field with data to existing documents in mongo db? -

i have documents like [{ _id:.., mailtitle:"hello", broadcastmessage:"how u"}] [{ _id:.., mailtitle:"hello john", broadcastmessage:"how u john"}] [{ _id:.., mailtitle:"hello", broadcastmessage:"how u john", user_id:"1", datesent:"12/12/2016" }] now want add user_id:"1", datesent:"12/12/2016" first 2 , others documents. please help!!! using update (deprecated) : db.collection.update( { "user_id": {$exists: false}, "datesent": {$exists: false} }, { $set: { user_id : 1, datesent: "12/12/2016", (use utc date object instead of string) } }, { multi: true } ); using updatemany : db.collection.updatemany( { "user_id": {$exists: false}, "datesent": {$exists: false} }, {

android - Encoding HttpURLConnection Parameter work in marshmallow but not in jellybean -

public static string getjson(string url, int timeout) { httpurlconnection c = null; try { url = url.replace("%20", " "); url u = new url(url); uri uri = new uri(u.getprotocol(), u.getuserinfo(), u.gethost(), u.getport(), u.getpath(), u.getquery(), u.getref()); u = uri.tourl(); c = (httpurlconnection) u.openconnection(); c.setdooutput(true); c.setdoinput(true); c.setinstancefollowredirects(false); c.setrequestmethod("post"); c.setrequestproperty("accept", "application/x-www-form-urlencoded;charset=utf-8"); c.setrequestproperty("content-type", "application/x-www-form-urlencoded"); c.setrequestproperty("charset", "utf-8"); c.setrequestproperty("content-length", "0"); c.setrequestproperty("accept-encoding", "identity"); c.setusec

c# - Casting Exception in ASP.NET Web Application -

i have function: private void ds_itembound(object sender, datagriditemeventargs e) { if (e.item.itemindex >= 0) { e.item.cells[0].controls.add(utility.getimage("delegate")); e.item.attributes.add("description", ((system.data.datarowview)(e.item.dataitem)).row["delegatedescription"].tostring()); string delegatename = ((system.data.datarowview)(e.item.dataitem)).row["delegatename"].tostring(); e.item.attributes.add("delegatename", ((system.data.datarowview)(e.item.dataitem)).row["delegatename"].tostring()); ((system.web.ui.webcontrols.checkbox)(e.item.cells[3].controls[0])).checked = false; if (hdelegates.value != "") { string[] selecteddelegates = hdelegates.value.split(new char[] { ',' }); foreach (string delega

mongodb - Mongo Client Gui Not Running - linux? -

i trying use mongodb's mongoclinet admin ui , when trying run ./mongoclient.sh , getting error following error, error while loading shared libraries: libssl.so.1.0.0: cannot open shared object file: no such file or directory how can resolve issue??

ios - Fetching particular attributes or properties in CoreData -

i using following code eliminate attributes while fetching coredatamodel called industry. still able access attributes have not requested using fetchrequest.propertiestofetch let fetchrequest = nsfetchrequest(entityname: "industry") fetchrequest.propertiestofetch = ["id","industry_name"] after using following code: industryobject.industry_name=tuple.value(forkey: ""ind_subtype"") as? string "ind_subtype" have not specified in *.propertiestofetch* , still able access func fetchindustrynameswithid()->[industrydata]{ var industrydata=[industrydata]() //fetchrequest.predicate = nspredicate(format: "firstname == %@", firstname) let fetchrequest = nsfetchrequest<nsmanagedobject>(entityname: "industry") fetchrequest.propertiestofetch = ["id","industry_name"] { let tuples = try managedobjectcontex