Posts

java - The exception is thrown - and the code is executed further -

faced situation - in main method, child method called, checks object, , exception thrown in child method (one of objects in list null). code of main method still continues executed! example code: @transactional public boolean addcompany(list<company> companies, list<address> addresses) throws exception{ checkaddress(addresses); try{ for(int = 0; < companies.size(); i++){ if(findcompany(companies.get(i).getid()) == null && !isexistscompany(companies.get(i))){ companies.get(i).setaddress(addresses.get(i)); this.em.persist(companies.get(i)); } } }catch(exception e){ return false; } return true; } public void checkaddress(list<address> addresses) throws exception{ try{ if(addresses == null) throw new exception(thread.currentthread().getstacktrace()[2].getclassname() + "." + thread.currentthread().getstacktrace()[2].getmeth...

unity3d - Visual Studio Error: Type 'CoreApplicationView' and 'CoreWindow' Defined in assembly that is not referenced -

Image
in visual studio 2017 i'm getting error when i'm trying compile: 'coreapplicationview' , 'corewindow' type defined in assembly not referenced. must add reference assembly 'windows, version=255.255.255.255, culture=neutral, publickeytoken=null, contenttype=windowsruntime'. see screenshots. i want deploy app on hololens. don't need emulator. installed everything, reinstalled several times. followed these instructions: https://developer.microsoft.com/en-us/windows/mixed-reality/install_the_tools https://developer.microsoft.com/en-us/windows/mixed-reality/holograms_100 i figure visual studio knowledge should able help. enter image description here

php - How to extend Quickbooks API entity with more fields -

i'm needing extend the employee entity adding more rows of data it. example 1 row need add might call 'types', can know type of employee (e.g. administrator, journeyman, owner etc). is possible? quickbooks doesn't allow add "rows", or add fields "rows". there custom fields can use store additional data you're describing. docs: https://developer.intuit.com/docs/0100_quickbooks_online/0200_dev_guides/accounting/0040_create_custom_fields

MySQL prepared stmt issue -

i've following simple table structures , prepared statement: create table junk1(name varchar(10), state varchar(10)); create table junk2(state varchar(100)); insert junk2(state)values("state '%tex%'"),("state '%neb%'"),("state '%was%'"); insert junk1(name, state) values ('asa', 'texas'), ('dff', 'washing'), ('fgfgf', 'oklahoma'), ('bbb', 'nevada'), ('hhh', 'texas'), ('jjj', 'nebraska'); set @va = ''; select group_concat(state separator ' or ') @va junk2; prepare stmt1 'select * junk1 ?'; execute stmt1 using @va; deallocate prepare stmt1; i'm not getting results expected. no results. i'm doing wrong here? you can't use syntax elements parameters in prepared statement, i.e. can't pass entire clause parameter, values. you may want concatenate clause instead: select group_concat...

servlets - Java Login with SSO -

i have servlet saml , wo2 server working. after login, system gets user data ldap. library created application using jsf (faces context). there class called loginutil makes user data available applications through static methods such as: getuserid(), getuseremail() etc... each of method gets http session via faces context retrive user data saved @ login. now have new applications being using spring boot , because of that, loginutil class doesnt work anymore. i want suggestions change loginutil class make available use in application. @ first idea remove faces context , use pure session object, method statics wont able use normal variable inside of it. , i cant use static variable because applications deployed in clustered server. any ideas? your first idea not crazy, contextfaces, uses threadlocal request, you can same thing, make threadlocal, every request, using servlet filter, put theadlocal in loginuser, work in every app class loginutil { private static...

loops - Generate 1s in place of NAs when i=2 -

i need change nas 1s when i=2, in loop. reposted question since did not have solution in r-help. my code: zeta <- rep(1,8) n <- 7 (i in 1:2){ beta <- zeta[1:n+(i-1)*(n+1)] print(beta) parm <- zeta[i*(n+1)] print(parm) } the output follows: [1] 1 1 1 1 1 1 1 [1] 1 [1] na na na na na na na [1] na the desired outcome be: [1] 1 1 1 1 1 1 1 [1] 1 [1] 1 1 1 1 1 1 1 [1] 1 how desired outcome? best, moohwan

rest - Proper request with async/await in Node.JS -

in program make async call function api module: var info = await api.myrequest(value); module code: var request = require("request") module.exports.myrequest = async function myrequest(value) { var options = { uri: "http://some_url", method: "get", qs: { // query string ?key=value&... key : value }, json: true } try { var result = await request(options); return result; } catch (err) { console.error(err); } } execution returns immediately, result , therefore info contains request object , request body - info.body key=value&... , not required response body. what i'm doing wrong? how fix? proper request usage async , or works correctly promises mentioned here: why await not working node request module ? following article mentioned possible: mastering async await in node.js . you need use request-promise module, not reques...