Posts

Showing posts from June, 2013

javascript - How to calculate angle between two planes? -

i have 2 planes, how can calculate angle between them? possible calculate angle between 2 object3d points in case of planes? heres example fiddle: https://jsfiddle.net/rsu842v8/1/ const scene = new three.scene(); const camera = new three.perspectivecamera(45, window.innerwidth / window.innerheight, 1, 1000); camera.position.set(25, 25, 12); var material = new three.meshbasicmaterial({ color: 0x00fff0, side: three.doubleside }); window.plane1 = new three.mesh(new three.planegeometry(10, 10), material); scene.add(plane1); plane1.position.set(0.3, 1, -2); plane1.rotation.set(math.pi / 3, math.pi / 2, 1); window.plane2 = new three.mesh(new three.planegeometry(10, 10), new three.meshbasicmaterial({ color: 0x0fff00, side: three.doubleside })); scene.add(plane2); // setup rest var pointlight = new three.pointlight(0xffffff); pointlight.position.x = 10; pointlight.position.y = 50; pointlight.position.z ...

sql - MonetDB - Table added to merge table multiple times, can't remove or drop it -

i have monetdb merge table 620 million rows of data in it, let's call merge_table . has 14 member tables, each containing monthly data (e.g. data1701 january 2017). java program handles loading data database , adding/removing member tables somehow managed add same table merge table multiple times. problem can't remove these duplicated tables merge table, though monetdb says operation successful: alter table myschema.merge_table drop table data1708; operation successful (0.608ms) then, when try drop table: drop table myschema.data1708; drop table: unable drop table data1708 (there database objects depend on it) of course, when list members of merge_table , data1708 still there. is there other method use remove these duplicates? edit: monetdb version 11.25.23 (monetdbd[21491] 1.7 (dec2016-sp5)). jdbc version 2.19. running drop table command multiple times yields same results. trying add of tables again doesn't work, works expected without j...

java - Hibernate doesn't include schema into query -

this question has answer here: how set default schema name in jpa configuration? 4 answers according configuration, hibernate dao repository should send query this: insert some_schema.some_table (...) values (...) instead, hibernate sends this: insert some_table (...) values (...) it omits schema prefix. without prefix getting ora-00942, table not exist oracle database error. how force hibernate send schema prefix? p.s. question similar this question , adding default schema doesn't work me, because using more of them. configuration of entity this: <hibernate-mapping> <class name="com.somepackage.someclass" table="some_table" schema="some_schema"> <id name="someid" type="int" column="some_table_id"> <generator class="increment"/> </id> <...

openerp - what should I add to display the value of fields correctly? -

what should add display user_id , cat correctly @api.model def create(self, vals): record=super(test, self).create(vals) if vals['total'] > 0: vals['date'] = fields.datetime.now() self.env['journal'].create({ 'user_id': record.patient_id, 'cat': record.cat,}) .... ..... on tree view (journal): user_id displayed test.user(6,) cat displayed cat1 edits: class test(models.model): _name = 'test' cat = fields.selection( required=true, related='test_type_cat.name', store=true, ) user_id = fields.many2one('res.users', string='user', readonly=true,) ..... @api.model def create(self, vals): record=super(test, self).create(vals) if vals['to...

ios - Swift : ARKit Save ARPlaneAnchor for next session -

arkit quite new , quite new in swift... i'm having troubles... i'd save arplaneanchor detected during session , reload them when relaunch app. phone @ same place , i'd scan room 1 time. , remembering anchor found in room everytime launch app. i tried several solutions : solution1 : save arplaneanchor using : nskeyedarchiver.archiverootobject(plane, tofile: filepath) i got error : terminating app due uncaught exception 'nsinvalidargumentexception', reason: '-[arplaneanchor encodewithcoder:]: unrecognized selector sent instance i think maybe can't save kind of data locally solution2 : store datas of arplaneanchor intantiate them when launch app. datas float. creat aranchor easily, cast them arplaneanchor , not modify "center" , "extend" parameter of arplaneanchor because have getter , not setter. can't create anchors. i open anysolution. think need store aranchor object, not find way without crash! if can ...

Compiling MariaDB C/C++ Connector on Windows -

i trying use mariadb in visual studio project, after looking @ documentation, installed mariadb , downloaded source code c/c++ connector. i got include folder linked project, able make calls functions there, won't build because linker fails find function definitions (obviously). have looked on , cannot find solid directions on building .lib files need. have found 2 sources need build mariadb_connector_c.sln, file not exist in source code got, nor exist on git repo: https://github.com/mariadb/mariadb-connector-c the closest thing have found appveyor.yml file provided, contains following: contents of yml file is there out there has done before? can't find online or in files provided pertaining this. update: i found answer of replies. needed run source code through cmake in order .sln build .lib files need link project. the answer generic answer cmake project install cmake. make sure cmake.exe in path (windows installer offers option). install visual ...

java - How many strings are produced in a .toString.split(","); call? -

suppose have following code: stringbuilder sb = new stringbuilder("521,214"); string[] result = sb.tostring().split(","); my question is: tostring().split(",") generate 2 strings or 3 strings? know result string array have 2 strings - tostring() call generate string - isn't returned? basically, i'm trying limit number of strings created performance purposes , want know if tostring() call brings total number of strings created 3? there 5 string object created in total these 2 lines: "521,214" object passed stringbuilder 's constructor. object in interned pool of strings, "," string object passed split . object in interned pool of strings, an equivalent "521,214" object produced tostring . each call of tostring produces new string object. there no optimization see if in identical string object has been requested before. two string objects "521" , "214" produc...

iOS: How do I know if user left the current screen? -

Image
i want build analytics app , send data when user leaves current screen, though there multiple ways can (back button, other button, sidebar menu, etc). there efficient way this? don't feel implementing every possible button can lead user different screen. you should call function inside viewwilldisappear , called every time current view controller disappear screen. see documentation of viewwilldisappear see view controller life cycle (thanks @paolo tip) below ( documentation ).

python - pandas read_csv usecols and names out of sync -

when trying read columns using indices tabular file pandas read_csv seems usecols , names out of sync each other. for example, having file test.csv : foo -46450.494736 0.0728830817231 foo -46339.7126846 0.0695018062805 foo -46322.4942905 0.0866205763556 foo b -46473.3117983 0.0481618121947 foo b -46537.6827055 0.0436893868921 foo b -46467.2102205 0.0485001911304 bar c -33424.1224914 6.7981041851 bar c -33461.4101485 7.40607068177 bar c -33404.6396495 4.72117502707 and trying read 3 columns index without preserving original order: cols = [1, 2, 0] names = ['x', 'y', 'z'] df = pd.read_csv( 'test.csv', sep='\t', header=none, index_col=none, usecols=cols, names=names) i'm getting following dataframe: x y z 0 foo -46450.494736 1 foo -46339.712685 2 foo -46322.494290 3 foo b -46473.311798 4 foo b -46537.682706 ...

html - Two-column div contained within individual printed pages -

sorry if has been asked before, here goes: i'm creating reports using html , css, though pdf'ed. report needs contain two-column layout on pages, i'm using: <div class="two_columns"> <p>lots , lots of text...</p> <p>and multiple paragraphs...</p> </div> with div.two_columns { -webkit-column-count: 2; /* chrome, safari, opera */ -moz-column-count: 2; /* firefox */ column-count: 2; } however, report section long enough span multiple pages, left column continues onto second page , goes until half text in div displayed, wraps right column on first page. want left column wrap right column on first page until first page filled text, , wrap left column on second page (and display same amount of text in each of 2 columns on second page). there way this? not want have create separate divs individual columns or pages, because length of these different sections depends on features of data, different each unit ...

build - Building an iPhone app exported from Expo using Fastlane (or any other method) -

i have iphone app exporting expo, can build using own hardware. simply put call exp detach call cert sigh gym using fastlane beta this fails build cannot sign application. error is [15:27:30]: ▸ === build target appname of project appname configuration release === [15:27:30]: ▸ check dependencies [15:27:30]: ▸ no profiles 'com.getexponent.appname' found: xcode couldn't find provisioning profile matching 'com.getexponent.appname'. [15:27:30]: ▸ code signing required product type 'application' in sdk 'ios 10.3' clearly picking com.getexponent. somewhere. have correct bundle name set in app.json . i have updated fastfile lane :beta update_app_identifier( xcodeproj: '../ios/appname.xcodeproj', plist_path:'./appname/supporting/info.plist', app_identifier: "com.mycompany.appname" ) cert sigh gym( scheme: "appname", workspace: '../ios/ap...

ios - How to distribute enterprise iPA files -

first of all, let me explain have no experience xcode or apple products whatsoever. have been working developer create ios app business. i'm posting because experience developer has been less awesome , need more professional guidance. the app developer creating intended used communicate employees out in field , not in office. i'm using php program created push out notifications each device app installed on. app looks information on database , displays user , allows them respond. simple communication app. when developer submitted app apple review rejected stating that, determined in-house app intended business purposes. apples response required enterprise version of developer account. i ended paying $299 set enterprise developer account , notified developer apples response. developer hit road block. i'm pretty never had produce app under enterprise account. my request have easy way employees install app on devices. link on website allows them instal...

typescript2.4 - TypeScript 2.4 Generic Inference causing compilation errors -

i seeing existing typescript code break due changes in generic inference. example: interface action { type: string; } interface myaction extends action { payload: string; } interface mystate {} type reducer<s> = <a extends action>(state: s, action: a) => s; const myreducer: reducer<mystate> = (state: mystate, action: myaction) => { if (action.type === "myactiontype") { return {}; } else { return {}; } }; and compilation error: error:(11, 7) ts2322:type '(state: mystate, action: myaction) => {}' not assignable type 'reducer<mystate>'. types of parameters 'action' , 'action' incompatible. type 'a' not assignable type 'myaction'. type 'action' not assignable type 'myaction'. property 'payload' missing in type 'action'. interface myotheraction { type: 'myotheractiontype' ...

oracle - ORA-01722 invalid number though types should match -

table1 dwh.fct_nc_crm_dims@etl4 name null type --------------------------- -------- ------------- ban_key not null number(9) client_name varchar2(300) client_inn varchar2(40) effective_date not null date expiration_date date table2 etl.stg_acrm_ban_attr@etl2 name null type ---------------- ---- ------------- segment_crm varchar2(150) ban_key varchar2(32) table3 evkuzmin_b2b_churn_ban_segment name null type ----------- ---- ------------- ban_key number(9) client_name varchar2(300) client_inn varchar2(40) segment_crm varchar2(150) my query. here join first 2 tables on ban_key , insert result third table. types match, still error. why? insert evkuzmin_b2b_churn_ban_segment select a.ban_key, a.client_name, a.cl...

algorithm - Efficient method to find what elements of Array A are in Array B -

in particle case need javascript code find strings of array in array b. but it's more interesting ask general question: given array a length of n , array b , return boolean[] array of length n such boolean[i] true iff a[i] item in b . what efficient solution problem? both of array unsorted , array b can empty , can larger or smaller array a . there few different ways varying complexities. first, nested loop on both lists , print out elements a when find corresponding solution in b . o(ab) time , o(1) space. second, sort both lists , walk through lists in lockstep looking matches (imagine merge operation in mergesort). o(aloga + blogb) time , either o(1) or o(a+b) space, depending on whether want sort in-place or not. third, sort second list , binary search elements in 1 @ time. o(blogb + alogb) time , o(1) or o(b) space, again depending on whether sort in-place or not. the tosters proposed solution whereby create hash set , repeated queri...

node.js - terminal won't open npm binary even if it's right there -

i have installed global npm package using sudo npm install mtemplate -g . mtemplate package appears in /usr/local/bin directory. shows when type ls in terminal in directory. can see in finder. but when type mtemplate or /usr/local/bin/mtemplate in terminal (or variation thereof) get no such file or directory according docs should possible run mtemplate terminal. why isn't found when it's right there? after head-scratching figured out myself... mtemplate in usr/local links mtemplate.js file in node_modules . .js file had windows line endings, , apparently node on mac won't execute those! after converting line endings unix works...

swift3 - How to create highscores in swift 3 with the spritekit technology -

i trying implement highscore mechanic game working on, tutorials online using uikit instead of spritekit. wondering whether or not put code score in gameviewcontroller or gamescene.swift i'd imagine place you're keeping track of score particular "play" of game in scene, makes sense. what need decide how save high score. basic approach use userdefaults . so when game ends can save score this: let defaults = userdefaults.standard defaults.set(100, forkey: "highscore") that set value "highscore" key whatever specify (in above example 100). of course, you'll need make sure score higher pervious higher one. can load in previous high score this: if let highscore = defaults.value(forkey: "highscore") { if score > highscore { defaults.set(100, forkey: "highscore") } } you can load in "highscore" value anywhere in app. view controller or scene.

python - Pandas reporting series to be an object when it's a decimal -

i need automated reliable way find data type of each column in pandas data frame. have been using .dtype() have noticed unexpected it. consider 10 row data frame: df['a'] out[6]: 0 250.00 1 750.00 2 0.00 3 0.00 4 0.00 5 0.00 6 0.00 7 0.00 8 0.00 9 0.00 name: a, dtype: object type(df['a'][0]) out[9]: decimal.decimal why dtype of entire column 'object' when each entry decimal? need decimal or float or numeric. appreciated! this not error due numpy dtype representation: https://docs.scipy.org/doc/numpy/reference/arrays.scalars.html . basically decimal not principle inbuilt type it's dtype ends being object though actual type of each cell still decimal . it's advised possible use inbuilt scalar types, in case float64 , because arithmetic operations unlikely vectorised though type may numerical. the same observed when store str or datetime.date values, dtype object these.

c# - ASP.NET MVC DateTime Parse -

i've made simple web application , it's work correctly on local db. after publishing, there error connected datetime: system.formatexception: string not recognized valid datetime. the code in viewmodel looks this: [required] [validtime] [display(name = "game time")] public string time { get; set; } [required] [futuredate] [display(name = "game date")] public string date { get; set; } public datetime getdatetime() { return datetime.parse(string.format("{0} {1}", date, time)); } controller code: public actionresult create(gameformviewmodel viewmodel) { if (!modelstate.isvalid) return view("gameform", viewmodel); var userid = user.identity.getuserid(); var game = new game { teama = viewmodel.teama, teamb = viewmodel.teamb, datetime = viewmodel.getdatetime(), leagueid = viewmodel.id, adminid = userid }; _context.games.add(game); _context....

Logback: print text only if a context variable is defined -

i'm using logback logger , i'm putting information in logging context in order print out in log file. i differentiate printed message based on presence of information in context. using name context key: when name key present print like: [name = john] - i'm logging message when name key not present print like: i'm logging message

Artifactory Remote Repositories - does it keep files deleted remotely? -

a repository use regularly deletes old version of deb packages releases new ones, annoying breaks our builds until can bump package version in our config management. i hoping remote repositories feature let me create cache keeps packages in though original repository has deleted them. does artifactory remote repositories delete files when deleted original repository? thanks the answer no, artifactory not delete files if remote repository deleted files. there scenario artifactory clean unused artifacts if admin choose , explain. in artifactory ui --> admin --> remote repositories --> repository configuration --> advanced tab, have checkbox named "unused artifacts cleanup period". default, field empty means no cleanup. unless admin change field nothing should deleted automatically artifactory process.

hadoop - For some of the hive queries I wasn't able to see the o/p? -

my query select txnno, product txnrecsbycat tablesample(bucket 2 out of 10) order txnno; i getting success unable view o/p o/p is: total jobs = 1 launching job 1 out of 1 number of reduce tasks determined @ compile time: 1 in order change average load reducer (in bytes): set hive.exec.reducers.bytes.per.reducer=<number> in order limit maximum number of reducers: set hive.exec.reducers.max=<number> in order set constant number of reducers: set mapreduce.job.reduces=<number> starting job = job_1500975292039_0005, tracking url = http://localhost:8088/proxy/application_1500975292039_0005/ kill command = /usr/lib/hadoop-2.2.0/bin/hadoop job -kill job_1500975292039_0005 hadoop job information stage-1: number of mappers: 1; number of reducers: 1 2017-07-25 20:26:48,640 stage-1 map = 0%, reduce = 0% 2017-07-25 20:27:05,179 stage-1 map = 100%, reduce = 0%, cumulative cpu 3.61 sec 2017-07-25 20:27:20,461 stage-1 map = 100%, reduce = 100%, cumulati...

python - Django template not getting view data -

im trying make own app called services, have been following django tutorial on how make own app. i making app in django cms, want app contain templates can insert pages of cms via includes tag. i have made models, views, urls , template. template isn't receiving data view. able create new service objects in backend know model working how want , i'm not getting template error when including it. here models, views, url file , template. suspect either how setup view or how i'm pulling view in urls file. currently output in template "no services available" set output when there no service_list view. models.py from django.db import models djangocms_text_ckeditor.fields import htmlfield import filer.fields.image django_extensions.db.fields import autoslugfield colorfield.fields import colorfield class service(models.model): title = models.charfield(max_length=200,default="") slug = autoslugfield(max_length=50, populate_from='title...

ios - why outlet text disappears in Mobile while it appears in Debugging view -

i've controls on viewcontrollers on stroyboard not connected properties or iboutlets, when running , put app in background , return app in forground again text in buttons , uilabels disappears . when debugs view hierarchy found them on debugging view. this applied labels , buttons inside app inside uitableview cell connected iboutlet or not , custom font or not , static text on story board or text localizable file enter image description here

node.js - Exposing additional endpoints through Azure Bot Service -

i'm creating proactive bot, once endpoint accessed right parameters start new dialog specific user. locally easy done restify or express , adding server.get method. how can bot service? need change on function.json file? refer this: https://docs.microsoft.com/en-us/bot-framework/azure/azure-bot-service-template-proactive using azure bot service proactive sample more complicated customize, , adds more services azure (more $$). recommend write own bot (web api); refer this, https://docs.microsoft.com/en-us/bot-framework/nodejs/bot-builder-nodejs-proactive-messages

cocoa - Get the local date format as a string -

this question has answer here: date formats device based on locale 5 answers i want method returns local date format string. e.g., method return string "dd/mm/yyyy" uk users , "mm/dd/yyyy" usa users. what looking nsdateformatter 's dateformatfromtemplate:options:locale: method. takes template containing elements of date wish included , returns appropriate format supplied locale.

excel vba - VBA run time error 1004 in VBA, application defined or object definned error -

i getting error raised above on piece of code reuse regularly. cannot life of me figure out issue is. error occur @ line: ws4.range("f2:f" & lastrow).formula = "=if(d2="", e2, d2)" then lastrow variable working , ws4 defined. lost. thanks try in empty excel sheet: option explicit public sub test() dim lastrow long dim rngcell range lastrow = 5 each rngcell in activesheet.range("f2:f" & lastrow) rngcell.formular1c1 = "=if(1=1,2,3)" next rngcell end sub then try see differences between , code. can not referring correct sheet or else. sheet can locked (e.g. 1004 well). or cells can locked. thus, looping can you.

what does the output "<generator object <genexpr> at 0x0000020B9232B888>" mean in python-3? -

code: marks = [[ input() , float(input()) ] _ in range(int(input()))] s = ( y [x,y] in marks) print(s) l = list(s) l.sort() print(l) sec = l[1] ans = [x [x,y] in marks if y == sec] ans.sort() x in ans: print(x) output: 5 harry 37.21 berry 37.21 tina 37.2 akriti 41 harsh 39 <generator object <genexpr> @ 0x0000020b9232b888> [37.2, 37.21, 37.21, 39.0, 41.0] berry harry

java - How do I set and get a Vector<Integer> in two different classes? -

i need set , vector in 2 different classes seem losing size of vector in process. if v.size() 100 example. use setter. in class use getter access vector again. if v.size() in new class 0. below code rough example of have, can't copy paste code exactly, since it's part of larger private project. public class params { private vector<integer> _v = new vector<integer>(); public vector<integer> get_v(){return _v;} public void set_v(vector<integer> _v){this._v = _v;} } public class { v.add(10); system.out.println(v.size()); //returns 1 params p = new params(); p.set_v(v); } public class b { params p = new params(); v = p.get_v(); system.out.println(v.size()); //returns 0 } when make params = new params() on b create new object of class params , , new object initializes new empty vector on _v property. you should pass object created on a b class can use it.

angular2 routing - Angular 2/4 How to get route parameters in app component? -

Image
as new angular 2/4 having trouble setting new application per need. i trying build application called application. calling application send parameter token, username, application id , etc. now, in angular 2/4, app.component our landing component , every first request go through it. so, want parameter here in app component , load user detail, make local session , move other stuff. problem when trying access these parameter getting anything. here url start angular application: http://localhost:86/dashboard?username=admin&token=xyz&appid=8 here routing file code: const routes: routes = [ { path: 'dashboard/:username, token', component: appcomponent } ]; @ngmodule({ imports: [routermodule.forroot(routes)], exports: [routermodule] }) export class approutingmodule { } here app component code: import { component, oninit } '@angular/core'; import { authenticationservice } 'app/services/authentication/authe...

google bigquery - QueueDequeue step is a significant bottleneck in Tensorflow code -

Image
i've seen few other questions regarding dequeueing step causing bottleneck have tried many of suggestions without success: i using multiple threads based on cpu count i have tried small batches (of 100) , larger batches (of 1000) i have tried switching shuffle_batch_join , batch_join none of these things seem helping overall time. extent dequeue step causing bottleneck in code seems worse others have experienced. when @ timeline of other steps practically disappear in comparison. wondering if partially using bigquery , bigqueryreader source although other people experiencing slowdown assuming isn't cause. i'm not entirely sure how interpret chart doesn't seem the problem being caused empty queue. additional info capacity set batch size * 10 min after dequeue set batch size * 2 + 1 enqueue many set true does have thoughts on else might able try speed things while still using bigquery source of data?

ios - collection view cells fetch data -

i new collection view. want retrieve data coredata collection view cell. know how retrieve table view cell failed when use similar way fetch collection view. here functions coredatahelper , viewcontroller class override func prepare(for segue: uistoryboardsegue, sender: any?) { if let identifier = segue.identifier { if identifier == "displaycelldetail" { print("task view cell tapped") collectionviewcoredatahelper.retrievetasks() let indexpath = collectionview.indexpathsforselecteditems! let task = tasks[indexpath.row] let tasksettingviewcontroller = segue.destination as! viewcontroller tasksettingviewcontroller.task = task } else if identifier == "addtask" { print("+ button tapped") } } } static func retrievetasks() -> [tasks] { let fetchrequest = nsfetchrequest<tasks>(entityname: "tasks") { let results = try...

file io - Cannot close my DataInputStream and DataOutputStream in java -

this question has answer here: what “cannot find symbol” compilation error mean? 7 answers i have started learning file handling in java. however, in code (down below), trying close file @ end of reading , writing facing error in doing way. package trycatch; import java.util.scanner; import org.omg.corba.datainputstream; import java.*; import java.io.dataoutputstream; import java.io.file; import java.io.fileinputstream; import java.io.filenotfoundexception; import java.io.fileoutputstream; import java.io.ioexception; import java.io.writer; public class source { public static void main(string[] args) throws exception { scanner input = new scanner(system.in); try { file f = new file("record.txt"); fileoutputstream writing = new fileoutputstream(f); dataoutputstream write = new dataoutputstream(writing); write.writeutf("wha...

Chrome Invalid SSL Certificate Security Warning -

Image
i ran interesting problem today using chrome , i'm hoping there better way fix ended doing. the issue starts invalid ssl certificate on site i'm configuring. in chrome it's possible advance past screen using link adds security exception current domain don't have view warning message again. it's possible clear warning going site exception clicking not secure text , choosing re-enable warnings option. now problem, have couple different redirects in place on site redirect .com , .bank domains primary .net domain. while developing added security exceptions 3 of these domains. becomes , issue when testing ssl certificate configured properly. want clear out chrome's stored exception .com domain - cannot using re-enable warnings option because arrive @ page chrome sees exception stored , proceeds load page gets redirected .net domain. because of there no point can clear out bypassed security warning in chrome... the way i've been able find clear ...

python - Selenium remoteWebDriver (& SauceLabs) Firefox moseMoveTo action exception -

while performing simple hover test on firefox through selenium (3.4.0) python bindings (3.4.3) using of available os in saucelabs (except linux, latest available firefox version old), performing following actionchain: hover = actionchains(driver) hover.move_to_element(elm_men_menu).perform() it throws following error: taceback: file [...] in testhover hover.perform() file "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/common/action_chains.py", line 80, in perform action() file "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/common/action_chains.py", line 290, in <lambda> command.move_to, {'element': to_element.id})) file "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 256, in execute self.error_handler.check_response(response) file "/usr/local/lib/python2.7/...

Ruby algorithm to determine valid HTML structure -

i have input data array hashes, each hash description of html tag (open , end position in text , type of tag). need generate array tags put in order. for example: input = [ {start_p: 0, end_p: 100, start_t: '<p>', end_t: '</p>'}, {start_p: 10, end_p: 50, start_t: '<p>', end_t: '</p>'}, {start_p: 0, end_p: 100, start_t: '<span>', end_t: '</span>'}, {start_p: 20, end_p: 30, start_t: '<em>', end_t: '</em>'}, {start_p: 40, end_p: 50, start_t: '<em>', end_t: '</em>'}, {start_p: 50, end_p: 60, start_t: '<em>', end_t: '</em>'}, {start_p: 70, end_p: 80, start_t: '<em>', end_t: '</em>'}, {start_p: 8, end_p: 99, start_t: '<strong>', end_t: '</strong>'} ] expected_output: [<p><spa...

jsf - Bean class cannot be loaded due to a missing dependency: LazyDataModel -

i'm using primefaces framework realise lazy data table. imported package: import org.primefaces.model.lazydatamodel; in eventviewer managedbean class. put primefaces-6.1.jar in web-inf/lib folder. after deploying project on jboss as, when loading page following exception: 2017-07-25 18:12:13,817 error [javax.enterprise.resource.webcontainer.jsf.managedbean] jsf unable create managed bean eventviewer when requested. following problems found: - bean or property class com.imnet.oam.fe.event.eventviewer managed bean eventviewer cannot loaded due missing dependency: org/primefaces/model/lazydatamodel. 2017-07-25 18:12:13,817 error [javax.enterprise.resource.webcontainer.jsf.application] error rendering view[/event.xhtml] com.sun.faces.mgbean.managedbeancreationexception: unable create managed bean eventviewer. following problems found: - bean or property class com.imnet.oam.fe.event.eventviewer managed bean eventviewer cannot loaded due mi...

angularjs - Javascript controller -function is not defined -

i posted post wasn't easy read... hope 1 understand problem: basicly have 2 controllers, , in first one, create dinamically div has 'onclick' attribute calls function on other controller (newcontroller). error is: activatesmartcase not defined. i'm desperate lol.. help. [edit solution] var myinjector = angular.injector(["ng"]); var $http = myinjector.get("$http"); function funcb($http){ } manually getting http dependency. app.controller('groupctrl', ['$scope','$http', '$resource',function($scope,$http,$resource) { $scope.smartcase=function(){ $http.get('http://localhost:8080/userapi/getsmartcasesfromtype/' + elements[0].alt) .then(function(result) { $scope.smartcases = result.data; }); var div = document.createelement("div"); div.setattribute('class', "container"); div.setattribute('id',ele...

Package name in Android -

is mandatory start package name com. ? have different package name xxxx.yyyy.com.xxxx . google play accept ? there harm in uploading app such type of package name . thank in advance help. no, not mandatory. even standard android components use package names android.foo.bar . or java components java.util.foo .

Meteor: Custom AutoForm with array of objects in afEachArrayItem blocks -

i'm working on dictionary app, , schema have nested structure. articles (collection) -words (array of objects {"note", "word"} ) -translations (array of objects {"translation", "examples"} ) --examples (array of objects {"example", "translation"} ) means examples of word usage it's translation. the {{> quickform collection=articles ... }} working fine, want change template , functionality conditions... i tried use {{#autoform collection=articles id="insertarticleform" class="article-form" }} {{#afeacharrayitem name='words'}} {{> affieldinput name=this.current.note placeholder='schemalabel' class="note"}} {{> affieldinput name=this.current.word placeholder='schemalabel' class="word"}} <button type="button" class="autoform-remove-item"><span class="glyphico...

Azure Access control IAM to give access to a group not a user for my resource -

so instead of giving access individual users web app or functions, want use groups it's easier manage. only problem when click on azure resource , click on (iam), there's + add button, lets me add users/email address, not group created. even if search, group doesn't come up. example, want give access developers group

python - Adafruit motor hat python3 -

iv written script uses adafruit motor hat library control motors when recives 433mhz ex transmitted codes! short range @ moment best way project! the problem 433mhz rx/tx library python3 , won't work on python2 and adafruit_motor_hat_library pyrhon2 , wont work on pyrhon3? as need both of these work in same scrip how can go this? also if try , run command line won't work, (if python3.scrip.py brings error adafruit motor hat, if python.script.py brings error on 433mhz? if needs full scrip can copy , past here problem doesn't seem actual scrip seemed pretty pointless! if need can provide it to save time, convert smaller of 2 libraries mention other version. if they're same size, i'd convert 2.x library 3. motor hat library ~350 lines of code, of not change in conversion 3.x. self-teaching exercise...

SQL Server 2008 pivoting table with unknown column name -

i having trouble pivot following firstname lastname ---------------------- talyor swift bruno mars to following columnname columnvalue -------------------------- firstname talyor lastname swift firstname bruno lastname mars i don't have clue how start without hardcoding way retrieve column name system. **column name in source table not given here "dynamic" approach accomplished via xml. clearly unpivot more performant example select c.* ,columnorder = d.ordinal_position yourtable cross apply (select xmldata = cast((select a.* xml raw) xml) ) b cross apply ( select item = attr.value('local-name(.)','varchar(100)') ,value = attr.value('.','varchar(max)') b.xmldata.nodes('/row') n(r) cross apply n.r.nodes('./@*') b(attr) ) c ...

c# - Rabbitmq move message to different queue if processing fails -

i working rabbitmq .net , message acknowledgements. if consumer able process message can send ack in form of channel.basicack(ea.deliverytag, false); which take off queue. move message "error-queue" if have issues deserialization var message = jsonconvert.deserializeobject<object>(json); i have tried using "x-dead-letter-exchange" depends on "x-message-ttl" time setting. want move messages error-queue if processing fails. how achieve funcationality? couldn't find online. if consumer rejects message using basic.reject or basic.nack requeue flag set false , rabbitmq republish message dead-letter exchange. documented in article dead-letter exchanges . here functions reject or nack messages in rabbitmq .net 3.6.10 client: basicnack(ulong deliverytag, bool multiple, bool requeue) basicreject(ulong deliverytag, bool requeue)

python - How can I check whether every second value from a dictionary is in a specific range? -

i have dictionary reads in file called peaks_ee.xpk. sample peaks_ee.xpk: label dataset sw sf 1h 1h_2 noesy_f1ef2e.nv 4807.69238281 4803.07373047 600.402832031 600.402832031 1h.l 1h.p 1h.w 1h.b 1h.e 1h.j 1h.u 1h_2.l 1h_2.p 1h_2.w 1h_2.b 1h_2.e 1h_2.j 1h_2.u vol int stat comment flag0 flag8 flag9 0 {1.h1'} 5.82020 0.05000 0.10000 ++ {0.0} {} {2.h8} 7.61004 0.05000 0.10000 ++ {0.0} {} 0.0 100.0000 0 {} 0 0 0 1 {2.h8} 7.61004 0.05000 0.10000 ++ {0.0} {} {1.h1'} 5.82020 0.05000 0.10000 ++ {0.0} {} 0.0 100.0000 0 {} 0 0 0 2 {1.h8} 8.13712 0.05000 0.10000 ++ {0.0} {} {1.h1'} 5.82020 0.05000 0.10000 ++ {0.0} {} 0.0 100.0000 0 {} 0 0 0 3 {1.h1'} 5.82020 0.05000 0.10000 ++ {0.0} {} {1.h8} 8.13712 0.05000 0.10000 ++ {0.0} {} 0.0 100.0000 0 {} 0 0 0 4 {2.h8} 7.61004 0.05000 0.10000 ++ {0.0} {} {2.h1'} 5.90291 0.05000 0.10000 ++ {0.0} {} 0.0 100.0000 0 {} 0 0 0 5 {2.h1'} 5.90291 0.05000 0.10000 ++ {0.0} {} {2.h8} 7.61004 0.05000 0.10000 ++ {0.0} {} 0.0 100.0000 0 {}...