Posts

Showing posts from August, 2015

c++ - Visual Studio 2013 Graphics Diagnostics throws immediate access violation in dxgi.dll -

Image
i wanting use visual studio's graphics diagnostics debug shader code, when try "start diagnostics", immediate access violation in dxgi.dll. access violation appears occur before program's main function entered. tried adding sleep inside winmain function attach separate debugger, code never hit. opened 1 of directx sdk sample programs same installation of vs2013 , graphics diagnostics worked fine. tried using graphics diagnostics on program on 2 separate pcs , both threw same access violation. i suspect maybe has project configuration? seems failing establish connection between graphics diagnostics debugger , program before entry point of program called. any ideas appreciated!

java - S3 Presigned Url Callback -

is there way know if has uploaded generated public presigned url of s3? callback trigger servlet. for example: i created presigned url docs amazons3 s3client = new amazons3client(new profilecredentialsprovider()); java.util.date expiration = new java.util.date(); long msec = expiration.gettime(); msec += 1000 * 60 * 60; // add 1 hour. expiration.settime(msec); generatepresignedurlrequest generatepresignedurlrequest = new generatepresignedurlrequest(bucketname, objectkey); generatepresignedurlrequest.setmethod(httpmethod.put); generatepresignedurlrequest.setexpiration(expiration); url url = s3client.generatepresignedurl(generatepresignedurlrequest); // use pre-signed url upload object. then, give url , if upload url , http://example.com/upload invoked data uploaded file. you can use s3 event notifications generate notification. @ objectcreated event. notifications can filtered s3 prefix. (there samples in aws documentation on linked page.)

html - Internet Explorer 11 "n" char based width doesn't fit "n" characters -

i'm building app requires char ("ch") width components. in ie11 doesn't seems working. for example: <input style="width: 5ch; padding: 0; margin: 0; font-family: monospace" maxlength="5"> the width don't fit 5 characters. knows why? couldn't find answer anywhere. plnkr example here edited: i'm using monospace family fonts unlike question better use size attribute : the size attribute gives number of characters that, in visual rendering, user agent allow user see while editing element's value . input { padding: 0; margin: 0; font-family: monospace; } <input size="5" maxlength="5">

angularjs - Angular search not filtering properly -

i have list of json data need able filter typing name in. results should display listings have name in result. hiding other names, , still showing of other listings. how can set filter when type in actors name, shows movie listings actor listed in? this markup used display listings, angular filter code: <div class="row" ng-repeat="movies in results | filter:genre"> <div class="col-lg-12"> <div class="well well-sm"> <div class="row"> <div class="col-xs-3 col-md-3 text-center"> <img src="" alt="poster" class="img-rounded img-responsive" /> </div> <div class="col-xs-9 col-md-9 section-box"> <h2> {{movies.name}} </h2> <div

html - Two divs side by side, the right one's width decided by its content, the left one takes up all available space? -

in right div have image , link. images might load have huge variety of aspect ratios (from 0.38 6.83) , have no control on source images need have proper aspect ratio. that, i've given max-width image thinner width. i'm trying first div ( .owner-info-container ) take left on space in parent second div ( .primary-image-container ) doesn't use. if image doesn't take entire space allowed max-width , i'd left container not leave white space. i've messed floating second div right if first div's content gets wide won't break new line, it'll push second div down. html <div class="owner-address col-xs-12"> <div class="owner-info-container"> <h3>address</h3><br/> <span class="owner-info"> <span class="header">owner name</span><br/> <span>name goes here</span> </span> </div> <div class="primary

C#: Trying to aggregate a dictionary with a tuple<datetime,int> key using the datetime and one of the associated values -

i've spent few hours trying piece having hard time finding example. have dictionary tuple key , set of values class. want able aggregate (by averaging) value sets datetime , stored value aggregate indicator. i struggling how aggregate based on single part of tuple key , stored value. if in sql like: select datetime, [aggregate value], avg(myaggregatedfields) dictionary group datetime, [aggregate value] but tuple tripping me on one. appreciated, if pointing toward tutorial. reason used tuple needed have 2 values ensure uniqueness. maybe this: class myclass { public datetime time { get; set; } public int otherval { get; set; } public double aggfield { get; set; } } list<myclass> lst = new list<myclass>(); lst.add(new myclass { time = datetime.today, otherval = 4, aggfield = 1}); lst.add(new myclass { time = datetime.today, otherval = 4, aggfield = 2 }); lst.add(new myclass { ti

networking - Does my switch update its router table automatically -

i have hp procurve switch, added 2 new machines network, had assign ip addresses manually. using these 2 machines can ping current machine , other machines on network, if try ping 2 machines current machine (or others on network) not go through. thoughts router table has not updated that's why can't ping them machines have been on router. (not sure, not enough knowledge yet) at least think so. question router table update it's information automatically? assuming hp procurve acting switch, routing table should not problem. switch not route ips, switch concerned routing packets via layer-2 addresses (mac addresses). switch determined physical port connected device mac address, , when gets packet addressed mac address, sends packet out port. mapping on port destination mac address stored in cam table inside switch. different routing table maps ip address ranges physical interfaces. what happening arp not resolving. arp binds layer 3 ips layer 2 macs in local

javascript - uib-popover-template not showing -

hi trying use uib-popover-template on font awesome icon sort of settings menu can't popup show. in header of page using: <h3>{{vm.title}} <i class="fa fa-ellipsis-v pull-right" aria-hidden="true" uib-popover-template="'options-panel.html'" popover-placement="left"></i> </h3> and have ellipses in right corner kind of 'more options' menu. options-panel.html 4-5 <select> dropdowns depending on page looks this: <div class="row"> <div class="form-group col-md-12"> <label for="viwemode">view&nbsp;mode</label> <select id="viewmode" class="form-control" ng-model="vm.currentviewer" ng-options="view view in vm.views" ng-change="vm.viewchange();"></select> </div> <div class="

go - go1.7 not reconizing vendor directory -

i have package i'm trying vendorize. uses capnproto2 package. builds without error when package under $gopath/src/zombiezen.com/go/capnproto2 fails when move vendor directory. project located under gopath. $ go build ../fram/rim/fsd.go:7:8: cannot find package "zombiezen.com/go/capnproto2" in of: /home/mjohn/software/go/src/zombiezen.com/go/capnproto2 (from $goroot) /home/mjohn/workspace/gopath/src/zombiezen.com/go/capnproto2 (from $gopath) ../fram/rim/schema.capnp.go:7:2: cannot find package "zombiezen.com/go/capnproto2/encoding/text" in of: /home/mjohn/software/go/src/zombiezen.com/go/capnproto2/encoding/text (from $goroot) /home/mjohn/workspace/gopath/src/zombiezen.com/go/capnproto2/encoding/text (from $gopath) ../fram/rim/schema.capnp.go:8:2: cannot find package "zombiezen.com/go/capnproto2/schemas" in of: /home/mjohn/software/go/src/zombiezen.com/go/capnproto2/schemas (from $goroot) /home/mjohn/workspace/gopath/src/zo

javascript - Return value from Socket.io function in Angular factory -

i have sockets factory defined return array coming server in data argument of socket.on('user_entrance') . .factory('sockets',function(){ var user_name = window.prompt('enter name'); var socket = io('http://localhost:3002'); var online_users = []; socket.emit('user_name', user_name); socket.on('user_entrance', function(data,my_id){ online_users.push(data); }); return online_users; }) and in controller want use online_users , inject dependency on "sockets factory" so,but returns undefined. .controller('chatsctrl', function($scope, chats,sockets) { //this undefined console.log(online_users); }) however whats strange if run code in controller works fine. .controller('somectrl',function(){ var user_name = window.prompt('enter name'); var socket = io('http://localhost:3002'); var online_users = []; socket.emit('user_name', user_name); socket.on('user_e

javascript - How to use bootstrap modal for multiple controllers? -

i want use same modal window different parent controller, difference in modal controller separate factories calling e.g ctrl-1-factory.getserverfiles want call ctrl-2-factory when modal populated ctrl2 . modalctrl.js angular.module('app').controller('serverfilesctrl', function($scope, $rootscope, filesaver, $uibmodalinstance, ctrl-1-factory, $uibmodal) { 'use strict'; $scope.cancel = function() { $uibmodalinstance.close(); } ctrl-1-factory.getserverfiles().then(function(response) { $scope.data = response.data; console.log($scope.data); }); }); ctrl-1.js $scope.modalinstance = $uibmodal.open({ templateurl: '/web/global/modal.html', controller:'modalcontroller' }); ctrl-2.js $scope.modalinstance = $uibmodal.open({ templateurl: '/web/global/modal.html', controller:'modalcontroller' }); you can wrap in

Using Shared Compilation with Roslyn in a self contained build environment? -

we have upgraded our build system vs 2013 2015 update 2 , our build times have increased dramatically. our build environment self-contained, run msbuild package (using devpath) rather installed location. looking @ logs appears increase in build time in csc build task. installing msbuild on machine has no impact, although if run installed location rather our self-contained location build times similar see 2013. when running installed location can see shared compliation being used message " using shared compilation compiler directory: c:\program files (x86)\msbuild\14.0\bin ". @ moment under impression enabling shared compilation our build times, haven't been able working our self-contained environment. setting "usesharedcompilation" true has no impact , doesn't result in message above during build. is there way enable shared compilation roslyn when running msbuild path other installed location? have tried overriding "csc" task alto

Foreach Loop in PowerShell Not in Order -

i working config file powershell , every time call foreach loop grab data grabs in wrong order. see below: config.ini [queries] query01=stuff1 query02=stuff2 query03=stuff3 query04=stuff4 the foreach loop: #loads ini file data variable $inicontent = get-inicontent 'config.ini' #grabs hashtable data under [queries] section $queries = $inicontent['queries'] foreach($query in $queries.getenumerator()) { write-host $query.name } i following output: stuff1 stuff4 stuff2 stuff3 i assuming has asynchronous processing powershell, best way handle queries config.ini file in order store them in there? note: added number end of query ( query01 ) testing purposes. queries not have them in final config.ini . edit: get-inicontent function: function get-inicontent ($filepath) { $ini = @{} switch -regex -file $filepath { “^\[(.+)\]” # section { $section = $matches[1] $ini[$section] = @{}

assembly - Dynamic recompilation on the same architecture -

i know dynamic recompilation can used translate instructions 1 architecture during execution. can used optimize program on same architecture? if write poorly optimized assembly language program, can use dynamic recompiler make run faster native speeds? it's impossible create code runs faster native speed, fastest code possible still runs @ native speed only. :) if mean "faster original code", yes, it's possible create tool such purpose, quite difficult make practical , successful. reasoning: with native-compiled languages c++, compiling original source compiler has many strong hints original intent of programmer, , optimizer can more aggressive, not blindly translating char char machine code, producing code holds language definition (ie. omitting whole function call, when result not used, , there's no side effect of function execution). once try optimize native machine code only, wouldn't have additional context. new optimized code must mi

c# - Improve an SQLite query that returns many records -

i have query gets executed on sqlite database table wpf application; query can return large amount of records (from 80000 1 million) down-sample before displaying it. takes 10 seconds return 700000 records, can optimized in way? the clause filters records date time column: (where collectedon > @starttime , collectedon < @endtime) and i'm selecting of 18 columns of table. number of columns influence executing time of query? thanks comments. should point out few more things: the data collect needs displayed in chart; since want display 600 points algorithm picks 1 point every 600 700000 records. can achieved in single query? these of things consider: further narrowing down number of returned records (you said down-sample before displaying... can down-sample within database or clause)? do need records @ once? maybe paging (see limit , offset ) you try use index speed query. use explain find out query exactly... afterwards can optimize joins , selecti

javascript - Get height of flexbox row -

Image
i have flexbox container items on each row overflow, , go onto next line. each item aligned baseline; hence, rows can of varying sizes depending on items on row , how align baseline. the items pictured below being centered @ baseline: i wondering if there way dynamically row height? or distance each item's baseline top/bottom of row? i can set hover state around items allow hover stretch on item , have height go way top of each row, hence hover each items follows: my attempt: codepen /* on hover want box around item, , have top , bottom of border touching top/bottom of row on */ .flex-item:hover { border: 1px solid darkred; } /* item doesn't move when not hovering */ .flex-item { border: 1px solid lightblue; } .flex-container { overflow: hidden; position: relative; display: -webkit-flex; display: flex; -webkit-align-items: baseline; align-items: baseline; width: 400px; height: 350px; background-color: lightblue;

c - Matlab: Help understanding sinusoidal curve fit -

Image
i have unknown sine wave noise trying reconstruct. ultimate goal come c algorithm find amplitude, dc offset, phase, , frequency of sine wave prototyping in matlab (octave actually) first. sine wave of form y = + b*sin(c + 2*pi*d*t) = dc offset b = amplitude c = phase shift (rad) d = frequency i have found this example , in comments john d'errico presents method using least squares fit sine wave data. neat little algorithm , works remarkably having difficulties understanding 1 aspect. algorithm follows: algorithm suppose have sine wave of form: (1) y = + b*sin(c+d*x) using identity (2) sin(u+v) = sin(u)*cos(v) + cos(u)*sin(v) we can rewrite (1) as (3) y = + b*sin(c)*cos(d*x) + b*cos(c)*sin(d*x) since b*sin(c) , b*cos(c) constants, these can wrapped constants b1 , b2 . (4) y = + b1*cos(d*x) + b2*sin(d*x) this equation used fit sine wave. function created generate regression coefficients , sum-of-squares residual error. (5) cfun = @(d) [ones(size(x)),

debugging - Visual Studio Code - "Error:spawn jdb ENOENT" trying to debug java app -

this question has answer here: how debug “error: spawn enoent” on node.js? 15 answers i trying debug java application in visual studio code , getting following error: "error:spawn jdb enoent". vs code suggesting update launch.json have following: { "version": "0.2.0", "configurations": [ { "name": "java", "type": "java", "request": "launch", "stoponentry": true, "cwd": "${filedirname}", "startupclass": "${filebasename}", "options": [ "-classpath", "\"${filedirname};.\"" ] }, { "name": "java c

SQL Server trigger insert causes lock until commit -

having trouble locks on related table via triggers. i'm inserting table tcatalog (this has trigger insert record in table tsearchqueue ). insert tcatalog inside transaction has lot of other functions takes several seconds. however, tsearchqueue table locked until transaction can committed. there way avoid this? insert [dbo].[tsearchqueue] (processed, sql, sys_createdate) select 0, 'test ' + cast(catalogid varchar(10)), getdate() inserted begin tran t1 declare @catalogid int insert tcatalog (programid, sys_createdby, itemnumber, description, uomid) values (233, 1263, 'brian catalog4', 'brian catalog4', 416) select @catalogid = scope_identity() insert tcustomattributecatalog (catalogid, customattributeid, defaultvalue, defaultvalueread, sys_createdby) values (@catalogid, 299, 'no', 'no', 1263) insert tcustomattributecatalog (catalogid, customattributeid, defa

Regex expiration date MM/YYYY -

this question has answer here: regular expression describe credit card expiry (valid thru) date 3 answers i'm trying find regex pattern validate credit card expiration date. format mm/yyyy 00/0000 -> not accepted 02/0000 -> not accepted 00/2016 -> not accepted 02/2016 -> accepted 12/2016 -> acceptedenter code here 13/2016 -> not accepted the 2 number of year must 20 year doesn't under 2016 ideas? you want this -- not it's solution: (0[1-9]|10|11|12)/20[0-9]{2}$ ps: requires -e tag if being used grep . pps: answer assumes expiration date @ end of line. ppps: if want explanation, give me ring. :)

node.js - How to check for Object key in javascript for object not inheriting from Object.prototype -

in node 6.x querystring module parses values object not extend object.prototype (although have no idea why change made). given that, expected way check query parameters not contain value, i.e. called express or koa localhost:8080/some/path?keyonly , want check presence of this.query.keyonly ? expected this.query.hasownproperty('keyonly') doesn't work. what's alternative? for background behind change, see original pr here . in general, should not rely on foo.hasownproperty() since hasownproperty reassigned else (hence reason querystring change -- imagine calling web service http://example.org/foo?hasownproperty=hahacrashed ). as far alternatives, check if property defined, example: var qs = querystring.parse('foo=bar'); if (qs.foo !== undefined) { // ... } you like: var qs = querystring.parse('foo=bar'); if (object.hasownproperty.call(qs, 'foo')) { // ... } but isn't efficient because hasownproperty() per

linux - How to create a perforce workspace in a -

i have been allocated rhel 6.8 box, i'd set perforce workspace there. how can set up? don't believe has p4v installed there(maybe that's step 1). or assistance appreciated. yes, installing p4 or p4v logical first step. can find downloads @ https://www.perforce.com/downloads/helix . recommend starting out plain old p4, command-line version, because easy follow steps command-line interface when getting started. documentation setting workspace @ https://www.perforce.com/perforce/r15.1/manuals/p4guide/chapter.configuration.html#db5-17566 . setting workspace presumes has set perforce server can use through workspace. want server information user or administrator. earlier sections of same documentation web page detail server information once have it. hope helps.

sql - Row_Number Date Range -

i'm trying fill in table has personid appointment date, , whether or not follow call made after visit. tbl_appt personid appt_date 1 1/1/2016 1 1/3/2016 1 1/9/2016 1 1/31/2016 tbl_call personid call_date 1 1/5/2016 1 2/1/2016 desired table: tbl_followup personid appt_date follow_up_flag 1 1/1/2016 n 1 1/3/2016 y 1 1/9/2016 n 1 1/31/2016 y the tbl_followup.follow_up_flag = y when tbl_call.call_date > tbl_appt.appt_date , before next appt. i assume use row_number/partition, these functions allude me (see prior posts). thanks in advance! not extremely trivial, assuming have access window functions such row_number , here's option using lead , outer join : select a.personid, a.appt_date, case when c.personid null 'n' else 'y' end follow_

angular - Javascript "Import" Keyword as Used in Angular2? -

Image
import {component, view} "angular2/core"; what angular2/core part here? thought reference. on checking mdn on subject , still don't it, syntax clear: import { member1 , member2 } "module-name"; module-name : name of module import. file name. i don't understand whether or not supposed path, "file name" implies - js file in "angular2" folder. doesn't seem be, since angular files in 'node_modules' folder , don't have called "angular2" there (i have called "@angular" "core" folder). if core folder it, don't understand syntax. why "@"? why not path? why mdn file-name when it's folder? basically, how import statement work, exactly? another example of in plunk maintained angular team (afaik), in app.ts: import {component, ngmodule} '@angular/core' edit: adding screenshot - there auto-magic going on , don't understand how works. if file in "

Typescript method overloading in subclass -

here's example: class { func(): void {} } class b extends { func(a: number, b: string): void {} } class b gives error saying func() implemented incorrectly. ultimately, i'm trying make work: var b: b; b.func(0, ''); // func overloaded b b.func(); // func inherited is possible in typescript? update : fixed code, accidentally used function properties instead of methods. when using arrow functions don't class methods members of type/value of function. difference being while methods added prototype, arrow functions added instance in constrctor: class myclass { method() {} funct = () => {} } compiles to: var myclass = (function () { function myclass() { this.func = function () { }; } myclass.prototype.method = function () { }; return myclass; }()); that's fine of course, if that's want. main problem overloading , calling parent method aren't simple. in case, overloading

javascript - The business case for getElementById() -

it's understanding every modern browser, both desktop , mobile, surfaces elements ids global javascript namespace. still, people on industry keep using document.getelementbyid() or jquery cousin $("#theid") . for cases not pathological (e. g. id matches object in global namespace), there reason doing so, other misplaced concern backwards compatibility? how far in time have go starts mattering? edit: consider following: <html> <body> <input type="hidden" id="foo" value="hello world"/> <input type="button" onclick="alert(foo.value);" value="press this"/> </body> </html> it displays "hello world" on msie on windows, chrome, firefox, opera, safari on mac, safari on ipad, android browser, msie on windows phone... why use document.getelementbyid("foo").value instead? for cases not pathological (e. g. id matches object in global namespace)

javascript - How can I retrieve info with UrlFetchApp.fetch using Google Apps Script -

i have question. coded piece of google apps script, i´m not getting result i´m waiting for function getdatafromquery(myid){ var data; var sqlslect = encodeuricomponent("select a, b, c, d, e, f, g, h, i, j, k ="+myid+" "); try{ var fullquery = "https://docs.google.com/a/google.com/spreadsheets/d/my_google_spreadsheet_id/gviz/tq?tq="+sqlslect+"&gid=the_sheet_where_info_is"; logger.log("<full query> "+fullquery); data = urlfetchapp.fetch( "https://docs.google.com/a/google.com/spreadsheets/d/my_google_spreadsheet_id/gviz/tq?tq="+sqlslect+"&gid=the_sheet_where_info_is"); logger.log("<result> "+data.getcontenttext()); } catch (e) { logger.log("< error > " + e.tostring()); } return data; } ¿does can give me idea happening? thanks attention!

javascript - Enable CORS on Cloudant local -

Image
i have setup cloudant local database using docker image. when try send in cloudant query using javascript application hosted on localhost:8000 gives me cors error. how enable cors on cloudant local? have tried following put request described in https://docs.cloudant.com/cors.html#setting-the-cors-configuration checked dashboard local instance not have "account" tab available. same answer @anirus, there's very kludgy way around it. if have named container cloudant-developer in current instructions @ https://hub.docker.com/r/ibmcom/cloudant-developer/ : save stock default.ini file locally: docker exec cloudant-developer cat /opt/cloudant/etc/default.ini > default.ini modify enable_cors = true instead of false in [cors] section, add line origins = http://localhost:3000 . should take comma delimited list, you're working on 1 app @ time. volume mount modified default.ini on original whenever run container adding -v `pwd`/default.ini:

javascript - Coldfusion, 5 forms submit to iframe -

i have 5 forms in coldfusion submit 1 iframe, , iframe calls coldfusion page. forms , iframe working fine. problem need wait 1 form finish submitting call submit of form. $("#form1").attr('action', 'uploadpicturesvideos.cfm'); $("#form1").attr('target', 'uploadiframe'); $("#form1").submit(); $("#form2").attr('action', 'uploadpicturesvideos.cfm'); $("#form2").attr('target', 'uploadiframe'); $("#form2").submit(); $("#form3").attr('action', 'uploadpicturesvideos.cfm'); $("#form3").attr('target', 'uploadiframe'); $("#form3").submit(); $("#form4").attr('action', 'uploadpicturesvideos.cfm'); $("#form4").attr('target', 'uploadiframe'); $("#form4").submit(); $("#form5").attr('action', 'uploadpicturesvideos.cfm'); $

css - How do I make an `hr` with repeating small images? -

i have 256x256 image called myimg.png . want make hr element uses repeating 16x16 versions of myimg.png . my css far: hr#target { border: 0; height: 15px; background-color: #333; background-image: url(myimg.png); background-repeat: repeat-x; overflow: hidden; } but shows 2 repetitions of image @ full 256x256 size can see 15px of it. how make hr background image row of small versions of myimg.png ? use background-size in: hr#target { border: 0; height: 15px; background-color: #333; background-image: url(myimg.png); background-repeat: repeat-x; background-size: 16px 16px; overflow: hidden; } as @bjskistad mentioned, should using image that's sized correctly.

css - Have a transparent when hover each images(not background) -

i have code <div class="photo"> <img src="images.jpg"> <div class="text">its transparent</div> </div> i have tried css .text{ opacity:0.8; background-color:#ccc; position:fixed; width:100%; height:100%; top:0px; left:0px; z-index:1000; } also this .text{ background: rgba(0, 0, 0, 0.28) none repeat scroll 0 0; color: #fff; position: relative; top: -240px; width:100%; height:100% } i want text above in images (not background) transparent background. have transparent doesnt cover whole images. have tried doesnt apply me. allow div cover whole page instead of area within container background images: how fill whole div if image small , vice versa have background image transparent colour you set .photo { position: relative; } use position: absolute; .text div.photo .text { position: absolute; top: 0; right: 0; bottom: 0; left: 0; } try o

swift - How to reload UITableView without printing data twice? -

i have single view of slacktextviewcontroller works uitableview. i'm switching between "states" using public string allowing read 1 set of data in state , set of data in state. problem when switch , forth original state prints data 2, 3, 4 times; many go , forth. i'm loading data firebase server , think may firebase issue. here code... override func viewwillappear(animated: bool) { super.viewwillappear(animated) if chatstate == "all" { self.globalchat() }else if chatstate == "local" { self.localchat() } } override func viewdiddisappear(animated: bool) { self.messagemodels.removeall() tableview.reloaddata() ref.removeallobservers() } func chatactn() { if chatstate == "all" { self.viewwillappear(true) }else if chatstate == "local" { self.viewwillappear(true) } } func globalchat() { self.messagemodels.removeall() tablevie

mysql - hive broke after dropping a table -

i had installed hive 2.0.0 on hadoop cluster using mysql metastore. hive works fine until yesterday when tried dropping table actual .orc file in hdfs had been deleted. after that, hive broke. first, hive command line hang several minutes before giving hive> prompt. second, if type show databases; on hive command line, again hang long time , gave errors caused by: java.sql.sqlexception: access denied user 'hive'@'namenode01-bi-dev' (using password: yes) tried following command posted on other question , got same problem. hive --service metastore i had searched through stackoverflow error. post setting mysql privileges. don't think case problem. had checked several time on hive-site.xml , mysql user have correct privileges. if it's privilege problem , how can hive worked fine before dropping table. in case,below related hive-site.xml fields: <property> <name>javax.jdo.option.connectionpassword</name> <value>hive</v

c++ - What does int **p in mean? -

i understand use when need give pointer array of pointers in dynamic memory don't understand how works in stack. does make array of pointers in stack pointing array of pointers in heap or make single pointer in stack pointing array of pointers in heap? if yes, difference between int **p = new int*[100] and int *p = new int[100] thanks in advance. have been trying understand long time , have read lot of documentation online still don't understand this. int **p declares pointer on stack points pointer(s) on heap. each of pointer(s) point integer or array of integers on heap. this: int **p = new int*[100]; means declared pointer on stack , initialized points array of 100 pointers on heap. each of 100 pointers point nowhere. "nowhere" mean point neither valid chunk of memory, nor nullptr s. not initialized, contain garbage value in memory before pointers allocated. should assign sensible them in loop before usage. note p[0] - p[99] pointers

python - Seaborn FacetGrid cutting off charts -

Image
i have data want visualize in seaborn facetgrid . half_counts = all_counts.loc[all_counts['location_id'] <= 50] g = sns.facetgrid(half_counts, col="location_id", col_wrap=10) g = g.map(sns.pointplot, "invite_sent_time", "q_i_ratio", scale=.7) however, resulting plots cut off: how fix this?

How to repeat same codes in 10 times and get those results in R? -

here code: f.x <- function(x) { 60*x^3*(1-x)^2 } x <- seq(0, 1, length=100) n.samps <- 1000 n <- 0 # counter accepted <- 0 # iterations samps <- numeric(n.samps) while (n < n.samps) { y <- runif(1) <- + 1 u <- runif(1) if (u < f.x(y) / 2.0736) { n <- n + 1 samps[n] <- y } } i want repeat code above 10 times, each time "i" produced. want take average of these ten "i". instead of run code each time, there way can run 1 time 10 trials? you can try placing entire script function, , call 10 times loop: getvalue <- function() { x <- seq(0, 1, length=100) n.samps <- 1000 n <- 0 # counter accepted <- 0 # iterations samps <- numeric(n.samps) while (n < n.samps) { y <- runif(1) <- + 1 u <- runif(1) if (u < f.x(y) / 2.0736) { n <- n + 1 samps[n] <- y

javascript - Release toggle effect when clicking on another link -

i have javascript causes link change background color when clicked: $(".button").click(function(){ $(this).css('background-color', '#555'); }); and works, color toggle off when click on link. you can this $(function() { $(".button").click(function() { $(this).css('background-color', '#555'); $(".button").not($(this)).css('background-color', ''); }); }); jsfiddle

newline - Does Visual Studio have "advanced save options" -

does visual studio have options such as: save advanced opiton crlf lf save without bom etc? advanced save options dialog box use dialog box select language encoding scheme , specify characters inserted @ end of each line. to access dialog box, open code file editing in visual studio 2010 , click advanced save options on file menu . encoding use list box apply new language encoding scheme target file. line endings to ensure target file runs on specific operating system, select whether carriage return (for macintosh systems), line feed (for unix systems), or both characters (for windows systems) marks end of each line. https://msdn.microsoft.com/en-us/library/66d2abf2(v=vs.100).aspx

xctest - How to Wait for an element and do not fail if not found after a certain time xcuitest -

in application have 2 tab buttons tasks , worklist. tasks loaded. worklist button dynamic , loaded after time. i want click tasks button after time. ie, need wait worklist button , if exists after time click tasks button. if timeout exceeds , worklist button not loaded need click tasks button. i cannot use sleep. can use expectationforpredicate , waitforexpectationswithtimeout. waitforexpectationswithtimeout gets failed if element not found after timeout. if write waitforexpectationswithtimeout(120) { (error) -> void in click tasks button } this gives stall on main thread. i want click tasks button after worklists loaded. if worklist not loaded after timeout, need click tasks button.. is there solution. help. you can create own custom method handle this: func waitforelementtoexist( element: xcuielement, timeout: int = 20, failtestonfailure: bool = true) -> bool { var = 0 let message = "timed out while waiting elem

java - How to make JVM use the max (all remain) memory of a server -

i have dfs algorithm java console application, runs faster when more memory provided. dfs algorithm application, neither i/o nor other outer-jvm resource usage. consumes cpu , memory. application can run 1gb memory, run more faster 2 gb memory. more memory provided, faster application can run. haven't touch speed limit 12gb of memory provided. must use remain memory of server speed up. , application need not parallel, 1 request @ 1 time. and need install application on different server different memory size. is there way let jvm use remain memory of server? -xx:maxramfraction=1 maxramfraction not every server good, server result in start jvm failure location memory failure, works good. use wrapper application system remain memory, , minus memory usage other xmx, start real application same xms , xms. method result in jvm memory allocation error. because code below returns more memory can use, not minus of xss256m or more non-heap jvm memory. com.sun.management.opera

Xen guest VM with two static IP address -

i have installed xen4centos on centos7, having single nic bridge network , have 2 vms on that. in 1 vm, want add 2 static ip 1 webserver , 1 mail server. so have created ip alias in guest vm, created not pinging outside public network or host. so if have idea how add second ip in guest vm please let me know. i have searched on google of tutorials had given example 1 ip only. i have figure out way listen second ip public network. i have added second interface in vm configuration file mac address, inside vm looks eth0 , eth1. then have created routing table eth1 , added default gateway eth1. [ ip route add default via xxx.xx.xxx.112 dev eth1 table eth1 ]. so doing way second ip in vm reachable public network.

python - FormSet saves the data of only one form -

when submitted forms (but on page filled id more 1 form) - formset saves data of 1 form, rest of data disappear... my template: <div id="data"> <form method="post" action="/lookup/" id="test_data">{% csrf_token %} {{ formset.management_form }} {% form in formset %} <section id="test_data_row"> {{ form }} </section> {% endfor %} </form> </div> <div class="bt"> <button type="submit" class="btn btn-default" id="submit_form" form="test_data">submit</button> <button type="button" class="btn btn-default" id="add" value="add row"/>add row</button> </div> my forms.py: class lookupform(forms.modelform): class meta: model = exclude = () lookupformset = formset_factory(lookupform, can_delet

javascript - jQuery Round Slider add shorthand values to range -

i'm using round slider in application slider type range. range varies 0-2 million. have requirement if value above 1000, should represented such 1k (1200 1.2k), , if value above 1000000, should represented such 1m (1200000 1.2m). far not find way this. if there way this? thanks in advance you can use tooltipformat property achieve behaviour html <div id="slider"></div> js window.formatter = function(e) { if (e.value >= 1000000) { return math.round(e.value / 100000) / 10 + "m"; } if (e.value >= 1000) { return math.round(e.value / 100) / 10 + "k"; } return e.value; } $("#slider").roundslider({ slidertype: "min-range", value: 45, max: 2000000, tooltipformat: "formatter" }); http://jsfiddle.net/osjo/4g5r0mex/4/

php - Creating a custom top menu in magento 1.9.2 -

i'm trying crate custom top menu in magento 1.9.2 overriding app/code/core/mage/catalog/block/navigation.php adding custom classes. created a new local extension has following file on it app/etc/modules/customnav_catalog.xml <?xml version="1.0"?> <config> <modules> <customnav_catalog> <active>true</active> <codepool>local</codepool> <version>0.1.0</version> </customnav_catalog> </modules> </config> app/code/local/customnav/catalog/etc/config.xml <?xml version="1.0"?> <config> <modules> <customnav_catalog> <version>0.1.0</version> </customnav_catalog> </modules> <global> <helpers> <customnav_catalog> <class>customnav_catalog_helper</class> </customnav_catalog> </helpers> <blocks> <customnav_catalog>

swift - Check if date is correct in IOS -

currently, grabbing current date nsdate().timeintervalsince1970. however, concerned user change date on phone mess app. wondering of 2 options below more suitable fix is there sort of apple way grab current date apple server. is there , reliable api can grab current date? use timeapi available @ www.timeapi.org you can retrieve current time in utc here.

node.js - Babel transform-async-to-module-method to Bluebird with ES6 maps -

we're trying use node.js 6.5.0 babel make async functions use bluebird instead of native v8 es6 promises: our package.json contains following babel entries: "devdependencies": { "babel-cli": "^6.9.0", "babel-plugin-transform-async-to-module-method": "^6.8.0", "babel-plugin-transform-es2015-destructuring": "^6.9.0", "babel-plugin-transform-es2015-modules-commonjs": "^6.14.0", } and .babelrc : { "plugins": [ "transform-es2015-modules-commonjs", "transform-es2015-destructuring", [ "transform-async-to-module-method", { "module": "bluebird", "method": "coroutine" } ] ] } however our async functions returning es6 map cause following error during execution: a value [object map] yielded not treated promise how fix this? p.s. worked

java - Hibernate 5 import cannot be resolved -

i'm working on maven project in eclipse , got error hibernate imports. here maven xml file , java file: pom.xml (some jboss , tomcat dependencies omitted relevance) <dependency> <groupid>javax.transaction</groupid> <artifactid>jta</artifactid> <version>1.1</version> </dependency> <!-- spring , transactions --> <dependency> <groupid>org.springframework</groupid> <artifactid>spring-context</artifactid> <version>4.3.2.release</version> </dependency> <dependency> <groupid>org.springframework</groupid> <artifactid>spring-tx</artifactid> <version>4.3.2.release</version> </dependency> <dependency> <groupid>org.springframework</groupid> <artifactid>spring-jdbc</artifactid> <version>4.3.2.release</version> </dependency> <!-- spring or

c# - What creational pattern I should use? -

my program have 2 classes; both derive same base class. class : mybase { internal a(initval initval) } class b : mybase { internal b(initval initval) } initval class injected through constructor. class internal usage. due internal constructor, user cannot create instance of class a , b directly. instead, created method creates these objects. class initiator { initval initval; public t createobject<t>(objectinstance objectinstance) t : mybase { mybase mybase = null; switch(objectinstance) { case objectinstance.a: mybase = new a(initval); break; case objectinstance.b: mybase = new b(initval); break; } return (t)mybase; } ... } objectinstance enum in above code. this works without problem sure have never seen such ugly code earlier. please suggest creational pattern should use. want remove objectinstance en