Posts

Showing posts from August, 2013

Get repository languages with the GitLab API -

i know if there way languages (percentage per language) used in project using api provided gitlab. checked documentation didn't see or maybe missed it. i know use linguist library i'm developping application that's not in ruby , i'm looking way integrate theses percentages. looks there's no endpoint right data language repartition sent in inline javascript. might become available refactor code (see this , this )

high availability - Jenkins: 2 master nodes using NFS -

i´m thinking following high availability solution enviroment: datacenter 1 powered on jenkins master node. datacenter desasters 1 off jenkins master node. datacenter 1 powered on, second disasters. idea install 2 jenkins using same ip shared nfs. if first has fallen, second starts same ip , still having service my question is, can solution work?. thanks hekp ;) i don't see challenges such why should not work. still got monitor in case of switch-over because have faced situation jobs running when jenkins abruptly shuts down still in queue when service recovered never completed afterwards, had manually delete build using script console. over jenkins forum lot of people have reported such bugs, of them seems have fixed, still there cases might happen, , because every time jenkins restarted/started configuration reloaded disk. there inconsistency @ times because of in memory config there earlier , reloaded config. so in case, might happen executor thread sti

ios - How to make generics in collection type constraint? -

i have been trying extract non-nil values string array. below. but, senior wants able extract non-nil values other types too. i read, generics me handling different types. how can use generics use following extension work other types too? getnonnil must return extracted non-nil values of specific type (i.e. if array [string?] must return [string], returns [int] if [int?] ) because have further calculations. what have tried below: import foundation // extended collection-type collectiontype constrained having element optional strings extension collectiontype self.generator.element == optional<string>{ func getnonnil() -> [string] { // filter out nil elements , forcefully unwrap them using map return self.filter({$0 != nil}).map({$0!}) } } // usage let x: [string?] = ["er", "err", nil, "errr"] x.getnonnil().foreach { (str) in print(str) } for getnonnil use x.flatmap { $0 } // returns ["

Mapping users to all of their files(URLs) in a mysql database. -

what want when have looked user in table, want list file urls user have access to. first thought have field in table list of file urls. however, have understood there no such field type. i thinking maybe foreignkeys might work, having trouble getting head around it. another solution maybe have 1 table each user, each row representing each file. what best practice in case? going expand having shared files, thought i'd address issue first. suggest explore json data type

Google Sheets query - conditional limits for ties? -

i have results of google form in google sheet, , form has participants vote on variety of options. results 1 question following: activity ------------- |bowling | |karaoke | |karaoke | |games night| |bowling | |karaoke | what want have query count votes each option in column, display top result. so, information above, display "karaoke". have query works (below). adapted forum response, i'm not fixed if there's better way it. =query(index(if({1,0},unique(a2:a12),countif(a2:a12,unique(a2:gx12)))),"select col1, col2 col1<>'' limit 1",0) my question is, can use "limit 1" in query show 1 item, if there 2- or 3-way tie top choice? there way can show 1 option if it's max, show 2 if there's 2-way tie max, or 3 if there 3-way tie, etc.? for example, in data above, show just |karaoke | but if next person votes bowling, there tie, want show |karaoke | |bowling | does make sense? solutio

Intent to open PDF file in Android N -

i have been trying open pdf file using intent. works fine devices prior adroid n. following code have used file file = new file(griditems.get(position).getpath()); intent intent = null; if (build.version.sdk_int < 24) { intent = new intent(intent.action_view); intent.setdataandtype(uri.fromfile(file), "application/pdf"); intent.setflags(intent.flag_activity_no_history); } else { intent = new intent(); intent.setaction(intent.action_view); uri pdfuri = fileprovider.geturiforfile(gallerypdfactivity.this, getapplicationcontext() .getpackagename () + ".provider", file); intent.putextr

nio - Java 8 Path Stream and FileSystemException (Too many open files) -

geniuses! i'm practicing java 8. so if this: files.walk(paths.get(corpuspathstr)) .filter(path -> path.tofile().isfile()) .foreach(path -> { try { files.lines(path) .foreach(...); } catch (ioexception e) { e.printstacktrace(); } }); i got filesystemexception error. if open file under foreach, may many files opened? or there other reasons causing filesystemexception (too many open files)? thanks in advance! use try(stream<path> stream = files.walk(paths.get(corpuspathstr))) { stream.filter(path -> files.isregularfile(path) && files.isreadable(path)) .flatmap(path -> { try { return files.lines(path); } catch (ioexception e) { throw new uncheckedioexception(e); } }) .foreach(...); } catch(uncheckedioexception ex) { throw ex.g

qt - in c++,how to change label text when the finger move on touch screen? -

i have label on widget , text of number 1. want change number when user move finger or down (up=number 1 ++ , down=number 1--). code text of label not change in console see value changed!!! , best way that?(get touch event , know user finger on touch screen) #include "mainwindow.h" #include "ui_mainwindow.h" mainwindow::mainwindow(qwidget *parent) : qmainwindow(parent), ui(new ui::mainwindow) { ui->setupui(this); qapp->installeventfilter(this); // grabgesture(qt::swipegesture); qgraphicsview graphicsview; graphicsview.setdragmode(qgraphicsview::scrollhanddrag); } mainwindow::~mainwindow() { delete ui; } bool mainwindow::event(qevent *event){ qdebug()<<"event type"<<event->type(); if(event->type() ==129 /*|| event->type() ==2 || event->type() ==5 */) { qmouseevent *ms=static_cast<qmouseevent*>(event); qpoint p=ms->pos(); // qdebug()<<

Migrating UCM Clearcase to new Server -

Image
as part of infrastructure upgrade upgrading our instance of ucm clearcase , moving new servers. have admin pvob , project pvobs linked admin pvob , vobs linked pvob. when moving new vob server hierarchy have moved big bang ensure admin pvob consistent or sort of phased migration approach used. have recommended approach? you should able move pvob first, stating admin one. (provided both servers up, , second 1 accessible first one) the official documentation mentions: if use ucm , moving pvob , 1 or more component vobs, move pvob first, , move component vobs. from there, should follow " moving vob ". other approach use (for older clearcase 7.x) multisite move/replicate vobs/pvobs .

How to refuse part of refactoring in IntelliJ? -

Image
i renaming package geojson geojsonmodel intellij refactoring. instead of rename package, suggest rename ecerything, including filename extension, absurd. how refuse consequent renaming of unrelated things while intellij refacoring? if press cancel entire refactoring stops.

java - Connection issue while connecting to HANA DB via JDBC -

Image
i connecting hana db via ngdbc.jar. connection made after running query 3-4 times connection hana db lost. when restart java server again works 3-4 times. can help? error msg- warn [org.hibernate.util.jdbcexceptionreporter] (http--0.0.0.0-8080-6) sql error: -708, sqlstate: 08006 error [org.hibernate.util.jdbcexceptionreporter] (http--0.0.0.0-8080-6) data receive failed [connection reset]. info [com.ultimatix.controller.metricscontroller] (http--0.0.0.0-8080-6) context setmonthfreezedateorg.hibernate.exception.jdbcconnectionexception: not execute query error [org.hibernate.transaction.jdbctransaction] (http--0.0.0.0-8080-6) jdbc rollback failed: com.sap.db.jdbc.exceptions.jdbc40.sqlnontransientconnectionexception: connection database server lost; check server , network status [system error: socket closed] i can see using hibernate based on log. can elaborate little bit on stack? as @rc said, should consider connection pooling instead of opening direct connectio

php - Posting xml to SOAP service -

i'm new soap , php , i'm having troubles, hope here on stack overflow can me with. i'm trying use code post xml file (retursvar.xml). i'm using code post file: <?php $url = "https://someserver/somefunction"; $options = array( 'login' => 'someusername', 'password' => 'somepassword', 'trace' => 1 ); $client = new soapclient($url.'?wsdl', $options); $document = file_get_contents('retursvar.xml'); $params = array('submitdocument' => $document); $response = $client->__soapcall('submitdocument', $params); but error in apache error log: php fatal error: uncaught soapfault exception: [bpws:forcedtermination] business exception in /var/www/html/soaptest.php:15\nstack trace:\n#0 /var/www/html/soaptest.php(15): soapclient->__soapcall('submitdocument', array)\n#1 {main}\n thrown in /var/www/html/soaptest.p

pic - TCS34725 color sensor readings fluctuate when interfacing with PIC16 -

i trying read values of tcs34725 color sensor pic16 through i2c. currently, continuously polling clear register on tcs. however, every 10 or times read value in clear register, random drop in readings. example, set of consecutive readings may [17, 17, 17, 17, 17, 17, 17, 17, 14, 15, 16, 17 ...], repeating. i have tried interfacing arduino uno in same situation , consistent reading of 17. i eliminate drop in readings. the code have in xc8 reading tcs follows void read_colorsensor(void){ unsigned char color_low[4]; unsigned char color_high[4]; int i; i2c_master_start(); i2c_master_write(0b01010010); //7bit address 0x29 + write i2c_master_write(0b10110100); //write cmdreg + access&increment clear low reg i2c_master_stop(); i2c_master_start(); //repeated start command combined i2c i2c_master_write(0b01010011); //7bit address 0x29 + read color_low[0] = i2c_master_read(1); color_high[0] = i2c_master_read(0); i2c_master_stop(); color[0] = (color_high[0] << 8)|

jquery - Open fancybox 2.1.4 using javascript -

i have div id #popupcontent. has text inside , loads modules via php, working fine if assign box tag. want open via javascript how do that.. documentation si confusing. as said on fancybox 2.1.4, tried use <div id="popupcontent"> <div class="row"> <div class="col...> <h2> bla bla bla </h2> </div </div> </div i tried this <script type="text/javascript"> (function() { $.fancybox($('#popupcontent')); })(); </script> create button , call function so- <button id="popupopenbutton" onclick="myfunction()"> and function myfunction(){ $.fancybox($('#popupopenbutton')); }

amazon s3 - How to improve query performance to s3 data from Athena -

i have partitioned data stored in s3 in hive format this. bucket/year=2017/month=3/date=1/filename.json bucket/year=2017/month=3/date=2/filename1.json bucket/year=2017/month=3/date=3/filename2.json every partition has around 1,000,000 records. have created table , partitions in athena this. now running query athena select count(*) mts_data_1 year='2017' , month='3' , date='1' this query taking 1800 seconds scan 1,000,000 records. so question how can improve query performance? i think problem athena has read many files s3. 250 mb isn't data, 1,000,000 files lot of files. athena query performance improve dramatically if reduce number of files, , compressing aggregated files more. how many files need 1 day's partition? one-minute resolution, need less 1,500 files. if current query time ~30 minutes, might start lot less. there many options aggregating , compressing records: aws's kinesis firehose simple way start on sor

.net - ChangeCulture: Culture name is not supported in C# Winform -

Image
this question has answer here: why get, “culture not supported” , what, if anything, should it? 2 answers i have windows form application developed in vb.net target framework 3.5. application running in windows 7,8,8.1,10. in windows xp, showing error : culture name 'en-in' not supported i have checked code , find line causing error : my.application.changeculture("en-in") when tried remove line, many forms , reports showing error or wrong information. can not remove line. is there way install or load culture in windows ? en-in not known culture code. you can check existing codes in list . you can create custom culture, using cultureandregioninfobuilder , it's highly unrecommended. // create new culture, name desire cultureandregioninfobuilder cib = new cultureandregioninfobuilder("en-in", cultureandregio

python - DataFrames repeat combination -

i have dataframe df1 , df2: df1 = pd.dataframe(['a1','a2']) 0 0 a1 1 a2 df2 = pd.dataframe(pd.date_range('2016-01-01',periods = 2, freq = '1d')) 0 0 2016-01-01 1 2016-01-02 how gonna dataframe? 0 1 0 a1 2016-01-01 1 a1 2016-01-02 2 a2 2016-01-01 3 a2 2016-01-02 you can use itertools: import itertools pd.dataframe(list(it.product(df1[0], df2[0]))) 0 1 0 a1 2016-01-01 1 a1 2016-01-02 2 a2 2016-01-01 3 a2 2016-01-02 itertools returns generator, need convert list before converting dataframe it.product makes combinations between 2 iterables objects, eg.: ["".join(i) in it.product("abc", "abc")] ['aa', 'ab', 'ac', 'ba', 'bb', 'bc', 'ca', 'cb', 'cc']

php - Explode error in TYPO3 7.6 with compatibility6 -

i've got errors after update typo3 6.2 typo3 7.6 compatibility6 mode enabled. in backend, when need edit page or article, content not charged in textareas , i've got warning php warning core: error handler (be): php warning: explode() expects parameter 2 string, array given in /home/typo3/typo3_src-7.6.16/typo3/sysext/core/classes/utility/generalutility.php line 1556 to try debug it, put test in trimexplode function of typo3 this: if(is_array($string)){ $e = new \exception(); $error_string = $e->gettraceasstring(); $f = fopen('/var/www/html/custom.log', 'a+'); fputs($f, php_eol . "new line" . php_eol); fputs($f, php_eol . $error_string . php_eol); fputs($f, php_eol . print_r($string) . php_eol); fclose($f); } but stacktrace not enough clear me understand what's wrong. array empty , so, think problem not array, in compatibility6. know what's problem compatibility6? here's stacktrace new line #0

javascript - iPad youtube video doens't play in fullscreen by default -

i don't know if possible or not when play youtube video ipad want same functionality iphone (the video plays in fullscreen default). on ipad need press fullscreen button see video in fullscreen. i tried using webkitrequestfullscreen() doesn't work. thanks.

excel - Conditional Formatting Error VBA -

i wondering whether can please?! im getting error @ following line: .add type:=xlexpression, formula1:= _ "=if($e1<>"",and($e1<today(),$f1=""awaiting information"")) = 1" here code below. sub conditionalformat() sheets("naco").cells.formatconditions.delete worksheets("naco").columns("a:n").formatconditions **.add type:=xlexpression, formula1:= _ "=if($e1<>"",and($e1<today(),$f1=""awaiting information"")) = 1"** .item(.count).interior .color = 255 end .add type:=xlexpression, formula1:= _ "=if($e1<>"",and($e1<today(),$f1=""on going"")) = 2" .item(.count).interior .color = 225 end .add type:=xlexpression, formula1:= _ "=if($e1<>"",and($e1<today(),$f1=""awaiting quotation"")) = 3" .item(.count).interior .color = 255 end .ad

JPA entity, identify Business key -

lets i'm writing jpa entity. simple one. has 3 properties. public class menuitem { @id @generatedvalue private long menuitemid; @column(nullable = false) private string name; @column(nullable = false) private type type; @onetoone(cascade = {cascadetype.all}) @joincolumn(name = "colorid") private color color; } now, lets need override equals/hashcode methods. according suggestion implementing equals() , hashcode() have use sort of "business key equality". have doubts, should consider "business" key here. have properties except of id, or color can excluded it. seems unclear me. thankful if can explain more on topic. the last statement in reference pure gold: note business key not have solid database primary key candidate. immutable or unique properties candidates business key. so in case name , type candidates. assuming type immutable object (you still away without might experienc

rose diagram - Length scaling orientation data in MATLAB -

Image
problem i have data set of describing geological structures. each structure has row 2 attributes - length , orientation (0-360 degrees). within data set, there 2 types of structure. type 1: less data points, structures physically larger (large length , , more significant). type 2: more data points, structures physically smaller (small length , , less significant). i want create rose plot show spread of structures' orientations. however, want plot represent significance of structures in combination direction face - taking account lengths. is possible scale length in matlab somehow subset less numerous not under represented, when structures large? example a data set might contain: 10 structures orientated north-south, 50km long. 100 structures orientated east-west, 0.5km long. in situation east-west population more significant north-south population based on absolute numbers. however, in reality length of members contributing population smaller , struct

c++ - Is it possible to assign a new ListNode to an already existing node of a linkedlist? -

i writing function inputs linked list associated head2 after occurrence of variable location in list associated head1 . however, keep getting core dump: void mergelists(listnode *head1, listnode *head2, const int &location){ listnode *tail1, *tail2, *run; tail1=head1; tail2=head2; if(head1->pointer_next!=nullptr){ while(tail1->content!=location){ tail1=tail1->pointer_next; } if(head2->pointer_next!=nullptr){ while(tail2->pointer_next!=nullptr){ run=tail1->pointer_next; tail1->pointer_next=new listnode; tail1=tail1->pointer_next; tail1->content=tail2->content; tail1->pointer_next=run; tail2=tail2->pointer_next; } } } delete tail1; delete tail2; delete run; } is there illegal operation in line 12? ran through gdb , pretty sure problem is. have tried setting pointer next nullptr produces same result. have idea core dump occurring? t

c - Perl: IsAdminUser returns incorrect value -

i'm new perl. i'm using win32::isadminuser() function (can't paste code because make runnable have paste whole code). returns 0, curious why because user run member of administrators group, created little test function (c++) , run right before running isadminuser here code: int davai() { file * fp; fp = fopen ("c:\\tmp\\davai.txt", "a"); fprintf(fp, "shevedi davai"); fflush(fp); handle token = null; handle duptoken = null; if(!openprocesstoken(getcurrentprocess(), token_query | token_duplicate, &token)) { fprintf(fp, "davai: openprocesstoken cheijva. %d\n", (int)getlasterror()); fflush(fp); } if (duplicatetokenex(token, maximum_allowed, null, securitydelegation, tokenprimary, &duptoken) == 0) { fprintf(fp, "davai: openprocesstoken duplicatetokenex. %d\n", (int)getlasterror()); fflush(fp); } ptoken_groups pprivilegestoken = null; dword cbsize = 0; gettokeninformation(du

Date/Time Revit Shared Parameter -

i brazilian student , work on research project need develop plug-ins autodesk revit. in midst of research, doubts have arisen. how can insert revit family shared parameter/project parameter in date/time format ? use string , format way like. revit parameters not provide built-in support date , time.

c# - Select only such items that contain any element in int array -

assume have class: public class item { ... public ienumerable<int> clientsids { get; set; } } and following code: list<item> items = getitems(); int[] ids = getids(); now need select such items contain element in ids int array. how can it? well simple where should it: var filtereditems = items.where(item => item.clientids.any(ids.contains)).tolist(); i don't see need extension method here, of course encapsulate it: public static ienumerable<item> filteritems(this ienumerable<item> source, ienumerable<int> filter) { return source.where(item => item.clientids.any(filter.contains)); }

ios - ShippingRates not getting in Shopify SDK -

i working on shopify sdk in ios app. i want shipping rates. when call method: - (nsoperation *)getshippingratesforcheckoutwithtoken:(nsstring *)checkouttoken completion:(buydatashippingratesblock)block { buyasserttoken(checkouttoken); nsurl *url = [self urlforcheckoutsshippingrateswithtoken:checkouttoken parameters:@{ @"checkout" : @"", }]; buyrequestoperation *operation = (buyrequestoperation *)[self getrequestforurl:url start:no completionhandler:^(nsdictionary *json, nshttpurlresponse *response, nserror *error) { nsarray *shippingrates = nil; if (json && !error) { shippingrates = [self.modelmanager insertshippingrateswithjsonarray:json[@"shipping_rates"]]; } block(shippingrates, [self statusforstatusco

jquery - Break the overflow of nanoscroller and overlap a div -

i searched example how make body of table scrollable using nanoscroller. solution made divs , works fine. now want add menu inside cells should overlap body of table corners this: wanted result but @ moment looks this: $('.nano').nanoscroller(); * { box-sizing: border-box; } body { background: #111; margin: 0; font-family: sans-serif; font-size: 120%; } .wrapper { margin: auto; max-width: 400px; width: 80%; min-height: 100vh; display: flex; justify-content: center; align-items: center; } .c-table { display: flex; flex-direction: column; width: 100%; background: #fff; border-radius: 5px; overflow: hidden; height: 220px !important; } .c-table__header { display: block; width: 100%; } .c-table__row { display: table; width: 100%; } .c-table__cell { display: table-cell; padding: 10px; text-align: left; } .c-table__cell--th { background: hsl(200, 40%, 60%); c

php - Facebook SDK cannot autoload classes in Wordpress -

i've been searching solution days, , have no clue try or go next. i'm trying set user token facebook app in custom plugin in wordpress website per documentation: https://developers.facebook.com/docs/php/gettingstarted since it's shared host, didn't seem use composer. anyhow, documentation manually installing sdk looked simple enough easier going way, want know going wrong. so on plugin's front page have this: <?php ini_set('display_errors', 1); error_reporting(e_all); // debug define('facebook_sdk_v4_src_dir', __dir__ . '/php-graph-sdk/facebook/'); require_once(__dir__ . '/php-graph-sdk/facebook/autoload.php'); if(!isset($_session['fb_access_token'])){ ?> <script> // pretty given facebook, except ajax seems working fine loginwithfacebook = function() { fb.login(function(response) { if (response.authresponse) {

c - Calling a function in another function: segmentation fault(core dumped) -

i'm supposed function erases repeated characters in string. here's code: #include <stdio.h> #include <stdlib.h> #include <string.h> #define dim 100 char* mystrcpy(char [], char[]); char* repeticoes(char []); int main() { char str1[dim]="john joanne"; printf("%s", repeticoes(str1)); return exit_success; } char* mystrcpy(char _dest[], char _orig[]) { int i=0; (i=0; _orig[i]!='\n'; i++) _dest[i]=_orig[i]; _dest[i]='\0'; return _dest; } char* repeticoes(char _s[]) { int i=0,j=0; char news[dim]={'\0'}; (i=0, j=0; _s[i]!='\0'; i++) { if(mystrcnt(_s, _s[i])==1) news[j++]=_s[i]; } news[j]='\0'; mystrcpy(_s, news); return _s; } mystrcpy function created in previous exercise. problem i'm obtaining segmentation fault(core dumped). if try use string library function strcpy program runs ok. problem functions? not declaring/initializing/passing arguments strings correc

salt stack - How to use autocomplete in saltstack -

i want use bash autocomplete feature saltstack. salt '*' test.p <tab> should complete word , make salt '*' test.ping . after googling, got following links: salt.bash & cli completion however, cannot figure out how use it. autocompletion feature not working default. please provide step step guide activate it. download salt.bash file. wget https://raw.githubusercontent.com/saltstack/salt/develop/pkg/salt.bash copy file /etc/bash_completion.d/ cp salt.bash /etc/bash_completion.d/ logout , layback in. or source file source /etc/bash_completion.d/ now use salt auto-completion feature salt '*' tes[[tab]].pi[[tab]] and result: salt '*' test.ping

java - JAXB unmarshalling from XmlStreamReader results in null object -

i created java procedure unmarshalling xml message "starttag" can provided start unmarshalling @ particular element within message. used xmlstreamreader make selection. a complete copy-pastable demo of problem run below. 'xml' message need work with. unfortunately yields null car object in result, while 'xmlstripped' message yields unmarshalled result. i isolated problem xmlns="http://www.example.com/type" namespace in <response> element. when remove this, 'xml' unmarshalled. i have no control on xml. 'xml' variable need work with. have little control on xsd/ objectfactory , first course of action solution in unmarshalling procedure. please let me know if know why fails , if have solution. thanks! import javax.xml.bind.jaxbcontext; import javax.xml.bind.jaxbelement; import javax.xml.bind.jaxbexception; import javax.xml.bind.unmarshaller; import javax.xml.bind.annotation.*; import javax.xml.namespace.qname; im

javascript - Flow union type refinement defeated by filter -

the example can found @ flowtype.org/try . here expect type refinement in conditional work in both examples, while works in simpler one. when introduce array.filter refinement not take effect. bug in flow or mis-usage on part? /* @flow */ export type action = {| type: 'action1', payload: string |} | {| type: 'action2', payload: number |} | {| type: 'action3' |} const things = (state: array<number> = [], action: action): array<number> => { if (action.type === 'action2') { return state.filter((thing) => { return thing !== action.payload }) } else { return state } } things([1, 5], { type: 'action2', payload: 5 }) const add = (state: number = 0, action: action): number => { if (action.type === 'action2') { return state + action.payload } else { return state } } add(0, { type: 'action2', payload: 5 }) generates following errors: 10: return state.filter((thing)

angularjs - How to search elements in aci tree -

i using acitree plugin in angular js injecting via directive. tree works fine me need include searching. can me? in advance! var treeapi = angular.element('#tree').acitree('api'); treeapi.filter(null, { search: searchtext });

math - How to find Y for corresponding X values (Implicit function, Complex number) -

Image
given equation: y^2 = x^3 + 2*x - 3*x*y assuming plotted sketch correct. y^2 = x^3 + 2*x - 3*x*y hint: y^2 + x^2 =1 ==> y= sqrt( 1 - x^2 ) the x values known. how can find corresponding y values x values? e.g. known x-values, expect below listed y-values (see plotted sketch): x= 1 ; y=0.79 x=2 ; y=1.58 x=3 ; y=2.79 x=4 ; y=4.39 x=5 ; y=6.33 x=6 ; y=8.57 x=7 ; y=11.12 x=8 ; y=13.92 x=9 ; y=16.98 x=10 ; y= 20.29 e.g. try find y x=6; y calculated follws: y^2+x^2=1 ==> y=sqrt(1 - x^2) = sqrt(1-36) = sqrt(-35) = (0, 5.92i ); thus: y^2 = x^3 + 2*x - 3*x*y = (228 , -106,49i) y = sqrt( 228 , -106,49i) = (15.49 , -3.44i) sadly, calculated y wrong! expect (6, 8.57i). how can find y? thanks in advance. just solve 'y'. it's not difficoult, when treat x constant value: y^2 = x^3 + 2x - 3xy 0 = (-1)y^2 + (-3x)y + (x^3 + 2x) it's quadratic equation of: = -1 b = -3x c = x^3 + 2x y1 = (-(-3x) - sqr((-3x)^2 - 4(-1)(x^3+2x)))/2*

java - Spring AMQP @RabbitListener custom retry on business error best practice -

following scenario: have @rabbitlistener picking messages rabbitmq. message runs error because can not find related business object. in case have no possibility reply sender want ignore message after amount of retry. my solution: in @rabbitlistener whenever not possible find business object throw custom runtime exception. in configuraion have retryoperationsinterceptor max attempts , custom recoverer. what best practice handling such cases? can configure diffrent recoverer class when having more 1 @rabbitlistener? see configuraion: @bean public simplerabbitlistenercontainerfactory rabbitlistenercontainerfactory() { simplerabbitlistenercontainerfactory factory = new simplerabbitlistenercontainerfactory(); factory.setmessageconverter(new custommessageconverter()); factory.setconnectionfactory(connectionfactory()); factory.setacknowledgemode(acknowledgemode.auto); factory.setconcurrentconsumers(1); factory.setmaxconcurrentconsumers(20); advice[] ad

python - How to import complex dict into pandas? -

Image
i have data extracted xml file: d = { 'test1': { 0: {'a': {'min': 1, 'mid': 12, 'max': 13}, 'b': {'min': 2, 'mid': 22, 'max': 23}}, 3: {'a': {'min': 3, 'mid': 32, 'max': 33}, 'b': {'min': 4, 'mid': 42, 'max': 43}}, 8: {'a': {'min': 5, 'mid': 52, 'max': 53}, 'b': {'min': 6, 'mid': 62, 'max': 63}}, }, 'test2': { 0: {'a': {'min': 9, 'mid': 12, 'max': 13}, 'b': {'min': 8, 'mid': 22, 'max': 23}}, 3: {'a': {'min': 7, 'mid': 32, 'max': 33}, 'b': {'min': 6, 'mid': 42, 'max': 43}}, 8: {'a': {'min': 5, 'mid'

swift - How can I make my level menu scrollable vertically? -

Image
i have following level menu (as seen below). make vertically scrollable, resulting in total height double of screen (full scroll height). how can achieve this? below code image above: class levelmenu: skscene { let levelbuttonsize = skspritenode(imagenamed: "b1").size let levelbutton1: skspritenode = skspritenode(imagenamed: "b1") let levelbutton2: skspritenode = skspritenode(imagenamed: "b2") let levelbutton3: skspritenode = skspritenode(imagenamed: "b3") let levelbutton4: skspritenode = skspritenode(imagenamed: "b4") let levelbutton5: skspritenode = skspritenode(imagenamed: "b5") let levelbutton6: skspritenode = skspritenode(imagenamed: "b6") let levelbutton7: skspritenode = skspritenode(imagenamed: "b7") let levelbutton8: skspritenode = skspritenode(imagenamed: "b8") let levelbutton9: skspritenode = skspritenode(imagenamed: "b9") let levelbutton10: skspritenode = sksprit