Posts

Showing posts from January, 2011

c# - How to detect remote actor disconnection (dissociation)? -

i have server contains serveractor. actor receives registerclient messages , adds actorrefs list of registered clients. i have multiple clients, each of them contains clientactor should registrered on server further actions. what best pattern handle client actor disconnect (because of network failure example). should implement hearbeat messages or akka.net contains out of box? akka.net documentation contains answer question: detecting , handling network failures remote deathwatch

excel - How to match text string in a cell approximately -

i've got formula =iferror(index('[fishing contact list july 2015.xlsm]places'!$a$2:$a$65, small(index(row($1:$64)+('[fishing contact list july 2015.xlsm]places'!$q$2:$q$65="a"&'[fishing contact list july 2015.xlsm]places'!$b$2:$b$65>="fishing")*1e+99, , ), row(1:1))),"no active fishing places") which designed in workbook in column b word " fishing" , return names of fishing places written in column if in column q has been written , in column b text matches word fishing. the problem having in column b there not text fishing. there often, "fishing/lakes" or "fishing/saltwater" example. need way of using word "fishing" find match (as using in column q) without having individually write out words. at moment returns "no active fishing places". if reverse >="fishing" <="fishing" value returned 0. i have tried fitting match formula should h

Magento: Creating custom pages with multiple levels in the url -

i've been creating pages using custom module, having following designate url: <frontend> <routers> <materials> <use>standard</use> <args> <module>modulename_custom</module> <frontname>materials</frontname> </args> </materials> <materials_wood> <use>standard</use> <args> <module>modulename_custom</module> <frontname>materials/wood</frontname> </args> </materials_wood> </routers> </frontend> i want have different levels in url, www.example.com/materials/ , www.example.com/materials/wood/ of course, above example doesn't work. is possible achieve want?

asp.net - Unable to resolve dependency 'Microsoft.AspNet.SignalR.SystemWeb'. Source(s) used: 'nuget.org', 'Microsoft and .NET' -

Image
not can this, installed vs 2015 community, trying install signalr , error pops out.

android - Espresso, scroll to bottom of dynamical loading ListView -

normaly scrolling down within testcase use peace of code: onview( withid( r.id.button)).perform( scrollto(), click()); however in test want scroll down listview, childelements loaded dynamically (i dont know how many there are), when view scrolled down. there scroll bottom in espresso in robotium? my workarround: int [] childcount = getlistelements(); for(int = 0;i<childcount[0];i++) { ondata(anything()).inadapterview(withid(r.id.scheduleorderlistviewlistview)).atposition(i).perform(click()); childcount = getlistelements(); } with public int[] getlistelements(){ final int[] counts = new int[1]; onview(withid(r.id.scheduleorderlistviewlistview)).check(matches(new typesafematcher<view>() { @override public boolean matchessafely(view view) { listview listview = (listview) view; counts[0] = listview.getcount(); return true; } @override public void descr

Python Django RestFramework route trigger -

i'am building api using python 2.7 , django 1.7 , i'm facing problem. i'm not expert in rest framework understand basic mechanisms. i can resume problem giving example. have route lets say /api/project/ django rest framework provides me basic operations route , don't need write them e.g: post, get, put, delete => /api/project/ the fact is, want operation when create new project. want add id of user has created new project. i want add kind of trigger/callback create function: class projectviewset(viewsets.modelviewset): queryset = project.objects.all() serializer_class = projectserializer def create(self, request, *args, **kwargs): i want keep internal behavior of rest framework (i don't want rewrite route functions), want route stuff , need request object in trigger/callback. like def callback(request, instance): instance.created_by = request.user instance.save() do have ideas? thank you. you need add creato

Payu payment gateway integration with PHP -

payu provide lot of api. don't know api used. want integrate lots of option like, credit card option debit card option web checkout option most recommended way use direct payment gateway provider's api rather others. if using payu biz : step 1: can use simple html form enter payu payment gateway step 2: can use official payu sdk payu sdk if using payu money : can download php api merchant login page. in general payment gateway provider provide credit/debit , netbanking options.

javascript - Scrolling iframe on iOS causes the page to scroll -

i have application displays iframe user needs able scroll on ipad. apparently can't scroll iframes , other elements default on ios unless use special -webkit-overflow-scrolling in css. so example have following html (based on david walsh's solution here: http://davidwalsh.name/scroll-iframes-ios ) <div class="framecontainer"> <iframe src="./frame.html"></iframe> </div> and css: * { margin: 0; padding: 0; border: 0; outline: 0; } html, body { height: 100%; background: #ff0000; } .framecontainer { position: absolute; top: 40px; left: 80px; right: 80px; bottom: 40px; background: #ffffff; overflow: auto; -webkit-overflow-scrolling: touch; /* removes spacing below iframe */ font-size: 0; line-height: 0; } .framecontainer iframe { width: 100%; height: 100%; } however can cause page (red area) bounce , lose focus of iframe either flicking p

I have multiple array and i want to write each array into each tab of excels sheets using PHP -

i have following array. want write array in excel sheets using php. try{ $client = new soapclient(wsdl_url, array('cache_wsdl' => wsdl_cache, 'trace' => true, 'features' => soap_single_element_arrays, 'proxy_host' => soap_proxy_host, 'proxy_port' => soap_proxy_port)); $client->__setlocation(wsdl_endpoint_url); $result = $client->maximiselostprospectdecision(); //print_r($result); //exit; if (!empty($result->lostprospect->lostprospectrow)) { foreach ($result->lostprospect->lostprospectrow $prospect) { $fields = array(); foreach($prospect $key=>$prospect_details) { $fields[]=$prospect_details; } } } } <?php ini_set('max_execution_time',0); error_reporting('all'); ini_set('display_errors','on'); ini_set('memory_limit'

cluster analysis - Latent class clustering -

i have data contains continuous , categorical variables , have cluster data using latent class analaysis - lca. know lca mean manifest variables categorical read programs latentgold know how hande both types of data when clustering way. know how kind of clustering in r? there package can me that? looked on lot of packages polca, mclust didn't manage want. thanks

Sitecore Azure package installation -

i installing sitecore azure 8 inside sitecore using admin account. keep installing package taking long time. there alternate this? as far understood, trying install 'sitecore azure 8.0 rev. 150522.zip' sitecore installation package never finishes , shows 'installing' progress bar in installation wizard application. if yes, make sure sitecore xp 8.0 installation has valid connection mongodb instance. if not have, bunch of sitecore client functionality might work incorrectly, including installation wizard application.

java - Design library and support library -

i want use ' com.android.support:design:22.2.0 ' in android studio(1.3) project when add 'com.android.support:design:22.2.0' dependencies{} 103 errors , can not rid of errors. same happens if try use new version of appcompat. have compile 'com.android.support:appcompat-v7:19.+' in build.gradle. anyone have idea? my errors: information:gradle tasks [:generatedebugsources, :generatedebugandroidtestsources] :prebuild up-to-date :predebugbuild up-to-date :checkdebugmanifest :prereleasebuild up-to-date :preparecomandroidsupportappcompatv72220library up-to-date :preparecomandroidsupportcardviewv72211library up-to-date :preparecomandroidsupportdesign2220library up-to-date :preparecomandroidsupportsupportv42220library up-to-date :preparecomgoogleandroidgmsplayservices6111library up-to-date :preparepaketekbeaconestimotesdkunspecifiedlibrary up-to-date :preparedebugdependencies :compiledebugaidl :compiledebugrenderscript up-to-date :generatedebugbuildconfig u

oop - How to enforce constructor in Java -

is there way enforce specific constructor in java classes? for example want classes inherit class have constructor - public classname(string s1,string s2){....} i know should not avoided because can lead problems multiple inheritance. there way anyway? there no facilities in java directly. however, can enforced extent usin abstract method. abstract class base { base(string s1, string s2) { init(s1, s2); } protected abstract void init(string s1, string s2); } class myclass extends base { // forced this. myclass() { super("one", "two"); } // forced this. @override protected void init(string s1, string s2) { } }

DocuSign Up Sell Page -

we testing docusign in sandbox. each time after user signs document, sell page show up: https://www.docusign.com/p/membernet/finish_signing_demo.php?__utma=60499768.4301863.1366206636.1366231833.1368732074.3&__utmb=60499768.8.10.1368732074&__utmc=60499768&__utmx=-&__utmz=60499768.1366206636.1.1.utmcsr%3d(direct)%7cutmccn%3d(direct)%7cutmcmd%3d(none)&__utmv=-&__utmk=242484613 are getting page because in sandbox? our clients see similar page after move production? thanks, that default behavior, can change landing pages workflow. see below general landing pages (non-embedded/non-powerforms) https://support.docusign.com/guides/ndse-user-guide-configure-branding embedded / powerforms https://support.docusign.com/guides/cdse-powerforms-landing-pages-for-web-powerforms

javascript - How do I get oauth_timestamp, oauth_nonce, oauth_signature for Flickr OAuth on android -

for flickr oauth authentication, i'm authenticating user i'm getting oauth token. oauth moauth = oauth.newinstance(activity.getapplicationcontext(), activity.getsupportfragmentmanager(), new clientparametersauthentication(flickrdemoconstants.flickr_api_key, flickrdemoconstants.flickr_api_secret), authorization_verifier_server_url, token_server_url, redirect_url, lists.<string>newarraylist(), temporary_token_request_url); credential mcredential = moauth.authorize10a( userid).getresult(); if(flickrdemoconstants.debug_enable) { log.i(tag, "token: " + mcredential.getaccesstoken()); but how oauth_timestamp, oauth_nonce, oauth_signature ?

c++ QueryPerformanceCounter performance spikes -

i created simple program determinate how long queryperformancecounter call takes. takes around 8 nanoseconds on computer time time can see spikes 500 usecs per call. some details: visual studio 2013, c++ large_integer ll; queryperformancefrequency(&ll); int steps = 10000000; large_integer t1, t2; long long dt=0, dtavg=0, dtmax=0; double nanosecmult = 1000000000.0 / ll.quadpart; double usecsecmult = 1000000.0 / ll.quadpart; (int = 0; < steps; i++) { queryperformancecounter(&t1); queryperformancecounter(&t2); dt = t2.quadpart - t1.quadpart; dtavg += dt; if (dt>dtmax) dtmax = dt; } double dtd = dtavg*usecsecmult / steps; double dtdmax = dtmax * usecsecmult; printf_s("steps: %d, dtavg: %.12f usec, dtmax: %.6f usec\n", steps, dtd, dtdmax); output example: ... steps: 10000000, dtavg: 0.008456895938 usec, dtmax: 3.893501 usec steps: 10000000, dtavg: 0.008427907056 usec, dtmax: 222.991405 usec steps: 10000000, dtavg: 0.008

ruby on rails - How to correctly write a path to stylesheets in application layout? -

Image
i want include bootstrap.min.css file project , located in (project)/css/bootstrap.min.css folder. added following line in application layout between <head> tags. <head> <title>greenbull</title> <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> <%= csrf_meta_tags %> <link rel="stylesheet" href="path/css/bootstrap.min.css"> </head> however when run app, console renders error why so? as mentioned preferred way of including assets rails application use asset pipeline. in event need include asset lives outside of default include paths setup rails (in case css/bootstrap.min.css) can add custom path application. by adding following config/initializers/assets.rb: config.assets.paths << rails.root.join("css&qu

java - Show float number on a button -

i'm writing application android, , have difficulties writing float value on button text. tried this: float percentage1 = (level1/16)*100; string s = float.tostring(percentage1); percent.settext(s+"%"); and this: float percentage1 = (level1/16)*100f; percent.settext(float.tostring(percentage1)); it's show me 0.0% on button. if has on idea how that, please respond! (level1/16) computed in integer arithmetic ; i.e. remainder discarded. to remedy, use (level1/16.0)*100; . using 16.0 causes expression evaluated in floating point.

javascript - Angular2 Http Request -

hi trying make request using http module in angular2 . everything compiles fine in typescript (1.5), chrome shows following error in console: exception: error during instantiation of entrylist!. original exception: typeerror: cannot read property 'merge' of undefined original stacktrace: typeerror: cannot read property 'merge' of undefined @ mergeoptions (angular2.dev.js:27991) @ execute.http.get (angular2.dev.js:28052) @ entryservice.getentries (services.js:17) @ new entrylist (entry-list.js:20) services.ts /// <reference path="../typings/angular2/angular2.d.ts" /> import { http, observable } "angular2/angular2" export class entryservice { private _entries: array<string>; private _http : http; constructor() { this._entries = ["test1", "test2", "test3"]; this._http = new http; } entries() : array<string> { return this._entries;

css3 - How to style the arrow that opens submenus in jQuery mmenu? -

does know how arrow in mmenu opens (vertical) submenus generated , how can possibly style via css? hint appreciated. thanks. link mmenu website the css styles these arrows following ones: .mm-prev:before, .mm-next:after, .mm-arrow:after { content: ''; border: 2px solid transparent; display: inline-block; width: 8px; height: 8px; margin: auto; position: absolute; top: 0; bottom: 0; border-color: rgba(0, 0, 0, 0.3); -webkit-transform: rotate(-45deg); -moz-transform: rotate(-45deg); -ms-transform: rotate(-45deg); -o-transform: rotate(-45deg); transform: rotate(-45deg); } if apply css anchor, have 45 degree rotated box 2 pixel border line. can remove border of each sides want following code have right sided arrow: .mm-next:after, .mm-arrow:after { border-top: none; border-left: none; right: 20px; } and below code have left sided arrow: .mm-next:after, .mm-arrow:after { border-bottom

delphi - Preffered way to define readonly property with getter function -

what preferred method define read property getter function: tmyclass = class(tobject) private function getvalue: integer public property value: integer read getvalue; end; or tmyclass = class(tobject) public function value: integer; end; [edit]i know matter of taste i'll rephrase question into: pro's , con's of both methods? the first 1 preferred way it. want read value name it's common way property. function named instruction getvalue or extractfilepath etc. variables , properties named value store.

jquery - filtering HTML table with JavaScript - no plugins -

update: i still unable render data. basic strategy, has worked sorting write function filter named filtercats , call callback in getfilterbreed. approach seems nothing. approach below: function getfilterbreed(){ $.getjson('cats.json', function(cats) { var cats = cats; filtercats(cats, criteria); }); } function filtercats(cats, criteria){ //renderdata(cats.filter(function(c){return c.breed === criteria;})); var criteria = document.getelementbyid('filter').value; var filtereddata = cats.filter(function(c){return c.breed === criteria;}); renderdata(filtereddata); } and html: <label for="filter">filter</label> <input type="text" name="filter" v

How to delete/remove/undo DrawString in C# WinForm -

my form has background image. have pictureboxes using buttons. attempting have mouseenter/mouseleave event display label or picturebox. i have been trying various approaches. getting similar results- label or picturebox appears fine, on mouseleave, label1.visible = false; causes temporary blank box on background image of form. while functional, seems slight lag, makes program bad. i experimented drawstring method. seems option, cannot figure out how remove object on mouseleave event. is possible? if not, there better option accomplish trying accomplish? here how drawing string (in buttonclick event testing): graphics g = this.creategraphics(); string letter = "yo dawg!"; g.drawstring(letter, new font(fontfamily.genericsansserif, 20, fontstyle.regular), new solidbrush(color.black), 100, 100); you draw in paint event, in mouseleave set flag, cause paint invalidate() within paint if flag not set don't draw anything. public partial class thef

java - IOException: Size Mismatch on inflated file error -

in android, have zip file need unzip, while unzipping end getting ioexception: size mismatch on inflated file: 6843932 v 0 i noticed when looking @ log see bunch of files unzipping. geocoord/canada/nad27nad83/123w53n3d.dac, 85472 bytes. extracted 85472bytes. geocoord/canada/nad27nad83/bc27v1_1.dac, 48032 bytes. extracted 48032bytes. geocoord/canada/nad27nad83/readme_nad27tonad83.txt, 646 bytes. extracted 646bytes. geocoord/canada/nad83csrs/readme_nad83tocsrs.txt, 593 bytes. extracted 593bytes. geocoord/canada/readme_canada.txt, 534 bytes. extracted 534bytes. geocoord/coordsys.dty, 0 bytes. and code super simple: private final int byte_size = 4096; private void unzip( string src, string target ) { try { zipfile = new zipfile(src); enumeration<? extends zipentry> entries = zipfile.entries(); while (entries.hasmoreelements()) { zipentry entry = entries.nextelement(); file entrydestination = new file

Javascript / Jquery Table Plugin with Multiple Operation -

i looking javascript / jquery table plugin, should have following functionalities included in it. fixed header of table (header lock elements scrollable) few columns locked while scrolling (say first 2 columns) drag , drop column column resizing (like excel) column priority change in responsive views (e.g table saw plugin) horizontal scroll on column exceeding on current views sorting i have group of plugin's gave me these individual options separately. looking combination of it. if have reference link, please suggest. regards, sopo

asp.net - Visual Studio - One click publish files outside of the website root -

i'm trying publish files unrelated solution part of one-click publish job. this relatively standard, similar outlined here , here too . however, files need reside 1 folder above actual root of website. if try specify relative path outside of website directory, such <destinationrelativepath>..\data\%(recursivedir)%(filename)%(extension)</destinationrelativepath> results in publish skipping item, since claims date (in reality there isn't there can't date). i've had quick , can't find way specify absolute path, possible, or there better approach take here? as part of properties of file want copy can set "copy always" resolve issue if date issue.

symfony - FosElasticaBundle: define mapping for GUID / UUID fields -

how define mappings in config_yml if entities uses guid field type identifier? details i have project symfony 2.7.3 , foselasticabundle 3.1.4. i have configured mapping , works fine when use populate command or if edit existing entity; when creating new entity exception "expected simple value field [_id] found [start_object]]" checking json response have noticed _id set empty object ..."_id":{}... . the uuid class has __tostring method expect should trick, missing something. current mappings fos_elastica: clients: default: { host: %elasticsearch_host%, port: %elasticsearch_port%, logger: true } indexes: app: types: user: mappings: name: ~ surname: ~ persistence: driver: orm model: appbundle\entity\user provider: ~

racket - What is the difference between a transparent and a prefab struct? -

as title implies, don't understand difference between using #:transparent , using #:prefab when defining struct. reference mentions prefab involves sort of global sharing. what difference between them? in situation should use 1 on other? to make structure type transparent, use #:transparent keyword after field-name sequence: (struct posn (x y) #:transparent) > (posn 1 2) (posn 1 2) an instance of transparent structure type prints call constructor, shows structures field values. transparent structure type allows reflective operations, such struct? , struct-info, used on instances. although transparent structure type prints in way shows content, printed form of structure cannot used in expression structure back, unlike printed form of number, string, symbol, or list. a prefab (“previously fabricated”) structure type built-in type known racket printer , expression reader. infinitely many such types exist, , indexed name, field count, supertype, ,

java - Primefaces p:dataTable showing without message "No records found."? -

Image
this question has answer here: hide primefaces datatable 'no records found' while loading table content 2 answers i have p:datatable: <p:datatable var="ind" value="#{logindpersistbean.list}" paginator="true" rows="10" id="table" rowstyleclass="odd-row, even-row"> <f:facet name="header"> list of logs </f:facet> <p:column headertext="name" > <h:outputtext value="#{ind.name}"/> </p:column> <p:column headertext="date" > <h:outputtext value="#{ind.date}" />

javascript - How to hide element using Class; instead of using css function in JQuery? -

there multiple times datatables used in solution. at 1 place got requirement need hide data table header: <div id="doctable_wrapper" class="datatables_wrapper no-footer"> <div> <div class="datatables_scroll"> //following top div of head generated dynamically datatables <div class="datatables_scrollhead nodisplay" style="overflow: hidden; position: relative; border: 0px none; width: 100%;"> <div class="datatables_scrollheadinner" style="box-sizing: content-box; width: 1188px; padding-right: 16px;"> <table class="datatable no-footer" role="grid" style="margin-left: 0px; width: 1188px;"> <thead id="docheading"> </thead> i have added style named nodisplay in datatables_scrollhead. it contains : nodisplay{ display:none !important; } i applying in jquery as: $(".datatables_sc

angularjs - In a custom directive, what functionality does `controller` have over `link`? -

in trying grasp on creating own angularjs directives, have example need, realize in borrowing various examples, can create functionality directive's view in both controller link . it seems rid of controller , put link , or there can controller can't link? http://jsfiddle.net/edwardtanguay/gxr49h96/6 .directive('itemmenu', function () { var controller = function ($scope) { var vm = this; vm.additem = function () { $scope.add(); vm.items.push({ 'kind': 'undefined', 'firstname': 'joe', 'lastname': 'newton', 'age': math.floor(math.random() * 60) + 20 }); }; // same function defined below in link // $scope.converttointernal = function(item) { // item.internalcode = 'x0000'; // item.kind = '

java - Objectpool vs. immutable Objects -

say working simple class , object creation not heavy: class simple { public final int data1; public final float data2; ... } you have continuously put simple-objects queue: queue.add(new simple(123,123f,...)); is faster work object-pool , change simple-class modifiable class? hope not. generally, no isn't faster. if configure jvm use "throughput" gc, better performance not attempting recycle objects. worth considering object pools if either "memory constrained" or if gc pauses problematic. (the amortized cost of garbage collecting object tends towards 0 proportion of garbage non-garbage increases, if objects "die young", per generational hypothesis.) in fact: if application multi-threaded, object pool may concurrency bottleneck, and mutation of "effectively immutable" objects may require additional overhead and/or additional synchronization. if object creation rate "about 20 objects per second&quo

Find and input byt its class and value with JQUERY -

i have input: <input type="hidden" class="code" value="22015054"> and want find it. selector: var inputv = $('input.code input[value=22015054]'); in console have this: console.log(inputv.html()); "null" but not work, how can solve this?? please help. your current selector targeting input element child of input.code element. what appears want select input element class code , value of 22015054. to that, you'd write following selector: 'input.code[value=22015054]' here example outputs html element matched input element div. $('#output').text($('input.code[value=22015054]')[0].outerhtml); <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <input type="hidden" class="code" value="22015054"> <div id="output"></div> so, code become: var

elasticsearch - Is the Logstash "agent" command-line argument necessary? Deprecated? -

in logstash, agent command-line argument anything? deprecated? don't find documentation , adding or removing doesn't seem make difference in (simple) cases i've tested. i think argument nothing, because not anymore in documentation

javascript - Parameter in a jquery event -

i want pass object called hottraitement in parameters of event .click of jquery. declare object : $(window).load(function(){ container = document.getelementbyid('tab_traitement'); var hottraitement = new handsontable(container, { data: data_traitement}); }); and i'm trying pass object : $('#submit_button_traitement').click(function({hottraitement:hottraitement}) { console.log(hottraitement); }); but it's not working, hottraitement undefined. help please ! try this. define hottraitement variable global one. $('#submit_button_traitement').click({hottraitement:hottraitement},function(e){ console.log(e.data.hottraitement); }); simple demo: fiddle update: try way. $(document).ready(function() { var container = document.getelementbyid('tab_traitement'); var hottraitement = new handsontable(container, { data: data_traitement }); //... $('#submit_butto

html - Embed Video into SharePoint WebPart - Do not play video when page opens -

i wrote following html embed flash video content webpart: <embed src="relativeurltoflahfile" type="application/x-shockwave-flash" width="700" height="200"></embed> works great, however, since have several videos in webparts start playing @ same time. videos not start when page opens. i have tried adding <embed...play="false" <embed..autoplay="false" but none of options have worked. thanks. try add autostart="false" and in case used chrome "chrome doesn't seem understand true , false. use autostart="1" , autostart="0" instead." source: html embed autoplay="false", still plays automatically

facebook - Verify in which adcampains, adcampain_groups, adset is used a CA custom audience -

is possible know (from customaudienceid) in adcampain, adcampaingroup , adset used (or not) ca? possible select graph /customaudiences specifying ids need query? many @ all, alex. no, it's not possible list of campaigns or ads given ca. can targeting info adgroups , check see if ca id present there.

c++ - cin and cout in c programming -

my code written in c. however, converted code via changing header files c++ , program works fine. question is: want cin , cout work in c program. have included following libraries #include <stdio.h> #include <stdlib.h> #include <string.h> #include <linux/types.h> #include <asm/types.h> #include <linux/socket.h> #include <asm/socket.h> #include <netinet/in.h> #include <errno.h> and cin , cout work used iostream library in c++ not work in c. kindly advise me of library can use or if can convert code work in c programming. cin , cout streams , not exist in c. can use printf() , scanf() in c. in general running c code in c++ work c++ based on c going other way can problematic there lot of features in c++ don't exist in c.

qt - how to change background color for qtabbar empty space pyqt -

Image
i need change background color empty space of qtabbar in image below, can use style sheet change tabbar change tabs not empty space next tabs (red bordered area) i using pyqt as far know can make either via: tabwidget->setstylesheet("qtabbar { background-color: red; }"); tabwidget->setdocumentmode(true); but doesn't good. or via: tabwidget->setautofillbackground(true); qpalette pal = tabwidget->palette(); pal.setcolor(qpalette::window, qt::red); tabwidget->setpalette(pal); or create qwidget background , insert qtabwidget on top of it.

c++ - Dereferencing a 50% out of bound pointer (array of array) -

this new question in "i don't understand pointers in c , c++" collection. if mix bits of 2 pointers equal values (pointing same memory address), happen have same bit representation, when 1 dereferenceable , 1 one past end, standard should happen? #include <stdio.h> #include <string.h> #include <assert.h> // required: == b // returns copy of both , b dest // (half of bytes of either pointers) int *copy2to1 (int *a, int *b) { // check input: // not pointers must equal assert (a == b); // representation must match int *dest; size_t s = sizeof(dest); assert(memcmp(&a, &b, s) == 0); // copy , b dest: // on "exotic" architectures, size does't have dividable 2 size_t half = s/2; // = floor(s/2), char *pa = (char*)&a, *pb = (char*)&b, *pd = (char*)&dest; // copy half of dest: memcpy (pd, pa, half); // copy half of b dest: memcpy (pd+half, pb+half, s-half)

boolean - php preg_match() acts weirdly -

i found this, when i'm working in regex validation on php. i've used preg_match function validate string. i've printed value returned preg_match ensure working flow. during i've found thing. can't understand concept. that preg_match() returns 1 if match found. otherwise return 0. print function didn't print anything. after gone through on php manual know of return value... there posted follow... preg_match() returns 1 if pattern matches given subject, 0 if not, or false if error occurred. and used var_dump know printed or not... this helped me know that's boolean false. but i'm curious know why returns boolean false, when i'm putting " ! " (not) before preg_match() ? following code, echo preg_match("/script/","script") // ===> returs 1 echo !preg_match("/script/","script") // ===> returns boolean false i think have return integer 0(zero)... me know function

regex - How to remove all whitespaces in string and get exactly one number?( Python) -

i have string. example: str= '\n 4 420 700 – 6 219 000 \n ' or '\n 4\xa0420\xa0700 – 6\xa0219\xa0000\xa0 \n' in case number: 4420700 . number can there. 3 333 999 233 , example. i had tried solution: >>> import re >>> re.sub(r'\d','',str) '4420700621900016' could me? do split , replace. >>> st = '\n 4 420 700 – 6 219 000 \n ' >>> re.sub(r'\d', '',st.split('–')[0]) '4420700' or st.split('–')[0].strip().replace(' ', '')

python - Override the value of a static variable while using decorator -

i've created class following: class simon: name = 'simon' @classmethod def says(cls, sentence): return '%s says: %s' % (cls.name, sentence) if want simon sit down , can this: >>> simon.says('sit down') 'simon says: sit down' to substitute simon name, say, eva , can subclass this: class eva(simon): name = 'eva' and result: >>> eva.says('stand up') 'eva says: stand up' now want change says said creating decorator called to_past_tense : class eva(simon): name = 'eva' def to_past_tense(self, func): def wrapper(*arg, **kw): present_tense = func(*arg, **kw) past_tense = present_tense.replace('says', 'said') return past_tense return wrapper @classmethod def says(cls, *arg, **kw): return cls.to_past_tense(cls, simon.says)(*arg, **kw) if this: >>> eva.

Android Map Api access -

i new software development , have question mobile development. creating app relies heavily on users location, uber, , wondering if needed api key google maps in order launch device map application , present data on top of it? to obtain user's location don't need google @ all, android sdk contains appropiate methods. if want open google map application app (leaving app, opening google maps), don't need api key. to display google maps in app, need api key. it's obtainable though, have @ the docs .