Posts

Showing posts from June, 2015

c# - String Join not working fine -

following code returns true, why? var inputs = new object[]{null, 1}; var output = string.join(",", inputs); console.writeline(output == "");//prints true > output = "" but following code working fine var inputs = new object[]{"", null, 1}; var output = string.join(",", inputs); console.writeline(output == "");//prints false > output = ",,1" is wrong in native implementation? from msdn : if first element of values null , join(string, object[]) method not concatenate elements in values instead returns string.empty . which special case overload using object[] . note isn't true other overloads, string[] one.

arm - snmpget: not found, but I do have the snmpget binary -

i compiled net-snmp , copy installation package arm based linux. because file system small deleted commands binaries except snmpd , snmpget. then on arm board when tried "snmpget" got error "not found". have snmpget binary. (net-snmp provides these) my question is, looks not going manual install using "yum" or "rpm". need use net-snmp installation package. "snmpget" binary on board. missing now? thank !!

visual studio 2010 - Raise compile error if braces not closed at end of file (C++) -

is there way raise warning or error if c++ compiler comes end of file without braces being closed? never use headers spill scope file , receive compiler warnings if happens accident. compiler msvc 2010, others might of interest too. // utilities.hpp namespace example { class utilities { } //<eof> -> should warn or error edit: willing put marker/pragma/macro @ end of each file, know brace level should 0. a reasonable method #define at_global_scope namespace { } because can appear @ global or namespace scope. unfortunately won't catch missing } namespace, catch class-case, missing parentheses , semicolons.

java - Handling API that throws two Exceptions with the same method, but without common interface -

i've been trying write logic regarding exception handling evernote java api . stumbled upon weird situation. there 2 exceptions - edamsystemexception , edamuserexception ( documentation link ) both of exceptions have method edamerrorcode geterrorcode() lack common interface method. i feels flaw in api design, since state of codes make sense edamsystemexception , others edamuserexceptions since not state edamerrorcode bounds exception, , shielding myself situation of codes use in both of exception types wanted write try-catch block: try { clientfactory.createnotestoreclient(); } catch (edamsystemexception | edamuserexception ex) { switch (ex.geterrorcode()) { case invalid_auth: case bad_data_format: .. case auth_expired: ... case rate_limit_reached: ... default: ... } } catch (texception ex) { ... } but (obviously) cannot call ex.geterrorcode() . instance checki

swift - What's the point of if let statements? -

i've read swift docs on optional binding it's incomprehensible me @ level of knowledge (and/or intelligence). what's difference between: var number:int? = 1 if let num = number { print("number \(number!)" } else { print("it must nil") } and var number:int? = 1 if number==nil { print("it must nil") } else { print("number \(number!)" } as far can tell, these work same, , @ least me second 1 more readable. , wouldn't ordinarily care this, if let prominent in basic tutorials it's useful, i'd know why. suppose had 2 optional values , b classic syntax if != nil { if a?.b != nil { here access a.b.blah } } new syntax if let blah=a?.b?.blah { use blah ... } it's shorter,more readable , more flexible

Building .mex file in Visual Studio 2015 for Matlab R2015A -

i'm trying build fork of caffe windows .mex file used in matlab (r2015a) code. in fork there .mexa64 files present, since i'm on windows machine have rebuild .mex / .mexw64 . i've got cmake work various dependencies , generate .sln project files. have visual studio 2015 installed. i tried solution: building matlab mex file in visual studio gives "lnk2019 unresolved external symbol _mexprintf referenced in function mexfunction"? i'm getting on 1000 errors of various types (syntax error, cannot open file, undeclared identifier, etc.), i'm doing wrong. how go creating .mexw64 files in vs2015 (or in matlab if possible)? edit : got rid of bunch of errors including dependency folders in configuration manager , following: https://github.com/bvlc/caffe/issues/1761 . still loads go..

Not able to add host using docker-machine -

i have docker-engine installed on linux vm on company data center. installed docker-machine on windows. want manage docker-engine through windows machine. want add host , executed following command: docker-machine create -d generic --generic-ip-address 10.51.227.5 --generic-ssh-port 22 --generic-ssh-user root compute but getting following error after waiting couple of minutes running pre-create checks... creating machine... (compute) no ssh key specified. connecting machine , in future require ssh agent contain appropriate key. waiting machine running, may take few minutes... detecting operating system of created instance... waiting ssh available... error creating machine: error detecting os: many retries waiting ssh available. last error: maximum number of retries (60) exceeded i don't know doing wrong. try using native ssh unfortunately, can happen multiple reasons, since you're running on windows, have guess. try using native ssh client - is, go libra

php - How to define function name using variable? -

how define function name (in php) using variable, this? $a='blabla'; function {$a}() {.......} or that? the way know give fixed name function use eval, not suggest. more likely, want stuff function in variable, , call that. try this: $a = function() { echo 'this called anonymous function.'; } $a(); edit : if want accessible other files, use global variable: $globals['variable_name'] = 'my_func_123'; ${$globals['variable_name']} = function() { echo 'this called anonymous function.'; }; // executing my_func_123() ${$globals['variable_name']}(); see also: http://php.net/manual/en/functions.anonymous.php

string - Python 2 vs Python 3 straight bytes converting -

i have python 2 code, works alright: # python 2 key = 'l\x1e@\xael\xc0\xa9\xa3\x8d\x9e5\xac\x00\xe5\x98h' # type(key) => <type 'str'> originally key random 32bytes value. , here share repr() values. so can use random bytes-like sequence string. when comes python3, incoming string in bytes: # python 3 key = b'l\x1e@\xael\xc0\xa9\xa3\x8d\x9e5\xac\x00\xe5\x98h' # type(key) => <class 'bytes'> and need convert string "as looks", without replacing characters. i tried though ascii: key_chuncks = [chr(s) s in key] # ['l', '\x1e', '@', '®', 'l', 'À', '©', '£', '\x8d', '\x9e', '5', '¬', '\x00', 'Ã¥', '\x98', 'h'] as see chr(s) interpretes bytes sequences characters , don't need behavior. there way, convert bytes string "as looks"? without character interpretation (decoding).

ios - UIImagePickerController shows text in UpperCase Letters "USE_PHOTO" , "RETAKE" and Gallery Images "CAMERA_ROLL"? -

Image
i using following code func pickerimage(type type : string , presentinvc : uiviewcontroller , pickedlistner : onpicked , canceledlistner : oncanceled){ self.pickedlistner = pickedlistner self.canceledlistner = canceledlistner let picker : uiimagepickercontroller = uiimagepickercontroller() picker.sourcetype = type == cameramode.camera ? .camera : .photolibrary picker.delegate = self picker.allowsediting = false presentinvc.presentviewcontroller(picker, animated: true, completion: nil) } i've faced same issue , problem was, need set "applelanguages" user defaults allow system frameworks load localized strings in same language set. used bundlelocalization library localization , main problem. link: https://github.com/cmaftuleac/bundlelocalization issue link: uiimagepickercontroller shows text in weird capital case thanks

scala - How do I normalize org.apache.spark.mllib.linalg.Vectors? -

it pretty easy normalize vectors in scala (scala.collection.immutable.vector) using map: val w = vector(3,4,5) /** l1 norm: **/ val w_normalized = w.map { _/w.sum } but can't perform same thing org.apache.spark.mllib.linalg.vector: if try it, error: error: value map not member of org.apache.spark.mllib.linalg.vector so, way normalize spark vectors?

I am not able to display image from my local storage in android -

Image
i have 20k image files in folder inside local storage, need display image file name local storage. how it? attached code here: if (environment.getexternalstoragestate() .equals(environment.directory_pictures)) { string filepath = file.separator + "sdcard" + file.separator + "android" + file.separator + "obb" + file.separator + "convertmp3todb" + file.separator + "ldoce6pics" + file.separator + filename; try { fileinputstream fis = new fileinputstream(filepath); string entry = null; while ((entry = fis.tostring()) != null) { if (!entry.tostring().isempty()) { file mytemp = file.createtempfile("tcl", "jpg", getcontext().getcachedir()); mytemp.deleteonexit(); fileoutputstream fos = new fileoutputstream(mytemp); (int c = fis.read(); c != -1; c = fis.read())

PHP Amazon SES Email Verification -

is there way verify email domain or send verification through api? client confirm email domain when create email campaign in website. i using php aws sdk v2. http://docs.aws.amazon.com/aws-sdk-php/v2/guide/service-ses.html $mailbox_email = 'email@yourdomain.com'; $aws_client = \aws\common\aws::factory(array( 'region' => 'eu-west-1', 'credentials' => array( 'key' => aws_access, 'secret' => aws_secret ) )); $ses_client = $aws_client->get('ses'); $ses_result = $ses_client->verifyemailidentity(['emailaddress' => $mailbox_email]); // set bounces, complaint, deliveries notification $ses_client->setidentitynotificationtopic(array( 'identity' => $mailbox_email, 'notificationtype' => 'bounce', 'snstopic' => 'arn:aws:sns:eu-west-1:9:ses_bounces' )); $ses_client->setidentitynotificationtopic(array( 'identity' =>

java - How to assign a javascript variable to a hidden input? -

i wanted store javascript variable hidden input field because wanted servlet. current code: html: <form action="myservlet"> <input type="hidden" id="id" value="" name="total"> <input type="submit" value="go!"/> </form> javascript: var = 2; document.getelementbyid('id').value=a; myservlet (java servlet): int count = integer.parseint(request.getparameter("total")); servletcontext context= getservletcontext(); request.setattribute("count", count); requestdispatcher rd= context.getrequestdispatcher("/newjsp1.jsp"); rd.forward(request, response); whenever click submit button, gives error numberformatexception because javascript variable not assigned hidden input field i'm trying using servlet. hope guys can me dilemma. thanks! you have add javascript after input hidden element render

excel - Resizing a screen image, from range of cells, on your clipboard before pasting into new sheet -

i have situation copying range of cells, selecting , copying them screen image, , pasting them new sheet , location. worksheets("lmc_model").range("g1:x34").copypicture xlscreen, xlpicture worksheets("pdf page").paste _ destination:=worksheets("pdf page").range("a26") this works well, screen image large , needs resized before pasting in final location. ways resize image before pasting? one option paste picture , resize it. since selected after pasting, can use afterwards: selection.shaperange.lockaspectratio = msofalse selection.placement = xlmoveandsize selection.shaperange.width = desiredpixelwidth selection.shaperange.height = desiredpixelheight

mysql - Subquery processing more rows than necessary -

Image
i optimising queries , found can't head around. i using following query select bunch of categories, combining them alias table containing old , new aliases categories: select `c`.`id` `category.id`, (select `alias` `aliases` category_id = c.id , `old` = 0 , `lang_id` = 1 order `id` desc limit 1) `category.alias` (`categories` c) `c`.`status` = 1 , `c`.`parent_id` = '11'; there 2 categories value of 11 parent_id , should 2 categories alias table. still if use explain says has process 48 rows. alias table contains 1 entry per category (in case, can more). indexed , if understand correctly therefore should find correct alias immediately. now here's weird thing. when don't compare aliases categories conditions, manually category ids query returns, process 1 row, intended index. so replace where category_id = c.id where category_id in (37, 43) , query gets faster: the thing can think of subquery isn't run on r

javascript - AJAX DELETE Method Redirect Not Working -

i trying fix jquery ajax command there click on <a href="#"> triggers delete request specific url have route setup , redirect new page. delete portion of ajax working correctly, reason, success portion interpreting redirect /app delete request. doesn't seem recognize get have set before url , defaulting delete . can me determine part of method incorrect? link: <a href="javascript:void(0);" id="card-delete-link"><span class="glyphicon glyphicon-trash" aria-hidden="true"></span>delete</a> jquery: <script type="text/javascript"> $(document).ready(function() { $('#card-delete-link').click(function(){ $.ajax({ method: 'delete', url: '/app/edit/{{card.cardid}}', success: function(){ console.log('annotation id: ' + '{{card.

ios - Why did UIImageView did not load properly using Swift -

basically want create road hero move on before game starts, user can see first steps, problem when post code in override func viewdidload load image appearance post in main.storyboard not code,using print shows images in place them need be, that's not see on screen. in alternative, place same code in @ibaction func play , after press play button images load them need be. here code put in viewdidload: @iboutlet weak var hero: uiimageview! @iboutlet weak var bigroad: uiimageview! @iboutlet weak var road: uiimageview! @iboutlet weak var roadtwo: uiimageview! @iboutlet weak var play: uibutton! override func viewdidload() { super.viewdidload() self.play.hidden = false self.hero.hidden = false self.bigroad.hidden = false self.road.hidden = false self.roadtwo.hidden = false self.hero.center.x = (width / 2) + 3 self.hero.center.y = ((height / 2.5) + (height / 3.5)) - 46 self.bigroad.center = cgpointmake(width / 2 , (height / 2.5) + (

doctrine2 - Doctrine 2 Entities ".php~" Files -

zend 2 latest doctrine 2 latest swagger latest windows xampp php 5.6 netbeans latest if generate entities, entity files updated, , additionaly, {entityname}.php~ file generated (mostly exact same file content). sometimes .php~ files outdated - older version of entity. as use swagger in project, read entities of given folder, complains double definition entities.. why .php~ files happen, , how can stop behaviour? try using "--no-backup" argument when generating entities command

scala - Finch: not enough arguments for method 'toService' -

i've made pretty simple rest-method using finch , finagle: val getusers:endpoint[list[user]] = get("users") {ok(getallusers())} http.serve(":8080", getusers.toservice) and got error: error:(50, 32) not enough arguments method toservice: (implicit ts: io.finch.internal.toservice[list[dal.instances.user.user]])com.twitter.finagle.service[com.twitter.finagle.http.request,com.twitter.finagle.http.response]. unspecified value parameter ts. http.serve(":8080", getusers.toservice) ^ any idea on how fix it? the compiler error little better in recent version of finch (0.10). if have following build config: scalaversion := "2.11.7" librarydependencies += "com.github.finagle" %% "finch-core" % "0.10.0" and setup: import com.twitter.finagle.http import io.finch._ case class user(id: string, name: string) def getallusers(): list[user] = list(user("111",

Wordpress upgrade to 4.4.2 failed -

my setup: os: centos 7.1 http user: apache http group: apache when perform automatic update, below error: downloading update https://downloads.wordpress.org/release/wordpress-4.4.2-new-bundled.zip … unpacking update… the update cannot installed because unable copy files. due inconsistent file permissions.: wp-admin/includes/update-core.php installation failed i have tried upgrade full permission no luck: #find . -type f -exec chmod 666 {} \; #find . -type d -exec chmod 777 {} \; anyone has clues? searched hours no luck. do not use 777 permission! wordpress need 755 directories, 644 files, , 666 themes , plugins directories & files. , give 600 wp-config.php security. can see wordpress documentation file permission i had problem, , how solved issues. make sure owned apache. sudo chown -r apache:apache /var/www/html/sitedir give proper permissions sudo find /var/www/html/sitedir -type d -exec chmod 755 {} + give 7

shell - Windows Batch sript that moves files based on a (partial char string) looking it up in a CSV/txt file -

what i'm looking might variation of solution: windows batch file sort files separate directories based on types specified in csv my situation: batch process in server creates files this: s0028513-010716-0932.txt. s stands summary, first 5 digits stand supplier, last 2 before hyphen stand distribution center. after hyphen, there date , after second hyphen timestamp. what need is: set variable month/year (e.g. 0716) (this has been set "set /p c:please enter mmyy:"). this part done. create folder subfolders (e.g. 0716\pharma, 0716\medical, etc). i've done part. look supplier number in csv file (e.g. s00285 above) and move file corresponding folder based on mmyy\pharma, etc. points 3 , 4 obvioulsy missing. practical example: there 3 folders files can moved: pharma, medical , consumer the csv file looks this: s00285 consumer s00286 pharma s00287 medical ... what want script month/year combination in variable c , take files correspond month/year

javascript - How to track events on mediaelement.js using their plugin and universal Google Analytics -

i trying implement google analytics event tracking on mediaelement.js audio player. have succesfully managed track clicks on links on page, love track how many people listen audio (without offering download link , no audio player). i believe have done right, apparantly have not, because it's not working. no events show in ga report. cannot find googling. found similar question on site ( how track events on mediaelement.js google analytics ), didn't me. can see mistakes are? maybe i'm doing fundamentally wrong here. here relevant html <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <script type="text/javascript" src="xrefthemes/theme1/src/jquery.js"></script> <script type="text/javascript" src="xrefthemes/theme1/src/mediaelement-and-player.min

android - Maximize the button in a gridlayout -

Image
i have activity: <?xml version="1.0" encoding="utf-8"?> <android.support.v7.widget.gridlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" app:rowcount="4" app:columncount="4"> <button android:text="1" android:id="@+id/button1" app:layout_gravity="fill" app:layout_rowweight="1" app:layout_columnweight="1" app:layout_row="0" app:layout_column="0""/> <button android:text="2" android:id="@+id/button2" app:layout_rowweight="1" app:l

android - How to keep a View on top of my Fragments -

Image
sounds question answered before research couldn't find solution. layout following: the main area container i'll add/replace fragments, , bottom place bottom navigation menu. pink view button need place on top of menu (and that's not working). every time add fragment main view, "menu" text disappears, though textview added after container view. same pink button, added after bottom menu container (see xml below). how can keep both "menu" textview , pink button on top of fragments? this xml: <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#eee" tools:context="com.wecancer.wecancer.activities.menu"> <framelayout android:id="@+id/main_container_view" android:lay

node.js - Visual Studio Shows Tons of JavaScript Errors for an ES6 project -

Image
i'm using node.js tools visual studio 2015. es6 features under node.js tools options turned on. i've tried turning them off too. i've tried setting javascript files not display syntax highlighting. visual studio displays tons of errors files containing es6 javascript (the content of files fine es6 standards). interestingly, if double click on of errors, message so, seems maybe vs "double-inspecting" these files...and second pass fails. because if open file in question solution explorer, there no run underlining anywhere in file? i've spent long time troubleshooting this. there way make visual studio work, little bit? what version of node.js tools visual studio using? may need update latest version . i had same problem version 1.1.31117.00, i'm not seeing anymore 1.2.40726.00.

selenium - validate dropdown elements from a string -

i clicked dropdown . now, how check expected string present in dropdown , , if element not present, display message: "this element not present" ? code: driver1.findelement(by.xpath("//span[contains(.,'work items')]")).click(); string[] expected = {"defect", "task", "story", "epic","design task"};

html - How to size flex-items without percentages? -

Image
i trying create flexbox-based grid, content being 2/3 width , side bar remaining 1/3. i have used percentages width in each col, unfortunately giving me errors in navigation , header. why this? , how can make without using percentages, avoid errors? codepen demo @import url(https://fonts.googleapis.com/css?family=open+sans:400,300,600,700); *, *:before, *:after { box-sizing: border-box; } html body { margin: 0; padding: 0; font-family: 'open sans', sans-serif; } h1, h2, h3, h4, h5, p, a, li, ul { margin: 0; padding: 0; } /* centres content of website in width of 950px */ .container { width: 80%; margin: 0 auto; } /* header styling */ header { background: #66b3ff; /* padding: 10px; */ } /* logo */ #logo h1 { font-weight: 300; margin-top: 30px; } #logo h1 span { font-weight: 600; } /* end of logo */ /* nav */ nav ul { margin: 0; padding: 0; display: f

java - Application crashes while deploying in heroku -

i have developed java based webapp. im trying push heroku test webapp. following pom.xml file content <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0</modelversion> <groupid>webmobilegroupchatserver</groupid> <artifactid>webmobilegroupchatserver</artifactid> <version>0.0.1-snapshot</version> <packaging>war</packaging> <build> <sourcedirectory>src</sourcedirectory> <plugins> <plugin> <artifactid>maven-war-plugin</artifactid> <version>2.6</version> <configuration> <warsourcedirectory>webcontent</warsourcedirectory> <failonmissingwebxml>false</failonmissingwebxml>

c# - Using [DebuggerHidden] prevents code coverage -

i have helper class 1 of methods has [debuggerhidden] attribute not show in call stack. /// <summary> /// encapsulates guard-clause logic conditions allow neat , tidy single line call /// </summary> public static partial class guard { /// <summary> /// checks if specified condition true. if /// system.argumentoutofrangeexception thrown /// argument name /// </summary> /// <example> /// guard.argumentoutofrange((collection.count == 1), "arg1"); /// </example> /// <param name="condition">if set <c>true</c> argumentoutofrangeexception thrown.</param> /// <param name="argumentname">name of argument.</param> /// <exception cref="argumentoutofrangeexception"></exception> [debuggerhidden] //does not appear @ in call stack public static void argumentoutofrange(boolean condition, [invokerparametername] string a

unit testing - Typescript: how to disable spec.ts file generation? -

i'm developing angular2 app typescript , every time run typescript transpiler creates spec.ts files. unit tests source files because convention angular2 applications have file each .ts file. since @ moment don't want test, temporaly disable generation of spec.ts files, bit messy handle source files. do know how that? edit: here tsconfig.json file: { "compileroptions": { "module": "commonjs", "target": "es5", "noimplicitany": true, "suppressimplicitanyindexerrors": true, "outdir": "dist", "rootdir": "./src", "sourcemap": true, "emitdecoratormetadata": true, "experimentaldecorators": true, "moduleresolution": "node" }, "exclude": [ "typings/main.d.ts", "typings/main", "node_modules" ] } you can con

amazon web services - Can't set SSH in AWS EB CLI -

when try set ssh keys on elastic beanstalk cli, got error instead: error: ssh not installed. must install ssh before continuing. i don't error before. maybe before, ssh got installed automatically when install other things, somehow missed now. i can solve installing ssh using openssh binary version windows here: http://www.mls-software.com/opensshd.html

Symfony controller unables to receive AngularJS form post data -

trying send $http.post request angularjs form symfony controller add form content database. can success response "status": 200 @ angularjs side. however, @ symfony controller, $request->getcontent() empty, returns nothing; $request->getmethod() returns 'get', doesn't make sence me. how can post data in symfony?? p.s. installed fosrestbundle , enabled body listener, param fetcher listener. i know question duplicated post ajax request angularjs symfony controller , 2 answers of post didn't work me. my blog.html.twig, <form name="replyform" ng-submit="sendreply(blog.id)"> preview: {{'{{reply.content}}'}} <br><br> reply: <input type="text" name="content" ng-model="reply.content" /> <input type="submit" value="reply" /> </form> blog.js, $scope.reply = {}; $scope.sendreply = function(blogid){ $scope.reply.b

angularjs - Use same functions over different arrays in Angular directive -

i'm new angularjs , i'm having difficulties when trying reuse functions on different arrays,actually 1 array , has 2 more inside him.can tell me i'm wrong,please.thank you. <body ng-controller="mainctrl mainctrl"> <my-dates ng-repeat="item in mainctrl.list"></my-dates> </body> app.directive('mydates', function() { return { // scope:{options:'&'}, restrict:'e', template:'<table class="mytable">' + '<tr>'+ '<th><input type="checkbox" ng-model="selectedall" ng-click="mainctrl.checkall()"></th>'+ '<th>start date:</th>'+ '<th>end date:</th>'+ '<th>hours:</th>'+ '<th>status:</th>'+ '</tr>'+ '<tr ng-repeat = "items in item">&

html - Background-image won't show -

i'm trying have background image in header of website of won't show. file setup follows: d:\ mywebsite image, home.css, index.html image rocks.jpg the code have : <div class="header-image" style=background-image: url("../image/rocks.jpg")> </div> edit css: #header .header-image { width: 100%; height: 400px; background-position: left center; background-size: 100%; background-repeat: no-repeat; } your style attribute should have quotation marks around in-line css, , .. in file path sending directory (and must removed), so: style = 'background-image:url("image/rocks.jpg");' edit: note must use single quotes surround css or double quotes within url("image/rocks.jpg") interpreted closing quotes.

sonarqube - How do I add the deprecated Resharper plugin to sonar, manually? -

Image
the resharper plugin 2.0 sonar marked deprecated, untill new pops up, use it. or @ least testdrive it. the plugin still available on github page https://github.com/sonarqubecommunity/sonar-resharper , downloaded jar , dropped extensions\plugins folder, picked valid plugin. but resharper.xml rules result never picked up. doing wrong? not supported "xcopy" deploy jar plugins? i else in solutions analyzed , imported sonar, including code coverage. using resharper console tool, generate report, , solution file , report, tell sonar use, there, @ correct location. i can see sonar-project.properties generated msbuild sonar runner knows resharper files known. sonar.verbose=true sonar.cs.vscoveragexml.reportspaths=d:\\builds\\1\\tsv.net\\msmqmonitor\\testresults\\visualstudio.coveragexml sonar.resharper.cs.reportpath=d:\\builds\\1\\tsv.net\\msmqmonitor\\testresults\\resharper.xml sonar.resharper.solutionfile=d:\\builds\\1\\tsv.net\\msmqmonitor\\sources\\msmqmonitor.sln

.htaccess - RewriteCond and RewriteRule to do a permanent redirect to https://www. and keep the query string -

i using mod_rewrite condition/rule shown below redirect url www equivalent , ensure https. rewritecond %{http_host} ^example.com [nc] rewriterule ^(.*)$ https://www.example.com/$1 [l,r=301,nc] this, example, converts example.com/foo/bar https://www.example.com/foo/bar , works fine. however, if link includes query string (eg, http://example.com/foo/bar?x=baz&y=qux ), query string not appended. how can modify rewritecond/rewriterule above http://example.com/foo/bar?x=baz&y=qux automatically converted https://www.example.com/foo/bar?x=baz&y=qux query string appended? have tried adding qsa (query string append) flag in rewrite rule , doesn't help. you need qsa flag (query string append) rewritecond %{http_host} ^example.com [nc] rewriterule ^(.*)$ https://www.example.com/$1 [l,r=301,nc,qsa] second option rewriterule ^(.*)$ https://www.example.com/$1?%{query_string} [l,r=301,nc]

python - How to save an animation as gif and show it at the same time? -

i wrote code generates , shows matplotlib animation. able save animation gif. however when these 2 actions sequentially (first saving gif, , showing animation, because plt.show() blocking call, shown animation doesn't start beginning; seems it's first used gif saving routine. my idea show animation in window using plt.show() , , save same animation gif disk (before, or ideally during animation). i've tried solve using threads or creating new figure, wasn't able pull off - shown animation modified saving routine. also, putting plt.show thread didn't work (because handles drawing screen, suppose, needs in main thread). here's code i'm using: import matplotlib.pyplot plt matplotlib import animation visualizer import visualize import updater def run(k, update_func=updater.uniform, steps=1000, vis_steps=50, alpha_init=0.3, alpha_const=100, alpha_speed=0.95, diameter_init=3, diameter_const=1, diameter_speed=1, xlim

qt - QML importing module -

i want import custom module in main.qml file. main.qml located under "/" prefix of qml.qrc resource. my custom module config.qml located within config subdirectory. ( config directory main.qml is, i.e. /path/to/main/config/config.qml . the config.qml , qmldir files stored under prefix myprefix in qml.qrc file. project |- config |- config.qml |- qmldir |- main.qml also created qmldir file according documentation http://doc.qt.io/qt-5/qtqml-modules-identifiedmodules.html necessary. here config.qml , qmldir files. config.qml pragma singleton import qtquick 2.0 qtobject { property int myvariable: 10 } qmldir singleton config 1.0 config.qml when want import custom module as mymodule in main.qml file. import "???" mymodule how can that? have suggestion? edit: qrc file <rcc> <qresource prefix="/"> <file>main.qml</file> </qresource> <qresource prefix="/myprefix&

html - How do I apply bootstrap's clearfix to my code? -

i'm using wysiwyg editor in project, , part of editor includes option set images' position left, right, inline. when choose left, gives float-left feature. i'm wondering how can make div containing content automatically expands allow floating images. below code posts partial use in project <div class="thumbnail"> <div class="text"> <%= link_to post.title, post_path(post), class: "h1" %> <p class="pull-right"><span class="glyphicon glyphicon-time"></span> posted on <%= post.created_at.to_formatted_s :long %></p> <hr> <p><%= post.content.html_safe %></p><hr> <p> <% post.tags.any? %> <div class="btn-group btn-group-xs" role="group" aria-label="..."> <% post.tags.each |tag| %> <%= link_to tag.name, tag_path(tag), class: "btn

c# - StackExchange redis client very slow compared to benchmark tests -

i'm implementing redis caching layer using stackexchange redis client , performance right bordering on unusable. i have local environment web application , redis server running on same machine. ran redis benchmark test against redis server , results (i'm including set , operations in write up): c:\program files\redis>redis-benchmark -n 100000 ====== ping_inline ====== 100000 requests completed in 0.88 seconds 50 parallel clients 3 bytes payload keep alive: 1 ====== set ====== 100000 requests completed in 0.89 seconds 50 parallel clients 3 bytes payload keep alive: 1 99.70% <= 1 milliseconds 99.90% <= 2 milliseconds 100.00% <= 3 milliseconds 111982.08 requests per second ====== ====== 100000 requests completed in 0.81 seconds 50 parallel clients 3 bytes payload keep alive: 1 99.87% <= 1 milliseconds 99.98% <= 2 milliseconds 100.00% <= 2 milliseconds 124069.48 requests per second so according benchmarks looking @ on 100,