Posts

Featured post

Why do we use internal classes for constants in C#? -

i have seen in many projects. why developers use internal classes store constant variables in c#? for instance: internal static class constants { public const double pi = 3.14159; public const int speedoflight = 300000; // km per sec. } simply, designer decided class need used within same assembly. , not exposed or accessed project referencing assembly. when download nuget package, can't access classes internal. developers decided don't need access these. these values "private" package. more on access modifiers: public :access not restricted. protected :access limited containing class or types derived containing class. internal: access limited current assembly. protected internal : access limited current assembly or types derived containing class. private : access limited containing type.

scala - Using the kronecker product on complex matrices with scalaNLP breeze -

i had piece of code: def this(vectors: list[densevector[double]]) { this(vectors.length) var resultvector = vectors.head (vector <- vectors) { resultvector = kron(resultvector.todensematrix, vector.todensematrix).todensevector } _vector = resultvector } it worked way wanted work. problem needed complex values in stead of doubles. after importing breeze.math.complex, changed code to: def this(vectors: list[densevector[complex]]) { this(vectors.length) var resultvector = vectors.head (vector <- vectors) { resultvector = kron(resultvector.todensematrix, vector.todensematrix).todensevector } _vector = resultvector } this results errors: error:(42, 26) not find implicit value parameter impl: breeze.linalg.kron.impl2[breeze.linalg.densematrix[breeze.math.complex],breeze.linalg.densematrix[breeze.math.complex],vr] resultvector = kron(resultvector.todensematrix, vector.todensematrix).todensevector

android - Basic camera in app -

Image
i trying activate camera in app have done following , kept simple possible. androidmanifest file <uses-permission android:name="android.permission.camera"/> <uses-feature android:name="android.hardware.camera" /> <uses-feature android:name="android.hardware.camera.autofocus" /> ... <activity android:name=".cameraact" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" /> </intent-filter> </activity> cameraact.class public class cameraact extends appcompatactivity { public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_camera); // have camera? if (!getpackagemanager()

javascript - Why Selenium can't find an element that is graphically visible -

i'm using selenium test appllication running on firefox browser, when want click on button selenium, don't find it. find strange since can see element eye. have tried multiple method worked other exemple : wait.until(expectedconditions.visibilityofelementlocated(by)) wait.until(expectedconditions.presenceofelementlocated(by)); (i use xpath in path variable, , i'm sure correct) setting implictlywait on driver putting thread.sleep(1000) then again, post here because don't understand why selenium not see element diplayed on browser. important information maybe giving me proper answer html dom dynamically generate websocket triggered javascript event. edit 1: <button type="button" class="btn btn-xs btn-block btn-stroke" id="252_button"> delete </button> the element i'm trying access. use xpath it. it's not in iframe element. to access element did method supposed find , click on giving xpath in para

php - Insert data into database in angularjs -

i trying insert data in database not working @ all! followed tutorial , work according not working. tried lot no success till now. here html file <!doctype html> <html> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"> </script> <body> <div ng-app="myapp" ng-controller="myctrl"> <form> name:-<input type="text" ng-model="bname" /> phone:-<input type="text" ng-model="bphone" /> <input type="button" value="submit" ng-click="insertdata()" /> </form> </div> <script> var app = angular.module('myapp',[]); app.controller('myctrl',function($scope,$http){ $scope.insertdata=function(){ $http.post("insert.php", { 'bname':$scope.bname, 'bphone':$scope.bphone}) .success(function(data,status,headers,config){ c

Android chat application architectures -

i have requirement need build group chat application. chat app contain multimedia messages. as know can architect chat app using gcm/fcm , xmpp protocol. problem gcm/fcm is, cannot handle multimedia messages , xmpp heavy architecture. do have other servers or architectures apart gcm/fcm , xmpp? thank you use fcm. when want multimedia items use url of items. fcm can send receive urls easily. you can point multimedia files stored on hosting servers.

dns - 1and1 domain to my heroku app -

Image
i'm trying make fresh new domain point heroku app, , don't know if made right. me out ? 1st screenshot : 1and1 base domain configuration 2nd screenshot : 1and1 www subdomain overview 3rd screenshot : 1and1 www subdomain's cname configuration 4th screenshot : heroku domain configuration and if go mydomain.com or www.mydomain.com, stills point 1and1 default page. did right or have wait until redirection done ? maybe need forward requests root domain: yourdomain.com -> www.yourdomain.com