Posts

Showing posts from September, 2014

swift - Scores are not registered on the leaderboard of GameCenter -

i've got such log when score report leaderboard. <gkscore: 0xxxxxxxxxx>player:playerid:g:9999999999 alias:tester ajw rank:0 date:2017-03-28 08:31:26 +0000 value:1 formattedvalue:(null) context:0x0 leaderboard:testscore group:(null) the value seems sent, formattedvalue , group null. i've tried app on testflight, score never registered on leaderboard. shows "no scores". appdelegate.swift func application(_ application: uiapplication, didfinishlaunchingwithoptions launchoptions: [uiapplicationlaunchoptionskey: any]?) -> bool { // login check if let presentvc = window?.rootviewcontroller { let targetvc = presentvc let player = gklocalplayer.localplayer() player.authenticatehandler = {(viewcontroller, error) -> void in if ((viewcontroller) != nil) { print("login: faile") // login phase start targetvc.present(viewcontroller!, animated: true, comp

jboss - Keycloak 'ExampleDS' in production -

i'm following guide set keycloak 3.0.0 in ha mode production oracle db. see in standalone-ha.xml file there's subsystem: <subsystem xmlns="urn:jboss:domain:ee:4.0"> at bottom of subsystem section there's <default-bindings> element refers exampleds datasource: <default-bindings context-service="java:jboss/ee/concurrency/context/default" datasource="java:jboss/datasources/exampleds" managed-executor-service="java:jboss/ee/concurrency/executor/default" managed-scheduled-executor-service="java:jboss/ee/concurrency/scheduler/default" managed-thread-factory="java:jboss/ee/concurrency/factory/default"/> exampleds declared use h2 driver, cannot use in production. can change <default-bindings> element refer oracle keycloakds datasource? you need add , configure oracle jdbc driver beforehand , add datasource needed keycloak. can follow example setup stated here . have seen

PHP regex, skip <link> tags when rel="canonical" -

i run php script in wordpress removes http: , https: protocols links using following regex: $links = preg_replace( '/<input\b[^<]*\bvalue=[\"\']https?:\/\/(*skip)(*f)|https?:\/\//', '//', $links ); for first part: <input\b[^<]*\bvalue=[\"\']https?:\/\/(*skip)(*f) , skips <input> tags have http: / https: value, such as: <input type="url" value="http://example.com"> additionally, i'd skip <link> tags have rel="canonical" attribute: <link rel="canonical" href="http://example.com/remove-http/" /> using regex tester , i've been trying update logic. i've come far: <(input|link)\b[^<]*\(value|rel)=[\"\'](https?:\/\/|canonical)(*skip)(*f)|https?:\/\/ but hasn't worked me. the (*skip)(*f) verbs used discard text matched far , proceed search next match position regex index after matching text pattern before the

javascript - LazyLoad on multiple elements with both default and non-default sources and attributes -

i using lazyload xt ( https://github.com/ressio/lazy-load-xt ) load default <img> s , it's working fine using $.extend($.lazyloadxt, { selector: 'img', srcattr: 'src' }); i using srcattr: 'src' due compatibility third party plugin requires default src . however, have several div s background-image lazy load. question is; how configure plugin target div fx .someclass lazy load background-image default attr data-bg ? i've tried several different variations seem cancel other 1 out. back-ground image work not <img> etc. furthermore have html5 video running lazy load default src instead of data-src . basically, know how define each element lazyload, based on fx class, , src attribute whether it's lazyload default or html default. for information have included plugin using bower , use both jquery.lazyloadxt.js , jquery.lazyloadxt.extra.js . sorry noob question, hope can help.

javascript - Getting contacts from ContactsApp Service for autocomplete using GAS -

Image
how code getcontacts() using apps script if i'll have use jquery autocomplete "multiple", fetch emails(email not phone or other details). it should return in such way if person has 2 email ids saved under single name, has added returning json array. example if person.a has pera1@gmail.com , pera1@yahoo.com list has be var emails = [ "person.a" <pera1@gmail.com>, "person.a" <pera1@yahoo.com>, ... ]; javascript emails = google.script.run.getcontacts(); $( function() { var availabletags = emails; function split( val ) { return val.split( /,\s*/ ); } function extractlast( term ) { return split( term ).pop(); } $( "#recipients" ) // don't navigate away field on tab when selecting item .on( "keydown", function( event ) { if ( event.keycode === $.ui.keycode.tab && $( ).autocomplete( "instance" ).menu.activ

android - How to get the cursor on Editext of child item of the Recyclerview when the new item is added to it? -

i have recyclerview i'm adding child items on click of button dynamically. each child item has editext. when new child item been added recyclerview editetext of new item should focus. how can it? you can request focus inside adapter. something this: @override public void onbindviewholder(recyclerview.viewholder holder, final int position) { ((viewholder) holder).youredittext.requestfocus(); // set focus on edittext whenever child getting created }

handling multiple select values in ASP.net MVC with a service layer -

i have many multiple select dropdowns in asp.net mvc application , wondering best way handle transferring values viewmodel model saved database using ef6 (im using db first way create entities). 1 of viewmodels looks this public class someviewmodel{ public string[] selectedids public ienumerable<selectlistitem> selectvalues //other properties } i decided create partial model class , add selectedids like public partial class somemodel{ public string[] selectedids //other properties } my model passed service layer public class someservicelayer{ public int insertsomething(somemodel model){ //do stuff if (model.selectedids.length != 0){ model.selectvalues = _context.selectvalues .where(b => model.selectedids.contains(b.id.tostring())).tolist(); } } } it feels wrong have add custom property in partial class model. there better way of handling this? interest

How to open DICOM (.dcm) images in iOS ? -

though duplicate question, great if can me in integrating dicom image viewer in ios application. building health application, have requirement showcase .dcm images. solutions ? i'd tried this , this too . no luck :( imebra (c++) can compiled os-x , ios. it comes few objective-c helpers convert images uiimage or nsimage , std::string objects to/from nsstring. the documentation contains section dedicated building library apple oses. disclosure: i'm author of imebra

excel - check for duplicates in diffrent worksheets and thereafter print value -

i have searched cant seem figure out how print specified value in column next find duplicate. have since earlier code first specify diffrent ranges , thereafter if duplicate found in sheet y sheet x. sheet le weeks information , sheet last weeks information. if find duplicate in specified range want on delivery sheet print in column next duplicate either delivered or not delivered depending on if output function compareaeo print true or false. the conditions looking if can find same value in column b in sheet (le) on sheet (be) check if text in column f has changed. if shall print in column on sheet (le) = delivered. otherwise not delivered. it checks se if dates in column m same. if not shall print replanned in column on sheet (le). shortly if value in cell on column b, sheet (le) = value in column b, sheet (be) value in column on sheet le = "delivered" else "not deliverd". then if value in cell in column m, sheet (le) <> if value in cell in

enterprise architect - The Error I see when I try to assign more than 6 elements to a tag of type RefGUIDList -

Image
i have query in mgd technology regarding tagged value of type “refguidlist”. i using mdg technology in giving tagged value of type “refguidlist”, should refer maximum number(multiplicity 0-n) of elements. in mdg not able refer more 6 elements. the error see when try assign more 6 elements tag of type refguidlist. please tell me there way increase count of references or let me know there other tagged value referring maximum number of elements. you tweak database schema t_objectproperties.value can hold more chars. absolutely on own risk. people have done different char fields. should first try in sandbox find out if works without side effects. , of course won't support sparx if fails. alternatively send in feature request. postal address: santa claus, north pole.

Android Studio - No build option for Cordova/Ionic project -

Image
since updated android studio version 2.3, cannot manage build cordova/ionic project anymore. before update working fine, there no build options anymore, "make module" (see picture). in "run" menu, can "run..." "configurations" screen android app there "modules" dropdown 1 option: "no module". i have tried add new configuration, new module, set "android" platform folder source root, no success. any idea missing? tks!

google api - GoogleApp Directory API's to set the Proxy credentials -

i using googleapps directory api access googleapps. have 1 query regarding proxy , how set proxy credentials using directory api's. as per googleapps api's documentation can use class "googlenethttptransport" set proxy (port , host). static httptransport newproxytransport() throws generalsecurityexception, ioexception { nethttptransport.builder builder = new nethttptransport.builder(); builder.trustcertificates(googleutils.getcertificatetruststore()); builder.setproxy(new proxy(proxy.type.http, new inetsocketaddress("127.0.0.1", 3128))); return builder.build(); } but if have credentials proxy server how can set, there no mention setting proxy credentials. is there googleapps api allow set proxy credentials along hostname , port? if no , should go setdefault(authenticator) set proxy credentials system property ? can have idea this. input on highly appreciable! you may refer documentation . http proxy java client libr

php - How we can get difference of time In "H:i:s" time format as given scenario? -

here scenario have 2 time given have time part of datetime in 24 hour format $start_time = "23:00:00"; $end_time = "07:00:00"; how can calculate duration hours , if start_time's hour part greater $end_time's hour. i create if, if start time bigger have calculate 24h (base_time) minus start time first. $start_time = "23:00:00"; $end_time = "07:00:00"; $base_time = "24:00:00"; if ($start_time>$end_time) { $time = $base_time-$start_time+$end_time; } else { $time = $start_time-$end_time; } or can have here , if have day format given. the way on datetime, far know, possible date. add pseudo date infront... , use diff : $start_time = "23:00:00"; $end_time = "07:00:00"; $st = new datetime("0000-00-00".$start_time); $et = new datetime("0000-00-01".$end_time); $interval = $st->diff($et); $time = $interval->format('%h:%i:%s');

Coordinator node timed out on Cassandra cqlsh shell -

i new cassandra , trying multi node setup on 2 mac machine. not datastax casandra. ip 10.100.1.12 , other machine ip 10.100.1.15. have changed following properties in cassandra.yaml files on bothe machine: 10.100.1.15: seeds: "127.0.0.1,10.100.1.12,10.100.1.15" listen_address: 10.100.1.15 rpc_address: 10.100.1.15 endpoint_snitch: gossipingpropertyfilesnitch 10.100.1.12: seeds: "127.0.0.1,10.100.1.12,10.100.1.15" listen_address: 10.100.1.12 rpc_address: 10.100.1.12 endpoint_snitch: gossipingpropertyfilesnitch cassandra runs fine cqlsh opening using command bin/cqlsh 10.100.1.12 but when trying retrieve count of tables showing me error: readtimeout: error server: code=1200 [coordinator node timed out waiting replica nodes' responses] message="operation timed out - received 0 responses." info={'received_responses': 0, 'required_responses': 1, 'consistency': 'one'} i tried changing read_request_

.htaccess - Point string to php page and query -

i've been trying past 2-3 hours working don't have enough knowledge of regex. i'm trying make url shortener, want point url domain.com/d5ds93x domain.com/view.php?s=d5ds93x i've been messing around .htaccess file , have now: rewriteengine on rewritebase / rewriterule /(.*?)$ /view.php?s=$1 [l] and sort of works, points right file string (d5ds93x) isn't passed on. view.php file looks (for testing purposes): <?php if (isset($_get['s']) && ctype_alnum($_get['s'])) { echo $_get['s']; } ?> when visiting url blank page. if echo before if rule displayed page works fine. data of passed on? or should add code detects data in url? use this: rewriteengine on rewritebase / # if request not valid directory rewritecond %{request_filename} !-d # if request not valid file rewritecond %{request_filename} !-f rewriterule ^/?(.+)$ view.php?s=$1 [l,qsa] make leading slash optional rule works .htacces

java - Creating Azure storage container fails when deploying on weblogic 12c -

Image
i have simple spring boot project testing creates container in existing azure storage account when running standalone. when deployed in weblogic 12c server fails error can't find on internet. the proyect has controller, application, weblogic.xml , pom.xml, nothing more. when running locally works perfectly, creating container connection string of account (with de account key) , name of container. here code of controller class: package com.example; import java.io.ioexception; import java.net.urisyntaxexception; import java.security.invalidkeyexception; import org.springframework.web.bind.annotation.requestmapping; import org.springframework.web.bind.annotation.requestmethod; import org.springframework.web.bind.annotation.restcontroller; import com.microsoft.azure.storage.cloudstorageaccount; import com.microsoft.azure.storage.storageexception; import com.microsoft.azure.storage.blob.cloudblobclient; import com.microsoft.azure.storage.blob.cloudblobcontainer; @restcontr

node.js - nodejs /Mongo - multiple finds not working -

still noob node/mongo , stuck on this. i have 2 mongo collections, tenants , rent. rent collection has tenant _id in schema. following function searching through active tenants , each of pulling out attributes latest rent document. first part of function populates tenant object results. working good. second .then starts iterate through tenant object pulling out _id use in rent query. (join). issue loop seems iterate through , print _id correctly, second find query seems print out last document in object. not sure why happening thanks in advance app.get('/chargerenttest/:date', (req,res) => { //check date valid var rentchargedate = new date(req.params.date); var tenant = ""; //for each active tenant tenant .find({ activetenant : true }) .then ((tenant) => { if (!tenant) { return res.status(404).send(); } console.log("found tenents") return te

inheritance - c# - How to get property value from derived class? -

this question has answer here: can override property in c#? how? 6 answers i writing console app in c#. here code: interface itest { string str { get; } } public class baseclass : itest { public virtual string str { { return "baseclass"; } } } public class derivedclass : baseclass { public new string str { { return "derivedclass"; } } } class program { static void main(string[] args) { itest itest = new derivedclass(); console.writeline(itest.str); console.readkey(); } } when executing above code, "baseclass" coming output. instead, how "derivedclass" output? with declaring property new in derived class you're creating new member isn't called when invoked through interface. use o

Varnish List all URLS in Cache -

i looking way iterate on whole cache , list of object url's - inside storage. is there varnish command missing. or have starting poiunt iterating on objects within vmod? regards with command, see hit , miss varnishncsa -f '%u%q %{varnish:hitmiss}x'

julia lang - pushing elements to an array of matrices -

suppose want have array of matrices , iterate in for-loop , add in every loop matrix array, afaik in julia: v = array{array{float64,2},1} i=1:nlevels img = imgread("/path/img.png") push!(v, img) # append!(img) doesn't work end methoderror: no method matching append!(::type{array{array{float64,2},1}}, ::array{float64,2}) closest candidates are: append!(!matched::array{t,1}, ::any) @ collections.jl:21 append!(!matched::catindices.bidirectionalvector{t}, ::any) @ ... i error! what doing wrong here! how there right way achieve in julia? a () missed! have look julia> v = array{array{float64,2},1} array{array{float64,2},1} julia> typeof(v) datatype julia> v = array{array{float64,2},1}() 0-element array{array{float64,2},1} julia> typeof(v) array{array{float64,2},1}

Automatically adding headers to python Requests requests -

i trying create rest api client talking 1 of our services. every request needs include authorisation header compromised of epoch times, request verb, data, path etc. i'm trying use python requests module seamlessly possible, unsure best way "inject" header every request. there seems concept of "hooks" in requests, there "response" hook. i considering extending session object , overriding "send" method, adding header , passing super (session.send) method. my python isn't fantastic when comes oop , inheritance, have tried class mysession(session): def __init__(self, access_id=none, access_key=none): self.access_id = access_id self.access_key = access_key super(mysession, self).__init__() def send(self, request, **kwargs): method = request.method path = urlparse(request.url).path request.headers['authorization'] = self.__create_security_header(method, path)

wix3.5 - How to set write permission to a single file in WiX -

i have mvc app , need set write permission everyone on single file. file generated on fly during installation custom action script. file created inside app folder. i know final path of file, after installation process online i've seen examples setting permission folders , subfolders, none of them seemed address issue

javascript - why <a> tag in firefox needs two clicks when set href as a self-defined protocol to run a native application -

<a href="hythttpauto://somthing"> hythttpauto self-defined protocol, works in chrome(a native aoolication run after click tag), in firefox, needs 2 clicks run native application. how fix it?

php - Drupal 7 doesn't upload images styles -

Image
i have drupal 7 hosted on windows azure web app. when upload image content, original image stored in files folder corresponding image styles not stored (example in thumbnail folder). i tried this: permissions 777/775 comment following lines in htaccess located in files folder: #options none #options + followsymlinks i have impression azure blocks writing of files because htaccess can changed in own editor , not in ftp. since deployed app azure web apps, azure use iis host app, , running on windows server machines. htaceess , permissions 777/775 don't work on azure. without error message , how deploy drupal app, it's hard figure out what's wrong there. however, can deploy drupal 7 template acquia drupal 7 on mysql azure marketplace. tested upload image content , both of original , thumbnail image stored properly. maybe can have try. choose template acquia drupal 7 on mysql create azure web app. upload image worked fine.

oracle - SQL - Update String in Colum with regex -

using sql, trying update substring in column regexp. that's goal : i have html content in column : example : <a href="http://blabla.fr/blibli">link1</a> or other content multiple links: <p>blablabla</p> <a href="http://blabla.fr/blibli">link1</a> <a href="http://blabla.fr/">link2</a> <a href="http://blabla.fr/test">link3 </a> (this example represente entire string, not many result of select ) - want remove 'http://' in urls not contains 'blibli' so did query update my_table set my_col = replace(my_col,'http://','') not regexp_like(my_col,'http://^((?blibli).)*$') but work if column contains @ least 1 link first example. if column contains many link, update nothing due conditions. (maybe doing many step? ) tried have regexp_substr think can't achieve too. desired result second example : <p>blablabla&

javascript - Setup the objetname of new open browser in vbscript -

for each ele in elementcol if instr(objie.document.getelementsbytagname("img")(x).outerhtml,vart) > 0 objie.document.getelementsbytagname("img")(x).click 'after event new ie browser opened exit end if x = x + 1 next while objie.busy wscript.sleep 100 wend wscript.sleep 10000 set elementgo = objie.document.getelementsbytagname("img") x = 0 ' object not vart = "text1" 'msgbox vart each ele in elementgo msgbox objie.document.getelementsbytagname("img")(x).outerhtml msgbox instr(objie.document.getelementsbytagname("img")(x).outerhtml,vart) if instr(objie.document.getelementsbytagname("img")(x).outerhtml,vart) > 0 objie.document.getelementsbytagname("img")(x).click 'msgbox "click" exit end if x = x + 1 next now problem not able read second browser open. there way read , assign new object open

excel - Delete all rows in a column that don't match a value in another worksheet using VBA -

i learning vba , having trouble trying develop macro in workbook 2 worksheets. first worksheet named "para" , second named "report". when enter number or text para!c6 (e.g. 76894 ), vba code delete rows in column report!y:y except 1 matches value in para!c6 . i tried following code, not working: sub keeponlyatsymbolrows() dim ws worksheet dim rng range dim lastrow long dim s integer s = worksheets("para").range("c6") set ws = activeworkbook.sheets("report") lastrow = ws.range("y" & ws.rows.count).end(xlup).row set rng = ws.range("a1:ar" & lastrow) ' filter , delete header row rng .autofilter field:=1, criteria1:="<>*s*" .offset(1, 0).specialcells(xlcelltypevisible).entirerow.delete end ' turn off filters ws.autofiltermode = false end sub try code below. if rng column "a" column &

Jacoco.exec is not getting created for all modules in multi-module maven project -

we using jacoco unit test code coverage in our multi-module maven project , able coverage info(jacoco.exec) of modules unit tests available. issue i'm seeing is, jacoco.exec not getting generated of classes in few modules though unit tests available (note surefire-reports generated). able coverage info same unit tests when used cobertura. the following parent pom.xml i've added jacoco-maven-plugin info. please if there issues pom.xml. <modules> <module>module1</module> <module>module2</module> <module>module3</module> <module>module4</module> </modules> <build> <plugins> <plugin> <groupid>org.jacoco</groupid> <artifactid>jacoco-maven-plugin</artifactid> <version>0.7.8</version> <executions> <

javascript - Efficient way to convert an array into an object where each key is a value of a member of the array -

suppose have data: var obj = [ { type: 1, value: "abc" }, { type: 2, value: "abcde" }, { type: 1, value: "fghez" } ]; is there efficient , elegant way in javascript transform object follows? var sortedbytype = { 1: [ "abc", "fghez" ], 2: [ "abcde" ] } obviously can loop through every element in obj , read type property , add value new object, assembling result 1 one, below. kind of seems strange, long, inefficient , not elegant. var sortedbytype = {}; (var = 0; < obj.length; i++) { var type = obj[i].type; if (!sortedbytype[type]) { sortedbytype[type] = []; } sortedbytype[type].push(obj[i].value); } you use array#reduce object accumulator. var array = [{ type: 1, value: "abc" }, { type: 2, value: "abcde" }, { type: 1, value: "fghez" }], result = array.reduce(function (r, a) { if (!r[a.type]) { r[a.type]

Open all files in different directory python -

i need open file different directory without using it's path while staying in current directory. when execute below code: for file in os.listdir(sub_dir): f = open(file, "r") lines = f.readlines() line in lines: line.replace("dst=", ", ") line.replace("proto=", ", ") line.replace("dpt=", ", ") i error message filenotfounderror: [errno 2] no such file or directory: because it's in sub directory. question : there os command can use locate , open file in sub_dir ? thanks! -let me know if repeat, searched , couldn't find 1 may have missed it. os.listdir() lists only filename without path. prepend these sub_dir again: for filename in os.listdir(sub_dir): f = open(os.path.join(sub_dir, filename), "r") if doing loop on lines file, loop on file itself; using with makes sure file closed when done too. last not least, str.replace() r

Concatenate multiple fields into a single field in marklogic -

these sample xmls i'm uploading database: <?xml version="1.0" encoding="utf-8"?> <axfroot> <maobject type="default" mdclass="news_video" label="news video"> <id name="">123456</id> <meta name="maintitle" format="string" label="title">clifford irving hugs wife edith after release nassau jail.</meta> <meta name="system_objectowner" format="string" label="owner">default</meta> <meta name="keywords" format="string" label="keywords">clifford-irving edith-irving prisoner-releases 1972-08-18 nassau new-york nassau-county-jails prisons wifes husbands media, [],</meta> </maobject> <axfroot> <?xml version="1.0" encoding="utf-8"?> <axfroot> <maobject type="default" mdclass="news

javascript - How can I change style of element with jQuery function and media query when resize event working -

i'm making responsive web site, , have problems @ resize. using media query @ ww<1280, ww<1024, ww<640, controll elements jquery functions. when document loaded, media query , functions worked well. but, when try jquery functions resize window, there many problems. one of function wrote is, var menuopen = function() { var ctrybtn = $(".countrymenu input[type=button]"); var ctrymenu = $(".countrymenu"); var subgnb = $("#subgnb"); var gnbbtn = $("#header button.mobilegnbbtn"); var mygnb = $("#gnb"); var schbtn = $(".mobilefindbtn"); var schmenu = $(".utilmenu"); var gnbdown = function () { $("#gnb ul").append("<li class='mobilesitemap'><a href='sitemap.html'>site map</a></li>"); mygnb.slidedown(500,function () { $(".mobilegnbbtn").css({ "width":"37px", "heig

sql - Combine data from one table to another table at multiple level -

i have following table in sheet1. project| resource name | line manager ---------------------------------- 2345 david peter 2345 tam peter 2345 richard peter 2358 russell adam sheet2 has following table project| month |revenue ----------------------- 2345 jan 10000 2345 feb 15000 2358 jan 8000 2358 feb 12000 how following result in sheet2 project| month| revenue| resource|name line manager ------------------------------------------------ 2345 jan 10000 david peter 2345 jan 10000 tam peter 2345 jan 10000 richard peter 2345 feb 15000 david peter 2345 feb 15000 tam peter 2345 feb 15000 richard peter 2358 jan 8000 russell adam 2358 feb 12000 russell adam how about: select s1.*, s2.* sheet1 s1 join sheet2 s2 on s2.project=s1.project

payment gateway - Implement mercadopago in Django 1.10 -

i'm working on shopping cart django 1.10 , need receive payments mercadopago. looking in developer section i'm new in django , can't figure out how use it. used before , can me this? if found guide explained more details it? sorry if i'm asking topic in google in many ways , found nothing . thanks in advance.

wordpress - Pagination not working properly with Jetpack Infinite Scroll -

on homepage, using action pre_get_posts , filter infinite_scroll_query_args update query 2 post type. infinite scroll doesn't work , active 8 times. correct 48 times. i did tests , understand function getting pagination custom post type, ignoring second. add_action( 'pre_get_posts', 'function_pre_post' ); function function_pre_post( $query ) { if ( $query->is_main_query() && $query->is_home() ) { $query->set( 'post_type', array( 'post', 'critica' ) ); } } function jetpack_infinite_scroll_query_args( $args ) { $args['post_type'] = array( 'post', 'critica' ); return $args; } add_filter( 'infinite_scroll_query_args', 'jetpack_infinite_scroll_query_args', 100 );

javascript - Display data in dynamic matrix format using jquery -

Image
i below json webapi , need display data in matrix format on ui. how this? the json data looks this: [ {"shippingline_cd":"aac","sizetype_cd":"20bu","eristatus_cd":"active","shift_nbr":"1"}, {"shippingline_cd":"acl","sizetype_cd":"20bu","eristatus_cd" :"active","shift_nbr":"2"}, {"shippingline_cd":"ama","sizetype_cd":"20dr","eristatus_cd" :"active","shift_nbr":"1"}, {"shippingline_cd":"abc","sizetype_cd":"20dr","eristatus_cd" :"pending","shift_nbr":"2"}, {"shippingline_cd":"cde","sizetype_cd":"20dr","eristatus_cd" :"pending","shift_nbr":"3"}, {"shippingline_cd":"aac

Scala pattern matching default -

lets want write following function using scala's pattern matching: def foo(num: int): int = { num match { case 1 => 0 case x if x%2 == 0 => 1 case _ => _ } } but of course compilation error line case _ => _ i know can solve changing line like: case x=>x , why scala's pattern matching doesn't allow me that? it's way me saying don't care what's there return it. because doesn't make sense. case _ means "match , don't assign value symbol", should => _ mean? if don't care is, mean compiler can put in random value? case x => x eagerly match everything , return same value. it's clear, concise, , same amount of characters want. reads can understand happening. literally translate "i don't care what's there, match , return it".

rename - Folder setting to prompt "Save As" when dropping a file into specified Folder? -

trying find if there way have folder automatically use "save as" when file dropped it. document scanner prompt enter file name scanned file, .pdf file dropped monitored folder , transferred file repository. used when user has attachment in email , needs drop monitored folder file needs renamed. looking way automate without having manually rename file.

powershell - Unable to run Node and Script in Desired State Configuration -

background i provisioning vm in azure using arm template , created desired state configuration .ps1 file installs , configures iis. far good. i added script block right next node block. current set up: configuration main { param ( [string] $nodename ) import-dscresource -modulename psdesiredstateconfiguration node $nodename { windowsfeature webserver { name = "web-server" ensure = "present" } #other windowsfeatures } script formatdiskscript { setscript = { #powershell format disks } testscript = { return $false } getscript = { } } } inside arm template, have added dsc extension vm , specified url zip file, script run , function invoke. "properties": { "publisher": "microsoft.powershell", "type": "dsc", "typehandlerversion": "2.23&quo

ios - Show Category and subcategory in tableview -

i have 2 arrays: 1 categories , second subcategory. when parse category , save in first array , subcategory array, want access specific subcategories category. e.g 1 index of category array want save subcategory array that. nsdictionary * datas = [dic valueforkey:@"data"]; for(nsarray *data in datas ){ parsesubcategorymodel * pscm = [[parsesubcategorymodel alloc]init]; pscm.zeroindex = [data objectatindex:0]; pscm.oneindex = [data objectatindex:1]; pscm.twoindex = [data objectatindex:2]; pscm.threeindex = [data objectatindex:3]; nsarray *sub1 = [ pscm.oneindex valueforkey:@"sub_categories"];// parse sub_categories here ok yaha tak self.fetchdata = [[nsmutablearray alloc]init]; self.subsubdata = [[nsmutablearray alloc]init]; for(nsdictionary *subdic in sub1 ){ parsesubcategorymodel * pscm1 = [[parsesubcategorymodel alloc]init]; pscm1.id_no = [subdic valueforkey:@"_id"]; pscm1.name = [

javascript - Gracefully fail "ERR_CONNECTION_REFUSED" -

i've tried 2 ways of error handling. in javascript , nodejs. retrieving content ajax request api output data onto application every once in while, multiple times day "err_connection_refused". causes entire script break , no longer work. there way gracefully fail error without breaking page? have tried jquery ajax catch, , try{}catch(error){} bypass nothing works.

>10sec aggregation performance in elasticsearch -

i'm new elasticsearch , have setup flow of storing jmx data polled every 10seconds elasticearch index looks this: { "jmxmetrics": { "mappings": { "kafkajmx": { "properties": { "@timestamp": { "type": "date" }, "@version": { "type": "keyword" }, "attr_type": { "type": "keyword" }, "host": { "type": "keyword" }, "kafka_broker_id": { "type": "keyword" }, "kafka_clientid": { "type": "keyword" }, "kafka_fetcher_id": { "type": "keyword" }, "kafka_metric_group": { &q