Posts

Showing posts from January, 2012

java - Date time and simple date time format results are different -

i have following code fragment: datetime datetime = new datetime().withzone(datetimezone.forid("america/chicago")) .withyear(2016) .withmonthofyear(8) .withdayofmonth(25) .withhourofday(12) .withminuteofhour(37); system.out.println("datetime: "); system.out.println(datetime.todate().gettime()); string str = "2016-8-25 12:37 cst"; simpledateformat sdf = new simpledateformat("yyyy-m-dd hh:mm z"); system.out.println("sdf: "); try { system.out.println(sdf.parse(str).gettime()+""); } catch (parseexception e) { // todo auto-generated catch block e.printstacktrace(); } according understanding, both represent same date (and hence epoch should same well). result is: datetime: 1472146669119 sdf: 1451198220000 if change timezone cdt, ge...

reactjs - How can I call forceUpdate on the root element in React? -

i need call forceupdate on app root of react app or on component 1 in. know call forceupdate on current component this.forceupdate() , how call on component? you can pass this.forceupdate() function vis props child component root.js var root = react.createclass({ render: function() { return ( <updatecomponent rootupdate={this.forceupdate.bind(this)} /> ); } }); then can access call this.props.rootupdate() in updatecomponent whenever need root force updated.

ios - why the stack view's frame is (0.0, 0.0)? -

i'm trying autolayout stack views , create arrangedsubview(2 labels , 1 image) in code, 1 set of stack view appear in simulator. when print results in console, labels , image have values, except stack view's frame 0.0;0.0 . why happen this? why stack view not appear? please see code below: code let contentview: uiview = uiview() let stackview: uistackview = uistackview() var singlestack = array(count: 6, repeatedvalue: uistackview()) var timelabel = array(count: 6, repeatedvalue: uilabel()) var iconimage = array(count: 6, repeatedvalue: uiimageview()) var templabel = array(count: 6, repeatedvalue: uilabel()) override func viewdidload() { super.viewdidload() index in 0...5 { timelabel[index].text = "0\(index):00" iconimage[index].image = uiimage(named: "sunny")! templabel[index].text = "0\(index)°" singlestack[index].addarrangedsubview(timelabel[index]) singlestack[index]...

unity3d - How can I render two transparent objects as one continuous object? -

i'm struggling transparency right 2 objects overlap , work 1 layer. ideally i'd have 1 big red field on skybox instead have moments transparency adds up. there effective way around this? what want (from angles): http://imgur.com/sn8sotz what looks (from angle see them intersect): http://imgur.com/q7an21v current shader code: shader "mobile/particles/ballshader" { properties { _color("main color", color) = (1,1,1,.1) } category { tags { "queue"="transparent" "rendertype"="transparent" } blend oneminusdstcolor 1 // soft additive lighting off zwrite on ztest lequal subshader { color [_color] pass { } } } } edit: got closer solving things without real understanding of how. unity's built in particles/additive deals problem.

c++ - ==15341==ERROR: AddressSanitizer: heap-buffer-overflow on address 0xb59007e0 at pc 0x8048ca7 bp 0xbfb47388 sp 0xbfb4737c -

i'm pretty new dynamic memory management , using fsanitise flag find problems memory management. cannot use vector store data - need use primitive arrays, "new" , "delete" manage heap objects. i got following error when try run euclideanvectortester compiled program not sure problem is, enlighten me please? weill % make g++ -std=c++14 -wall -werror -o2 -fsanitize=address -c euclideanvectortester.cpp g++ -std=c++14 -wall -werror -o2 -fsanitize=address -c euclideanvector.cpp g++ -fsanitize=address euclideanvectortester.o euclideanvector.o -o euclideanvectortester weill % ./euclideanvectortester 1 ================================================================= ==15341==error: addresssanitizer: heap-buffer-overflow on address 0xb59007e0 @ pc 0x8048ca7 bp 0xbfb47388 sp 0xbfb4737c write of size 8 @ 0xb59007e0 thread t0 #0 0x8048ca6 in main (/tmp_amd/kamen/export/kamen/3/z3386180/cs6771/evec/euclideanvectortester+0x8048ca6) #1 0xb6ecae45 in __libc_sta...

emacs - Can I turn off highlighting of TODO keywords? -

i using several normal verbs todo keywords. example, 'fix' todo keyword, , when gets done turns 'fixed'. works except find highlighting distracting. can turn off? ideally task simple sentence "fix ..." no special highlighting, recognised todo item. todo keywords have org-todo face default, changing face doesn't trick. reinstates default if turn off 1 of attributes, , in case foreground should match current level, there no 1 colour work. if it's org-level-x want org-level-x.

database design - link subform to mainform access 2007 -

mainform: has read textboxes reference table (tblemployee) hold flatfile upload data. subform: linked "id" field in tblemployee table. subform input data input tblemployeechangeover table. subform acting "update" tool. user @ mainform, , if data needs updated, interact subform so. tblemployee not modified, , tblemployeechangeover can used email new data , used run reports. both forms: --have field named id, supposed linked on. example, if flat file has id of "3", subform should "3" well. --field names identical both main form , sub form, except subform has "_changeover" on them. id id both forms. "employeeschedule" on mainform "employeeschedule_changeover" on subform table , textboxes. problem: upload of flatfile seems fine. need able input data in subform saved tblemployeechangeover table. whenever try input data subform , advance new record in mainform: -cannot input id in id textbox in subform -w...

Detailed Heart Rate Export from Jawbone Up4 -

i'm researcher trying research on stress using jawbone up4. research i'm doing i'm looking @ stress changes during day in response specific stimuli, need detailed hourly heart rate readings. how can export detailed hourly heart rate readings jawbone up4? i'll exporting 30 people, , experiment running 4 months , @ moment looks option sitting down , reading off application , entering manually spreadsheet, stupid , impractically time-consuming. options have checked: the historical data offered on jawbone website here ( https://jawbone.com/support/articles/000011483/historical-data ) has insufficient detail - gives daily high , low heart rate. the thread here ( jawbone javascript , resting heart rate data ) seems unresolved - , bit on head. option x: if there's no way data out can please recommend similar device (or devices) can export hourly heart rate data. jawbone not make of heartrate readings available through public api. however, if you...

angularjs - Angular Karma post has unexpected JSON -

i have following karma test. error "expected: {"data":{"form_field_17":"none required","title":"mr","firstname":"john","lastname":"doe","email":"john@gmail.com","mobile":"1114269874","registration":"123","form_field_15":"test","pref_date":"2016-08-30t02:13:00.000z"},"formid":4} got: {"data":"{\"form_field_17\":\"none required\",\"title\":\"mr\",\"firstname\":\"john\",\"lastname\":\"doe\",\"email\":\"john@gmail.com\",\"mobile\":\"1114269874\",\"registration\":\"123\",\"form_field_15\":\"test\",\"pref_date\":\"30/08/2016 12:13 pm\"}","formid":4} why json object have bac...

validation - How to validate google analytics tracking (events, page tracking) in android apps? -

please me in how can validate/debug google analytics tracking custom events, page variables sent google analytics? i used chrome web debugging able debug web pages opened through chrome not android application...... i recommend use google analytics measurement protocol sending hits ga. use debug in url https://www.google-analytics.com/debug/collect here doc related validating hits in measurement protocol. https://developers.google.com/analytics/devguides/collection/protocol/v1/validating-hits

How to classify class, function and function property in javascript? -

i've 3 objects these: class person { constructor(name, age) { this._name = name; this._age = age; } } let add = function (a, b) { return + b }; let math = { multiply: function (x, y) { return x * y } }; as can see , person class, add , math.multiply functions. my question: how classify class , functions in case? my question comes from: person looks function, this: let person = function (name, age) { this._name = name; this._age = age; }; also, there no problems if declare object new instance of add function: let result = new add(2, 3); // allowed although needn't new operator says: the new operator creates instance of user-defined object type or of 1 of built-in object types has constructor function. all of 3 cases, person , add , math.multiply constructors. so: let person = new person('hermione', 18); // allowed let result = new add(2, 3); // allowed result = new math.multip...

.net - How to set some PDF reader's propertie via Webbrowser Control? -

first,i used adobe reader control , set properties hidden pdf reader 's toolbar code. axacropdf1.src = strfilename axacropdf1.setshowtoolbar(false) but don't want use adobe reader control .so change use webbrowser instead. webbrowser1.navigate(strfilename) when program run. webbrowser1 display pdf toolbar. how hide toolbar? possible?

ios - Installing CocoaPods on virtual machines -

i using os x ei capitan, version 10.11.4 using vmware i able install gem using sudo gem install cocoa pods i want use firebase in project , followed guideline mentioned on official website. on pod install, getting below error pod install --verbose preparing setting cocoapods master repo cloning spec repo `master` `https://github.com/cocoapods/specs.git` (branch `master`) $ /usr/bin/git clone https://github.com/cocoapods/specs.git master cloning 'master'... error: rpc failed; curl 56 sslread() return error -9806 fatal: remote end hung unexpectedly fatal: eof fatal: index-pack failed [!] unable add source url `https://github.com/cocoapods/specs.git` named `master`. (/usr/bin/git clone https://github.com/cocoapods/specs.git master cloning 'master'... error: rpc failed; curl 56 sslread() return error -9806 fatal: remote end hung unexpectedly fatal: eof fatal: index-pack failed ) can try adding manually in `~/.cocoapods/repos` or via `pod repo ad...

java - unable to use matrix variable in spring -

i learning springmvc , encountered problem not able use matrix variables when call url neither hitting controller nor showing exception not triggering code expected have following classes: controller class @autowired productrepositiry productrepositiry; @requestmapping("/filter/{path}") public string getfiltered(@matrixvariable(pathvar = "path") map<string, list<string>> filterparms, model model) { model.addattribute("items", productrepositiry.getfilteredproducts(filterparms)); return "viewall"; } repositiry class private list<item> list = new arraylist<>(); public list<item> getlist() { item first = new item(); first.setitemone("firstone"); first.setitemtwo("firsttwo"); first.setitemthree("firstthree"); item second = new item(); second.setitemone("seconeone"); second.s...

node.js - MongoDB insertion not working -

i new mongodb, , have question insertion of data. mongoose schema 'user' collection: var user = new mongoose.schema({ username : {type: string}, email : {type: string,index: {unique: true}}, password : {type: string}, feed : [{ title : {type: string}, description : {type: string}, latitude : {type:number}, longitude : {type:number}, feedimages : [{imageurl: {type: string}}] }] }); here inserted data username, email , password in first service call: app.post('/users',function(req,res) { var username = req.body.username; var email = req.body.email; var password = req.body.password; var userdata = {'username':username,'email':email,'password':password}; new db.user(userdata).save(function(err,result){ if (err) { res.json({"success": '0', "message": ...

html - Overflow hidden with parent div in absolute position -

i have specific requirement is, parent div absolute:position , child div absolute position , in parent div have overflow:hidden width of child div hidden not working, know parent div have position:relative , per current structure of code cannot change parent div position absolute relative , wanted know if there way handle this? here jsfiddle of example, want light red box hidden under parent div child div within parent. here code .wrapper { position: absolute; left: 100px; top: 100px; width: 400px; height: 350px; background: #666666; padding: 10px; } .wrapper-inner { position: absolute; width: 450px; height: 380px; background: #fecccc; } <div class="wrapper"> <div class="wrapper-inner"> content goes here </div> </div> check code, per requirement: .wrapper { position: absolute; left: 100px; top: 100px; width: 400px; height: 350px; back...

encoding - strange characters appear in GIT cmd -

Image
i installed git-2.9.3.2-64-bit, in git cmd displaying strange characters in hebrew (i guess). installed default options selected. please let me know how can change latin characters makes sense me? try same git command after: set lang=en_us.utf-8 or in bash shell: export lang=en_us.utf-8 if work, can add export line %userprofile%\.bashrc .

html - Disable select option based on innerhtml with pure JavaScript -

scenario: user votes via html form field trip take on bus. there 3 options: <select id="selectbox"> <option>berlin</option> <option>munich</option> <option>cologne</option> </select> the free bus seats stored in / read database: ($tour our array keeping free seats) <table class="status"> <tr><td>berlin: <span id="t1">available (<?php echo $tour[0]; ?> seats)</span></td></tr> <tr><td>munich: <span id="t2">available (<?php echo $tour[1]; ?> seats)</span></td></tr> <tr><td>cologne: <span id="t3">available (<?php echo $tour[2]; ?> seats)</span></td></tr> </table> if free seats zero, display "sorry, booked out" info using vanilla javascript: // content of status table var t1 = document.getelementbyid(...

batch file - Cant run shell script using Git Bash interface on Windows10 -

Image
following this post wasn't able run shell trough git bash. batch file : %comspec% /c ""c:\program files\git\git-bash.exe" --login -i -- c:\users\rmrd001\documents\git\scripts\first\test.sh" pause this shell script: echo hello, world! and when batch run: i can see instantaneous appearance of bash program, can't catch text it. double-triple-checked paths, correct. ran script trough git bash, worked (the message appeared). any ideas? i have seen different syntax before . i see message with: start "" git-bash.exe -i -l -c "/c/path/to/script.sh" with script.sh including a pause : echo hello. world! read -n1 -r -p "press key continue..." key the op hairi report in comments making work with: start /b cmd /c "c:/program files/git/git-bash.exe" /c/path/to/script.sh

Encrypt excel-vba ADODB connection -

i in process of creating excel reports , trying encrypt sql connections. on server side have setup , microsoft management studio able establish secure connection. cant find solution excel. think need encrypt = yes or adodb.connection not supporting ssl ? private function getdatafromado(byval sel string) adodb.recordset 'declare variables' dim objmyconn adodb.connection dim objmycmd adodb.command dim objmyrecordset adodb.recordset set objmyconn = new adodb.connection set objmycmd = new adodb.command set objmyrecordset = new adodb.recordset 'open connection' objmyconn.connectionstring = "provider=sqloledb;data source=" & sqlserver & ";database=" & _ sqldb & ";user id=" & sqlusername & ";password=" & sqlpassword & ";" dim s string s = objmyconn.connectionstring objmyconn.open 'set , excecute sql command' set objmycmd.acti...

How to check whether a date is any of the valid date types present in SQL Server 2012? -

the code below validating date types present in mm/dd/yyyy format , should not contain time, how check date field's validity in possible formats sql server offers? declare @dateofbirth varchar(max); declare @dateofbirth_flag bit; if(isdate(@dateofbirth)=1 , @dateofbirth not '%[:]%') begin set @dateofbirth_flag=1; end else begin set @dateofbirth_flag=0; end in general - if ever possible: you should avoid culture specific date/time literals , better use appropriate data types! your question has no plain answer all possible formats sql server offers : date 01/13/2016 valid in mdy culture, invalid, if culture dmy . more dangerous: if date 03/05/2016 valid, differing values there... in formats without year 03/05/08 you'll have pure chaos. you might extract details this select * sys.syslanguages what want tell: have know , have specify culture. never rely on implicit casting! checked valid date might w...

Black Screenshot android OpenCv -

currently using opencv want happen when user presses screen of course screen/object displayed camera highlight necessary/similar colors see: color-blob-detector . video without screenshot. below there small camera icon triggering screenshot (imagebutton), when screenshots outcome of picture black. wanted when necessary colors being highlighted , press screenshot progmatically (which imagebutton) take picture of screen (including highlighted objects) , save image in file. i have tried using camera control opencv taking picture, hard me merge these two. public class camera extends activity implements ontouchlistener, cvcameraviewlistener2 { private static final string tag = "ocvsample::activity"; private boolean miscolorselected = false; private mat mrgba; private scalar mblobcolorrgba; private scalar mblobcolorhsv; private colorblobdetector mdetector; private mat mspectrum;...

c# - How do I change Folderlocation with radio buttons in a groupbox? -

Image
i have these groupboxes i want open specific folderlocation depending on radiobuttons checked in groupboxes. so let's option 1 , option b open desktop , option 2 , option folder on desktop. i know how run single radiobutton have difficulties in how make work 2 groupboxes. if have shown code better understand terminologies. case use nested for , if like //some path ever want string[] paths = { environment.getfolderpath(environment.specialfolder.desktop), environment.getfolderpath(environment.specialfolder.applicationdata), "c:\\"}; string[] folders = { "somefolder", "anyfolder", "yesthisfolder" }; string calcfolderpath=""; for(int i=0;i<=1;i++) //this group { for(int j=0;j<=2;j++) //this option / radio button { //you have check if group option checked or not if(group[i].option[j].checked) //this might not work { if(i==0) { calcfold...

ios - App crash Due to memory managment -

#import "myviewcontroller.h" #import "datasynchandler.h" #import "parenttableviewcell.h" #import "ayaah.h" static nsstring *parentcellidentifier = @"parenttableviewcell"; @interface myviewcontroller () { double pinchscale; uipinchgesturerecognizer *twofingerpinch; cgpoint buttonposition; nsindexpath *ipath; dbmanager *bmanager; cgpoint p; uifont *df; uifont *df1; nsmutablearray *header; nsuserdefaults *defaults; cgaffinetransform cg; } @end @implementation myviewcontroller @synthesize datasource;// nsmutable array have filled sqlite databasedata @synthesize ptc;// customcell - (void)viewdidload { [super viewdidload]; self.datasource=[[nsmutablearray alloc]init]; cg=_tableview.transform; self.tableview.estimatedrowheight = 80.0; _tableview.rowheight = uitableviewautomaticdimension; self.tableview.delegate=self; self.tableview.datasource=self; uipinchgestu...

VBA auto hide ribbon in Excel 2013 -

Image
how auto-hide ribbon in excel 2013 in vba? achieve clicking on upper arrow icon @ right top of excel menu marked blue in picture below , clicking on first option marked orange: i interested in vba switching third option show tabs , commands . important thing me keep in excel menu upper arrow icon (marked blue). i have tried hints shown in thread: vba minimize ribbon in excel not satisfied results. attempt 1 application.executeexcel4macro "show.toolbar(""ribbon"",false) this hides blue icon. attempt 2 commandbars.executemso "minimizeribbon" this close want. keeps blue icon not hide entire menu. switches second option displayed in picture show tabs . attempt 3 sendkeys "^{f1}" the attampt not work @ all. moreover, supposed imitate attempt 2. not satisfy me. i can't see else has brought up... isn't workaround, actual idmso think you're looking for. code makes excel window gone same way first op...

c++ - Running qt5 program cannot find symbol -

i wrote program qt5.6 on mac 10.10. crashed when run. qt application output is: dyld: symbol not found: __cg_png_create_info_struct referenced from: /system/library/frameworks/imageio.framework/versions/a/imageio expected in: /usr/local/lib/libpng.dylib in /system/library/frameworks/imageio.framework/versions/a/imageio but compiled latest version of libpng , installed in /usr/local/lib default name libpng.dylib . tried rename libpng.dylib nothing changed of tips. why didn't find symbol? should solve it?

"react-native run-android" - BUILD is SUCCESSFUL but get error type 3 Error: Activity class MainActivity does not exist -

i try run application on android emulator failed. run react-native run-android , build successful error type 3 , don't see installed on emulator. this part of when run "react-native run-android" in cmd: installed on 1 device. build successful total time: 2 mins 24.714 secs starting app on ***** (...\android\sdk/platform-tools/adb -s **** shell start -n app/.mainactivity)... starting: intent { cmp=app/.mainactivity } error type 3 error: activity class {app/app.mainactivity} not exist. i spent hours on , in end ended replacing package name. original name contained 2 dots. e.g. com.abc.test renamed com.abctest keep in mind update folder name in android ( android/app/src/main/java/com ). i tried react-native init myproject --package "com.abctest" seems in recent versions of react native no longer works. tried using npm instead of yarn , tried remove node-modules , caches non of worked. potentially might need run watchman watch-del-all rm...

javascript - AngularJS: Watch form for input change on blur -

i searched many times , haven't found answer or right solution me. wanna create directive control form input change on blur. editing user settings inside tool. so user clicking inside input field form called 'generall', until here nothin should happen, if user editing (typing) nothin should happen. user clicks outside (blur) field, directive should call function 'updatesettings' , give them form name (generall) , name + value fields. could var vars = { formname: 'generall', fields: {allfields} } . i tried allready function: return { require: "form", link: function(scope, element, attrs){z var cb = $parse(attrs.formonchange); element.on("change", function(){ cb(scope); }); } }; here code: https://plnkr.co/edit/krjtjvcs9kxrckmh3mv6?p=preview use element.on("blur",function(){}) sample directive app.directive("mydirective", function ($rootscope) { return { ...

javascript - Php error on ajax call script -

well start want tank the script create table send empty info have try this: http://mediaads.eu/villageop/back/savepoints.php?user_id=abcdefghijklm now script wen call give me error: so have edit script code clean code is: <?php header('access-control-allow-origin: *'); error_reporting(e_all); ini_set('display_errors',1); $servername = "localhost"; $username = "publiadd_publix"; $password = "1a3g7893fsh"; try { $conn = new pdo("mysql:host=$servername;dbname=publiadd_registervillageop", $username, $password); // set pdo error mode exception $conn->setattribute(pdo::attr_errmode, pdo::errmode_exception); echo "connected successfully"; } catch(pdoexception $e){ echo "connection failed: " . $e->getmessage(); } if(isset($_get['user_id'])){ //$user_id = intval($_get['user_id']); //lightly sanitize get's prevent sql injections , possible xss ...

Java - Get repeated array elements and their repetition number -

i want extract , count repeated array elements in example: int arr []= {7,4,3,0,2,0,5,2,13,2,0,3}; the output should 2 repeated 3 times 0 repeated 3 times 3 repeated 2 times there trial code in java: public static void repeated(int x[]){ int i, j; int counter = 0; for(i=0 ; i<x.length ; i++ ){ boolean isrepeat = false; for(j=i-1 ; j>=0 ; j--){ if(x[i] == x[j]){ isrepeat = true; counter++; } } if(isrepeat){ counter = counter+1; system.out.println(x[i] + " repeated " + counter + " times"); counter = 0; } } } public static void main(string[] args) { int arr []= {7,4,3,0,2,0,5,2,13,2,0,3}; repeated(arr); } but output is: 0 repeated 2 times 2 repeated 2 times 2 repeated 3 times ...

javascript - Make elements below absolute positioned div clickable -

i working on project need upload screenshots copy pasted browser. system works have problem click images show them in full-screen. i made jsfiddle of looks like: <div id="screenshot-container" class="vertical-scroll-div"> <div id="editor" contenteditable="true"> </div> <img class="screenshot" src="https://blog.xenproject.org/wp-content/uploads/2014/10/testing.jpg" /> <img class="screenshot" src="https://blog.xenproject.org/wp-content/uploads/2014/10/testing.jpg" /> <img class="screenshot" src="https://blog.xenproject.org/wp-content/uploads/2014/10/testing.jpg" /> <img class="screenshot" src="https://blog.xenproject.org/wp-content/uploads/2014/10/testing.jpg" /> <img class="screenshot" src="https://blog.xenproject.org/wp-content/uploads/2014/10/testing.jpg" /> </div> .v...

dictionary - Scale path to fit SVG height without blind trial and error -

Image
this feature var singaporejson = {"type":"featurecollection","geocoding":{"creation_date":"2016-01-09","generator":{"author":{"name":"mapzen"},"package":"fences-builder","version":"0.1.2"},"license":"odbl (see http://www.openstreetmap.org/copyright)"},"features":[{"properties":{"name:display":"singapore","name":"singapore"},"geometry":{"type":"multipolygon","coordinates":[[[[104.5706735,1.4419380999999996],[104.55258289999996,1.4106225999999995],[104.3891305,1.3172011999999995],[104.3488465,1.3331733],[104.35531379999998,1.3563739000000001],[104.37827119999996,1.4102812999999996],[104.4633395,1.4991501],[104.48455620000003,1.5130449],[104.486389,1.5123502],[104.4986883,1.5064215999999995],[104.52192920000003,1.4921171000000004],[104.5...

php - Selecting average value from multiple rows -

i have 2 columns in mysql database i.e. totalrating , ratingdate. there exists multiple values of totalrating against on date e.g. there can 5 totalratings on date 2016-08-29, 4 on 2016-08-30. using chartjs show graph of totalrating , ratingdate. want take average of totalratings of single date , plot on graph i.e. 1 totalrating 1 date. using php backend. can me queries? using below query can find average rating dates. select avg(totalratings) avgrating, date your_table group date;

typescript - ngSubmit refreshes the page in Angular 2 form -

Image
i using angular2 template creating form. when click on button, pages refreshes. my validations working fine. how can stop page refresh when user clicks on button? following html using:- <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title">add employee</h3> {{model | json}} {{ename.errors | json}} </div> <div class="panel-body"> <form (ngsubmit)="onsubmit(empform)" #empform="ngform" autocomplete="off" novalidate> <div class="form-group"> <label for="employeename">employee name</label> <input type="text" class="form-control" id="employeename" placeholder="employee name" required [(ngmodel)]="model.ename" name="ename" #ename="ngmodel" ngcontrol=...

javascript - TypeError: header name must be a valid http token in nodejs -

Image
this code var http = require('http'); var hostname = 'localhost'; var port = 3000; var server = http.createserver(function (req,res) { console.log(req.headers); res.writehead(200,{'content-type':'text/html'}); res.end('<h1>this hello word</h1>'); }); server.listen(port,hostname,function () { console.log(`server running @ http://${hostname}:${port}/`); }); error have got, node version use v4.4.7

vertica sql delta -

i want calculate delta value between 2 records table got 2 column id , timestamp want calculate delta time between records id |timestamp |delta ---------------------------------- 1 |100 |0 2 |101 |1 (101-100) 3 |106 |5 (106-101) 4 |107 |1 (107-106) i work vertica data base , want create view/projection of table on db. is possible create calculate without using udf function? you can use lag() purpose: select id, timestamp, coalesce(timestamp - lag(timestamp) on (order id), 0) delta t;

android - How to show gallery icon in Camera View? -

Image
image a image b the first image screenshot of default camera view , second image screenshot of camera view open intent on app. the problem default camera have gallery icon .how can show gallery icon when open camera app ? i used code open camera intent takeimageintent = new intent(mediastore.action_image_capture);

sharedpreferences - is there any method to change font style,color in android Preferences? -

i have created custom preferences app, uses sharedpreferences save data , used preferenceactivity. need modify appearance.including font style,color,font type if possible,add custom colors,background,add images etc. can that?if so,please help first create extend textview class , create custom typeface. go style folder , create new style , set color , size there.

excel - Proportional distribution -

Image
can please me understand how distribute amount using coefficient , quantity every part using formula or vba macro? table large manually. please find excel table extract sample. "amount distributed" column corresponds "key" , each cell duplicated, e.g. cells e2-e4 should not summarized. first line of each duplication occurence in "amount distributed" column should distributed using "coefficient" , "quantity". e.g. want 733134.89/(110+60+90) distribute given proportionally d2, d3, d4 many in advance. given data @ present (which should shown in op , not merely via link or image): and assuming columnf shows trying achieve, pivottable values of amount distributed proportionally max of, count of , sum of last shown % of grand total: would provide values formula in l2 , copied down suit of: =k2/j2 which basis lookup table formula in f2 , copied down suit of: =vlookup(a2,h:l,5,0)