Posts

Showing posts from July, 2014

How to set the right Billing Tier in Google BigQuery? -

please let me know how calculate , set right billing tier in google bigquery. i have built queries. of them process 3 tables of each 50 gb , other queries process tables of each 100-200 gb. i don't prefer run smaller queries high billing tier. as stated in docs , don't set directly billing tier you'll running query rather set maximum tier allow bigquery reach finishing given job. as can see in job resource definition, can define query method parameter maximumbillingtier sets how costs can potentially rise query complete successfully. still, keep in mind many high-compute queries can optimized changing few techniques in query, such using analytical functions, arrays , structs, subqueries , on. given working relatively small data bigquery, can find great ways optimize query , not have processing high-computing query.

proxy - Edit POST message after CONNECT with LittleProxy -

i started using littlepxoy because documentation says manipulating packets on way through easy. add httpfilterssourceadapter they say , set buffer size 1mb . done , set breakpoints. client arrives @ httpfiltersadapter.clienttoproxyrequest connect request. far can tell connect request has no body. once connect has been established messages never come via code route until connect tunnel times out. how can little proxy make direct calls remote service, or force client not use proxy tunnel, or catch/intercept packet on way through. need able manipulate post body of message before sending on. any great.

c# - Castle Windsor - Get Root Component type being resolved -

i using castle windsor ioc container , nlog in project. trying inject ilogger classes logging needed. want ilogger resolved logmanager.getlogger(roottypename). is there way root type name? tried following, creationcontext.requestedtype doesnt root type. container.register(component.for<ilogger>() .usingfactorymethod((y, creationcontext) => logmanager.getlogger(creationcontext.requestedtype.fullname)) .lifestyletransient()); structuremap has provision it x.for<logger>().use(y => logmanager.getlogger(y.roottype.fullname)); you can achieve subresolver... public class loggerresolver : isubdependencyresolver { public bool canresolve(creationcontext context, isubdependencyresolver contexthandlerresolver, componentmodel model, dependencymodel dependency) { return dependency.targettype == typeof(ilogger); } public object resolve(creationcontext context, isubdependencyresolver contexthandlerresolver, componentmode

hibernate - Use Envers in OSGi -

i have working instance of hibernate embedded osgi context. want have envers, too. the documentation states: as of orm 4.2, envers supported. so possible. i'm not sure how. dutifully added @audited 1 of entities, nothing happened. i tried add these listeners persistence.xml : <property name="hibernate.ejb.event.post-insert" value="org.hibernate.ejb.event.ejb3postinserteventlistener,org.hibernate.envers.event.auditeventlistener" /> <property name="hibernate.ejb.event.post-update" value="org.hibernate.ejb.event.ejb3postupdateeventlistener,org.hibernate.envers.event.auditeventlistener" /> <property name="hibernate.ejb.event.post-delete" value="org.hibernate.ejb.event.ejb3postdeleteeventlistener,org.hibernate.envers.event.auditeventlistener" /> <property name="hibernate.ejb.event.pre-collection-update" value="org.hibernate.envers.event.auditeventlistener" />

msbuild - How edit or add properties in inline task -

i need invoke msbuild task properties, whats name can calculated in runtime. try scripts main.xml <?xml version="1.0" encoding="utf-8"?> <project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" toolsversion="14.0" defaulttargets="build"> <usingtask taskname="getvars" taskfactory="codetaskfactory" assemblyfile="$(msbuildtoolspath)\microsoft.build.tasks.v4.0.dll"> <parametergroup> <result parametertype="system.string" output="true"/> </parametergroup> <task> <code type="fragment" language="cs"> <![cdata[ this.result = "aaa=123;bbb=456;"; ]]> </code> </task> </usingtask> <propertygroup> <vars></vars> </propertygroup> <target name="make"> <g

javascript - Validate checkbox selections -

please check javascript code bellow. once click on "upload" getting "you didn't checked item" checked item same alert run. how can correct execute per item have selected? <!doctype html> <html> <head> <title>test</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> </head> <body> <form> <input type="checkbox" name="check_item" value="1">item 1<br/> <input type="checkbox" name="check_item" value="2">item 2<br/> <input type="checkbox" name="check_item" value="3">item 3<br/> <input type="button" class="uploadexternal" value="upload"/> </form> <script type="text/javascript"> $(document).on("click", ".uploadexternal",

java - Union of sets in spark querying cassandra -

the table structure in cassandra: identifier, date, set(integer) what want achieve using spark grouping rows identifier , date, , aggregating sets value. more clear example: raw data: (consider letters representing integers) id1, 05-05-2017, {a,b,c} id1, 05-05-2017, {c,d} id1, 26-05-2017, {a,b,c} id1, 26-05-2017, {b,c} id2, 26-05-2017, {a,b,c} id2, 26-05-2017, {b,c,d} output: id1, 05-05-2017, {a,b,c,d} id1, 26-05-2017, {a,b,c} id2, 26-05-2017, {a,b,c,d} since set, want unique values in aggregated results. using java , dataset. if dataframe has columns mentions can this: df.withcolumn("set", explode(col("set"))).groupby("identifier", "date").agg(collect_set("set"))

php - HTACCESS for given url -

i'm trying write rewriterule new url. old url : https://www.ex.com/hindu-bbb-10/2 old htaccess: rewritecond %{http_host} ex.com$ [nc] rewritecond %{request_uri} (bbb|ggg) rewriterule ^(.+?)/(.+?)(/?)$ seo/index.php?cat=$2&title=$1 [nc,l] by using above htaccess values request folllows [cat] => 2 [title] => hindu-bbb-10 i tried lot , 1 follows new url : https://www.ex.com/hindu-bbb-10?pageno=2 new htaccess: rewritecond %{http_host} ex.com$ [nc] rewritecond %{request_uri} (bbb|ggg) rewriterule ^(.+?)/(.+?)(.+?)$ seo/index.php?cat=$2?pageno=$1 [nc,l] and getting result [cat] => hindu-bbb-10 i can't values [cat] => 2 [title] => hindu-bbb-10 form old url. how values [cat] => 2 [title] => hindu-bbb-10 using new url " https://www.ex.com/hindu-bbb-10?pageno=2 " for url https://www.ex.com/hindu-bbb-10?pageno=2 you need capture value query_string : rewritecond %{http_host} ex.com$ [nc] rewritecond %{reque

javascript - How to get data from a html row (in a table) with php -

im trying information inside dynamic table when clicks on it, can read column column , extract data, show in textbox. dont know how since im new languages, hope can help. im doing @ moment exctrating data database , creating dynamic table it. i´ve tried couple things, none of them worked i´m not going paste failed attempts here. code (since lot of people had problems being mysql updated mysqli_: if (($result)||(mysqli_errno == 0)) { echo "<table cellspacing='0' cellpadding='0' border='0' width='126%'> <tr> <td> </table> <div style='width:450; height:350px; overflow:auto;'> <table cellspacing='0' cellpadding='1' border='1' width='380px'> <tr style='color:white;background-colorgrey'>"; if (mysqli_num_rows($result)>0) { //loop thru field names print correct headers $i = 0; while ($i < mysqli_num_fields($result)

web services - flex Gathering the result from my wsdll webservice -

hey have wsdll webservice, im trying result via flex. but can see im doing wrong attributes, can't seem see error is. the webservice looks this <soap:body> <getmeetingpictureresponse xmlns="http://picture.zaqsolutions.com/picture"> <getmeetingpictureresult> <meetingpicture> <meetingid>string</meetingid> <image>base64binary</image> <image1>base64binary</image1> <image2>base64binary</image2> <name>string</name> <name1>string</name1> <name2>string</name2> <host>string</host> <eid>int</eid> </meetingpicture> <meetingpicture> <meetingid>string</meetingid> <image>base64binary</image> <image1>base64binary</image1> <image2>b

javascript - background is not working inside select input field on google chrome -

i want add icon inside select input tag working in firefox not working in google chrome can solve it? code below have tried. select{ font-size:18px;} .bride{ background:url('https://www.shareicon.net/data/32x32/2016/04/06/745724_people_512x512.png') top right no-repeat; float:right;} .groom{ background:url('http://icons.iconarchive.com/icons/designbolts/free-male-avatars/32/male-avatar-cool-sunglasses-icon.png') top right no-repeat; float:right;} <select> <option value="female" class="bride">bride</option> <option value="male" class="groom">groom</option> </select> this might https://jsfiddle.net/7x1v5wyy/1/ /* when user clicks on button, toggle between hiding , showing dropdown content */ myfunction = function() { document.getelementbyid("mydropdown").classlist.toggle("show"); } // close dropdown menu if user clicks outsid

static initialization in Java EE differs between parentfirst/parentlast classloading policy, at least in Websphere Liberty -

i discovered interesting, may wrong behaviour in websphere liberty / jee 7, discuss if bug or feature. first, code described older project have taken over, , code not fanciest or best way something. let's point: there utility-jar, contains servletcontextlistener. listener performs log4j initialization way, has final static variable causes log4j initialization, when class loaded first time. the maven build produces 2 wars, each war contains utility-jar containing servletcontextlistener. see following graphic in order see structure of ear: structure of ear this means have 2 webapps containing same utility-jar, contains static initilizer this: private static final mylogger log = logger.getlogger("webapp-1"); and here point: when deploy on liberty standard classloader policy (parentfirst), static initialization takes place 1 time! when using parentlast policy, static initialization hapens 2 times. i have discussed colleague first said, that's ok. thinkin

r - Formatting scientific notation for latex -

in rstudio, scientific notation results 1e-2 or 4e-35. using xtable export such numbers latex want them in regular format in latex i.e., $1 \times 10^{-2}$ or $4 \times 10^{-35}$ . how can code in r such regular scientific notation format xtable output?

node.js - nightwatch - find current page object -

is there way find current page object within custom command. i call getelementcount(), while page pageobejct1 instantiated. browser.page.pageobejct1() .getelementcount('@clicktoselectlist', function (count) { //some code } the custom command on other hand tries find out current locatestrategy. module.exports.command = function (tag, callback) { //here distinction between pageobejct1 , pageobejct2 var selector = this.page.pageobejct2(tag); var locatestrategy = selector.locatestrategy; //some code again. }; anyway, issue page pageobejct1 , page pageobejct2 represent 2 different page objects. therefore, have generic solution. interface in oop. would possible? or possible current page object nightwatch somehow? thanks!

Openshift resource limit and pagecache -

i'm running kafka cluster on openshift. understand, kafka performance relies on pagecache. trying understand how best can limit resource on kafka container works efficiently. linux tries use available ram buffer speed disk operations. assuming there kafka container running on node, if set limit on container 5gi, rest of available memory on node used buffer/cache believe. i wondering if set limit 10gi , if kafka use 5gb, remaining unused 5gb still available pagecahce operating system? the limit doesn't reserve memory, puts cap on how application can use. don't believe should affect how operating system handles kernel buffer/cache.

javascript - Unusual Zombie root URL with socket.io -

i using zombie visit index route ( / ), contains socket.io chat application. my test expecting browser url after request equal http://localhost/ . instead, following url: http://localhost/socket.io/?eio=3&transport=polling&j=0&t=lrvjmq8&b64=1&sid=pj7nbbvpufvfaukxaaac . when run our application in development environment, works fine. visiting / works expected. why test redirecting other path? test code browser.localhost('localhost', 3000); describe('user visits root path', function() { const browser = new browser(); before(function(done) { browser.visit('/', done) }); it('should see chat page', function() { // fails, equals http://localhost/socket.io/?eio=3&transport=polling&j=0&t=lrvjmq8&b64=1&sid=pj7nbbvpufvfaukxaaac instead browser.assert.url(browser.location.href, 'http://localhost/'); }); })

xamarin - How to list provisioning profiles and installed iOS signing identities? -

environment: visual studio 2015 on pc visual studio (xamarin) on mac ipad connected mac my setup used work fine. pc, able debug ios apps running on ipad. yesterday, updated mac os ipad ios. may have updated few other things too. however, running problems deploying xamarin ios apps on ipad. i can create ios app in xcode , deploy successfully. however, when try build xamarin app, error "no installed profiles match installed ios signing identities." there few posts on forum talk similar problem. have gone through these posts. have downloaded (once again) ios certificate apple developer portal , added keychain store. i still don't understand why error. appreciate if can tell me how can list of installed ios signing identities , compare them against list of provisioning profiles. also, when @ plist.info file, see that, key cfbundleidentifier , value replace_bundle_id . wondering how can tie bundle id provisioning profile. on apple's portal, see bunch of

Eval in for with two arguments -

i wrote 2 function in script for type in $list_type egrep -v 'dc02|vh|dc03kh00|r0' $report_37 | grep cp_ask | grep $dc |awk -f, -v type=$type '$nf == type { print $1 }' > ./$dc_'type_'$type empty_type_$type=$(cat $dc'_type_'$type | wc -l) done the second use in other empty_type_$type did for type in $list_type eval echo \$empty_type_$type egrep -v 'dc02|vh|dc03kh00|r[0-2]' $report_33 | grep not | grep $dc |awk -f, -v days=$days -v version=$version -v type=$type '{if (($(nf-15) > days || $(nf-02)!= version) && ($(nf-20) == type)) print $1}' | eval tail -n \ empty_type_$type > ./$dc'_to_work' done the problem error awk -f, -v days=180 -v version=6.7 -v type=e '{if (($(nf-15) > days || $(nf-02)!= version) && ($(nf-20) == type)) print $1}' + eval tail -n '$empty_type_e' when run command (not in bash script) egrep -v 'dc02|vh|dc03kh00|r[0-2]' repo

Robot framework,Selenium,Python-key down in loop in combobox skips values -

Image
i need iterate on items in combobox, not created regular combobox (select element), "complicated" js component. wrote while loop in python press key down (to item), check whether there message on page , if messages not there, loop should end. not work properly. not go 1 item, seems go 3 items. (i print out "messages true/false" can see if chooses 15th item, there 5 messages loop instead of 15) have no idea how force key pressed shorter time, move 1 item. the function: def find_not_used_protocol(self,entity): actionchain = self.get_action_chain() message = true msgs=[] while message: #actionchain.key_down(keys.arrow_down) #i tried did not behave better actionchain.send_keys(keys.down).perform() actionchain.release() #builtin().sleep(1) #i tried did not behave better message = self.get_library_instance()._is_text_present( "this protocol has "+entity+". please select differen

angular - How can I define an array with dynamic keys using Typescript? -

i'm using ionic 2, sits on top of angular 2. need create array of items. don't know how many items going in array. here typescript, simplified: import { component } '@angular/core'; import { vgapi } 'videogular2/core'; @component({ selector: 'page-class', templateurl: 'class.html' }) export class classpage { api: any[]; constructor(...){} // load api when videos ready onplayerready(api: vgapi, i: any) { this.api[i] = api; } } onplayerready called when video players in view intialize. i id of player (0, 1, 2, ...). i'd expect construct array of: this.api[0] = vgapi (of player 1) this.api[1] = vgapi (of player 2) this.api[2] = vgapi (of player 3) this.api[3] = vgapi (of player 4) this.api[4] = vgapi (of player 5) unfortunately, following: runtime error cannot set property '1' of undefined i believe because this.api[0] isn't explicitly defined anywhere. that's problem, don't k

python 3.x - tkinter filedialog with statement -

i'd store file. reason, use filedialog 'with' statement. long chose file , save it, works fine. however, when filedialog canceled, following error: file "...\src\test.py", line 7, in filedialog.asksaveasfile(mode='w') myfile: attributeerror: enter is there work arround accomplish 'with' statement? import tkinter tk tkinter import filedialog root = tk.tk() filedialog.asksaveasfile(mode='w') myfile: myfile.write('test') root.mainloop() thanks clarification, zwer . think try...finally block convenient solution purpose. overcome problem follows: import tkinter tk tkinter import filedialog def test(): root = tk.tk() myfile = filedialog.asksaveasfile(mode='w') if not myfile: return try: myfile.write('test') finally: myfile.close() root.mainloop() test()

Share `Play Store` Link in `DrawerNavigator` Menu via react-navigation -

i have 3 screen items in drawernavigator menu. how add share play store link in drawernavigator menu under item "3"? mean not real page, aplication share link icon, when clicks share area opens. const router = drawernavigator( { home: { screen: mainscreen }, new: { screen: news }, photo: { screen: photos }, }) you can use custom contentcomponent option https://reactnavigation.org/docs/navigators/drawer#providing-a-custom-contentcomponent drawernavigator. this const router = drawernavigator( { home: { screen: mainscreen }, new: { screen: news }, photo: { screen: photos }, }, { contentcomponent: props => { return ( <scrollview> <draweritems {...props} /> <touchableopacity onpress={() => { share.share({ message: play_store_url });

ssl - Routing domain www.abc.com (User view) to www.abc.firebaseapp.com -

we have www.abc.com users , main domain (no ssl) have our deployment version of web application in www.abc-xyz.firebaseapp.com (has ssl enabled) our requirement: when users type or click www.abc.com should show application in firebase without revealing url of firebase. possible? if 1 not possible should move domain firebase? thanks lot input

android - Which software should I use for developing a 3d-printing mobile app? -

i going work on final year project of computer science. develop app 3d printing. idea this: purpose: let users design own phone cases platform: android after users open app, 3d template of phone case displayed on screen(slowly rotating). users can customize following features: size(for different sizes of phone)、colors、patterns(allow inserting 2d logo). after change pattern/color, 3d display change accordingly. moreover, phone case not typical one, can have flip out hook/kickstand. hook/stand snapped place, wont opened when not in use. therefore, app needs automatically divide phone case several components(maybe 4-5, not sure) after users have customized own phone cases. divided components each have joints allow them combined manually form phone case. after obtaining different components, these components exported .stl format, 3d printer can use these stl files perform 3d printing. based on above ideas, ask if unity 3d enough produce android app. or should use android st

android - Checking a radioButton in RecyclerView makes other random radiobutton checked too -

im new in recyclerview , when use radiogroup 4 radiobutton in recyclerview .every things works fine, when scroll down in recyclerview radio button randomly checked in position layout row_mylist.xml <radiogroup> <radiobutton android:text="radiobutton" android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/btn_radio_test2" android:button="@null" android:drawableright="?android:attr/listchoiceindicatorsingle" android:layout_weight="1" android:gravity="right|center_vertical" android:textsize="10sp" /> <radiobutton android:text="radiobutton" android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+i

arrays - Excel - find the minimum difference between elements in two columns that have same feature -

Image
this first question here, apologizes if it's simple one. have following issue/goal. i have 2 matrices: at1 at2 b c e f g yrs ticker yld yrs ticker yld 7 ibm 4.5 6.5 ibm 1 6.5 gs 3 3 gs 2 4 msft 6 20 msft 6 1 ibm 3 now, need find, same ticker (let's ibm, hence column b matrix "at1", , column f matrix "at2"), minimum yield difference between ibm yields in column c , in column g, @ 1 condition though: maturity of ibm security in matrix "at1" , maturity of ibm security in matrix "at2" less 2 years. so in example above there's once instance of ibm in matrix at1, has 7 years maturity , yield 4.5. so 4.5 yield should compared , subtracted both ibm security yield 1 , 1 yield 3 in matrix at2 , give me minimum difference between (7-1) , (7-3). theoretically output of array formula shou

html - How to make flex child height to wrap content -

Image
this question has answer here: how disable equal height columns in flexbox? 2 answers what want make each child element's height wrap content. here code: <style> .parent{ display: flex; } .child{ padding: 5px; margin: 10px; background: green; height: auto; } </style> <div class="parent"> <div class="child">child1</div> <div class="child">child2</div> <div class="child">child3</div> <div class="child" style="height:50px">child1</div> </div> output: expected output: you need set align-items: flex-start on parent element because default value stretch . .parent { display: flex; align-items: flex-start; } .child { padding: 5px; margin: 10px;

Create folder Structure in Batch using SQL script output -

i have sql table holds records organised hierarchically follows: id item othercolumns parentid 1 blah null 2 b blah 1 3 c blah 2 4 d blah 3 5 e blah 3 6 f blah 3 7 g blah 4 8 h blah 4 9 blah 4 10 j blah 4 11 k blah 6 12 l blah 6 13 m blah 6 14 n blah 6 graphically, hierarchy is a --b ----c -------d ----------g ----------h ----------i ----------j -------e -------f ----------k ----------l ----------m ----------n i have sql script takes parentid parameter , returns children node. i call script recursive function in batch file , print out the items in order of structure i'm not sure how can create folder structure mirrors this my batch is @echo off setlocal enabledelayedexpansion set id=1 call :createsubdirectories !id! 1 goto eof :cre

How to aggregate query result in elasticsearch -

i new in elasticsearch. want elasticsearch result following sql query, select distinct(car_name) car_master car_name '%suv%' i getting result doing: { "query": { "query_string": { "fields" : ["car_name"], "query": "*suv*" } } } but want distinct records. you there, need add terms aggregation on car_name field: { "query": { "query_string": { "fields" : ["car_name"], "query": "*suv*" } }, "aggs": { "cars": { "terms": { "field": "car_name" } } } }

angular - Issue in implementing the Ngrx Store service into my component -

after user tried issue regarding post: my stackoverflow old post trying implement ngrx store using ngrx store github me solve multiples input/output event. just after constructor have error: counter not assignable parameter of type (state: appstate) => boolean : child.ts : import { component, input, output, eventemitter } '@angular/core'; import { userservice3 } '../user3.service'; import { store } '@ngrx/store'; import { observable } 'rxjs/observable'; import { on, off, reset } '../counter'; interface appstate { counter: boolean; } @component({ selector: 'my-daydetail', templateurl: './my-daydetail.component.html', styleurls: ['./my-daydetail.component.css'] }) export class mydaydetailcomponent { counter: observable<boolean>; constructor(private store: store<appstate>) { this.counter = store.select('counter'); } //... } // counter.ts import { action }

How do I in CSS combine a plus selector with parent and class? -

in div wrapper, have radio buttons. when 1 selected, wish make label have background color. how specific can in css rule this? html: <div class="switch-wrapper"> <form> <input id="id-1" class="my-switch-on" type="radio" /> <label for="id-1">yes</label> <input id="id-2" class="my-switch-off" type="radio" /> <label for="id-2">no</label> </form> </div> my closest guess: div.switch-wrapper input[type="radio"].my-switch-on+label { background-color: #000; } but can't work. did instead this: input[type="radio"]:checked + label { background: #000; } which work, i'd know how combine plus selector other types of selectors , classes. possible? can group selectors parenthesis? e.g.: div.foo form.bar + div > span { background-color: #000; } which s

Android Validators fields -

i have made many layout in android. kindly tell me best , easy way validate input field before save data database. required field. data should in number etc. for input must number use @ edittext android:inputtype="number" for required field can use : private boolean isempty(edittext edittext) { boolean isempty = false; if (textutils.isempty(edittext.gettext())) { isempty = true; edittext.seterror("empty field"); } return isempty }

ruby on rails - Optimizing queries which priortize non-empty text fields -

i'm working on large, long-running rails monolith using mongoid. i've been asked find , optimize slow running queries, i've started doing of mlab plugin in heroku. this query (some column names redacted) comes number 1 slowest running function: { "status":"<val>", "from":{"$regex":"<val>","$options":"<val>"}, "text":{"$regex":"<val>","$options":"<val>"}, "field_x":{"$gte":"<val>"}, "field_y":{"$gte":"<val>"}, "field_z":{"$gte":"<val>"} } mlab gives recommendations improve slow running queries , i've added index suggested, wonder if can make rails query better. looks (model names changed): @reviews = object.reviews.active.and(:text.ne => nil, :text.ne => '').desc(:created_at) @

html - Get URL parameters in VBA -

i need id parameter in url, example have http://apps/inventory/others.aspx?id=8678 how extract 8678 , i've looked @ method of object winhttp.winhttprequest.5.1 haven't found anything. possible simple substring? url same , there 1 parameter, thanks try this: option explicit public sub testme() debug.print extractafter("http://apps/inventory/others.aspx?id=8678", "id=") debug.print extractafter("http://apps/inventory/others.aspx?id=867843", "id=") end sub public function extractafter(strinput string, strafter string) string extractafter = mid(strinput, instr(strinput, strafter) + len(strafter)) end function this in immediate window: 8678 867843

jsf - Strange display of p:fileUpload component -

Image
i trying use fileupload component of primefaces , working but empty error message displayed when component appeared no content , not understand why. and if add file component disappeared still not pretty have when component loads. // view <h:form> <p:fileupload fileuploadlistener="#{bean.handlefileupload}" /> </h:form> // managedbean public void handlefileupload(fileuploadevent event) { uploadedfile file = event.getfile(); system.out.println("handlefileupload : " + file); } the managed bean function called when click on upload button. hope understand problem ! thanks in advance

java - how to run testng test cases jar with all dependence? -

i use intelli j ide build 1 executable jar contains dependencies , test classes. the /src/main/java/meta-inf/manifest.mf manifest-version: 1.0 main-class: org.testng.testng when run jar command java -jar tahoe-test.jar org.testng.testng suites/t123.xml i error: error: invalid or corrupt jarfile tahoe-test.jar if unzip jar , run command java org.testng.testng suites/t123.xml all works fine! why cant run jar? try run: java -cp tahoe-test.jar org.testng.testng suites/t123.xml

performance - SQL Handling 2 tables efficiently by Joins -

i have described scenarios have efficient 1 sql query. have tried using temporary tables, i'm finding myself no where. seeking expert opinions. i'm using sql server 2012. i have 2 tables table , table b. table id testname table b id tableaid lastupdate tableaid in table b id column of table a. scenario 1 : table id testname 1 test 1 table b id tableaid lastupdate if table b not have records, insert table records table b scenario 2: table id testname 1 test 1 table b id tableaid lastupdate 1 1 if table has records , matches records in table b, donot action scenario 3: table id testname 1 test 1 2 test 2 table b id tableaid lastupdate 1 1 if table has records , not matching in table b, insert table b scenario 4: table id testname table b id tableaid lastupdate 1 1 2 2

ios - Is keychain item created by app safe without access control? -

i'm saving secret in keychain in app without access control. i've searched item should accessible app. is there anyway compromise keychain item? e.g can hacker install fake app same bundle identifier replace app , keychain item? ios has single keychain accessible when device unlocked. app(or set of apps if have keychain sharing set up), has access keychain items store. if device jailbroken there ways steal items keychain. see tutorial has info on keychain best practices: ios app security ray wenderlich from above site: although keychain access more secure, high-priority target. jailbroken ios devices there command line utilities print out keychain access database’s contents.

php - MySQL: Selecting boolean value from JSON field -

i'm using mysql 5.7.19 i'm trying retrieve class looks follows class task { public $title; public $done; } the title , done properties saved in json column. the code use retrieve looks follows: $taskssql = <<<'eot' select json_unquote(json_extract(data, '$.title')) title, json_extract(data, '$.done') done tasks tasklistid = ?; eot; $tasksstatement = $connection->prepare($taskssql); $tasksstatement->execute([$id]); $tasksstatement->setfetchmode(pdo::fetch_class, "task"); $tasklist->tasks = $tasksstatement->fetchall(pdo::fetch_class, "task"); it fills out fields, done property gets set string values "true" or "false" instead of boolean value. i think pdo not recognizing boolean value being returned, , assuming string. has nothing json being used. change in query json_extract(data, '$.done') done

java - Can I make a base class that I inherit this information from? -

my boss suggested me use inheritance classes in app. there 1 method use quite often, .this class changed. here base code use: public class currentclass extends appcompatactivity implements navigationview.onnavigationitemselectedlistener { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_currentclass); toolbar toolbar = (toolbar) findviewbyid(r.id.toolbar); setsupportactionbar(toolbar); floatingactionbutton fab = (floatingactionbutton) findviewbyid(r.id.fab); fab.setonclicklistener(new view.onclicklistener() { @override public void onclick(view view) { intent intent = new intent(currentclass.this, activitymenu.class); startactivity(intent); } }); drawerlayout drawer = (drawerlayout) findviewbyid(r.id.drawer_layout); actionbardrawertoggle toggle = new actionbardrawertoggle( this, drawer, toolbar

c++ - Exception thrown from sysfer.dll when running in different Visual Studio version -

i have old c++ desktop application running in visual studio 2012, on platform toolset of visual studio 2010. compiles , runs okay in version of visual studio. in visual studio 2015 (on same 2010 platform toolset) when run application throws exception sysfer.dll exception thrown @ 0x72649581 (sysfer.dll) in myproject.exe: 0xc0000005: access violation reading location 0x050e0000. after reading this question understand problem related antivirus program, , it's suggestion disable loading sysfer.dll , not sure if alter functionality of application or impact have antivirus program. other thing concerned why visual studio 2012 doesn't break when exception thrown, , because if hit continue , application seems run correctly, real exception, or should ignore it? edit: realized happens when run in debug configuration.

vba - Remove reminder from incoming email appointment -

at work use emailed appointments inform person on pto. procedure set reminder "none" forget (we human). find way search subject of email term "pto" or "leave early" , set reminder "none" if 1 set. i have found number of questions find reminders , how change them. getting stuck on detection part. welcome help. here 1 of questions using help. question the answer depends on when want checked. event in appointmentitem.send event. in order trap event, first must "catch" new appointment item created. can monitoring inspectors.newinspector event , handle appointmentitem objects. see here guidance on working events in outlook.

android - Firebase users setting phone number -

i have been authenticating user facebook on firebase want make them set phone numbers linked user cant find way make them set phone number can retrieve using firebaseuser user.getphonenumber , update phonenumber needs credentials not string don't know how use can me ?! firebaseuser user = firebaseauth.getinstance().getcurrentuser(); user.getphonenumber(); user.updatephonenumber(); firebase auth verifies own phone numbers. doesn't populate facebook phone numbers after facebook sign-in or of like. however, if have phone number, need go through verification process: verifyphonenumber phone number verificationid , ask user sms code, populate phone auth credential using verification id/code , call user.updatephonenumber(phonecredential) . alternatively, if verified phone number via other means, can send user id token , phone number server. using firebase admin node.js sdk, verify id token , call updateuser api phone number: https://firebase.google.com/docs/auth/

tsql - Creating a column to correctly group by effort -

i'm trying create column correctly label changes in effort estimator. i've been able close using below code dense_rank() function, it's not quite i'm looking for. i'm having trouble identifying start , end points organize by. i've include current , desired output below. current code: select *, dense_rank() on (order estimator, effort) group #estimating_with_breakpoints order estimator, date, datetype current output: job name datetype date effort group hidden lakes apartments start 3/8/2017 50 6 hidden lakes apartments breakpoint 4/13/2017 50 6 hidden lakes apartments finish 4/13/2017 0 4 dr. biggs joint institute breakpoint 5/1/2017 0 4 dr. biggs joint institute start 5/1/2017 33 5 bonita springs library breakpoint 5/22/2017 33 5 north ft. myers library breakpoint 5/22/2017 83 7 bonita springs library start 5/

scheduled tasks - Error in manifest or policy file(Invalid Xml syntax) -

Image
i have .net console app written in c#, supposed setup in task scheduler(as job), have setup task requirements(action, triggers, conditions , settings). when try run job see error reads the application has failed because of side-by-side configuration , when check event logs see error reads invalid xml syntax below screenshot of error seeing on event viewer , line below actual line(line7 per event viewer) <connectionstrings> i have since open config file notepad++, set language xml see there amiss in file there nothing wrong in far can see here more detailed config part(in case asks it) <?xml version="1.0" encoding="utf-8"?> <configuration> <configsections> <section name="entityframework" type="system.data.entity.internal.configfile.entityframeworksection, entityframework, version=6.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089" requirepermission="false" /> <!-- more infor

asp.net mvc - Get values from controller to Javascript code -

i getting id value controller javascript code want full row value "reportssql.reportname". , want display value reportname in view through javascript. here ,my controller [httpget] public actionresult viewreports(int id, sqlserver_reports reportssql) { context = new cost(); //todo whole row values id, right have report id reportssql.reportname = context.sqlserverreportses.where(x => x.reportid == id).select(x=>x.reportname).firstordefault(); // list<string> report = context.sqlserverreportses.where(x => x.reportid == id).select(x=>x.reportname).tolist(); return json(reportssql.reportname, jsonrequestbehavior.allowget); } here javascript function function viewreport(id) { var id = id; // alert(id);// getting value gridview button , passing javascript alert var state = {}; var newurl = "/report/viewreports/";

ios - Xcode debug memory graph showing released object -

Image
i've been looking in xcode memory graph tool project , noticing odd behaviour. hoping might able explain what's going on/if need worry. i have view controller creates couple of objects (which aren't doing @ moment) when dismiss view controller sure enough released. 1 (sometimes both) seem hang around in visual debugger: only 2 ever being created, , both being deinitialized, confirmed in consol: i think i'm correct in saying, i'm not responsible of objects referencing user object in image above, bug, or don't need worry about? if not responsible of objects in graph described, ones retaining user object, should not worry it. fyi: have experienced leaks before when including firebase on app. not fault, , should not leaking lot of memory. i agree @charlessrstka , if still worried leaks can check them on instruments show specific line of code might causing issue.

Content of Xamarin Fragments in ListView diappearing when scrolling -

we have android app built xamarin , mvvmcross. have activity mvxlistview , dynamically add amount (~between 10 , 80) of fragments it. fragments have 1 visible label , click behavior. when app run on device android 7(nougat) fragments not have content, label , click behavior missing. it's not same fragment , when list scrolled - fragments leave viewport while others enter - fragments regain content , others lose it. few of fragments lacking content, on screen working normally. this behavior not occur on older versions of android, tested on various devices version 4-6. behavior occured on devices andoid 7. does have idea cause this? did memory managment lists change in nougat?

python - Merging several rows with the same index on a single data frame? -

i new python , pandas sorry beginners question but, have not yet found solution simple task. dataframe: org data1 data2 1 1234 win 1 2345 win 2 loss 3 3456 win 3 4567 win i've been trying use groupby , apply lambda df.groupby(["org"])["data1", "data2"].apply(lambda x: ';;'.join(x.astype(str))) which not function since outcome org 1 data1;;data2 2 data1;;data2 3 data1;;data2 this achieve: org data1 data2 1 1234 ;; 2345 win ;; win 2 nan loss 3 3456 ;; 4567 win ;; win the org represents defined index want use group by. same org answers "1 2 3" data1 , data2 should go same cell in excel, want print out new excel file. can me simple (but somehow difficult me) issue? you close, need agg instead apply : df = df.groupby(["org"

c# - Switch statement using string.contains -

i have following method public list<availablefile> getavailablefiles(string rootfolder) { if (directory.exists(rootfolder)) { try { foreach (string f in directory.getfiles(rootfolder)) { if (f.tostring().contains("test")) { files = createfilelist(f); } } } catch (system.exception excpt) { // log stuff } } return files; } what i'm wanting refactor out if statement inside foreach loop, making using of switch statement need check against variety of different words however, i'm struggling put switch statement in due use .contains() , fact need check each of file names may or may not have particular set of characters i'm looking for. is there way in can make use of switch statement or stuck using variety of if statements? edit maybe unclear in wanting do. , seem ho

pyparsing: Grouping guidelines -

pyparsing: below code put can parse nested function call , logical function call or hybrid call nests both function , logical function call. dump() data adds many unnecessary levels of braces because of grouping. removing group() results in wrong output. there guideline use group(parsers)? also pyparsing document does'nt detail on how walk tree created , not of data available out there. please point me link/guide helps me write tree walker recursively parsed data test cases. translating parsed data valid tcl code. from pyparsing import * pyparsing import oneormore, optional, word, delimitedlist, suppress # parse action -maker; # paul's example def makelrlike(numterms): if numterms none: # none operator can binary op initlen = 2 incr = 1 else: initlen = {0:1,1:2,2:3,3:5}[numterms] incr = {0:1,1:1,2:2,3:4}[numterms] # define parse action number of terms, # convert flat list of tokens nested list def pa(s,l,t): t = t[0] if len(t) > init

entity framework - CI and MSBuild adding EntityFramework -

(i still beginner stuff) implementing ci jenkins builds using msbuild. pulling code , building visual studio works, when pull repo (bitbucket) these sort of errors: c:\program files (x86)\msbuild\14.0\bin\microsoft.common.currentversion.targets(1820,5): warning msb3245: not resolve reference. not locate assembly "entityframework, version=6.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089, processorarchitecture=msil". check make sure assembly exists on disk. if reference required code, may compilation errors. [c:\users\bob.jenkins\workspace\sift\source\sift.model\sift.model.csproj] and because of these sort of errors domain\incident.cs(5,19): error cs0234: type or namespace name 'entity' not exist in namespace 'system.data' (are missing assembly reference?) [c:\users\bob.jenkins\workspace\sift\source\sift.model\sift.model.csproj] now know has repo not allowing dll or other kinds of files (we don't want because

javascript - How to include whitespaces in string replace? -

i need replace strings '5 hours' '5h'. i'm able '5 h'. how remove space in between? when replace "hours" in function " hours" whitespace, replaces nothing , returns '5 hours'. $('div.block_name span').text(function(){ return $(this).text().replace("hours","h"); }); you can use regex so: // "\s?" means find space if exists console.log("5 hours".replace(/\s?hours/, 'h')); // 5h console.log("5hours".replace(/\s?hours/, 'h')); // 5h

python - Skeletal animation transfer - Orientation -

Image
i'm trying make pymel script in maya want transfer animation 1 rig another. right script transferring keyframes orignal rig other, ignores joint orientation. have mathematical formulas unsure of how use them in pymel, since it's not primary language. the formula: "s" rig source , "t" targeted rig. as of have isolated rotation, unsure of how worldspacerotation , translatedrotation. if or give me pointers appreciated! can send current code if needed.

Facebook marketing api insights can be used in graph api explorer -

how see facebook marketing api insights in graph api explorer? explain? can output see in link? marketing api sample i had answer,i expalin here the following links usefull question https://developers.facebook.com/docs/marketing-api/insights-api https://developers.facebook.com/docs/marketing-api/insights/fields/v2.10 https://developers.facebook.com/docs/marketing-api/reference/ad-keyword-stats https://developers.facebook.com/docs/marketing-api/insights/v2.10 https://developers.facebook.com/docs/marketing-api/insights/fields/v2.10 https://developers.facebook.com/docs/marketing-api/tracking-specs/v2.10 https://developers.facebook.com/docs/marketing-api/insights/parameters/v2.10 fb not defined javascript go https://developer.facebook.com , create app , left side nav bar create marketing api , manage above tools. doubts comments here..

logging - How to configure application audit log on a separate file in Wildfly-swarm -

i have configured logging fraction , tried add additional handler store specific logs in different files, using category, looking answer in how log application auditing separate file on wildfly 8 adapting wildfly-swarm fluent api. the code looks this: loggingfraction loggingfraction = new loggingfraction() .consolehandler(level, "color_pattern") .formatter("pattern", "%d{yyyy-mm-dd hh:mm:ss,sss} %-5p [%t] (%c{1}) %s%e%n") .formatter("color_pattern", "%k{level}%d{yyyy-mm-dd hh:mm:ss,sss} %-5p [%t] (%c{1}) %s%e%n") .formatter("audit", "%d{yyyy-mm-dd hh:mm:ss,sss} %-5p (%c{1}) %s%e%n") .periodicsizerotatingfilehandler("file", h ->{ h.level(level) .namedformatter("pattern") .append(true) .suffix(".yyyy-mm-dd")