Posts

Showing posts from April, 2012

javascript - Morris line chart with php query data -

i'm developping curve through database data works great bu i'm having problem refreshing data dynamically, each time new value inserted in table want load automatically without refreshing page. here index.php file : <!doctype html > <html lang="en" > <head> <title> line chart </title> <meta charset="utf-8" > <link href="css/style.css" rel="stylesheet" type="text/css" /> <link rel="stylesheet" href="/css/timeout.css" /> <link href="http://cdn.oesmith.co.uk/morris-0.4.1.min.css" rel="stylesheet" /> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script> <script src="http://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script> <script src="http://cdn.oesmith.co.uk/morris-0.4.1.min.js&

javascript - Error: [ng:areq] Argument 'DepartmentCustomReportController' is not a function, got undefined in Internet Explorer -

i'm facing error in internet explorer , when try same controller in chrome working fine. index.html : <script src="assets/js/boostrapjs/jquery-1.11.1.min.js"></script> <script src="assets/js/boostrapjs/angular.js"></script> <script src="assets/js/boostrapjs/ngdialog.js"></script> <script src="assets/js/boostrapjs/angular-route.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/angular-google-chart/0.1.0/ng-google-chart.min.js" type="text/javascript"></script> <script src="assets/js/boostrapjs/ui-bootstrap-tpls.js"></script> <script src="assets/js/boostrapjs/angular-animate.js"></script> <script src="assets/js/boostrapjs/angular-touch.js"></script> <script src="assets/js/boostrapjs/angular-ui-router.js"></script> <script src="app/components/a

javascript - how to add two functionality on single click of radio button -

i want add 2 functionality 1 checkbox 1 backend , 1 frontend 1st after clicking shows option on front-end , 2nd after clicking shows table enter data in backend if understood right, want click 2 times on same element, result in 2 differents pre-defined actions. to so, need call function keep track of number of times clicked it. let clickcount = 0; function onclick(e) { clickcount++; if (clickcount === 1) { showoptionsonfrontend(); //your first action } else if (clickcount === 2) { showtable(); //your second action } } is need? a more detailed question lead more precise answers though.

python - unittest: wxpython's event method raises exception but assertRaises does not detect it -

i have wxpython dialog raises typeerror exception when clicking ok button. test occurrence of exception unittest test not work expected. output shows exception raised. anyhow unittest notifies test fails: "c:\program files (x86)\python\python.exe" test.py traceback (most recent call last): file "test.py", line 22, in on_ok raise typeerror( 'typeerror raised' ) typeerror: typeerror raised f ====================================================================== fail: test_should_raise (__main__.cdlgtest) ---------------------------------------------------------------------- traceback (most recent call last): file "test.py", line 34, in test_should_raise self._dut.m_button_ok.geteventhandler().processevent( event ) assertionerror: typeerror not raised ---------------------------------------------------------------------- ran 1 test in 0.005s failed (failures=1) here reduced sample of code: import unittest import wx class cdlgb

SFTP in Camel populates wrong parent folder for a file -

using camel sftp consumer polls remote folder files, have following endpoint configuration: sftp://user@server:22\ ?password=xxx\ &delete=false\ &move=.done\ &localworkdirectory=/tmp\ &delay=60000 ( \ wrap end lines in yaml, gets stitched on 1 line.) with setup when file gets downloaded user's home directory, tries move remote file .done directory (as per camel documentation, ".done" should enough). however, exception: org.apache.camel.component.file.genericfileoperationfailedexception - cannot create directory: /.done (could because of denied permissions) i have permissions since create directory , rename file manually using interactive sftp command in bash. i have debugged through camel's processing , found out parent folder of file (camelfileparent header) evaluated "/" means final path rename file evaluated "//.done/some-file-name.csv" . is, of course, wrong , fails above exception.

xml - Need to create multiple excel .xls file using XSLT -

the following sample xml file <?xml version="1.0"?> <mt_test_in> <record> <name>aashish</name> <age>25</age> <place>chennai</place> </record> <record> <name>satheesh</name> <age>25</age> <place>coimbatore</place> </record> </mt_test_in> i need 2 excel files based on text of name element. <?xml version="1.0" encoding="utf-8"?> <?mso-application progid="excel.sheet"?> <xsl:stylesheet version="1.0" xmlns:html="http://www.w3.org/tr/rec-html40" xmlns:xsl="http://www.w3.org/1999/xsl/transform" xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"> <xsl:template match="/&q

c++ - No idea what this pointer could be pointing to and unable to interpret the result -

this given past question in exam i'm unable understand result obtained of last 4 printf functions. conversion hexadecimal first 2 don't see how there characters @ ptr[0] ptr[3] this section of code compiled , run. int main(int argc, char *argv[]){ typedef unsigned char byte; unsigned int nines = 999; byte * ptr = (byte *) &nines; printf ("%x\n",nines); printf ("%x\n",nines * 0x10); printf ("%d\n",ptr[0]); printf ("%d\n",ptr[1]); printf ("%d\n",ptr[2]); printf ("%d\n",ptr[3]); return exit_success; } and corresponding output 3e7 3e70 231 3 0 0 when byte * ptr = (byte *) &nines; set address of ptr same address of nines . has value of 999 , in hex 0x3e7 from problem, assuming int has 4 bytes , little endian system. i.e. bytes stored this. --------------------------------- | 0xe7 | 0x03 | 0x00 | 0x00 | ---------------------------------

Best way to compare a in a list of list and add a different value with python -

i'm importing csv has duplicate values in second column , add corresponding values in column 1. 64052,10.10.10.10,red 3802,192.168.10.10,blue 488,10.10.10.10,red i've imported csv values list of lists below: import csv out = open('example1.csv','rb') data = csv.reader(out) data = [[row[0],row[1],row[2]] row in data] out.close print data ['64052', '10.10.10.10', 'red'], ['3802', '192.168.10.10', 'blue'], ['488', '10.10.10.10', 'red'] what's best way go through lists , if "second" [1] value matches, add values "first" [0]? this expected output i'm trying accomplish: ['64540', '10.10.10.10', 'red'], ['3802', '192.168.10.10', 'blue'] you can using pandas : import pandas pd df = pd.dataframe([('64052', '10.10.10.10', 'red'), ('3802', '192.168.1

javascript - Close react native modal by clicking on overlay? -

is possible close react native modal clicking on overlay when transparent option true ? documentation doesn't provide it. possible? if understood correctly, want close modal when user clicks outside of it, right ? if yes, searched time ago , solution remember 1 (which 1 i've been using far): render() { if (!this.state.modalvisible) return null return ( <view> <modal animationtype="fade" transparent={true} visible={this.state.modalvisible} onrequestclose={() => {this.setmodalvisible(false)}} > <touchableopacity style={styles.container} activeopacity={1} onpressout={() => {this.setmodalvisible(false)}} > <scrollview directionallockenabled={true} contentcontainerstyle={styles.scrollmodal} > <touchablewithoutfeedback>

node.js - how to get the path of an installed npm package via npm CLI/API? -

this question has answer here: node.js: (absolute) root path of installed npm package 2 answers i'm writing npm script, packed npm package, exposing main executable node_modules/.bin hosting project. this script has own npm dependencies, , script flow relies on copying 1 of these dependencies different location, needs know dependency installed. how can find (via api or npm cli) dependency installed inside host's node_modules ? see a more elaborated answer here . answer kept reference. you can use npm ls --parseable flag, will: show parseable output instead of tree view. for example: $ npm ls my-dep -p /users/my-user/dev/host-project/node_modules/my-dep you should aware command can output irrelevant errors stdout (e.g. extraneous installations) — work around this, activate --silent flag (see loglevel in docs): $ npm ls my-de

full text search - Elasticsearch document modelling options -

i know best practices when designing data model indices in elasticsearch. have system in need pull data cloud storage systems(eg:dropbox),social media(eg:twitter),articles web etc. the design issue facing each type of docs have different fields/mapping. some of options i've explored. use different types under single index since having different doc structure(eg : elastic types facebook,twitter,drobpox,googledrive etc.).this tend add lot of types under index. use dynamic mapping index add fields whenever necessary. , use same mapping docs. in case,most of fields null.(eg: elastic document storage social media specific fields null). use different indices different data points. in case, there lots of indices. i know of these options best in our use-case. consideration search , indexing performance , scalability. appreciated.

css li:before with direction from right to left -

i wrote code remove decimal point ordered list. code: ol { list-style-type: none; counter-reset: level1 } ol li:before { content: counter(level1) " "; counter-increment: level1; } it don't show decimal point showed number's direction left right below 7 xxxxx 8 xxxxx 9 xxxxx 10 xxxxx 11 xxxxx desired result: right left notepad++ line numbers 7 xxxxx 8 xxxxx 9 xxxxx 10 xxxxx 11 xxxxx i have tried css "direction: rtl" not worked. ideas on how achieve this? much! try following solution: ol { list-style-type: none; counter-reset: level1; } ol li:before { content: counter(level1) "."; counter-increment: level1; display:inline-block; text-align:right; min-width:20px; } <ol> <li>test 1</li> <li>test 2</li> <li>test 1</li> <li>test 2</li> <li>test 1</li> <li>test 2</li> <li&

angularjs - Uploading file on Step in Bonita -

Image
i upload , download file. know fileuploaddownload example required upload document on step not on instantiation form.how can achieve have made contract on step , assigned document variable initialized @ pool level, not working. gives error "error submitting form". new bonita anybody. steps process building given follows: step 1: step 2: step 3: step 4: error: when submit form error generates given follows: to solve issue, need remove contract inputs on process instantiation, change default value document variables , remove process instantiation form: remove contract inputs select pool. go execution -> contract. remove file inputs. document variables default value select pool go data -> documents for each variable, edit -> select none in initial content process instantiation form select pool go execution -> instantiation form remove current target form that should trick :) also, check new version of file upload

angularjs - running jasmine client test with karam that publishing by express -

i have angular app use in express.js publishing it's, express.static . now want run client testing ( jasmine ) karma . but problem it's client depends server url it's possible run karma on express server ? or other idea ? i know it's not best situation project huge , other change it's terrible. thanks answer, david lopez

android - BitmapFactory.decodeFile() not working with AdobeImageIntent.EXTRA_OUTPUT_URI -

i updated adobecreativesdk latest version support android nougat. after edit image in editor try edited bitmap using following code in onactivityresult: mimageuri = data.getparcelableextra(adobeimageintent.extra_output_uri); bitmap bitmap = bitmapfactory.decodefile(mimageuri.getpath()); if(bitmap!=null) { bytearrayoutputstream baos = new bytearrayoutputstream(); bitmap.compress(bitmap.compressformat.jpeg, 100, baos); imagebytes = baos.tobytearray(); playanimation(); } before updating latest version using data.getdata() instead of data.getparcelableextra , working fine android marshmallow. bitmap returned null. have set uri of image how has been mentioned in post : https://inthecheesefactory.com/blog/how-to-share-access-to-file-with-fileprovider-on-android-nougat/en . tried resizing bitmap using bitmapfactory.option

c# - How can I split date range into months -

now many date range data(datatable) this: startdate: enddate: 2016-06-12 2016-08-13 2016-01-12 2016-03-13 ... how can sum total days in each month in year? january november. datatable dtdaterange = ds1.tables[0]; //create months int[] count = new int[12]; //loop data (int = 0; < dtdaterange.rows.count; i++) { datetime starttime = ((datetime)dtdaterange.rows[i]["startdate"]); datetime endtime = ((datetime)dtdaterange.rows[i]["enddate"]); (int = starttime.dayofyear; < endtime.dayofyear; a++) { count[starttime.month-1] = count[starttime.month-1] + 1; } } foreach (int c in count) { console.writeline(c); } console.readkey(); maybe this. i've written in notepad i'm not sure compile. maybe you'll need fix here , there. can use list add dates loop conta

php - Making IF ELSE statement with combinations of choice -

currently i'm making application suggest car suits users' preferences based on selection. i'd skip html form choices follow: type: mpv, suv, sedan passengers: 5, 7 engine: gasoline, diesel budget: low, medium, high, luxury here i'm trying make combination because want every single choice counts. therefore i've done far: if (isset($_post['submit']) { $type = $_post['type']; $passengers = $_post['passengers']; $engine = $_post['engine']; $budget = $_post['budget']; if ($type == 'mpv' && $passengers == 5 && $engine == 'gasoline' && $budget == 'low') { // execute function here } else if ($type == 'mpv' && $passengers == 7 && $engine == 'gasoline' && $budget == 'low') { // execute function here } else if ($type == 'mpv' && $passengers == 5 && $engine == 'diesel' &&

sqlite - Query field text which is part from a longer text -

i have table productname , prductid productname | productid | 1 b | 3 c | 7 d | 8 i have text string product list string = "1,8,7". need sqlite search statement return records has productid 1 ,8 , 7 , ie return records a,c,d.

dotnet cli - How do you store user app data in .net core console app -

my scenario i'm building small cli app want able store user specific data in kind of user local cache. i guess i'm looking similar environment.specialfolder.applicationdata path, in dotnet core , cross platform friendly. i know not same, solved storing data in application folder so: var userdatapath = path.combine(appcontext.basedirectory, "userdata.json"); of course can take subfolder of appcontext.basedirectory .

java - JDK compiler fails for "open" module -

using current jdk build 9-ea+143 's javax.tools.javacompiler tool, can compile simple (empty) example module without error: module com.foo.bar { } if add open in: open module com.foo.bar { } ...the compiler error reads: /module-info.java:1: error: class, interface, or enum expected open module com.foo.bar { ^ syntax based on http://cr.openjdk.java.net/~mr/jigsaw/spec/lang-vm.html is current jdk 9 build not up-to-date spec or missing option passed javacompiler ? to newest jigsaw features, need use the jigsaw ea build (as opposed the regular ea builds ). created github repo exploring open packages , modules (to make reflection work) , wrote it - works on b146.

add - Make a Button that creates and places new Buttons with the Mouse -

hello can me: i m trying create simple application in vb, make button, creates , places new buttons using mouse alocating them. also assigning new buttons function autoerased, let's popup window , remove text button. public class form1 dim bmp new drawing.bitmap(640, 480) dim gfx graphics = graphics.fromimage(bmp) dim dynamicbutton new button private sub button1_click(sender object, e eventargs) handles button1.click gfx.fillrectangle(brushes.white, 0, 0, picturebox1.width, picturebox1.height) picturebox1.image = bmp end sub private sub picturebox1_click(byval sender system.object, byval e eventargs) handles picturebox1.click dynamicbutton.location = new point(mouseposition.x - me.location.x - picturebox1.location.x - 28, mouseposition.y - me.location.y - picturebox1.location.y - 50) dynamicbutton.height = 20 dynamicbutton.width = 100 dynamicbutton.backcolor = color.blue dynamicbutton.

ios - remove view controller from navigation controller -

i have 5 view controllers in navigation controller, , want remove pages 3 , 4 on page five.the problem below code is, if remove index 3 , index 4 , on page five.i no button on top anymore.i should getting button page 2 again.but no. solution? thank provided.appreciated. error driving me crazy navigationcontroller!.viewcontrollers.remove( at: 3 ) navigationcontroller!.viewcontrollers.remove( at: 4 ) i think cleaner way modify array of viewcontrollers , set them on navigation controller this.. if let nav = self.navigationcontroller { var stack = nav.viewcontrollers // index starts @ 0 page 3 index 2 stack.removeatindex(2) stack.removeatindex(3) nav.setviewcontrollers(stack, animated: true) } i tested on 1 of navigation stacks , button retained, assume due setviewcontrollers method doing it's thing , setting stack you.

java - What is the best way to keep/validate user login credentials in our application -

what best way keep/validate user login credentials in web application using mysql database , jsp/servlet front end. i have gone through couple of blogs , says not practice encrypt md5 , store user password might have collision attack. how can implement robust , secure login end use. it subjective discussion , answere depends upon existing system : best option hashing . store password in hashed format(use latest hashing mechanism , java 8 has encluded 1 ) , store in db. hash incoming password , mached hashed 1 stored in db .

mocking - mockito for spring components without interface -

i have used mockito mocking @autowired injection , works fine interface based injection if try mock spring @component ( not implement interface ) , mocking fails. is possible mock such component have @component annotation not implementing interface ?

ionic2 - Encryption with Ionic 2 -

i looking implement encrypt/decrypt functionality in ionic 2 app. looking simple, work ionic 2. please can recommend library/plugin works ionic 2? i have tried few libraries, cannot them work in ionic 2. have issues import ionic 2. e.g. using js-jose , following error: typeerror: argument 3 of subtlecrypto.wrapkey not implement interface cryptokey using crypto-js , following error: javascript library of crypto standards implementation for storing data on device, can switch secure storage cordova plugin instead of insecure localstorage. note android, need have either pin or swipe screen lock set make work. ionic add plugin cordova-plugin-secure-storage cordova-plugin-secure-storage dont forget wrap plugin inside platform.ready() constructor(public platform: platform) { platform.ready().then(() => { this.securestorage = new securestorage(); this.securestorage.create('demoappstorage').then( () =

java - org.eclipse.swt.Browser opens in read-only mode -

in eclipse-plugin project trying open org.eclipse.swt.browser.browser , , able open it. open in read-only mode. now want make editable. how can make editable platformui.getworkbench().getdisplay().asyncexec(new runnable() { public void run() { shell activeshell = platformui.getworkbench().getactiveworkbenchwindow().getshell(); try { display display = activeshell.getdisplay(); shell shell = new shell(display); browser browser = new browser(shell, swt.none); browser.seturl("htttp://www.sample.com"); } catch (coreexception e) { e.printstacktrace(); } } } how can solve @svasa editable - not able type thing on it. opening http://mail.google.com , want type username , password.

html - How to apply an `onclick` event to multiple radio button options in Scala Play? -

i'm using play framework in scala. have radio button lets choose between 2 options form: @helpers.inputradiogroup(searchform("options"), seq("option1" -> "option 1", "option2" -> "option 2")) i have form doesn't use helpers , has onclick events send data google analytics depending on option choose: <form> <input type="radio" name="option1" onclick="ga('send', 'event', { eventcategory: 'searchform', eventaction: 'options', eventlabel: 'option1'})" value="@searchform("options")">option 1<br> <input type="radio" name="option2" onclick="ga('send', 'event', { eventcategory: 'searchform', eventaction: 'options', eventlabel: 'option2'})" value="@searchform("options")">option 2<br> </form> my que

java - No recommendation in a simple Mahout item-based recommender -

i'm testing simple mahout item-based recommender 4 items , 1 user: model following: 1,00,5.0 1,01,5.0 so, user 1 "appreciated" item 0 , 1. the java code following: datamodel model = new filedatamodel(new file("datatest2.txt")); collection<itemitemsimilarity> similarities = new arraylist<>(); similarities.add(new itemitemsimilarity(0, 1, +1.0)); similarities.add(new itemitemsimilarity(0, 2, +1.0)); similarities.add(new itemitemsimilarity(0, 3, -1.0)); similarities.add(new itemitemsimilarity(1, 2, +1.0)); similarities.add(new itemitemsimilarity(1, 3, -1.0)); similarities.add(new itemitemsimilarity(2, 3, -1.0)); genericitemsimilarity sim = new genericitemsimilarity(similarities); recommender recommender = new genericitembasedrecommender(model, sim); list<recommendeditem> recommendations = recommender.recommend(1,1); system.out.println("list "+recommendations.size()); (recommendeditem recommendation : recommendations) {

mysql limitation varchar memory -

are differents in stored memory between varchar(30) , varchar(255) example in creating tables if fields adapts number of letters. example: i have created 2 tables 1 field name, in first table name varchar(255), in second varchar(30). store 3 values in both: -'one' -'two' -'three' and question is, differents between these 2 tables in memory? have perplexity because in programming languages if declare type example int 4 bytes.

Express.JS AND Ember.JS working together? -

i work express.js (and pug views). now i've stumbled upon ember.js , starting it. is there way of connecting them? i mean need mix them somehow? thanks, folks. this rather broad question , can (most likely) lead opinionated answers, i'll try remain on track. these tools serve different purpose, see 3 cases can used together. there might other cases, mileage may vary. express used serve ember assets through views this case use express backend server. if need serve ember application using server logic, 1 way go. example, may want have authentication part done express (e.g. not ember), let's restrict access parts of express application: assets, pages, or ember application. and end rendering dynamic templates script tag sourcing static ember application. any other combination of language/server works here, choosing express matter of taste. your ember application consumes api again, assume write api using javascript, , want serve using

Excel - calculating the median without removing duplicates -

i have table looks this: id total 3 3 3 3 3 3 4 11 4 11 4 11 4 11 4 11 4 11 6 9 6 9 7 13 7 13 7 13 7 13 7 13 7 13 7 13 7 13 7 13 7 13 7 13 7 13 7 13 i calculate median of column b (total), excluding duplicate combinations of columns , b. achieved constructing table below, , calculating median table. id total 3 3 4 11 6 9 7 13 is there way of obtaining median without having go through process of manually deleting duplicates? =median(if(frequency(match(a2:a25&"|"&b2:b25,a2:a25&"|"&b2:b25,0),row(a2:a25)-min(row(a2:a25))+1),b2:b25))

linux - docker-engine runlevel:/var/run/utmp: No such file or directory -

i trying install docker on virtual instance of ubuntu 14.04 service provider may have modified of default underlying init system or filesystem. when trying apt-get install of latest docker-engine, these errors below. ideas try? my installation steps: sudo apt-get install --yes apt-transport-https ca-certificates sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118e89f3a912897c070adbf76221572c52609d echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list sudo apt-get update apt-cache policy docker-engine sudo apt-get install --yes linux-image-extra-$(uname -r) linux-image-extra-virtual 1 giving errors one: 125 dnanexus@job-f0qpj700vbp11ffqk1b9ppyj:~⟫ sudo apt-get install --yes docker-engine readi

Replace matrix entries in Matlab based on their value and their index -

in matlab, want replace entries in matrix values equal row index one, , others zero. for example a = [3 1 4 2 2 5 1 3 3]; and want have b = [0 1 0 1 1 0 0 1 1]; is there way efficiently? bit more generic: matlab before r2016b: b = bsxfun(@eq, a, (1:size(a,1)).'); matlab r2016b , later: b = ( == (1:size(a,1)).' );

sabre - Authentication error on EnhancedAirBookRQ -

i used binarysecuritytoken enhancedairbookrq, receive usg_authorization_failed . used same token bargainfindermaxrq , worked. should set of test credentials sequence provided here ? request: <soapenv:envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sec="http://schemas.xmlsoap.org/ws/2002/12/secext" xmlns:mes="http://www.ebxml.org/namespaces/messageheader" xmlns:ns="http://www.opentravel.org/ota/2003/05"> <soapenv:header> <sec:security> <sec:binarysecuritytoken>--token--</sec:binarysecuritytoken> </sec:security> <mes:messageheader> <mes:from> <mes:partyid type="urn:x12.org:io5:01">from</mes:partyid> </mes:from> <mes:to> <mes:partyid type="urn:x12.org:io5:01">ws</mes:partyid> </mes:to>

ruby on rails - Capistrano linked_dirs doubles end of path -

i upgraded rails 5 , capistrano 3.5. now im facing issue, every folder in :linked_dirs gets double-symlinked: in deploy.rb set :linked_dirs, fetch(:linked_dirs, []).push('log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'vendor/bundle', 'public/system', 'public/uploads') this results in: ✔ 02 user@example.com 0.023s ✔ 04 user@example.com 0.023s 05 ln -s /var/www/app-dir/shared/tmp/cache /var/www/app-dir/releases/20161108113840/tmp/cache ✔ 05 user@example.com 0.025s 05 ln: 05 failed create symbolic link '/var/www/app-dir/releases/20161108113840/tmp/cache/cache' 05 : file exists it searched documentation, stack overflow , github issues hours now.. the behaviour same for: append :linked_dirs, "log", "tmp/pids", "tmp/cache" ... i tried capistrano 3.4, 3.5 i removed whole app-dir (then worked 1 deployment) i removed specific code in deploy.rb i removed :linked_dirs

internet explorer - Yammer Embed login Popup Not Working in IE -

i using yammer embed code show yammer embed feeds. the login pop working fine in firefox , chrome when tested site in ie 11, when click on login pop dialog box coming like: the webpage viewing trying close tab? want close tab? when click on "yes" dialog box disappears , nothing happens. when add //*.yammer.com , //*.assets.yammer.com in trusted sites, problem solved. but there other option solve issue? there isn't option. happening due design of internet explorer, , interactions across domains required complete authentication yammer. you had add domains listed, others using yammer embed may need add additional domains listed in fqdn documentation. thorough method resolution of type of problem analyze actual domains used requests , include in mutually agreeable zones. it's worth pointing out adding domains trusted sites not correct. adding domains used mutually agreeable domains more technically correct, can mean need remove domains intr

c++ try/catch ignorance in iOS -

in our app have c++ static library , use objective-c++ work it. c++ library utilizes rapidjson parse xml data: try { rapidjson::document document; document.parse(connection.data.description); connection.opentime = document["openfrom"].getint(); connection.closetime = document["opento"].getint(); return true; } catch (std::exception e) { connection.opentime = 0; connection.closetime = 0; return false; } the problem if document["openfrom"] cannot converted int via getint() method, exception not raised. instead of app crashes sigabrt. assertion failed: (data_.f.flags & kintflag), function getint, file /users/xxx/xxx/xx/ios/../src/rapidjson/document.h, line 1645. on android os, btw, in same case exception raised successfully. problem? guess issue in xcode's swift compiler behavior. as stated in log provided – not crash ,

html - How to change layout as per the selected paper size while printing? -

i want automatically change layout landscape selected paper size tabloid , portrait when selected paper size letter. the problem following css hides both layout , paper size options on chrome. selects "letter" paper size default , keeps layout portrait. @media print { @page {size: portrait} } there no way can keep paper size option open, control layout option code. else, hope following code might have helped me. @media print , (max-width: 17in) { @page {size: landscape} } @media print , (max-width: 8.5in) { @page {size: portrait} } is there way keep showing paper size option control layout code?

apache - Wordpress, redirect domain root to a subdomain -

a friend of mine asked wordpress site. did work under sub.domain.com , he'd have domain.com redirected it, if possible without showing sub in url bar this domain root .htaccess # begin wordpress <ifmodule mod_rewrite.c> rewriteengine on rewritebase / rewriterule ^index\.php$ - [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . /index.php [l] </ifmodule> # end wordpress following resources found, inserted these 2 lines after rewriteengine on : rewritecond %{http_host} ^sub\.domain\.com$ [nc] rewriterule ^(.*)$ http://domain.com/$1 [l,r] but doesn't seem work, should simple doing wrong... i tried commenting rest, didn't work i not apache expert @ all, what's problem? to redirect example.com/ sub.example.com/ ,you can use following : rewriteengine on rewritecond %{http_host} ^(www\.)?domain\.com$ [nc] rewriterule ^$ http://sub.domain.com/$1 [l,r] ^$ matches root / of example.com ,i

linux - How to access delegated mailbox using Python without win32.client -

i have windows account mailbox. using python on linux environment, can access mail , directory mailbox using imaplib account credentials that's fine. but now, want access delegated mailbox not belonging account , can't find how. so far used code doc gives directories within mailbox. i'd reach mailbox. i tried change username username/delegated-mailbox connection fails. i've seen solutions on windows environment using win32.client, far, nothing on linux. there solution using imaplib or lib? import imaplib import configparser def open_connection(verbose=false): # read config file config = configparser.configparser() config.read('connection.cfg') # connect server hostname = config.get('server', 'hostname') if verbose: print 'connecting to', hostname connection = imaplib.imap4_ssl(hostname) # login our account username = config.get('account', 'username') password = config.get('account

json - How to interact with a REST service in C# -

i'm developing small application has interact json/rest service. easiest option interact in c# application. i don't need have best performances, since it's tools synchronization once day, i'm more oriented toward ease of use , time of development. (the service in question our local jira instance). i think best way far use restsharp . it's free nuget package can reference. it's easy use , example website: var client = new restclient("http://example.com"); // client.authenticator = new httpbasicauthenticator(username, password); var request = new restrequest("resource/{id}", method.post); request.addparameter("name", "value"); // adds post or url querystring based on method request.addurlsegment("id", "123"); // replaces matching token in request.resource // add http headers request.addheader("header", "value"); // add files upload (works compatible verbs) request

python - Getting "targetdir variable must be provided when invoking this installer" message -

when try install python i'm getting "targetdir variable must provided when invoking installer" whilst attempting install python 3.5. have used tried run admin however, i', still getting error. i met issue also. find method resolve it. right click exe file , choose run administrator. can go on installing , successful.

github - Installing Spritebuilder from source -

i trying install spritebuilder since no longer on app store have through github. ran following code readme file on github. git clone https://github.com/apportable/spritebuilder cd spritebuilder git submodule update --init --recursive cd scripts ./build_distribution.py --version 1.x but keeps returning error: testing failed: error: there no sdk name or path '/users/ username /spritebuilder/scripts/spritebuilder/spritebuilder/macosx10.9' ** test failed ** following build commands failed: check dependencies (1 failure) am doing wrong? went build folder despite error , .app not able opened, saying may incomplete or corrupt. i found workaround downloading spritebuilder mirror hosting site.

c++ - Best practice for avoiding code duplication while implementing iterator and const_iterator classes -

what best practices avoid code duplication when implementing class pairs such iterator , const_iterator or similar? does 1 implement iterator in terms of const_iterator using lots of const_casts? does 1 employ sort of traits class , end defining both iterator , const_iterator different instantiations of common template? this seems common enough problem have canonical solution have failed find articles dedicated that. i don't have experience implementing iterators, although think similar other projects. refactor common code, etc. looking @ gnu libstdc++'s implementation of std::vector::iterator #include <bits/stl_iterator_base_funcs.h> // ... template ... class vector : ... { typedef __gnu_cxx::__normal_iterator<pointer, vector> iterator; typedef __gnu_cxx::__normal_iterator<const_pointer, vector> const_iterator; };

android - RecyclerView not deleted inside RecyclerView.Adapter -

i have recyclerview adapter based on inflating 2 different card layouts. adapater dynamically updated new cards , therefore each of cards in adapter needs updated well. each of cards, there progressbar showing random generated data. however, problem im facing when remove 1 of cards in list, reference deleted card not removed (the oncreateviewholder not called , therefore not update views), instead cards left writing on layout of "deleted" card. text on card correct , removes correct item list, progress bar still having old reference old card, makes adding values corresponds deleted card. to illustrate problem, i'm adding random data each of cards in progressbar depending on movement name. regardless of card, movement card named "open hand" should add random data between 0-20, "close hand" 20-60" , "pronation" 60-100". here working supposed after adding 3 cards: after inserted 3 cards but when delete 2 first cards "o

cloud - Openstack Multi-Site Versions Difference -

i'm going start openstack multi-site cloud deployment on 8 different geographical location on planet, openstack.org documentation http://docs.openstack.org/arch-design/multi-site-architecture.html suggesting use different openstack site different versions! questions are: reason use different versions sites? if there limitation, how should use versions on 08 different sites? your prompt response appreciated. thanks ali

jquery - prevent already disabled checkbox from being checked when click on checkAll -

below code using check check boxes. jquery("#checkall").on('click',function() { // bulk checked var status = this.checked; jquery(".selectrow").each( function() { jquery(this).prop("checked",status); }); }); but disabled checkbox checked when click on checkall link. how stop disabled checkbox being checked when click on checkall link? appreciated. you there. use not(":disabled") filter current code , leave out checkboxes disabled. jquery(".selectrow").not(":disabled")... see question looks similar: jquery selector checked checkboxes not disabled

how do i block or restrict special characters from input fields with jquery? -

how block special characters being typed input field jquery? a simple example using regular expression change allow/disallow whatever like. $('input').on('keypress', function (event) { var regex = new regexp("^[a-za-z0-9]+$"); var key = string.fromcharcode(!event.charcode ? event.which : event.charcode); if (!regex.test(key)) { event.preventdefault(); return false; } });

iOS: Performance of reloading UIImage(name:...) -

i have tableview , each row has icon. 90% of rows have same icon. in cellforrowatindexpath method load image assets folder this: var cellimage = uiimage(named: "myimage") does pose performance problem? os somehow smart enough it's same image each time? better if loaded image once , saved in class variable , assigned each time? uiimage 's named: api does kind of caching. if @ uiimage's documentation , states: use init(named:in:compatiblewith:) method (or init(named:) method) create image image asset or image file located in app’s main bundle (or other known bundle). because these methods cache image data automatically, recommended images use frequently.

Open file explorer using matlab gui pushbutton -

i want create matlab gui can open file explorer using pushbutton , select file further processing. how can that? also want know how assign .m function files pushbuttons. tried putting functionname.m file in callback of pushbutton. didn't work. please me both doubts. you'll need write callback function launch file selection dialog ( uigetfile ) set(hbutton, 'callback', @mycallback) function mycallback(src, evnt) [fname, pname] = uigetfile(); filepath = fullfile(pname, fname); % filepath end in general if want call .m file within callback, you'll want wrap call in anonymous function set(hbutton, 'callback', @(src,evnt)functionname())

netbeans - Any idea I wanted my JFrame to be transparent but not the button and label -

i have java project named javaapplication3 , created jframe named o insert jlabel1 , insert picture in icon property create button message hey the picture inserted png , transparent background i wanted make jframe transparent can see background wallpaper in desktop became transparent jlabel1 wanted jframe transparent not picture , button appreciated thank you. output package javaapplication3; public class o extends javax.swing.jframe { public o() { initcomponents(); com.sun.awt.awtutilities.setwindowopacity(this,0.7f); } @suppresswarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="generated code"> private void initcomponents() { jlabel1 = new javax.swing.jlabel(); jbutton1 = new javax.swing.jbutton(); setdefaultcloseoperation(javax.swing.windowconstants.exit_on_close); jlabel1.seticon(new javax.swing.imageicon(getclass().getresource("/tumblr_nqmzgf3pyc1si30aao1_500.png"))); //

security - Block Internet Explorer Users -

how can block internet explorer users accessing website? have tried few different things wont work.. example tried (wont work...): <meta http-equiv="refresh" content="1; url=http://www.kellotorni.eu"> </head> <body> <script language="javascript"> <!-- if (navigator.appname == "microsoft internet explorer") { document.location = "http://www.google.fi"; } else { document.location = "http://www.kellotorni.eu"; } // --> </script> how can block them? you link style sheet read ie users (ie <= 9): <!--[if ie]> <link rel="stylesheet" href="ie-styles.css" media="screen" type="text/css" /> <![endif]--> and display example warning if user uses ie. if want target ie 10 , above, redirecting post: how target ie (any version) within stylesheet?

ios - How to stop XCode from generating xcuserdata folder and xcuserstate files? -

xcode automatically generates files in .xcodeproj project file , in .xcworkspace etc... projectfolder.xcodeproj/project.xcworkspace/xcuserdata this get's corrupted , make xcode crash upon launching or changing window inside, how make xcode not memorize window settings when launch again? note, locked com.apple.dt.xcode.savedstate folder in ~/library/saved application state/ and never writes there. edit i made simple shell script, , get's job done : https://github.com/deya-eldeen/xcodeprojectcleaner why not write little shell script deletes files want, , launches xcode? instead of opening xcode, open script.

triggers - what is the real cause of mysql error 1442? -

well have looked lot of places on internet cause of mysql error #1442 says can't update table 'unlucky_table' in stored function/trigger because used statement invoked stored function/trigger some bug in mysql or feature doesnt provide. mysql triggers can't manipulate table assigned to. other major dbms support feature mysql add support soon. some claim due recursive behavior when insert record mysql doing lock stuff. can't insert/update/delete rows of same table insert.. because trigger called again , again.. ending in recursion during insert/update have access new object contains of fields in table involved. if before insert/update , edit field(s) want change in new object become part of calling statement , not executed separately (eliminating recursion) now cant understand why recursive. have case in have 2 tables table1 , table2 , run sql query as update table1 set avail = 0 id in (select id table2 duration < now() - interval 2 h

Powershell - Pulling a substring from a uri -

i'm trying pull this hrbkr.com smqzc.com znynf.com from list of uri's in $temp - anything.anything.hrbkr.com anything.anything.smqzc.com anything.anything.znynf.com this regex seems match @ least on regex101 - (<domainname>(?<ip>^[a-fa-f\d.:]+$)|(?<nodots>^[^.]+$)|(?<fqdomain>(?:(?:[^.]+.)?(?<tld>(?:[^.\s]{2})(?:(?:.[^\.\s][^\.\s])|(?:[^.\s]+)))))$)*?' but doesn't seem give me results, able match whole line, want 'substring' not true if line matches. $temp = ‘c:\users\money\downloads\phishinglist.txt’ $regex = '(<domainname>(?<ip>^[a-fa-f\d.:]+$)|(?<nodots>^[^.]+$)|(? <fqdomain>(?:(?:[^.]+.)?(?<tld>(?:[^.\s]{2})(?:(?:.[^\.\s][^\.\s])|(?:[^.\s]+)))))$)*?' $temp | select-string -pattern $regex -allmatches | % { $_.matches } | % { $_.value } | sort-object -unique > $list $list thanks! if file contains fqdns , nothing else, can solve simple -split , -join operatio

SQLite Prepared Statements not Inserting if bind text contains dash -

i run problem text field of table cannot bind string containing dash. if remove or replace dash/dashes against character prepared , bind statement works fine. here 2 code fragments. demo table "create table mytable (sometime text)" //do not work... runs commit!! add nothing mytable int result = sqlite3_exec(validsqlite3, "begin;", nullptr, nullptr, nullptr); if (result != sqlite_ok) return; sqlite3_stmt* stmt = nullptr; bool ok = true; if (sqlite3_prepare_v2(validsqlite3, "insert mytable (sometime) values (?);", -1, &stmt, nullptr) != sqlite_ok) ok = false; if (ok && sqlite3_bind_text(stmt, 1, "2016-11-01 12:00:00", -1, sqlite_transient) != sqlite_ok) ok = false; if (ok && sqlite3_step(stmt) != sqlite_done) ok = false; if (ok && sqlite3_finalize(stmt) != sqlite_ok) ok = false; if (ok) sqlite3_exec(validsqlite3, "commit;", nullptr, nullptr, nullptr); else sqlite3_exec(valids

javascript - Grabbing a file sent from Django on front-end -

i trying post file via http-request (something similar curl -f request). want best described following code: def my_view(request): string_to_return = '<?xml version="1.0" encoding="utf-8"?>...' file_to_send = contentfile(string_to_return) response = httpresponse(file_to_send,'application/xml') response['content-length'] = file_to_send.size response['content-disposition'] = 'attachment; filename="somefile.xml"' return response $.get('/my_view/', function(response){ var formdata = new formdata(); // file = ??? how grab file ??? formdata.append("thefile", file); xhr.send(formdata); }); basically, question here how grab xml file in client. in advance! some notes i need file content generated on server-side i need file passed client-side , sent external server via http request. okay trying download file django , upload