Posts

Showing posts from September, 2015

html - Difficulties with background-image property -

i working bootstrap , change .jumbotron background image instead of default color. tried using "background-image: url("img/ponder.jpg");" , it's not working reason. have tried using , without quotation marks, , i've tried placing image in root folder.. still no luck. here picture of file structure (root folder): https://i.gyazo.com/1cf9dcfd20224c4fce8fe4a775863ab1.png and here code: html: <div class="jumbotron"> <div class="container text-center"> <h1>hello world</h1> <p>lorem ipsum dolor sit amet, consectetur adipiscing elit. integer @ pharetra eros, vel condimentum nunc. vivamus eget bibendum mauris. integer quis volutpat enim. duis id lorem feugiat, mattis sapien eget, luctus eros. pellentesque vestibulum tempus elit, sit amet luctus purus dictum vitae. suspendisse non aliquam augue. morbi sagittis mi @ turpis luctus pretium. vestibulum sit amet orci orci.</p>

ios - Segue not passing data between ViewControllers -

Image
i making ios app uses payment methods. at moment trying work on checkout flow, contains oderformviewcontroller , checkouttableviewcontroller can see below: i connected both dragging segue, highlighted in blue. added segue identifier segue. i called first view controller e_orderformviewcontroller (its title shipping address), , in created ibaction for continue button , used -(void)prepareforsegue:(uistoryboardsegue *)segue sender:(id)sender pass in information. i have order model, properties in it. on checkouttableviewcontroller, have got labels , orderinfo public properties, first view controller 1 can access it. #import <foundation/foundation.h> @interface order : nsobject @property(strong, nonatomic) nsstring *shippingname; @property (strong, nonatomic) nsstring *shippingaddress; @property (strong, nonatomic) nsstring *shippingcity; @property(strong, nonatomic) nsstring *shippingstate; @property(strong, nonatomic) nsstring *shippingzip; @end //e_orderform

bitbucket - How to automate building and deploying Jekyll site to webserver via FTP -

my jekyll files stored in bitbucket, , able automatically generate _site folder on every new change gets pushed. (note, don't want push _site folder git, out of question). once _site generated, automatically deploy webserver via ftp. is @ possible? options? thank you! since didn't mention _site folder go, here' generic answer. in short, need webserver or service listens bitbucket post commit hook , here relevant documentation that. that way, on every push, bitbucket trigger action , notify server/app/service build new _site , deploy want to. here's tutorial on setting use of cron jobs , webserver. link a simple vps work, or tiny amazon ec instance/azure virtual machine. of course, these not 100% free. if hate using servers, a continuous integration (ci) service can used instead, on commit hooks trigger build, travis-ci , drone.io free public repos, if repo private you'll have go paid service. there many others well. (note tr

visual studio code - What does the isShellCommand property actually do and how should you use it? -

what isshellcommand property , how should use it? the description when hovering says: "specifies whether command shell command or external programm. defaults false if omitted" and in https://code.visualstudio.com/docs/editor/tasks mention in example with: "we want run gulp command in shell (vs code directly executing it) used isshellcommand" so difference between shell command vs external program? does running isshellcommand = false mean vscode not "directly executing it" meaning run "command" , don´t listen output (because ran external command?) in turn means cannot use problem matchers. or if setting isshellcommand = true mean vscode "directly executing it" , keep track of , listen output generated can use problem matchers etc integrate vscode? considering example below using tsc compile typescript project: c:\users\j\code\vscode-project>where tsc c:\program files (x86)\microsoft sdks\typescript\1.4\tsc.exe

amazon web services - JEE Container (Glassfish) and HikariCP - JNDI vs managing my own instance -

is considered bad/acceptable/good/best practice manage own instance of hikaricp connection pool, goal don't have configure jndi resources within glassfish? some background: my deployment environment aws's elastic beanstalk, running glassfish within docker container. have working solution generating jndi resources whe deploying in environment, makes deployment quite fragile. see following question details: how configure glassfish instance running on aws/elasticbeanstalk/docker? . i'm quite keen rid of deployment hassles, don't know connection pooling, , hikaricp in particular. cruising bruising in direction? super simple implementation might create static variable contains connection pool.

ios - Change UITableView custom header view's button image not working -

i created uiview using nib file. , set table view header view. in view have button. tried change button's image, nothing changes. - (uiview *)tableview:(uitableview *)tableview viewforheaderinsection:(nsinteger)section { if (section == 0) { healthplanheaderview *view = (healthplanheaderview *)[[[nsbundle mainbundle] loadnibnamed:nsstringfromclass([healthplanheaderview class]) owner:self options:nil] firstobject]; [view.addbutton addtarget:self action:@selector(editfood) forcontrolevents:uicontroleventtouchupinside]; self.healthplanheaderview = view; return view; }else { return nil; } } - (void)editfood { self.healthediting = !self.healthediting; uiimage *image = self.healthediting ? [uiimage imagenamed:@"finish"] : [uiimage imagenamed:@"edit-button"]; [self.healthplanheaderview.addbutton setimage:image forstate:uicontrolstatenormal]; } i noticed button image did set, button won't show n

javascript - Calling layout on a subset of nodes in a loop does not properly layout the nodes -

i have several groups of nodes, , need each group own circle around different location. i have loop adds nodes chart, , @ end gets nodes, , attempts circularize them. however when run program, nodes end in grid format. how expected behavior? for( group in groups ){ cy.add([ { group:'nodes', data: { id: 1, customgroup: group}, position:{x: 0,y: 0} }, { group:'nodes', data: { id: 2, customgroup: group}, position:{x: 0,y: 0} }, { group:'nodes', data: { id: 3, customgroup: group}, position:{x: 0,y: 0} }, { group:'nodes', data: { id: 4, customgroup: group}, position:{x: 0,y: 0} }, { group:'nodes', data: { id: 5, customgroup: group}, position:{x: 0,y: 0} }, { group:'edges', data: { source: '1',target: '2', weight:1} }, { group:'edges', data: { source: '2',target: '3', weigh

meteor - from relation table to mongodb -

i'm trying create mongodb design (but i'm new @ mongo) based on relation database schema. my question is: how far denormalize schema? : -users --wallets[field1,field2] ---items[field1,field2] ----transactions[field1,field2] --.... users -> linked lot of tables. wallets -> user can have more wallets. items -> wallet can have more items(the field values of items not regulary change). transactions -> item can have more transactions. idea to: split users in document group wallets , transactions (create reference user_id (at wallet level) , item_id (on transaction level)) in document items in document will right approach? as why mongodb: because i'm creating meteor app. as alternative @inspired's answer (which translates schema straight mongodb , models via document references ), might easier embed data user document . if choose embed, like: { name: 'username', id: objectid("512512a5d86041c7dca81914"

how to install boost-devel 1.59 in CentOS7‏ -

i want install boost-devel 1.59 in centos7, default repo has 1.53, have compile source code. i have download 1.59 web page, , use ./bootstrap.sh , ./b2 install install boost 1.59. but when want install other packages such cgal-devel, tells me donnot install boost-devel 1.59, wonder how install boost-devel? thanks. got boost 1.59 version installed in centos 7 below commands: sudo wget http://repo.enetres.net/enetres.repo -o /etc/yum.repos.d/enetres.repo download lib64icu42-4.2.1-1mdv2010.0.x86_64.rpm below link: ftp://fr2.rpmfind.net/linux/mandriva/official/2010.0/x86_64/media/main/release/lib64icu42-4.2.1-1mdv2010.0.x86_64.rpm install rpm: sudo rpm -ivh lib64icu42-4.2.1-1mdv2010.0.x86_64.rpm install required boost library version: sudo yum install boost-devel that's it. have great day! rpm link: https://www.rpmfind.net/linux/rpm2html/search.php?query=libicuuc.so.42()(64bit)

javascript - How to run a .js file on multiple Bootstrap tabs? -

i have page runs javascript file pulls data json file. js appends div on page. js runs on $(document).ready. i have added tabs page bootstrap, , run same js code on different tabs, accessing different json file each tab. would need wrap js new function , call on function using tab click event? looking little on best way this. edited add code: <!doctype html> <html lang = "en"> <head> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- above 3 meta tags *must* come first in head; other head content must come *after* these tags --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script type="text/javascript" src="quiz.json"></script> <script src="quiz.js"><

python - Unpack list of strings inside another list of strings -

i have found multiple examples similar questions in want flatten list made of multiple lists e.g [[0,1][2,3][3,4]] 1 list. in case want unpack 1 item. note using " * " operator work expand lists function arguments in following example. but, use instead " * " unpack files in scenario ? unpack = ["file_1.txt", "file_2.txt", "file_3.txt"] if unpack: subprocess.call(["mv", *unpack, "/destination_path"]) subprocess.call(["mv"] + unpack + ["/destination_path"])

flash - Embed my swf file on html -

i want embed swf-file via html. part of code. problem file shows on desktop , not on mobile devices. need show on mobile devices too. mistake? <center><object data="flickr_lung.swf" width="500" height="500"></object></center> i'm not sure how missed memo on this...it's been going on near decade @ point...but i'll explain anyway. practically no common mobile device browsers support flash player , .swf format . in general don't typically support plugin technology. option 1 : flash (the authoring tool, distinct flash player) can output html/css/js type content instead of .swf format. may take mucking project, it's new stuff learn , deal with. worth it. option 2 : progressive enhancement. have flash sites made before mobiles around still work great day because progressively enhanced them outputting simpler html version of same content "backup" content swf. ironically simple html versio

php - The type of the third parameter in preg_match_all() when no matches are found -

i'm using preg_match_all() in project find matches in given string. example: preg_match_all( $pattern, $subject, $matches, $flags ); if matches found, $matches parameter multidimensional array of matches ordered according $flags . if matches weren't found, type $matches be? still array, albeit empty array, or else such false or null ? ref: http://php.net/manual/en/function.preg-match-all.php $matches array containing empty sub-array. it's can test yourself. <?php preg_match_all('/o/', 'foo', $matches); var_dump($matches); output: array(1) { [0]=> array(0) { } }

jQuery in two external java script files -

i have html page 2 external javascript files one global <script src=".../js/global.js" type="text/javascript"></script> and 1 local <script src="js/local.js" type="text/javascript"></script> obviously, use jquery <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js" type="text/javascript"></script> so far, good. in both external javascript files, insert jquery code inside following piece of code $(document).ready(function() { // code goes here... }); i've tried removing piece of code in local external javascript file since i've have on global file. doesn't work. so, question absolutely need start both external java script files piece of code? how make have on global file? thanks if have 2 javascript files, , you're doing dom manipulation in both files (using jquery) - yes, need start both $(document).ready(function()

html - background-image appearing in the body margin -

i have thought background-image of element appears in element itself, padding , border not margin . however, while trying else work discovered seems not case , background-image appearing in margin . body { background: url("https://www.google.co.uk/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png"); background-size: contain; background-repeat: no-repeat; border-width: 1px; border-style: solid; border-color:red; margin: 50px; } <p>lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.</p> https://jsfiddle.net/rz52z14r/ as can seen, background appearing in margin . additionally, if add in overflow: hidden overflow not hidden. again, under impression overflow outside bounds of el

rss viewer webpart is missing in sharepoint 2013 how to activate it -

rss viewer webpart missing in sharepoint 2013 shown in default folder , when adding rss viewer web part default folder shows error 'an unexpected error occurred processing request. check logs details , correct problem.' the corresponding feature might not enabled, should follow path: under site settings, click modify site settings. under site collection administration, click site collection features. enable office sharepoint server enterprise site collection features. if problem not solved, can try going central administration: under central administration, click on operations. under upgrade , migration, select enable features on existing sites. select appropriate checkbox, , click ok.

Error:(39, 13) Failed to resolve: com.parse.bolts:bolts-android:1.+ -

error:(39, 13) failed resolve: com.parse.bolts:bolts-android:1.+ and build.gradle dependencies { compile files('libs/aspose-cells-8.3.1.jar') compile files('libs/bcprov-jdk15-146.jar') compile files('libs/nineoldandroids-library-2.4.0.jar') compile files('libs/renderscript-v8.jar') compile files('libs/parse-1.10.0.jar') compile 'com.android.support:support-v4:23.0.1' compile 'com.android.support:appcompat-v7:23.0.1' compile 'com.google.android.gms:play-services:8.1.0' compile 'com.android.support:multidex:1.0.0' compile 'com.parse.bolts:bolts-android:1.+' compile 'com.google.android.gms:play-services-ads:8.1.0' compile 'com.google.android.gms:play-services-identity:8.1.0' compile 'com.google.android.gms:play-services-gcm:8.1.0' } gradle build error message project structure - dependencies please need go app-

android - Why does my gradle take so long? > 13 minutes -

Image
why gradle take long on computer? after making minor changes? must broken. have ideas? i'm using android studio on ubuntu 15.04. android studio updated. here gradle files if relevant. // top-level build file can add configuration options common sub-projects/modules. buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:1.3.0' classpath 'com.google.gms:google-services:1.3.0-beta1' // note: not place application dependencies here; belong // in individual module build.gradle files } } allprojects { repositories { jcenter() } } and... apply plugin: 'com.android.application' apply plugin: 'com.google.gms.google-services' android { compilesdkversion 23 buildtoolsversion '23.0.0' defaultconfig { applicationid "ca.deanresin.arecipebook" minsdkversion 15 targetsdkversi

Can't deploy Hexo blog to Github in Cloud9 -

i set hexo blog in cloud9. can generate well, nothing works when deploy github. doesn't return error information, nothing has been pushed github. don't know do. terminal info ... info generated: css/fonts/fontawesome-webfont.woff info generated: css/fonts/fontawesome-webfont.ttf info generated: css/fonts/fontawesome-webfont.svg info generated: css/fonts/fontawesome-webfont.eot info generated: css/fonts/fontawesome.otf info 28 files generated in 71 ms younglaker@hexo-blog:~/workspace/hexo-theme-leo (gh-pages) $ hexo d younglaker@hexo-blog:~/workspace/hexo-theme-leo (gh-pages) $ make sure you've configured "_config.yml" file this: deploy: type: git repository: https://github.com/xxxx/xxxx.github.io.git branch: master or if using ssh key: deploy: type: git repo: git@github.com:xxxx/xxxx.github.io.git branch: master the repository github project build now,and attention format.

c++ boost write memory mapped file -

i searching fast writing file using c++ , boost library. , use memory mapped file. example reading. working simple. there string array. array elements 2 millions. ofstream outfile("text.txt"); (int = 0; < 2000000; ++i) { outfile << strarray[i] << "\n"; } outfile.close(); how can using memory mapped file? can find writing file using memory mapped file? thank concerning. you use boost iostreams mapped_file{_sink,_source} this. although boost interprocess use mapped files, you'd better off using iostreams kind of raw access. see http://www.boost.org/doc/libs/1_50_0/libs/iostreams/doc/classes/mapped_file.html live on coliru #include <boost/iostreams/device/mapped_file.hpp> #include <boost/iostreams/stream.hpp> #include <vector> namespace bio = boost::iostreams; int main() { using namespace std; vector<string> strarray(2000000); bio::mapped_file_params params; params.path

android - Searching in recycler view returns different position when i click? -

how filter recyclerview searchview i followed above answered recyclerview search. have 1 problem, whenever search , click on items returns different position provided particular item id,name,etc. you might try parse.com. gives possibility create database. getting data parse.com can done parsesdk or normal requests. if use normal requests, retrofit nice library that.

javascript - ajax request works in firefox, does not work in chrome -

function ajx(url) { var xhri = xhrrequest('xml'); var ajxout = ''; var out = ''; xhr[xhri].open('get', url, true); xhr[xhri].setrequestheader('content-type', 'application/x-www-form-urlencoded; charset='+document.characterset); xhr[xhri].onreadystatechange = function() { console.log(xhr[xhri].readystate); if (xhr[xhri].readystate == 4 && (xhr[xhri].status == 200 || xhr[xhri].status == 205)) { dosomething(); } } an ajax call function leads different result in chrome , firefox: in firefox, dosomething called, because onreadystatechange invoked several times , delivers readystate==4 in end. in chrome, however, onreadystatechange invoked once , logs readystate==0. how can be?

objective c - size class for table row height in iOS storyboard -

i develop ios app swift , storyboard. placed table , need change table cell height depending on screen class, can't find such option in table options. see cell height defined table view / row height option, doesn't support class sizes. this problem happens because set fonts of labels in cell prototype using size classes, bigger screens fonts bigger, row height can't changed per size class. need higher row bigger fonts, obviously. approach should use achieve it? obj-c code too. let me answer own question - in ios 8 it's possible enable auto layout cells using uitableviewautomaticdimension table's row height: override func viewdidload() { super.viewdidload() tableview.estimatedrowheight = 89 tableview.rowheight = uitableviewautomaticdimension } estimatedrowheight needs set too. links: http://natashatherobot.com/ios-8-self-sizing-table-view-cells-with-dynamic-type/ http://www.appcoda.com/self-sizing-cells/ https://stackoverf

android - DevicePolicyManager.resetPassword and DevicePolicyManager.ACTION_START_ENCRYPTION -

i have 1 strange problem resetpassword on samsung s4. want clear password, result cannot login phone , has factory reset before can use it. thing did listed below: 1: call devicepolicymanager.action_start_encryption start storage encryption on phone 2: accept action , finish storage encryption on phone , set password 3: clear password in app calling devicepolicymanager.resetpassword("") after above steps, cannot login phone password set , screen still locked prompt password, until factory reset. i tried find out lock-screen password after resetpassword. , find out quite complex password string hash stored in password.key , salt. maybe not feasible way solve that. this happened in galaxy s4, 1 has idea that? after investigation, found problem caused clear password while device still in "encrypted" state. if decrypt device first , reset password works ok now. so current work find out: api used decrypt device?

javascript - Pass PDF document to user-agent via XHR, using modern (HTML5) methods, without compromising document encoding -

Image
i trying accomplish described @ handle file download ajax post , dynamically-generated pdf file, i'm generating php v5.6.10 (using third-party pdflib extension, v9.0.5). yet, when pdf file downloaded, corrupted; no pdf-reading implementation i've tried able read file, , every observation points fact file content being butchered somewhere between printing pdf content response body , saving file via user-agent (web-browser) javascript. i happen using jquery v2.1.4, i'm not sure matters, ultimately. important provisos i should mention that, other asker (cited above), have html form users fill-out , submit via post verb. form submission performed javascript, because there 5 forms displayed in tabbed layout submitted simultaneously, , validation errors must sent via ajax , displayed without refreshing entire page). mention make clear fact post request, may return either a) json object (that contains validation error strings, primarily), or b) string represents pdf d

winforms - how to add multiple comboboxes to the listbox dynamically in C# -

i trying add comboboxes + text list box dynamically in c# has display 2 comboboxes + text, showing text if written lstboxvideos.item.add(subvideo) and showing 1 combobox if written lstboxvideos.controls.add(subvideo) suggest me how problem foreach(var video in videos) { var subvideos = video.descendants("subvideos"); if (subvideos.count() >= 1) { combobox subvideo = new combobox(); subvideo.name = "subvideo" + i; subvideo.items.add(video.attribute("name").value); foreach(var videoname in subvideos) { subvideo.items.add(videoname.value); } listboxvideos.items.add(subvideo); i++; } else { listboxvideos.items.add(video.attribute("name").value); } } you can add them this: var cb = new combobox(); var t1 = new textblock(){text = "111"}; var t2 = new textblock(){text = "222"}; var t3 = ne

Run query every time a SQL Server Agent job runs -

Image
i have around 100 sql server agent jobs run on schedules. need way execute query , dump results every time 1 of jobs runs table. [job name], [success/fail], [time] etc. the table custom table can flexible it. google has turned answers in wrong directions. why not check log file sql server agent? view sql server agent error log you can manually query dbo.sysjobhistory and/or dbo.sysjobactivity : dbo.sysjobhistory contains information execution of scheduled jobs sql server agent. table stored in msdb database. dbo.sysjobactivity records current sql server agent job activity , status. select * msdb.dbo.sysjobhistory and select * msdb.dbo.sysjobactivity

ios - Implement an asynchronously NSOperation -

i studying nsoperation object. according app document (listing 2-5), can implement asynchronously nsoperation. part of start part below: - (void)start { // check cancellation before launching task. if ([self iscancelled]) { // must move operation finished state if canceled. [self willchangevalueforkey:@"isfinished"]; finished = yes; [self didchangevalueforkey:@"isfinished"]; return; } // if operation not canceled, begin executing task. [self willchangevalueforkey:@"isexecuting"]; [nsthread detachnewthreadselector:@selector(main) totarget:self withobject:nil]; executing = yes; [self didchangevalueforkey:@"isexecuting"]; } i find out new thread assigned run main function: [nsthread detachnewthreadselector:@selector(main) totarget:self withobject:nil]; so, seems nsoperation did nothing concurrent execution. asynchrony achieve create new thread. why need nsoperation? you

winapi - How to get modifier key event(alt+ctrl+shift), -

if working on win32 api.please have below issue. have requirement call function when modifier keys pressed(alt+ctrl+shift) @ same time in win32 programming.but not getting how handle event when modifiers keys pressed @ same time. if have idea please post it. to status of key there api getkeystate . of can check whether key down or up. for example: if (getkeystate(vk_shift)& 0x8000) //key pressed you can check in combination this: if (getkeystate(vk_shift)& 0x8000 && getkeystate(vk_control)& 0x8000) //ctrl+shift key pressed.

python - Match an arbitrary path, or the empty string, without adding multiple Flask route decorators -

i want capture urls beginning prefix /stuff , following examples match: /users , /users/ , , /users/604511/edit . write multiple rules match everything. there way write 1 rule match want? @blueprint.route('/users') @blueprint.route('/users/') @blueprint.route('/users/<path:path>') def users(path=none): return str(path) it's reasonable assign multiple rules same endpoint. that's straightforward solution. if want 1 rule, can write custom converter capture either empty string or arbitrary data beginning slash. from flask import flask werkzeug.routing import baseconverter class wildcardconverter(baseconverter): regex = r'(|/.*?)' weight = 200 app = flask(__name__) app.url_map.converters['wildcard'] = wildcardconverter @app.route('/users<wildcard:path>') def users(path): return path c = app.test_client() print(c.get('/users').data) # b'' print(c.get('/users-n

Recursive functions that reverse a list in Haskell -

i've been tasked create recursive function takes in list , gives reverse of list. i have been able create function named rev1 this: rev1 :: [a] -> [a] rev1 [] = [] rev1 (x:xs) = reverse xs ++ [x] but have been asked create function 'rev2' should use additional argument serving accumulator. could please me compose rev2 function. thanks in advance, sam first of all, rev1 should instead: rev1 :: [a] -> [a] rev1 [] = [] rev1 (x:xs) = rev1 xs ++ [x] the point of rev2 achieve tail recursion means of passing intermediate result inside accumulator argument: rev2 :: [a] -> [a] -> [a] -- if applied empty list, return result -- far, i.e. whatever inside accumulator: rev2 acc [] = acc -- otherwise, take head of list , append -- accumulator, , carry on rest of list rev2 acc (x:xs) = rev2 (x:acc) xs this, however, has downside of exposing acc argument users of rev2 , typical approach hiding accumulator based implem

java - XDocReportRegistry.getRegistry() works fine through eclipse, but doesn't work in a third party app -

i'm using xdocreport replace data in placeholders in docx file. worked fine eclipse. exported app client jar file , used in third party product. getregistry method threw exception message: fr/opensagres/xdocreport/document/registry/xdocreportregistry please help. i placed xdocreport jars in 3rd party app server's common lib directory , worked fine after restarting server.

python - gurobipy.GurobiError: Invalid argument to LinExpr multiplication -

i'm getting error: gurobipy.gurobierror: invalid argument linexpr multiplication bug has in following line: m.setobjective(quicksum(sum(s[d, r] *x[d, r] r in piecewise) * h[d] * z * vardemand[d] d in demandstage) + quicksum(sum(s[j, r] * x[j, r] r in piecewise) *h[j] * z * var[j] j in intermediatestage), grb.minimize) x variable , rest dicts imported values out of excel files. i've been staring @ quite time, can't see bug.

CSS - make menu the size of the page -

i have vertical , extensible menu component within page. i want to: 1.occupy 100% of screen's height. 2.enable scrolling rather extending underneath screen. for now, using following css: #enablescrolling { overflow-y: scroll; height: 100%; } however, list extends underneath screen instead of allowing scrolling. therefore, using height: 100%; doesn't seem work. how should correctly? you can either make menu size of view port using viewport height style solution 1 #enablescrolling{ height:100vh; overflow-y:scroll; } here jsfiddle try scrolling red, begin scrolling in blue. see red box high window. or can position absolute make height of entire website this: solution 2 #enablescrolling{ position:absolute; top:0; height:100%; width:100%; overflow-y:scroll; } with second jsfiddle can see red take 100% height of page, try scrolling red, scroll blue. red never leave viewport. solution 3 (modified off solution 1) if element not

ios - How to do searching in NSTableView with NSSearchFiled? -

i have implemented application in use nstableview of data source , delegates have not used nsarraycontroller nor want use it. question how can bind nssearchfield nstableview in situation? had seen lot of answer using nsarraycontroller. not want convert implementation nsarraycontroller things working nsmutablearray. tableview display control , not filtering. should add 2 nsarray properties; 1) @property(nonatomic, strong) nsarray *allitems; 2) @property(nonatomic, strong) nsarray *filtereditems; #import "viewcontroller.h" @interface viewcontroller()<nssearchfielddelegate, nstableviewdelegate, nstableviewdatasource> // nssearchfield @property (weak) iboutlet nssearchfield *searchfield; // nstableview @property (weak) iboutlet nstableview *tableview; // in array store items @property(nonatomic, strong) nsarray *allitems; // in array store filtered items @property(nonatomic, strong) nsarray *filtereditems; @end @implementation viewcontroller - (vo

bash - How to use Popen with openssl in Python 3.x -

i porting code python 2 python 3 , realized m2crypto module not ported, yet. unfortunately want s/mime signing , thought use subproccess.popen instead. want give unsigned plist openssl , s/mime signed. in automx (see https://github.com/sys4/automx ) what want is: bash-example: echo "test " | openssl smime -sign -signer server.crt -inkey server.key -nodetach -outform der i tried in python: import subprocess s cmd = "/usr/bin/openssl smime -sign -signer " + sign_cert +\ "-inkey " + sign_key + "-nodetach -outform der" process = s.popen( cmd.split(), stdin=s.pipe, stdout=s.pipe, stderr=s.pipe, shell=true) plist_signed, errors = process.communicate( input=plist_unsigned) if errors not none: logging.error("call openssl failed: %s", str(errors)) return plist_unsigned unfortunately doe not work. openssl seems interpred stdin stuff command.

postgresql - Rails - custom timezone prevents from getting timestamps -

i'm using devise , grape i'm facing problem timezones. whenever set timezone in environment: config.time_zone = 'asia/dubai' config.active_record.default_timezone = 'asia/dubai' when record db , try access 1 of timestamps get user.first user.reset_password_sent_at #=> nil and weirdest part of see column filled valid timestamp in db. i tried run update manually via rails console. after updating record ran reload , reset_password_sent_at vanished. again got "nil". what can cause of , how can overcome? i found out cause. i set the config.time_zone = 'asia/dubai' config.active_record.default_timezone = 'asia/dubai' where should set time of application, not activerecord. in config should like: config.time_zone = 'asia/dubai' now i'm getting data database.

csv - Shiny/R error: Paths should be to files within the project directory -

my shiny app run locally, when try deploy shinyapps.io not. temporarily fixed problem removing 'dot' in path .csv file: data <- read.csv("/users/jmjc/desktop/bbteams-shiny/bbteams.csv") but when deployed shinyapps.io received different error, error: cannot open connection. shinyapps::deployapp('/users/jmjc/desktop/bbteams-shiny') i placed data set in same directory server.r , ui.r. , made sure setwd() same directory. i'm out of ideas. if don't remove dot not deploy, if remove dot cannot make connection. if force deploy, still not make connection. type following console: find_rtools() this should return true if rtools installation worked properly. if not, follow instructions here: http://jtleek.com/modules/01_datascientisttoolbox/02_10_rtools/#6

ios - Is 1-courier.push.apple.com needed for IBM MobileFirst APNS notifications? What is it for? -

the ibm mobilefirst knowledge center states that following servers , port numbers have accessible apns push notifications work: gateway.sandbox.push.apple.com:2195 feedback.sandbox.push.apple.com:2196 gateway.push.apple.com:2195 feedback.push.apple.com:2196 however, have seen references in apple documentation endpoint 1-courier.push.apple.com:5223 (for example, apple's troubleshooting documentation here ). is server , port required accessible mfp server (through firewall) also? used for? i not clear on for, unlike knowledge center - tutorial mention mobilefirst server instance requires address available it: https://developer.ibm.com/mobilefirstplatform/documentation/getting-started-7-1/foundation/notifications/push-notifications-overview/push-notifications-in-hybrid-applications/#setupios have tried , without , observed differences?

javascript - Disable Button OnClick -

i have asp.net application random generator , want button disable , stay disabled when clicked. i have tried adding onclientclick="this.disabled = true;" <asp:button> , tried adding following onclick in code behind btndecideforme.attributes.add("onclick", "this.disabled=true;"); none of these work. not bothered how done long it's clean , job. html <div class="col-sm-2"> <asp:button class="btn btn-success" id="btndecideforme" runat="server" text="decide me" onclick="btndecideforme_click" /> </div> on_click event protected void btndecideforme_click(object sender, eventargs e) { list<string> eat = new list<string>(); eat.add("chinese buffet"); eat.add("harvester"); eat.add("frankie & benny's"); eat.add("hungry horse"); eat.add("blaize"); eat.add("c

javascript - Dynamically reference an import -

in ecmascript 6 , how can instantiate class imported module variable? ex: import mymodule './modules/modulename'; let myvar = "mymodule"; let foo = new window[myvar]( params ); you have create mapping containing imported modules want dynamically instantiate. e.g. var classes = { mymodule, }; then can do new classes[myvar]();

performance - Comparing two neural networks (nntool in Matlab) -

i'm new neural network toolbox (nntool) in matlab. have trained 2 networks using same data set. 1 of these networks contains higher number of neurons other one. now i'm wondering: how can compare these networks? how can network better network b? is number of correctly classified pattern in test set? lets both networks shown same test set , network classified more pattern correctly. can network (in general) better network b? or should @ performance according performance function? are there other measures comparing 2 networks trained different parameter? that depends on concern. see, in cases analyzing predicted labels, or accuracy of nets can lead pickup decision, when networks have shallow architectures,however there side-handed issues may become more important when decide see nets wider eyes. for example, in training phase, adding 1 hidden unit first hidden layer comes inserting d (dimension of input layer) free parameters (weights) model should estim

Find free time with google calendar api -

i want check if there free time (without events) in interval of time on google calendar. there freebusy google api, returns array of events dates. "busy": [ { "start": "2015-10-08t16:00:00+02:00", "end": "2015-10-08t20:00:00+02:00" }, { "start": "2015-10-09t15:00:00+02:00", "end": "2015-10-09t16:00:00+02:00" }, ] is there simple way 'true/false' information free time (some feature google api)? if no, maybe know easy way manually iterate "busy" array , check if there empty space between events. freebusy.query supports timemin , timemax values. set 2 values encompass timeslot interested in , if response returns 0 events in timeslot have answer of free time. { "timemin": datetime, "timemax": datetime, }

ios - Can iCal and Excel be connected? -

can ical calendar synced excel sheet , vice versa? if change event in ical, change reflected in excel. know how manually upload excel (.csv) files ical not reverse, ical excel. can't figure out how seamlessly connect 2 (automated nice). possible? there apps can this? i've spend time researching , can't seem find answers. missing something?! please help!

angularjs - How can I handle an Angular promise in the controller using TypeScript -

i have service makes request data: /// <reference path="../../typings/reference.ts" /> module app { 'use strict'; export class vehiclemakeservice { static $inject = ['$http']; constructor(private $http: ng.ihttpservice) {} getvehicles(): ng.ipromise<any> { return this.$http.get('https://api.edmunds.com/api/vehicle/v2/makes?state=used&year=2015&view=basic&fmt=json') .then(function(response) { return response.data; }); } } angular.module('app').service('vehiclemakeservice', vehiclemakeservice); } this works expected, when attempt retrieve data in controller 'promise {$$state: object}'. here controller: /// <reference path="../../typings/reference.ts" /> module app { 'use strict'; interface isearchcontroller { vehicles: any; setvehicles(): void; } class searchcontroller implements isearchcontroller {

web applications - Go language - web loops and variables -

i beginner in go language , want write webapplication. missing docus things defining variable inside webpage (html). can use {{ "one" }} print 'one' on webpage. cannot define variable {{ var 1 string }} or loop {{ := 1; <= 10; i++ { fmt.println(i)} }} i found examples range iterate input parameter. possible use go similar jsp / java ?

swift - Google Cloud Messaging iOS, receiving multiple notifications -

i've implemented google cloud messaging ios succesfully , i'm sending following http format server: $jsondata = array( 'to' => '/topics/' . $data['abbreviation'], 'notification' => array( 'body' => $data['body'], 'title' => $data['title'] ) ); the data sent succesfully , ios application showing notification. it's showing 2 5 times , i'm sure server sending once because i'm sending same format android gets 1 notification instead of multiple. am forgetting something? appdelegate following: func application( application: uiapplication, didreceiveremotenotification userinfo: [nsobject : anyobject], fetchcompletionhandler handler: (uibackgroundfetchresult) -> void) { // works if app started gcm service gcmservice.sharedinstance().appdidreceivemessage(userinfo); handler(uibackgroundfetchresult.nodata) // invoke completion handler

multithreading - PHP PDO SQL MutliThreading Possible? -

i send full flat (edi) file oxford everyday. query database, array of results, , use data array make csv file out of it $sql = "select * master_table"; $sth = $apex->prepare($sql); $sth->execute(); $result = $sth->fetchall(pdo::fetch_assoc); //this fatal error due out of memory $csv = new csv(); $csv->makecsv($result); the $result contain array of millions of records make csv. the main problem i'm having here lack of memory , time. if "break up" sql query this: $years = [2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011]; //etc foreach ($years year) { $sql = "select * master_table year = $year"; $sth = $apex->prepare($sql); $sth->execute(); $result = $sth->fetchall(pdo::fetch_assoc); $csv = new csv(); $csv->makecsv($result); unset($result); } this works takes extremely long time due php not being unable execute foreach loop simultaneously. there option in pdo can execute

maven - Apache SparkUI on local mode -

i'm new apache spark. using in on intellij idea 14, maven project method. i'm unable access spark ui after program stops because of 15/10/22 23:28:27 info sparkui: stopped spark web ui @ http://192.168.1.88:4041 sparkui stops fast me review program does. there way review sparkui particular program after it's stopped? or can find kind of log created after running program? after setting "spark.eventlog.enabled" true , "spark.eventlog.dir" local folder, able produce unix executable files(local-1445955378567). however, details of log not expected. how add sparklistener?? output of unix executable"local-1445955378567" you need either keep ui alive (by keeping context alive) or start history server since ui tied context. http://spark.apache.org/docs/latest/monitoring.html

jquery - CSS3 - transform:translateY( out of screen ) -

i trying add slide down. and adding starting position: transform:translatey(200%) which works fine if scroll area not big. transform:translate(-200%) works better because moves relative top , part can't grow. is there way around this? using transform: translatey(50000px); and potentially affect animations have move on larger areas. what approach problem? ---------- edit ----------- actually, appears if scrolling area getting larger larger translatey meaning never gets out of viewport, might problem here. not sure how resolve though. it appears if translate3d(-100%, 100%, 0); resolves issue.

Javascript - The new method -

if break down me, can understand it, i'd greatful. know it's used create new object apply method. function.prototype.new = function () { var args = arguments; var constructor = this; function fake() { constructor.apply(this, args) }; fake.prototype = constructor.prototype; return new fake; }; basically, function new used inherit prototype methods on newly created object 1 on being called. // new function defined on function prototype so, // can called directly function function.prototype.new = function () { // caching arguments array-like object var args = arguments; // inside new() refers function on `new` called var constructor = this; // fake constructor function/class function fake() { // calling function passing context , arguments constructor.apply(this, args) }; // adding prototype members of function on new called // on new fake class fake.prototype = constructo

mysql - How to recount the count column in wp_term_taxonomy? -

i noticed when importing wordpress xml file blog wp_term_taxonomy table counted wrong , didn't display categories result of that. is there way me recount count column in wp_term_taxonomy . i solved problem calling wp_update_term_count_now() each time importer adds or updates terms in process_posts() .