Posts

Showing posts from May, 2013

r - Aggregate by paymentamount -

i have data this: emailaddress customer_acquisation_date customer_order_date payment_amount xy@gmail.com 01/05/2013 6:24 01/05/2013 5:10 $ 20.67 xy@gmail.com 01/05/2013 6:24 02/07/2013 7:21 pm $ 25.56 xy@gmail.com 01/05/2013 6:24 07/10/2013 8:00 $100.00 xy@gmail.com 01/05/2013 6:24 08/12/2013 9:35 $30.00 i trying sum(payment amount) emailaddress want final output as: emailaddress customer_acquisation_date customer_order_date payment_amount xy@gmail.com 01/05/2013 6:24 01/05/2013 $ 177 02/07/2013 07/10/2013 08/12/2013 code writing z <- aggregate(x$emailaddress~x$paymentamount,data=x,fun=sum) error getting error in summary.factor(c(211594l, 291939l, 79240l, 208971l, 369325l, : ‘sum

Android O - Detect connectivity change in background -

first off: know connectivitymanager.connectivity_action has been deprecated , know how use connectivitymanager.registernetworkcallback . furthermore if read jobscheduler , not entirely sure whether got right. my problem want execute code when phone connected / disconnected to/from network. should happen when app in background well. starting android o have show notification if want run service in background want avoid. tried getting info on when phone connects / disconnects using jobscheduler/jobservice apis, gets executed time schedule it. me seems can't run code when event happens. there way achieve this? maybe have adjust code bit? my jobservice: @requiresapi(api = build.version_codes.lollipop) public class connectivitybackgroundserviceapi21 extends jobservice { @override public boolean onstartjob(jobparameters jobparameters) { logfactory.writemessage(this, log_tag, "job started"); connectivitymanager connectivitymanager = (connecti

html - CSS circle with inner circle and image -

i'm new css please bare me. i'm trying achieve following: a background circle smaller colored circle inside of it, must centered a small centered image inside of both circles all of these items needs placed in single div i'm trying minimum amount of code. want avoid duplication as possible. believe of can achieved using before , after selectors, i'm not sure how done here's have far: css: .grid-container { display: grid; grid: 100px / 100px; } .circle { border-radius: 50%; width: 100%; height: 100%; background-color: #e4e4e7; } .circle:before { content: ""; border-radius: 50%; width: 80%; height: 80%; top: 10%; left: 10%; background-color: blue; display: block; position: relative; } .image-one:before { content: url("https://stackoverflow.com/favicon.ico"); } .ci

json - How to deserialize a Timestamp as-is using Jackson Annotation in Java? -

i have field in java bean below @jsonformat jackson annotation: @jsonformat(shape = jsonformat.shape.string, pattern="yyyy-mm-dd hh:mm") private timestamp createdon; when return timestamp , getting converted utc time in json response. lets on formatting timestamp , 2017-09-13 15:30 response getting returned 2017-09-13 10:00 . i know because of jackson annotation default takes system timezone , converts timestamp utc. (in case server belongs asia/calcutta time zone , offset +05:30 , jackson mapper subtracts 5 hrs , 30 minutes convert timestamp utc) is there way return timestamp as-is, i.e, 2017-09-13 15:30 instead of 2017-09-13 10:00 ? i've made test here, changing jvm default timezone asia/calcutta , creating class java.sql.timestamp field: public class testtimestamp { @jsonformat(shape = jsonformat.shape.string, pattern = "yyyy-mm-dd hh:mm") private timestamp createdon; // getter , setter } in other question told j

javascript Promise excution order -

promise.resolve() .then(() => console.log(2)) .then(() => console.log(3)); promise.resolve() .then(() => console.log(4)) .then(() => console.log(5)); console.log(1); why above code snippet result 1 2 4 3 5 instead of 1 2 3 4 5 . what execution order? it runs in order because that's order callbacks entered callback queue. lets follow through code does: promise.resolve() .then(() => console.log(2)) .then(() => console.log(3)); promise.resolve() .then(() => console.log(4)) .then(() => console.log(5)); console.log(1); first, main code ran, 2 promises created , resolved, , 2 callbacks added callback queue; callbacks 2 , 4. queue [2,4]. console.log(1) happens , function ends. now function done, next callback in callback queue runs, logging 2, pushes new callback callback queue, callback 3. queue [4,3]. next, callback 4 runs , logs 4, , pushes callback 5 queue. queue [3,5] next, callbacks 3 , 5 each run in order, bringing queue [].

Extract currency amount from string in Python -

i'm making program takes currency string , converts in other currencies. example, if string 'the car cost me $13,250' need $ , 13250 . have regex (?:\£|\$|\€)(?:.{1,}) sort of it, there reasonably large possibility string might have more 1 price, using different currencies. no know how effectively. what need know how extract of prices string. think if regex returns ['$12,250,000','£14,500,123','£120.25'] fine because can use number: prices = ['$12,250','£14,500','£120'] value in prices: value.replace(',','') and currency: for c in prices: currency = c[0] then there problem price might not whole number, , might $12.54 . on how initial list of prices great. this regular expression work better purposes: (?:[\£\$\€]{1}[,\d]+.?\d*) try out here . then sainoba notes, can use re.findall or re.finditer matches. then can extract currency first character, remove commas, , spl

authentication - How to specify redirect uri using WebAuthenticationCoreManager? -

i using webauthenticationcoremanager authenticate uwp app: webtokenrequest webtokenrequest = new webtokenrequest(provider, authority, clientid); webtokenrequest.properties.add("resource", resourceid); webtokenrequestresult wtrr = await webauthenticationcoremanager.requesttokenasync(webtokenrequest); i given clientid , redirecturi use, don't know how set redirecturi request. this thread says there no way, short of using webauthenticationbroker , i'm hoping has changed. so, there way specify redirect uri? so, there way specify redirect uri? you don't need set redirect uri web account manager relative apis. it seems redirect uri built in, , cannot set it. purpose using these apis requesting user's permission use microsoft account , obtain access token. can access token without setting redirect uri. confirm having app manifest being modified use app identity of registered microsoft store/registered aad app. more details please refere

android - In Cordova is there a way to always target a specific device for one or more specific platforms when running all? -

when type in: cordova run the cordova app run in added platforms. however, android doesn't run because seems need specified target run. when run android platform needs target, like: cordova run android --target=nexus_s_api_25 since run platforms @ once nicely, looking way let cordova know should target android in specified emulator. there way? thanks help. this work if emulator running. cordova printing following message in case: no target specified , no devices found, deploying emulator

php - Getting all users that created an item today in Laravel -

i want make list of users created item. these items have row user_id to items created today, this: $items = item::whereday('created_at', '=', date('d')); now want perform query gives me users have created item today. there users created 1000 items, , there users didn't @ all. i ->unique() there must surely better way this. any suggestions? assuming have items relationship set on user model like: $users = user::wherehas('items', function ($query) { $query->where('created_at', '>=', \carbon\carbon::today()); })->get(); hope helps!

algorithm - What is the runtime complexity of this short code? -

i found solution on programming practice site , said complexity o(n). however, looks more o(n^2) me. can please tell me why o(n) ? public static void transposematrix(int[][] matrix) { int n = matrix.length - 1; int temp = 0; for(int = 0; <= n; i++){ for(int j = i+1; j <= n; j++){ temp = matrix[i][j]; matrix[i][j] = matrix[j][i]; matrix[j][i] = temp; } } } what n ? if n max(matrix.length, matrix[0].length) , algorithm o(n^2), say. if n the total size of matrix , algorithm o(n). it's important define n in big-o notation. when learning big-o, discussions revolve around single-dimensional inputs, , people assume don't have define n . in real world, things dirty, deal multidimensional inputs, , have clear n is.

css - font-size not looking same in pixels and em -

i have webpage made me in have put "frontend developer" text twice on laptop image can compare font-size in pixels , em. for upper "frontend developer" text, have put font-size: 2.875em whereas lower "frontend developer" text, have put font-size: 46px i wondering why font-sizes both of text not looking similar ? although 46px=2.875em (font size) the css code both of text are: .frontend-background-image p:nth-child(1) { font-size: 2.875em; color: white; text-align: center; padding-top: 8%; padding-left: 5%; } .frontend-background-image p:nth-child(2) { color: white; text-align: center; padding-left: 5%; font-size: 46px; } em relative unit, meaning when ay 2.875em , mean 2.875 times whatever font size have been start with. 46px 2.875em...if base size 16px. fact other text showing @ different size means base size must else. when you're inspecting elements in dev tools, can @ 'comput

react-navigation - navigating back to previous screen after opening app from deep link not working -

Image
i'm trying implement deep linking in react native app i'm having trouble maintaining expected back-button behavior when closing out of view nested in stack navigator. root navigator stacknavigator has tabnavigator path 'customer'. inside tab navigator there 4 tabs, 1 of has path 'order-now' screen being stacknavigator. ordernow stack has 3 child screens this: const ordernowtab = stacknavigator({ root: { screen: storesscreen, path: 'show-stores' }, menu: { screen: storeitemsscreen, path: 'show-stores/:store_id'}, item: { screen: itemdetailsscreen, path: 'show-stores/:store_id/:item_id'} }); when follow deep linking guides running adb shell start -w -a android.intent.action.view -d "mychat://mychat/customer/order-now/show-stores/some_store_id/some_item_id" com.sampleapp taken item details screen expected, when press arrow button within navigation header, app appears close screen , land on exact copy of 1 closed (i

javascript - TypeError: __WEBPACK_IMPORTED_MODULE_0__api_user__.a.login(...) is undefined -

in vue.js project have following files: src/services/http.js import axios 'axios' export const http = axios.create({ baseurl: `http://localhost:3000/api/`, responsetype: 'json' }) src/api/user.js import { http } '@/services/http' export const user = { login (email, password) { http.post('v1/login', { email: email, password: password }) } } src/store/user/actions.js import {user} '@/api/user' export const actions = { loginuser ({ commit }, params) { user.login(params.email, params.password) } } when run code returns me following error: typeerror: __webpack_imported_module_0__api_user__.a.login(...) undefined

python - I want to write the answer of a function in a text file -

my assignment create function asks name, age, sex, , city of user. afterward have create text file python , insert answers given user in form: Âge : (user answer) ans sexe : m/f ville :( user answer) i decided write code this: nom=input("quel est votre nom ?") age=input(" quel est votre age ?") sex=input("quel est votre sexe ? ") ville=input("où résidez-vous ?") def asv(nom,age,sex,ville): n=str(nom) a=str(age) s=str(sex) v=str(ville) return(n,a,s,v) fichier=open("asv.txt","w") #fichier.write("Âge :" ++ "ans") #this need fichier.close() i cannot seem understand how write this. did research , of them talk loops, haven't seen yet. you need append string form of variable label want. instance: fichier.write("Âge :" + age) fichier.write("sexe :" + sex) ... you never converted input other values, still have them in stri

javascript - Components doesn't render a function called from render function -

i've been trying figure out why renderfilteredlist not render these list items (both of them include substring this.props.searchedword , console logs true, , renderfilteredlist called original render function). {<li key={singleobject.body} classname="list-group-item">{singleobject.body}</li>} {<li key={singleobject.name} classname="list-group-item">{singleobject.name}</li>} and couldn't figure out why, can tell me wrong code please? renderfilteredlist(){ console.log('the data fetch is: ', this.props.datafetched, 'and searchedword is: ', this.props.searchedword); return this.props.datafetched.map(objects=>{ return objects.map(singleobject=>{ console.log(singleobject.body.includes(this.props.searchedword), singleobject.name.includes(this.props.searchedword)); <div> {<li key={singleobject.body} classname="list-group-item"&g

excel - How to filter on one column, then filter on the next, then another and copy the total of all three filters? -

i have been struggling filtering 3 columns , taking whatever comes each of 3 columns (combined) , copying all. so, if column 1 returns 1 row , column 2 return 2 rows , column 3 returns 1 row. want see 5 rows @ 1 time , copy them. code doesn't seem work when there no data comes in filter. so, i'm thinking need if statement, reason gives me error "run-time error'1004': application-defined or object-defined error" @ .autofilter field:=11, criteria1:=rgb(192, 0, 0), operator:=xlfilterfontcolor thanks in advance have! i've been working day trying out code fix error.here's code. sub filterdifferences() 'filtering differences dim ws worksheet dim rng range dim rngk range dim rngl range dim rngm range dim lrow long set ws = sheets("sheet1") ws '~~> last row of col m lrow = .range("m" & .rows.count).end(xlup).row '~~> identify range set rng = .range("a1:m" & lrow) .autofil

batch processing - Copy folders and files to a new location based on the first character of the folder or file -

i wanted have folders , files copied new location via batch based on first letter of name , keeping it's original folder structure when copied new location. (incremental) examples: any folder or file begins a-m or 0-9 copied n:\movies any folder or file begins n-z copied m:\movies i found similar script here: batch: move files folder first letter of name? current code: @echo off setlocal enabledelayedexpansion set "sourcedir=n:\" set "destdir=m:\" pushd "%sourcedir%" %%a in (*) ( if /i "%%a" geq "a" if /i "%%a" lss "h" copy "%sourcedir%\%%a" "%destdir%\" if /i "%%a" geq "h" if /i "%%a" lss "u" copy "%sourcedir%\%%a" "%destdir%\h-t\" if /i "%%a" geq "u" ( if /i "%%a" lss "z" copy "%sourcedir%\%%a" "%destdir%\u-z\" ) else ( set "name=%%a&q

Regex to remove text after angle brackets -

i trying write regex extract names email "from" header. had regex worked email clients noticed email client send header on different breaking regular expression. initial thought extract inside of double or single quotes not work anymore because not have quoted. i using regular expression ([""'])(?:(?=(\\?))\2.)*?\1 extract text between quotes. think best course of action remove text inside of angle brackets leaving me "testing person" without quotes , preferably without second occurrence after comma although not necessary. below 2 strings trying extract names from: testing person <testing.person@example.com>,testing person <testing.person@example.com> "testing person" <testing.person@example.com>,"testing person" <testing.person@example.com> i tried using can't seem figure out how tell how capture first half of string angle bracket (?!([^<|>])).* any appreciated you can use p

Cloud Functions Emulator can't get default credentials -

i'm trying test cloud function locally, , using functions emulator has been fine until tried adding datastore project. whenever start emulator, deploy, , call function test data via --file=test.json , error datastore promise error: (node:35048) unhandledpromiserejectionwarning: unhandled promise rejection (rejection id: 2): error: not load default credentials. browse https://developers.google.com/accounts/docs/application-default-credentials more information. the problem i've tried multiple times, both beta , normal auth modules, ie: gcloud beta auth application-default login and gcloud auth application-default login they both successful functions emulator still fails no matter what. datastore version ^1.1.0 & google cloud sdk 170.0.1, beta 2017.03.24

Cannot deploy app to emulator in Android Studio - "unknown avd" -

i made simple hello world app deploy emulator in android studio. this used work before same project (i installed necessary packages) time random reason, in run options when select "target: emulator", under "prefer android virtual device" following in red: "unknown avd". i've googled around , answers vary. answer seems make sense is: you have install intel image library , google api desired api. go sdk manager , check intel system images installed or not if not have installed install google api library. however don't have these "intel image libraries" , "google api" options in sdk manager. these shorthand aliases other names in options? any ideas on how emulator , running? a bit of information on environment: android studio 2.3.3 windows 7 professional 64 bit gradle version: 3.3 selected sdk platform package: android 7.1.1 (nougat)/ api level 25 revision 3 virtual device: nexus 5x api 25

php - On submit, JavaScript alert showing and database data not insert if my code is any error -

<!-- html form --> <form action="insert_products.php" method="post" name="insert_products" enctype="multipart/form-data"> <table align="center" width="95%" cellspacing="20" cellpadding="5"> <tr> <td align="center" bgcolor="#cccccc"><strong>select category:</strong></td> <td><select name="category_id" id="insert_product_form_category"> <option value="select category" selected="selected" disabled="disabled">select category</option> <!-- select category --> <?php global $con; $get_categories = "select * categories"; $run_get_categories = mysqli_query($con, $get_categories); while ($row_run_get_categories = mysqli_fetch_array($run_get_categories)) { $category_id = $row_run_g

Arduino App with Android, Android Studio or App Inventor? -

which more convenient use android app arduino, android studio or app inventor. i have made apps both. interestingly android studio vs app inventor should concentrate when consider apps , arduino. because arduino separate part , easy use both ( though suggest using android studio). beginner using app inventor easier studio. know how create apps both ide suggest android studio provides more features , functionalities when combining hardware. as android studio provide more plugins , flexibility app invetor suggest using android studio.

python - Getting the weights from TensorFlow's estimator.DNNClassifier -

i understand dnnclassifier trained via estimator.dnnclassifier . before trained using contrib.learn.dnnclassifier extract weights using get_variable_names() . there no such method in estimator.dnnclassifier . if contrib.learn deprecated now, how weights new estimator.dnnclassifier ?

matlab - How to run system commands in Octave for OPM flow reservoir simulator? -

i research in oil simulation, use simulator called eclipse company called schlumberger , able use scripts matlab using following command. % file name 'icfm.data'; system(['eclrun',' eclipse ', c:path\icfm.data]); % command run eclipse now had installed new free simulator (opm.org) in linux , using octave programming. unable find out how run simulator octave. the simulator can run writing flow icfm.data and results using command ecl_summary icfm.data i want able run , results in octave have not being able in matlab. any suggestions? someone? assuming both flow , ecl_summary commands on system path (i.e. "linux" path, not in octave), should matter of: system('flow /my/path/to/icfm.data'); system('ecl_summary /my/path/to/icfm.data'); (where should change /my/path/to whatever path data file in).

javascript - Why is the passed in value undefined when accessing the map method? -

when run snippet below in jsbin says capitalize won't work because property undefined. looked @ documentation , mentioned use of word 'this' not quite sure if applies here since string value passed in correct (console logged confirm). why capitalize method not apple work off map value? class booktitle { constructor(title) { this.title = title; // creates object once, see top of jasmine file explanation } title() { return this._title; // retrieves title string } set title(title) { this._title = this.titlecreator(title); // calls method , sets title, see top of jasmine file explanation } titlecreator(string) { if (string == null){ return string; // catches first error } // note isn't meant fledged title creator, designed pass these specific tests var littlewords = ['and', 'do', 'the', 'a', 'an', 'in', 'of']; // thes

android - Would this kernel source work? -

i have archos 50 helium plus phone, phone uses mt6735p mtk chipset, archos didn't release source code of phone kernel, however, found lenovo phone, lenovo vibe c2, uses exact same mtk chipset mt6735p archos phone , source of kernel of phone publicly available containing vendor , device trees , kernel source i wonder if using source work phone, since 2 phones have exact same hardware chipset i'd like, build twrp recovery , cyanogenmod phone i'd recommend ask archos directly source code phone model ( https://www.archos.com/fr/support/support_tech/contact_support.html ). they have give source code of own version of android according gpl 2.0 ( https://www.gnu.org/licenses/old-licenses/gpl-2.0.html ).

c - Macro Accessing struct member without type definition -

i bumped macro definition. #define cmd_ctx (cmd->ctx) i understand functionality. trying access member 'ctx' struct 'command_invocation' in following snippet. knew because 'command_invocation' struct has 'ctx' member in code. what's confusing why there no mention type of input argument. struct command_invocation { struct command_context *ctx; struct command *current; const char *name; unsigned argc; const char **argv; }; now call of cmd_ctx follows command_context_mode(cmd_ctx, command_exec); and definition of function int command_context_mode(struct command_context *cmd_ctx, enum command_mode mode) i understand return value matches. what's not clear me here how input argument determined in call "command_context_mode(cmd_ctx, command_exec);" macros named text fragments. so, gets replaced contents before real compilation pre-processor. in case call function command_context_mode(cmd_ct

css - Show php image field only uploaded field -

i have 3 image field <?php echo $row['thumbnail1']; ?> <?php echo $row['thumbnail2']; ?> <?php echo $row['thumbnail3']; ?> if there 1 exp thumbnail1 have image.. how show and how if image 1 , 2 have data.. please how show php query if there 1 or 2 , 3 image upload this css style <div class="col-xs-12"> <a href="#"><img src="#" class="w-full"></a> </div> <!-- if 2 image available uploaded use --> <div class="col-xs-4"> <a href="#"><img src="#" class="w-full"></a> </div> <div class="col-xs-4"> <a href="#"><img src="#" class="w-full"></a> </div> <!-- if all/3 image available uploaded use --> <div class=

Swagger how to write a model which is array format -

Image
the json this [{xx:xx,xx1:xx1},{},...] here model of request, return array directly, not formal json, how write model? /hsseventwebapi/v1/walking/events/{eventcd}/livecomments: get: operationid: イベント実況を返す summary: 個人に関連するランキングを返す description: "イベント実況を返す(取得したい実況一覧の開始日時を指定取得できる一覧は最大30件" tags: - walking parameters: - name: eventcd in: path description: eventcd required: true type: integer responses: 200: description: ok schema: $ref: '#/definitions/livelistmodel' here model: livelistmodel: type: array description: live list items: type: object description: live item properties: eventno: type: string description: eventno livecommentymdhms: type: string description: livecommentymdhms livecomment: type: string description: livecomment livecommentseq: type: string description: livecommentseq targetappuserno: type: s

css - How to change bootstrap modal header colors (backgrond & text) -

how change bootstrap modal header background dark-blue , text white. fiddle here : https://www.bootply.com/kzdpqurfsl you can try use following css: .modal-header { background-color: darkblue; color: white; } fiddle here .

javascript - else statement not working correctly -

var question=prompt("what age?"); if (question == 14) { alert("coupon 1") } if (question == 21) { alert("coupon 2") } if (question == 30) { alert("coupon 3") } if (question == 50){ alert ("coupon 4") } else { alert("no coupon") } if enter age 14, display "coupon 1" , after displays "no coupon". every if statement except last one, age 50. if enter age 50, coupon 4 , no "no coupon". not understand why this. your if statements not connected, each 1 happening independent of others, means of cases being checked, if earlier 1 returns true . code more this: var question = prompt("what age?"); //check if 14 if (question == 14) { alert("coupon 1") } //check if 21 if (question == 21) { alert("coupon 2") } //check if 30 if (question == 30) { alert("coupon 3") } //chec

functional programming - java 8 How to only return sum and count values from SummaryStatistics -

as know,summarystatistics contain count, sum, min, average, max values. possibly more efficient if return count , sum values?if so,how achieve that? you can edit below code show me: stream.of(0.55f, 0.45f, 0.5f, 0.65f, 0f). filter(i -> > 0.5).maptoint(i -> (int) (i * 100 - 50)).summarystatistics() thank you if understood correctly, asking if should traverse source twice or once , use intsummarystatistics . cheaper: stream.of(0.55f, 0.45f, 0.5f, 0.65f, 0f) .filter(i -> > 0.5) .maptoint(i -> (int) (i * 100 - 50)) .count(); stream.of(0.55f, 0.45f, 0.5f, 0.65f, 0f) .filter(i -> > 0.5) .maptoint(i -> (int) (i * 100 - 50)) .sum(); versus: intsummarystatistics summarystatistics = stream.of(0.55f, 0.45f, 0.5f, 0.65f, 0f) .filter(i -> > 0.5) .maptoint(i -> (int) (i * 100 - 50)) .summarystatistics(); summaryst

error correction - How to compute hamming code for 10 bits? -

i have seen examples of hamming code detection , correction 8 bits or 12 bits. suppose had bit string: 1101 0110 11 contains 10 bits. do need add 2 additional bits bit string complete nibble? if add 0s or 1s ? i have looked other examples, cannot seem find partial nibbles determine procedure. thank you.

text - Is there an equivalent of Python's difflib.SequenceMatcher for Scala -

is there implements difflib.sequencematcher in scala? need convert of production code python scala not want use change previous output sequencematcher. any suggestions appreciated. after searching couldn't find researched sequencematcher , wrote up. it's quite simple in scala. please feel free use or improve on it. /** * class sequencematcher - simplified implimetation of python's sequencematcher * supports strings , ratio() * @version 0.1 * @param stringa - first string * @param stringb - second string */ class sequencematcher(stringa: string, stringb: string) { /** * ratio() * @return return measure of sequences’ similarity float in range [0, 1] */ def ratio(): double = { (2.0 * numofmatches()) / (stringa.length() + stringb.length()) } /** * numofmatches() * @return number of characters match in 2 strings */ def numofmatches(): long = { stringa.intersect(stringb).length() } }

android - Add views inside Constraint Layout and set them full screen PROGRAMMATICALLY -

i spent hours adding imageview inside constraintlayout , setting fullscreen size. this actual code add image inside constraint layout: final constraintlayout constraitlayout = (constraintlayout)activity.findviewbyid(layout_xml); constraitlayout.addview(mimage,0); constraintset set1 = new constraintset(); set1.clone(constraitlayout); set1.connect(mimage.getid(), constraintset.top, constraitlayout.getid(), constraintset.top, 0); set1.connect(mimage.getid(), constraintset.left, constraitlayout.getid(), constraintset.left, 0); set1.connect(mimage.getid(), constraintset.right, constraitlayout.getid(), constraintset.right, 0); set1.connect(mimage.getid(), constraintset.bottom, constraitlayout.getid(), constraintset.bottom, 0); set1.applyto(constraitlayout); thanks help! the issue didn't set width , height image view default wrap_content taken both. setting them both 0dp fix issue . add these lines set width , height 0dp. mimage.setlay

java - Getting error in DispatcherServlet during startup -

does see conflicting jars here might cause exception during tomcat startup. below exception. updated maven dependencies in project properties. error severe: servlet /transactionretrieval threw load() exception java.lang.classnotfoundexception: org.springframework.web.servlet.dispatcherservlet @ org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1714) @ org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1559) junit-3.8.1.jar spring-webmvc-4.3.9.release.jar spring-aop-4.3.9.release.jar spring-beans-4.3.9.release.jar spring-context-4.3.9.release.jar spring-core-4.3.9.release.jar commons-logging-1.2.jar spring-expression-4.3.9.release.jar spring-web-4.3.9.release.jar servlet-api-2.5.jar jstl-1.2.jar jackson-databind/2.5.3/jackson-databind-2.5.3.jar jackson-annotations/2.5.0/jackson-annotations-2.5.0.jar jackson-core/2.5.3/jackson-core-2.5.3.jar jersey-server-1.8.jar /users/vamsikrishna/.m2/repository/asm/asm/3.1/asm-3.

Why this is no "threads" module in tomcat7.0.81? -

i download tomcat on official website, , find tomcat-7.0-doc here, not find 'threads' module is. decompress list what's wrong?

Why is it "pip2" instead of "pip" after installed python with brew? -

i ran brew install python on mac 10.12.3, , logs following: ==> summary 🍺 /usr/local/cellar/sqlite/3.20.1: 11 files, 3.0mb ==> installing python ==> downloading https://homebrew.bintray.com/bottles/python-2.7.13_1.sierra.bottle.tar.gz ######################################################################## 100.0% ==> pouring python-2.7.13_1.sierra.bottle.tar.gz ==> /usr/local/cellar/python/2.7.13_1/bin/python2 -s setup.py --no-user-cfg install --force --verbose --single- ==> /usr/local/cellar/python/2.7.13_1/bin/python2 -s setup.py --no-user-cfg install --force --verbose --single- ==> /usr/local/cellar/python/2.7.13_1/bin/python2 -s setup.py --no-user-cfg install --force --verbose --single- ==> caveats formula installs python2 executable /usr/local/bin. if wish have formula's python executable in path add following ~/.bash_profile: export path="/usr/local/opt/python/libexec/bin:$path" pip , setuptools have been installed. update them

Node.js SAML implementation with OneLogin -

i looking setup our application in application catalog of onelogin, need create saml integration, understand it. see have toolkits available this, working in node.js , there no toolkit environment. i have been reading documentation other posts , think process following: 1) make request onelogin create application , add catalog. 2) application needs have route point provide onelogin used redirect when clicks icon our app. 3) user clicking on icon app in catalog tokenize user , send defined route point information passed saml request / xml. 4) route point need consume saml request / xml , perform internal login process. information passed route point onelogin include necessary information site, first name, last name, , email address. internal application information , if validates existing user, count successful login , let them continue. if not existing user, send them through user creation type form, default information saml request / xml onelogin, or automatically create use

WebApi HelpPage api detail page 404, when "api" prefix removed? -

Image
.net4.7 + webapi5.23 + helppage5.23. my webapiconfig.register: public static class webapiconfig { public static void register(httpconfiguration config) { ... config.maphttpattributeroutes(); config.routes.maphttproute( name: "defaultapi", routetemplate: "{controller}/{action}/{id}", //note: there no "api/" prefix defaults: new { id = routeparameter.optional } ); } } and index page worked: but api detail page fail(page not found): please help, thank you. routing bound getting confused between routing mvc controller or webapi controller since sharing same path. if need web page show, create new method within helpcontroller returns new view. if need json returned, can still create new method within helpcontroller that, change return type jsonresult. hopefully gives enough understand what's going wrong, , therefore google next.

javascript - Grouping objects in an array by multiple keys -

initially, i've array: [{ "vendorid": 1, "vendorname": "vendor1", "maxfilelimit": 2, "uploadfilename": "voice1.xlsx" }, { "vendorid": 1, "vendorname": "vendor1", "maxfilelimit": 2, "uploadfilename": "ven1_voice.xlsx" }, { "vendorid": 2, "vendorname": "vendor2", "maxfilelimit": 2, "uploadfilename": "voice2.xlsx" }, { "vendorid": 2, "vendorname": "vendor2", "maxfilelimit": 2, "uploadfilename": "ven2_voice.xlsx" }] i want file names in array no repetition of records. so, expect output similar following: [{ "vendorid": 1, "vendorname": "vendor1", "maxfilelimit": 2, "uploadfilename": ["voice1.xlsx", &quo