Posts

Showing posts from January, 2010

ElasticSearch NEST - Search on multiple types but apply filter on selected Type alone -

i looking achieve single query search , filtering. expected when applied filtering, filter condition applied types got result of document have filtered property , value . for example, here searched in 3 types (product,category,manufacturer) get /my-index/product,category,manufacturer/_search { "query": { "filtered": { "query": {...}, //--> search word present in types "filter": { "term": { "productfield": "value" } } } } } here got result of product type because product type contains field 'productfield' , has value 'value' . what expecting is, with single query , fetch types results(product,category,manufacturer), satisfying search query , apply filtering on product. so doubt is there way in elastic search apply filtering on specific type search results alone applying ...

c# - Using 7zip sdk to compress a Folder -

we decided use 7zip sdk compress , decompress files , folders. know there many libraries decided use sdk directly. have seen sample code uses sdk compress\decompress file not find way folders. appreciate if share c# code uses 7zip sdk directly can compress\decompress folders. not want use 7z.exe (saw many answers that also)

Custom authorizer vs Cognito - authentication for amazon api gateway - Web application -

i have been making web app. (angular 2 on s3 , apis in lambda through api gateway). authentication played both cognito , custom authorizer (i configured authentication work google , facebook bith via custom authorizer , cognito). in case of custom authorizer passing token via authroization header , custom authorizer validates it. i looking advice on should go forward , pros , cons. ones think of are: aws cognito: pros aws sdk handles , cannot make mistake in authentication process. fine grained access control aws resources via iam. an lambda function in front of every api not required authentication. cons need use aws sdk on client side. programmers have add toolchain , make use if during development. adds complexity. fine grained access control resources not required since access required api gateway. custom authorizer pros you can have authentication mechanism way want it. ultimate control on authentication , authorization. you can have ui call apis sta...

sql - get last inserted row id in ebean with sqlupdate -

if using ebean sqlupdate insert oracle in java transaction tx = ebean.begintransaction(); try { transaction tx = ebean.begintransaction(); try { string sqlstring = "insert customers values (1001,'nichols', 'alexandra', '17 maple drive', "+ "'nashua', 'nh','03062', sdo_geometry(2001, 8307, sdo_point_type (-71.48923,42.72347,null), null, null))"; sqlupdate query = ebean.createsqlupdate(sqlstring); query.execute(); string sqlquery = "select @@identity 'identity'"; sqlquery query2 = ebean.createsqlquery(sqlquery); list<sqlrow> list = query2.findlist(); system.out.println(list.get(0)); } { tx.commit(); } it gives error [persistenceexception: query threw sqlexception:ora-00936: missing expression query was: select @@identity 'identity' ] how id of last inserted row? after insert, select into, or bulk copy statement co...

mod rewrite - Apache vHost mod_rewrite -

i have vhost in apache , want rewrite subdomains subdomain www.domain.tld tld-part should one, user enters. i looked @ documentation of mod_rewrite, @ least didn't understand :) hope can exlain me. the actual part in vhost-config ist following,... matches subdomain problem, not tld problem: rewriteengine on rewritecond %{http_host} ^([a-z.]+)?domain\.de$ [nc] rewritecond %{http_host} !^www\. [nc] rewriterule .? http://www.%1domain.de%{request_uri} [r=301,l] but don't understand %1 before domain... rewritecond %{http_host} ^(?!www\.)(?:[^.]+\.)?(domain\.[^.]+)$ [nc] rewriterule .* http://www.%1/$0 [r=301,l] that redirects requests subdomain isn't www, has 0 or 1 sudomain levels, domain domain , has 1 level of tlds. if need, .co.uk , need modification.

sql server - CDC Tables and Transactional Replication -

can local cdc tables replicated azuresql data base using transactional replication? i didn't tried ,but seems ,its not possible.. if try add cdc table article publication receive error, marked ms_shipped: msg 20696, level 16, state 1, procedure sp_addmergearticle, line 251 object [cdc].[saleslt_customer_ct] marked shipped microsoft (ms_shipped). cannot added article merge replication. references: https://social.msdn.microsoft.com/forums/sqlserver/en-us/615f2ed1-2d93-49dd-8dc9-0440ad7ffd6d/replicating-cdc-change-tables?forum=sqlreplication

angularjs - Vertical alignment of label followed by md-switch in angular material -

i have page in want display text in label followed md-switch . i'm aware of fact can remove label , display text after switch, solution not acceptable. <md-content layout="row"> <label class="md-title">text</label> <md-switch class="md-primary" ng-true-value="'yes'" ng-false-value="'no'" ng-model="vm.data"> {{vm.data}}</md-switch> </md-content> i cannot seem align these elements vertically. switch lower text, not under label, after lower. suggestions appreciated. you can add layout-align="start center" attribute or replace "start" "center" or "end" if want other alignment: <md-content layout="row" layout-align="start center"> <label class="md-title">text</label> <md-switch class="md-primary" ng-true-value="'yes'" ng-false-value=...

javascript - Use onclick event in parent or child element? -

a little story situation: colleague monitors ga stuff tells me isn't firing when trying track how many clicking on what, on our website. don't have access google account check if changes working or not , she's sick (and no company doesn't want ga accounts being shared whatever reason) so thought i'd come here , ask while wait. ga set this, , wanted know if matters onclick is? should in anchor tag in situation? or leaving in div okay? html: <table> <tr> <td><div onclick="ga('send', 'event', 'participant_centre', 'click', 'pledgesheet');"><a href="this_tool" target="_blank">pledge sheet</a></div></td> <td><div onclick="ga('send', 'event', 'participant_centre', 'click', 'stepbystepguide');"><a href="this_tool" target="_blank">step step guide...

c# - Singly Linked List. RemoveBefore(Node node) method -

i trying implement singly linked list. optimal way of implementing removebefore(listnode) method ? have done below. check if node being removed head. if return. check if node there 2 nodes , node being removed tail. set head , tail same. old tail automatically disposed. if there mode 2 nodes , above 2 conditions not satisfied track current node, child node , grandchild node. if grandchild node requested node make current node point grandchild node. child node disposed. void isinglylinkedlist.removebefore(isinglylinkednode node) { //cannot remove before head if (object.equals(node.data, _head.data)) return; //if need remove node before tail make head , tail same if (object.equals(node.data, _tail.data) && _head.next == _tail ) { _head = _tail; (_tail idisposable).dispose(); } (isinglylinkednode<t> currentnode = _head, child = null, grandchild = null; currentnode != null; currentnode = currentnode.next) ...

swift - How do I programmatically save an NSDocument? -

i need programmatically save active document of nsdocument based app within method of nsviewcontroller controls document view. menu items sending save() first responder. best way programmatically? should a) reference nsdocument (somehow) , call save method or b) send save: message first responder? i'd (b) easiest do. have call line nsresponder down chain (like view controller): nsapp.sendaction(#selector(nsdocument.save(_:)), to: nil, from: self) this have same effect choosing "save" menu bar.

php - Laravel Unit Testing Dependency Injection -

i'm trying write test class shopping cart. here have: shoppingcarttest.php class shoppingcarttest extends testcase { use databasetransactions; protected $shoppingcart; public function __construct() { $this->shoppingcart = resolve('app\classes\billing\shoppingcart'); } /** @test */ public function a_product_can_be_added_to_and_retrieved_from_the_shopping_cart() { // placeholder @ moment $this->asserttrue(true); } } however, when run phpunit, seems laravel unable resolve shoppingcartclass. here error: fatal error: uncaught exception 'illuminate\contracts\container\bindingresolutionexception' message 'unresolvable dependency resolving [parameter #0 [ <required> $app ]] in class illuminate\support\manager' in c:\development server\easyphp-devserver-16.1\eds-www\nrponline\vendor\laravel\framework\src\illuminate\container\container.php:850 i have shoppingcart class being resolved...

javascript - looping through an object (tree) recursively -

is there way (in jquery or javascript) loop through each object , it's children , grandchildren , on? if so... can read name? example: foo :{ bar:'', child:{ grand:{ greatgrand: { //and on } } } } so loop should this... loop start if(nameof == 'child'){ //do } if(nameof == 'bar'){ //do } if(nameof =='grand'){ //do } loop end you're looking for...in loop: for (var key in foo) { if (key == "child") // something... } be aware for...in loops iterate on enumerable properties, including added prototype of object. avoid acting on these properties, can use hasownproperty method check see if property belongs object: for (var key in foo) { if (!foo.hasownproperty(key)) continue; // skip property if (key == "child") // something... } performing loop recursively can simple writing recursive funct...

powershell - How to grant permissions in Local Security Policy like "Log on as a service" via script specifically in windows 10? -

i've seen lots of posts earlier versions of windows pointing towards rsat , ntrights.exe neither of solutions work windows 10. i'm looking solution preferably in powershell or batch. alrighty, figured out. ended having use carbon. after running: .\carbon\import-carbon.ps1 i able run: grant-privilege -identity $username -privilege seservicelogonright something note local security policy manager doesn't have refresh button. you'll have close , reopen tool in order see external changes policy.

linux - Shell scripting for process count -

i need shell script display process counts in prod , pre-prod environments, excluding root user's processes. should send email if count exceeds 400. how write this? get count of processes , after that: count=$(ps -efh | gawk '{ if(nr > 1){ print $1 }}' | grep -v 'root' | wc -l) if [ "$count" -gt 400 ]; # send emails fi

c# 4.0 - Visual Studio, C# , How to execute a keyboardshortcut programmatically -

i have keyboard shortcut, fetched tools -> options -> environment -> keyboard "testexplorer.executionplatformx64" i execute shortcut programmatically. i've searched hour , felt topic isn't documented. i've found following piece of code: _dte.executecommand("testexplorer.executionplatformx64"); couldn't understand dll dte object related , if can show example of usage, fantastic thanks in advance, ~mont

autosar - Parse error in C code (.h file) -

i trying integrate c code. while building stack parse error files, have included .h file #if( fls_cancel_api == std_on ) // parse error appears here extern func( void, fls_code ) fls_cancel( void ); #endif /* fls_cancel_api == std_on */ #if( fls_get_status_api == std_on ) // , here extern func( memif_statustype, fls_code ) fls_getstatus( void ); #endif /* fls_get_status_api == std_on */ edit macros defined in header file #define fls_cancel_api [!if "flsgeneral/flscancelapi"!](std_on)[!else!](std_off)[!endif!] and #define std_on 0x01 this code drivers written according autosar standard, in automotive industry. header file has: #define fls_cancel_api [!if "flsgeneral/flscancelapi"!](std_on)[!else!](std_off)[!endif!] is in fact not header file, it's template of header file. tool takes autosar ecu description , templates produce actual code. think file template fls_cfg.h , , actual fls_cfg.h gener...

c# - Could not load file or assembly TechTalk.SpecFlow, Version=1.9.0.77 -

i trying out bdd in visual studio 2013. have started fresh new blank project. have written feature file , steps definition. added specflow using nugget packages. installed specflow version 2.1.0 when build solution looking specflow version 1.9.0.77 when searched specflow in nugget packages 1 listed. installed , believe latest version 2.1.0 why solution looking older version of 1.9.0.77 ? if resolution install 1.9.0.77 how install , how find version in nugget? the full error trace is: custom tool error: generation error: not load file or assembly 'techtalk.specflow, version=1.9.0.77, culture=neutral, publickeytoken=0778194805d6db41' or 1 of dependencies. system cannot find file specified. e:\rl fusion\projects\bdd\c# bdd\youtubetutorial2\specflowfirst\specflowfirst\specflowfirst\features\googlesearch.feature 2 2 specflowfirst thanks, riaz the imports are: using baseclass.contrib.specflow.selenium.nunit.bindings; using openqa.selenium; using system; us...

swagger - AutoRest parameters in Visual Studio 2015 -

when using autorest in visual studio 2015 (right click project -> add -> rest api client), parameters passed autorest.exe? how can set or change flags being passed in visual studio? is there default settings file somewhere? when generating code (c#) in library project, autorest generating async methods , not sync methods (which want). suspect has parameters being passed visual studio.

On iOS "monitor" NSUserDefaults read and writes -

in ios project, using 3rd party library (google vr), reads , writes stuff nsuserdefaults . i know can read , print user default (by like nsarray *keys = [[[nsuserdefaults standarduserdefaults] dictionaryrepresentation] allkeys]; for(nsstring* key in keys){ // code here nslog(@"value: %@ forkey: %@",[[nsuserdefaults standarduserdefaults] valueforkey:key],key); } what need see library looking , not not finding. basically, library checks if has done configuration before (pairing cardboard headset), checking userdefaults key. want know when happens , ket is. i understand 1 way diff, print user defaults before , after pairing , see changed, want know if there general way monitor nsuserdefaults read calls. method swizzling, sounds possible solution, not quite sure how work. edit: record, used answer @blackm below , found out google vr unity, on ios looks com.google.cardboard.sdk.deviceparamsandtime check if has configured headset or not. i man...

linq - How to Merge two lists and Merge it's inner lists without duplication in C# -

i'm trying merge 2 generic list using linq- list<linkedtable> firstlink list<linkedtable> secondlink as shown in class below, generic list has generic list in it. public class linkedtable { public string tableid { get; set; } public string tablename { get; set; } public list<link> innerlinks { get; set; } } public class link { public boolean linkflag; public string descriptor { get; set; } public string recordid { get; set; } } when merge 2 lists, new list doesn't contain both "innerlinks" records of firstlink , secondlink. have tried following code: firstlink = firstlink.concat(secondlink) .groupby(e1 => e1.tableid) .select(e2 => e2.firstordefault()) .tolist(); now firstlink tables grouped "tableid ", few "innerlinks" secondlink missing. i need both list of "innerlinks" firstlink , secondlink in new merged lis...

python - ImportError: HDFStore requires PyTables, "No module named tables" -

i followed installation guidelines here. http://www.pytables.org/usersguide/installation.html so, whenever run command in ipython pytables/build/lib.linux-x86_64-2.7 folder, works fine. in [1]: import pandas pd in [2]: store = pd.hdfstore('store.h5') but whenever run same commands other folders, gives me specified error. pythonpath issue? if yes, how solve it? to know version of pytables using, execute python -c 'import tables ; print tables.__file__' for python 2, or python3 -c 'import tables ; print(tables.__file__)' for python 3. it give path tables library. the procedure in link gave, executing build directory, test tables library. to install it, use python setup.py install --user it go in ~/.local/lib/python2.7/site-package" (for linux , python 2, example). should work expect.

build - Porting Android to nanoTesla A8 -

we have embedded device in our organisation has nanotesla a8 board , runs linux. we want run android on device develop android apps our device. is possible run android on nanotesla? there porting available android on nanotesla? or have cross compile android? any inputs helpful.a take @ android embedded

masm - Whats the fundamental difference between addressing of array[di] and [array + di] in assembly? -

Image
given assembly program of intel 8086 processor adds numbers in array: .model small .stack 100h .data array dw 1,2,3,1,2 sum dw ?,", sum!$" .code main proc mov ax,@data mov ds,ax mov di,0 repeat: mov ax,[array+di] add sum,ax add di,2 ; increment di 2 since array of 2 bytes cmp di,9 jbe repeat ; jump if di<=9 add sum,30h ; convert ascii mov ah,09h mov dx,offset sum ; printing sum int 21h mov ax,4c00h int 21h main endp end main above program adds number of array using "base + index" addressing mode. the same operation can performed like: mov ax, array[di] now have following questions here: what's difference between array[di] , [array+di] which memory addressing mode array[di] ? which 1 better use , why? according book the art of assembly language , array[di] , [array + di] both "indexed addresing modes", so, none bette...

jquery - Hide header on scroll down,show it on scroll up(not working) -

i have problem,which showed yesterday,after added new div page elements (wrapper) make slide , push effect on mobile menu design.after made div , fixed overflows , stuff,i noticed header function isn't working anymore..if know wrong please correct me,i paste header jquery , style.if need info wrapper div,just give info need me.thanks ! $(document).ready(function($) { "use strict"; var mql = 1170; //primary navigation slide-in effect if($(window).width() > mql) { var headerheight = $('.site-header').height(); $(window).on('scroll', { previoustop: 0 }, function () { var currenttop = $(window).scrolltop(); //check if user scrolling if (currenttop < this.previoustop ) { //if scrolling up... if (currenttop > 0 && $('.site-header').hasclass('is-fixed')) { $('.site-header').addclass('is-visible'); } else { ...

linux - How to offset image contents by X,Y pixels using ImageMagick? -

Image
i need offset pixels in png image -1 in x , -4 in y axis. the images converted pdf created corel draw, adds offset, breaking image processing system i'm working on. align_image_stack hugin-tools package crashes when processing these files, that's why resort trying fixed offest correction. i tried these commands: $ convert a.png: -geometry 100%-100-100 b.png $ convert -region '100%+500px+100px' a.png b.png $ convert -page '100%+500px+100px' a.png b.png $ convert -repage '100%+500px+100px' a.png b.png $ convert -crop '100%+500px+100px' a.png b.png $ convert a.png -geometry 100%-100px-100px b.png they have finished without error, gave me same image fed them input. a.png = b.png what doing wrong? why covert command not shift image contents? edit: here's pair of images illustrate problem. first image want, second comes out of corel draw, want apply arbitrary x/y offset compensate difference. images faked illustrate proble...

PHP & Javascript: Dynamic search with 2 textbox -

Image
is there way have dynamic search 2 textbox filter 2 different fields? for example have table like: and have created somethin this: it works in lastname textbox. i want when enter lastname same lastnames this: i want add filter firstname, when enter firstname on firstname textbox example enter pedro in firstname textbox pedro a. dela cruz show up. this codes index.php <script type="text/javascript"> $(function(){ $(".lname").keyup(function() { var value = $(this).val(); var datastring = 'lname='+ value; if(searchlname!='') { $.ajax({ type: "post", url: "search.php", data: datastring, cache: false, success: function(html) { $("#result").html(html).show(); } }); }return false; }); jquery("#result").live("click",function(e){ var $clicked = $(e.target); var $name = $clicked.find('.name').html(); var decoded = $...

busybox - Qt App running on ARM target freezing for exactly 350 ms -

i've got qt application running on embedded board linux busybox os inside. i can't understand why but, during nominal sequence, app freezing, screen , ssh too. i tried several times logs everywhere , noticed when app freezing, freeze 350 ms everytime. i don't understand what's going on. if haz explanation, i'm ready here you_ !!

basic authentication - Spring Security not working over RestServices -

i have restcontroller working , want learn how enable basic auth spring security. i've created class extends websecurityconfigureradapter , understand, should enough. sadly can call resources without providing credentials. here code: configurer adapter package es.ieci.test.security; import org.springframework.context.annotation.bean; import org.springframework.context.annotation.configuration; import org.springframework.security.config.annotation.web.builders.httpsecurity; import org.springframework.security.config.annotation.web.configuration.enablewebsecurity; import org.springframework.security.config.annotation.web.configuration.websecurityconfigureradapter; import org.springframework.security.config.http.sessioncreationpolicy; @configuration @enablewebsecurity public class securityconfiguration extends websecurityconfigureradapter { public static final string realm = "test_realm"; @override protected void configure(httpsecurity http) throw...

api - Android: Cannot disconnect apps correcty from Google -

Image
when testing app's leaderboards/achievements , sign-in flow (for google play game services), used able go 'google settings' app, 'connected apps', click on app , there option 'disconnect' 'also delete activities on google' following: however, seems have changed (not in code, same apps can't disconnect) - when attempt disconnect, message: now, test sign-in flow bugs, able make app 'forget' has ever connected google play game services, asks permission again - (please see previous question here answer used work) . presented first diagram & worked if clicked 'disconnect' - clicking checkbox, ('also delete your............') reset achievements, great when needed debug them. most other apps try disconnect give following message, first message minus checkbox: does know if requirements able let user disconnect app have changed , why apps give me basic messasge now? i connect gpgs this: mgoogleapiclient =...

hl7 fhir - Binding multiple value sets to a single extension element -

i'm wondering if there way bind multiple value sets single extension element in fhir. here's example of i'm trying achieve: <structuredefinition xmlns="http://hl7.org/fhir"> ... <snapshot> ... <element> <path value="extension.valuecode"/> ... <type> <code value="code"/> </type> <binding> <strength value="required"/> <valueseturi value="http://stelar.org/valueset/const-yesno"/> </binding> <binding> <strength value="required"/> <valueseturi value="http://stelar.org/valueset/missingdata"/> </binding> </element> ... </snapshot> ... </structuredefinition> my reason wanting bind multiple i'm porting data on legacy system in coded values can either come value set represents collecte...

c# - Error with partial view -

i working in blog web site project. create partial view blog post. Ä°t's _maincontent partial view @model system.collections.generic.ienumerable<blog.data.model.article> @foreach (var item in model) { <div class="panel"> <div class="panel-body"> <div> <h3> @html.actionlink(item.articletitle, "index", "article", new { id = item.articleid }, new { }) </h3> </div> <div id="img"> <img width="400" height="300" src="@string.format("data:{0};base64,{1}",item.articleimages.firstordefault().contenttype,convert.tobase64string(item.articleimages.firstordefault().content))" /> </div> <div> <p> @html.displayfor(x=> item.content) </p> </div> </div> </div> ...

How can I determine the mount path of a given file on Linux in C? -

i have arbitrary file determine mount point. let's /mnt/bar/foo.txt, have following mount points in addition "normal" linux mount points: [some device mounted to] -> /mnt/bar [some device mounted to] -> /mnt/other i've taken @ stat() , statvfs(). statvfs() can give me filesystem id, , stat can give me id of device, neither of these can correlate mount point. i'm thinking have call readlink() on arbitrary file, , read through /proc/mounts, figuring out path closely matches filename. approach, or there great libc function i'm missing out on to this? you can combination of getfsent iterate through list of devices, , stat check if file on device. #include <fstab.h> /* getfsent() */ #include <sys/stat.h> /* stat() */ struct fstab *getfssearch(const char *path) { /* stat file in question */ struct stat path_stat; stat(path, &path_stat); /* iterate through list of devices */ struct fstab *fs = null...

PHP: How to bind complex CollectionType-Object to Oracle -

i've got problem bind complex nested table-type php. my oracle types: create or replace type my.ot_my_status object ( id_nk number, status char(1) ); create or replace type my.ct_my_status table of ot_my_status; and tried bind parameter type in php 5.5: $coll = oci_new_collection($conn, "ct_my_status", "my"); //sampledata $data = new array(); $oneentry = new object(); $oneentry->id_nk = 12345; $oneentry->status = "1"; $data[] = $oneentry; //*********** $coll->append($data); //here crashes :-( oci_bind_by_name ( $stmt, ":coll", $coll, -1, oci_b_nty); i can't append object-array collection. oci-collection::append() expects parameter 1 string, object given any ideas? ase said here: http://php.net/manual/en/oci-collection.append.php "the value added collection. can string or number."

Django: python manage.py runserver gives RuntimeError: maximum recursion depth exceeded in cmp -

i trying learn django form 1st tutorial on django project website. might missing obvious but, after following instructions when come run command python manage.py runserver i error posted @ end of plea (i have posted first few lines of repeated lines of error message brevity). here of solutions/suggestions have found on web not helpful me. 1)sys.setrecursionlimit(1500). this didn't work me. 2). django runtimeerror: maximum recursion depth exceeded this isn't option because not using pydev, tried uninstalling , installing django using pip didn't fix , using mountain lion's native python, not going uninstall, since not recommended. 3). tried: python manage.py runserver --settings=mysite.settings same exact error command without option settings any suggestions, recommendations appreciated. using.... django official version. 1.5.1 installed using pip , python 2.7.2 unhandled exception in thread started <bound method command.inner_run of <d...

mysql - Select on join table with exact number of itmes -

i have 2 tables tracks tags one track have many tags i want have list of tracks have both of 2 tags example tag_id 1 , tag_id 2 select * tracks left join tags on tracks.tag_id = tags.id tags.id in (1,2) group track.id having count(tags.id) = 2 the problem if tracks have tag 1 , 3 listed. any please? add distinct count select track.id tracks left join tags on tracks.tag_id = tags.id tags.id in (1,2) group track.id having count(distinct tags.id) = 2 you can change left join inner join since converted implicitly based on clause

python - Why does pandas read_csv not support multiple comments (#,@,...)? -

i found pandas read_csv method faster numpy loadtxt. unfortunatly find myself in situation have go numpy because loadtxt has option of setting comments=['#','@'] . pandas read_csv method can take 1 comment string comment='#' far can tell site. suggestions or workarounds make life easier , make me not pivot numpy? why pandas not support multiple comment indicators? # save in test.dat @ bla # bla 1 2 3 4 minimal example: # work, 1 type of comment accounted df = pd.read_csv('test.dat', index_col=0, header=none, comment='#') # not work (not suprising reading help) df = pd.read_csv('test.dat', index_col=0, header=none, comment=['#','@']) # work slow df = np.loadtxt('test.dat', comments=['#','@']) the short answer nobody has implemented in pandas yet. looking through github issues, looks else has suggested , maintainers open patch implements it: https://github.com/pandas-dev/pandas/...

amazon web services - AWS API Gateway + Elastic Beanstalk and Microservices -

Image
i'm going build microservices' architecture on aws , want ask clarify doubts. my current general concept i use api gateway, exposes microsevices' apis running in elastic beanstalk. place elastic beanstalk in vpc without direct access internet instances. questions & doubts: elastic beanstalk gets subdomain on application creation. subdomain should used api gateway integration type: aws service, in action configuration - right? what represent single microservice? elastic beanstalk's application specific scalable microservice? how microservices should communicate each other? there task im going use sqs (simple queue service). in other cases, better when 2 microservices communicates each other through api gateway rather directly - right? test environment: structure should use in test environment (or staging env.)? think creating separate vpc elastic beanstalk , other amazon services. test environment , api gateway: how should set api gateway? should a...

javascript - how do you trigger an event on phaser.js by clicking anywhere js -

in phaser.js game, (flappy bird), want bird "flap" every time anywhere clicked. tutorial following shows how initiate when space bar pressed. how can make happen clicking anywhere? var game = new phaser.game(400, 490, phaser.auto, 'game_div'); var main_state = { preload: function () { this.game.stage.backgroundcolor = '#71c5cf'; this.game.load.image('bird', '../img/bird.png'); }, create: function () { this.game.load.image('bird') }, update: function () { } } edit: using phonegap, syntax effect answer? that use phaser js doesnt mean cannot use standard js: window.addeventlistener("click",function(event){ main_state.flap(); event.stoppropagation();//prevent phaser detection },false); var main_state = { game = new phaser.game(400, 490, phaser.auto, 'game_div'), preload: function () { this.game.stage.backgroundcolor = '#71c5cf'; th...

javascript - Gulp imagemin optimization removes svg symbol -

this first time use gulp task-runner or kind of task-runner. hope state problem in understandable way. i have svg file named svg-system.svg contains: <svg xmlns="http://www.w3.org/2000/svg"> <!-- facebook icon --> <symbol id="facebook" role="img" aria-labelledby="title desc" viewbox="0 0 9.3 20"> <title id="title">logo af facebook</title> <desc id="desc">logoet bruges til link indikator @ tilgå vores facebook side eller dele os.</desc> <path d="m9.3,6.5l8.9,10h6.1c0,4.5,0,10,0,10h2c0,0,0-5.5,0-10h0v6.5h2v4.2c2,2.6,2.8,0,6.2,0l3.1,0v3.4 c0,0-1.9,0-2.2,0c-0.4,0-0.9,0.2-0.9,1v2.1h9.3z"/> </symbol> </svg> and compress file / optimize dist save kilobytes. my confiq in gulpfile.js looks this: gulp.task('images', function() { return gulp.src('app/images/**/*.+(png|jpg|jpeg|gif|svg)...

javascript - While loop inside while loop [Javacript] -

how use while loop inside while loop without executing next loop (from outside while loop) unless inner while loop done executing? var x = 0; var y = 0; while(x < 10){ while(y < 10){ console.log(y); y++; } x++; } i'm guessing problem here @ end of inner loop, y set 10 , never reset 0. try instead: var x = 0; var y = 0; while(x < 10){ while(y < 10){ console.log(y); y++; } y = 0; x++; } otherwise, once inner loop finishes once, never runs again.

html - Javascript adding numbers as if they were a string -

this question has answer here: javascript (+) sign concatenates instead of giving sum of variables 12 answers i have been playing around cookies first time, , have saving part of completed. data i'm saving numbers , important part of these nubers can add, subtract , on these. when try add number 1 of saved parametres adds them if text. example: have cookie called value , , when want value use script found jeffery to looks this: function readcookie(name) { return (name = new regexp('(?:^|;\\s*)' + ('' + name).replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') + '=([^;]*)').exec(document.cookie)) && name[1]; } after have collected cookie want add 1 it. lets value equals nine, when should this: value + 1 = 10 . simple math. gives me 91 . why this? know because thinks numbers string of text, how can behave numbers? s...

user interface - Java GUI Layout Issues -

Image
i'm trying make simple program in java requires 8 jlabels on top 1 jbutton directly below it. tried using boxlayout , flowlayout , happens jlabels disappear @ start of program. when button clicked, displayed properly, have manually resize window. explain i'm doing wrong? thanks! public class programui { private jbutton _jbutton; private arraylist<jlabel> _jlabels; private jframe _jframe; private jpanel _top, _bottom; public programui(){ _jframe = new jframe (); _jframe.getcontentpane().setlayout(new boxlayout(_jframe.getcontentpane(), boxlayout.y_axis)); _top = new jpanel(); _jframe.add(_top); _bottom = new jpanel(); _jframe.add(_bottom); _top.setlayout(new flowlayout(flowlayout.left)); _bottom.setlayout(new flowlayout(flowlayout.left)); _jlabels = new arraylist<jlabel>(); (int i=0; i<8; i++) { jlabel label = new jlabel(); _jlabels.add(label); _top.add(label); //...rest of code not relevant } _jbutton = new jbut...

ios - NSURLSessionTask. Suspend does not work -

this apple's documentation says regarding suspend method of nsurlsessiontask class a task, while suspended, produces no network traffic , not subject timeouts. ok. i'm running following simple code: let url = nsurl(string: "http://httpbin.org/delay/10")! let urlrequest = nsurlrequest(url: url) self.task = nsurlsession.sharedsession().datataskwithurl(urlrequest.url!, completionhandler: { data, response, error in print("completion error \(error)") }) self.task.resume() print("start") delay(5, closure: { self.task.suspend() print("suspend") }) function delay wrapper around dispatch_after , request http://httpbin.org/delay/10 gives response after 10 seconds. in middle of waiting response suspend task. not work. in 60 seconds completion block called timeout error. can please explain what's wrong? this ap...

python - Can a Tkinter button have children? -

i have following code create button in tkinter: button = button(self.parent_frame, width=100, height=100) frame = frame(button) label = label(frame, text="this button") frame.pack(fill=both, expand=1) label.pack(fill=both, expand=1) when hover mouse on parts of button, button rapidly resizes width of window , initial size. why happen? tkinter button not allowed have children? note: not planning on using frame inside button, asking hypothetical purposes. instead of answers suggesting workarounds, prefer explanations why happens. theoretically, yes, button can have children. suspect behavior undefined platforms use native widgets (ie: osx , windows).

C# get value of property inside inherited class -

i don't know right words, use code example. class { public mylist<mymodel> models { { // won't work because call's models. how can make work?? return models.load(); }; } } class mylist<t> : list<t>{ public list<t> load(){ return something(); } } this thing want do: var context = new a(); context.models.where(...); the best can give if looking implement linq classes, made post here adding linq classes if you're looking use index class, there's link here setting list items in c# without automatic setter/getter but, unless post objective, , you're hung up, there's not can with.