Posts

Showing posts from 2015

javascript - looping promises in nodejs -

i learning promises in nodejs, below example code. output of below code test - 1 test - 2 test - 3 test - 4 var q = require('q'); var promise = q.when('test'); promise.then( function(val) { console.log(val + '-' + '1'); }); promise.then( function(val) { console.log(val + '-' + '2'); }); promise.then( function(val) { console.log(val + '-' + '3'); }); promise.then( function(val) { console.log(val + '-' + '4'); }); i know how can write same code using loop. this isn't specific promises. if you're creating callbacks in loop, you'll need closure scope , other it's quite standard. however, simplest way specific case use single callback only, attached same promise anyway , receive same value. use require('q').when('test').then(function(val) { (var i=1; i<=4; i++) { console.log(val + '-' + i); } });

Android Studio build failed at "processDebugResources" when using 9-patch images -

i following "the big nerd ranch's android programming guide" book (2nd edition) , in particular chapter (chapter 21), ask use 9-patch image image assets. until then, app wrote, called beatbox, worked fine , compiled without error. but, when go ahead , replace drawables 9-patch image, run build error , cannot make app build. following error get: executing tasks: [:app:generatedebugsources, :app:generatedebugandroidtestsources] configuration on demand incubating feature. :app:prebuild up-to-date :app:predebugbuild up-to-date :app:checkdebugmanifest :app:prereleasebuild up-to-date :app:preparecomandroidsupportappcompatv72311library up-to-date :app:preparecomandroidsupportrecyclerviewv72311library up-to-date :app:preparecomandroidsupportsupportv42311library up-to-date :app:preparedebugdependencies :app:compiledebugaidl up-to-date :app:compiledebugrenderscript up-to-date :app:generatedebugbuildconfig up-to-date :app:generatedebugassets up-to-date :app:mergedebugassets

converter - how do i convert photographs to tensors -

i neophyte neural network user trying grips tensorflow. have used mnist dataset test, , use real world data. can point me "howto" or paper or source tells me how go converting digital photographs in files, (jpeg, png, gif, wmf), tensors ready import tensorflow please? cheers! you can use tensorflow image functions load images , convert them tensors. after loading images, want @ tf.image.resize_bilinear resize images standard sizes.

sql - Sorting in a matrix SSRS -

Image
i try sort machine number ascending. if took out prduct description machines sorted ascending. show product description every machine , show machines sorted(m101,m102,m103...) where date between @startdatetime , @enddatetime , name in ('m101','m102','m103','m104','m105','m106','m107','m108','m109','m110', 'm111') group date, name, productname ) s order name asc it should here: did used matrix [![enter image description here][4]][4] i have try these 2 solution first use case when in order clause order case when name = 'm101' 1 when name = 'm102' 2 end it's not best solution it's can solved problem , second solution use substring in order clause this order cast(substring(name,2,10) int) and if use column group dynamic expand column don't forget delete delete sorting condition. hope it's help

Add marker to google maps in ios using url scheme -

when tap on "open in google maps" button in application, want application navigate google maps application , open address specified , put marker it. here code purpose: uialertaction* googlemaps = [uialertaction actionwithtitle:nslocalizedstring(@"google_maps", @"google maps") style:uialertactionstyledefault handler:^(uialertaction * action) { nsstring *customurl = @"comgooglemaps://?center=41.039400,28.994583&zoom=16&markers=size:mid%7ccolor:0xff0000%7clabel:1%7cvodafone+arena+stadyumu"; [[uiapplication sharedapplication] openurl:[nsurl urlwithstring:customurl]]; }]; when tap on button, correctly navigates specific location. however, not put marker it. there way achieve this? thanks :) as per google doc, format specified in code wrong:- example:- comgooglemaps://?q=vodafone+arena+stadyumu&center=41.039400,28.994583&zoom=15&views=transit this shows marker in center of map

ios - How to setup a UIScrollView to arrange content dynamically? -

Image
i trying create user profile screen. screen have lots of information user. similar airb from looks of it, seems sort of scrollview? or tableview or collectionview? (because seems there rows in there think) does 1 here know how type of view can accomplished or can setup? edit 2 answers below says use uitableview, , 2 other answers says avoid it. there benefits/disadvantages using either? use 1 child uiview call containerview inside uiscrollview , place child views inside containerview . use constraint trailing , leading , top , bottom of containerview uiscrollview . , use constraint placing child views viewcontroller.view not containerview ios find child views have be. good tutorial find out how use constraint on scrollview apple technical note

php - Is it possible to insert the data inside sharedpreference into mysql database? -

is possible insert data inside sharedpreferences remote mysql database? insert product specific user logged in or maybe know better way doing that. using sharedpreferences login session. if know tutorial please kindly share, need in project , new android development. yes, can. first : retrieve data sharedpreferences : sharedpreferences sp = preferencemanager.getdefaultsharedpreferences(myactivity.this); integer myvalue = sp.getint("mykey", 0); then: insert returned value database: this tutorial shows how perform insert mysql database: http://sampleprogramz.com/android/mysqldb.php hope helps.

c# - Dependency property of Custom Templated Control won't be set if it is set to binding in WinRT -

i wrote custom templated richtextblock in order represent emojis , links images , hyperlink buttons respectivly. has 1 "text" dependency property because conversion works process inside control when recieve plain text/string. the problem if text property specific string text="asdasdsa", control represent "asdasdas" properly. if property set bind text="{binding something}", control won't work , setter text dependency property never fire. the style of control this <style targettype="local:myrichtextblock" > <setter property="template"> <setter.value> <controltemplate targettype="local:myrichtextblock"> <border horizontalalignment="center" width="auto" height="auto"> <stackpanel> <richtextblock x:name="childrichtextblock"/>

java - How to start a transaction in another thread? -

spring 4 . i'm working on implementing updatable cache through scheduledthreadpoolexecutor . looks follows: public class myservice { @setter private mydao mydao; //immutable private volatile cache cache; //static factory method public static myservice create(){ myservice retval = new myservice(); cache = cache.emptycache(); updatecache(); } @transactional(propagation = propagation.requires_new) public int get(){ //retrieving cache return cache.getnext(); } private void updatecache() { try{ scheduledexecutorservice ses = executors.newscheduledthreadpool(1); //the runnable should in transaction. runnable updatecache; //the runnable queries mydao, //which in turn implemented db-dao //the cache assigned after computation ses.schedulewithfixeddelay(updatecache, 0, 60, timeunit.seconds); } cat

java - Spring Social Twitter -

i new spring , trying make web application reads last 20 tweets of user getusertimeline(screenname); . far made tutorial spring https://spring.io/guides/gs/accessing-twitter/ , changed request can see last 20 tweets of user. before can see them i'm getting redirected twitter authorization site. saw lot connection in reference i'm not shure best 1 app. want save tweets in database , fetch them view. i solved it.. needs twitter template tokens in application.properties file.

SASS support for VIM? -

i add sass support vim editor, there worth noting plugins or vimrc configuration out there help. have tried vim-haml ? provides vim runtime files haml, sass, , scss.

Android - submitting .ics file to calendar app -

i have calendar app (samsung default on note 3 / lollipop) invoked , inserts contents of downloaded .ics file when open it. i'm trying find proper intent setaction , settype values submit file within custom app. "almost there" solution seems action_view , text/calendar, respectively - calendar app appears briefly, no insertion done. code snippet follows: intent.setdataandtype(uri.fromfile(file), "text/calendar"); intent.setaction(intent.action_view); there countless examples of using parsed data presented extras type vnd.android.cursor.item/event, have yet find answer method. know intent make-up of samsung (or matter, gmail) calendar?

javascript - Angular Validation not working when dot in model -

angular validation working when there no dot(.) in model in following code... <div class="form-group"> <label for="title">post title</label> <input ng-model="new_title" class="form-control" name="new_title" type="text" required/> <p class="error" ng-show="addform.new_title.$touched && addform.new_title.$invalid">this field required</p> </div> but not working when use ng-model="new.title" in following code... <div class="form-group"> <label for="title">post title</label> <input ng-model="new.title" class="form-control" name="new.title" type="text" required/> <p class="error" ng-show="addform.new_title.$touched && addform.new.title.$invalid">this field required</p> </div> he

mysql - error not reported when taking input of deleted resource(soft deletion) in laravel 5 php -

i have model "topics". say, have soft deleted resource id=1 in topics. i have model "posts" has attribute "topics_id". now,i tried insert resource in posts table "topic_id"=1,it getting inserted table.but, want report exception or error.i know can implemented in controller checking "find" method.is there code can used in model doesn't inserted. perhaps use model events? see docs here: https://laravel.com/docs/5.2/eloquent#events so on post model following trigger when creating post : public static function boot() { parent::boot(); static::creating(function($post) { // check foreign key validaty // throw error if doesn't exist }); }

ios - tableView imageView content mode not working? -

i have image, inside of table row, i'm trying make round doing height/2 cell.imageview.frame.height/2 so problem when i'm trying insert image cell, image doesn't change size, code looks this let named = "avatar.png" let imagename = uiimage(named: named) cell.imageview?.image = imagename cell.backgroundcolor = uicolor.clearcolor() if(tablearray[indexpath.row] == "avatar"){ cell.imageview!.frame = cgrectmake(0,0,10,10) cell.imageview?.layer.borderwidth = 1 cell.imageview?.layer.maskstobounds = true cell.imageview?.layer.bordercolor = uicolor.blackcolor().cgcolor cell.imageview?.layer.cornerradius = cell.imageview!.frame.height/2 cell.imageview?.clipstobounds = true cell.imageview?.contentmode = .scaleaspectfit } i've tried lot of suggestions google, stackoverflow couldn't whats problem, can help? you cannot change size of imageview present in default uitableviewcell , if want change imageview size

How to increase the connection retry period for Jenkin slave nodes -

i have distributed jenkins setup many slave nodes. when master nodes rebooted, takes while come , lose slave node. there way set retry period slave nodes? increase 1 hour, or keep retrying indefinitely. according launching slave.jar from console it's supposed happen other way round: slave.jar meant launched jenkins. [...] slave.jar not meant initiate connection master on own there's option write own script launch jenkins slaves .

html - divs inside div not working properly -

this question has answer here: css container div not getting height 5 answers <div id="footer"> <div> <h2>revovation</h2> <p>our mission provide best handyman service @ reasonable price without sacrificing quality. satisfy our work knowing take necessary steps meet needs , job done right </p> </div> <div> <h2>information</h2> <div> <ul> <li>blog</li> <li>services</li> <li>extras</li> <li>contact</li> </ul> </div> <div> <ul> <li>projects</li> <li>information</li>

testing - Retry teamcity build if tests failed with some threshold -

Image
is there option or plugin re-run/trigger teamcity build if threshold of failed tests reached. e.g. 10 tests 100 failed - not retry build 11 tests 100 failed - trigger build again a "retry build trigger" retry failed builds there no way based on number of tests have failed. you write monitors build runs , retries them using teamcity rest api .

c# - Why is my FileSystemWatcher flag not updating in my razor view -

i have mvc 5 project set run iis express on vs2015. makes use of filesystemwatcher monitor folder , populate list accordingly. every 5 seconds check state of folderchanged flag. when true want alert user , reset flag false. have verified filesystemwatcher works , folder being correctly monitored. problem folderchanged flag never seen true in razor view updated in do_something method. fear may missing fundamentally simple have no idea what. appreciated. model class: public class logfileparser { public list<string> folderrecords { get; set; } public bool folderchanged { get; set; } private filesystemwatcher folder_watcher; public logfileparser() { //set list folder path , filesystemwatcher folder_watcher.changed += do_something(); folder_watcher.enableraisingevents = true; } private void do_something(object sender, filesystemeventargs e) { //populate folderrecords list folderchanged = true; } }

javascript - Adding properties to function, object and prototype -

lets have function: function myfunc () { this.property1 = 10; } var myobject = new myfunc(); now lets want add new property it. myfunc.newproperty = "new"; myobject.newproperty = "new"; myfunc.prototype.newproperty = "new"; what difference between these aproaches? , 1 should use? approach 1 myfunc.newproperty = "new"; because function object, create new property on it. may useful if work directly function object . approach 2 myobject.newproperty = "new"; on new instance of myfunc constructor, create own property . useful when need modify single instance, don't want modify class newproperty . new instances created new myfunc() not inherit or contain newproperty . approach 3 myfunc.prototype.newproperty = "new"; if modify constructor prototype , created objects inherit property. useful when need existing or new object created new myfunc() inherit newproperty . which 1 use

Evaluating Nginx Plus R7 Performance -

i evaluating nginx plus r7 commercial version , seems has significant performance improvements it's previous versions still there java runtime libraries gives high performance nginx simple proxy scenarios. following configuration add , have enabled thread pools , socket shading well. user nginx; worker_processes auto; events { worker_connections 100000; use epoll; multi_accept on; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 6000; keepalive_requests 100000; access_log off; tcp_nopush on; tcp_nodelay on; open_file_cache max=9000000 inactive=20s; open_file_cache_valid 30s; open_file_cache_min_uses 2; open_file_cache_errors on; reset_timedout_connection on; client_body_timeout 10

docker-compose --x-networking up not working -

i trying set docker-compose network command docker-compose --x-networking return standart docker-compose output define , run multi-container applications docker. usage: docker-compose [-f=<arg>...] [options] [command] [args...] docker-compose -h|--help options: -f, --file file specify alternate compose file (default: docker-compose.yml) -p, --project-name name specify alternate project name (default: directory name) --verbose show more output -v, --version print version , exit commands: build build or rebui... (etc) any idea why? this depends on version of docker-compose you're using. versions before 1.5 did not have flag. if you're using 1.6; --x-networking flag no longer present in 1.6 because it's automatically used if docker-compose.yml uses 2.0 format see release notes ; support networking has exited experimental status , recommended way enable communication be

Google Calendar V3 Ruby API insert event -

Image
i using example https://developers.google.com/google-apps/calendar/v3/reference/events/insert event = google::apis::calendarv3::event.new{ summary:'google i/o 2015', location:'800 howard st., san francisco, ca 94103', description:'a chance hear more google\'s developer products.', start: { date_time: '2015-05-28t09:00:00-07:00', time_zone:'america/los_angeles', }, end: { date_time:'2015-05-28t17:00:00-07:00', time_zone:'america/los_angeles', } } result = service.insert_event(calendar_id, event) however, got error: wwtlf:~/workspace $ ruby test.rb /usr/local/rvm/gems/ruby-2.3.0/gems/google-api-client-0.9.1/lib/google/apis/core/http_command.rb:202:in `check_status': required: missing end time. (google::apis::clienterror) /usr/local/rvm/gems/ruby-2.3.0/gems/google-api-client-0.9.1/lib/google/apis/core/api_command.rb:103:in `check_status' /usr/local/rvm/gems/ruby-2.

swift - How to override internal framework method in application (outside framework) -

is there anyway override internal framework method when subclassing in swift? ex. superclass public class barchartrenderer: chartdatarendererbase { internal func drawdataset(context context: cgcontext, dataset: barchartdataset, index: int) { ... } } and want override method draw differently dataset (ios-charts) public class esbarchartrenderer: barchartrenderer { overide func drawdataset(context context: cgcontext, dataset: barchartdataset, index: int) { ... } } but when i'm trying override xcode gives me error: method not override method superclass because it's internal. there 1 internal variable need access , same above xcode can't see it.

elasticsearch - kibana filters show differents value if it's a metric or a histogram -

Image
does can explain me why query doesn't give same result in 2 differents vizualisations ? the metric 1 give result! i needed add { "precision_threshold": 1000 }

Python, "subprocess.check_ouput()" hangs while installing rpm -

i trying install .rpm through subprocess.check_ouput() i.e. buff=subprocess.check_output(["rpm","-ivh","package_name"]) even though package installed, python script stuck @ instruction (not executing below instructions.) please note other "rpm" operation working subprocess.check_output() after including shell=true , i.e. buff=subprocess.check_output(["rpm","-ivh","package_name"],shell=true) package not getting installed , throwing error @ instruction, error : rpm usage can help?

Javascript on wordpress website page disappears as soon as I try to save it -

i'm trying insert javascript wordpress page. added functions.php : function add_custom_code() { if (is_front_page()) { ? > < script > (function() { var randomid = math.floor(math.random() * 100000); var targetelemid = ‘bcom_rwidget_’ + randomid; document.write(‘ < div id = ”‘+targetelemid + ‘” > < /div>‘); var script = document.createelement(‘script’); script.type = ‘text / javascript’; script.async = true; script.src = ‘http: //www.booking.com/review_widget/gb/the-manor-house-bed-amp-breakfast-enter code here`trunch.en.html?tmpl=review_widget/review_widget&wid=’ + targetelemid + ‘&wtype=box_small&hotel_id=xxxxx&`enter code here`widget_language=en’; var node = document.getelementsbytagname(‘script’)[0]; node.parentnode.insertbefore(script, node); }()); < /script> < ? php } } add_action('wp_footer', 'add_custom_code'); bu

javascript - In Webpack, how to enable a plugin according to command line parameters? -

following plugin property webpack.config.js : plugins: [ new webpack.provideplugin({ $: 'jquery', jquery: 'jquery' }), new webpack.optimize.occurenceorderplugin(), new webpack.defineplugin({ 'process.env': { 'node_env': json.stringify('production'), } }), new webpack.optimize.uglifyjsplugin({ compressor: { warnings: false } }), new compressionplugin({ asset: '{file}', algorithm: 'gzip', regexp: /\.js$|\.html$/, }) ], sometimes want disable compressionplugin while want enable it. however, looks clumsy create 2 webpack config files. wondering whether there way enable/disable plugin dynamically using command line parameters? for example, great if can use webpack --disable-compression-plugin disable compressionplugin . have ideas this? try yargs npm module this: npm install yargs -

.net - Handling multipe timers in a single timer -

i have around 20 timers on form, different intervals. example, 1 has interval of 25, 1 has interval of 100, have "irregular" intervals 43. i have single timer , handle in tick event. for example this: private sub _tmrall_tick(sender object, e eventargs) handles _tmrall.tick _itimer += 25 if _itimer mod 25 = 0 phandleclickdelayrepeat() end if if _itimer mod 100 = 0 phandleskype() end if if _itimer mod 43 = 0 'this of course not work current approach phandlemouse() end if it think current approach not because can not handle these irregular intervals. does have better idea of how it? thank you. you need 1 timer , set interval largest divisor (with no remainder) of of intervals can. in case 43 divides 43 or 1. can't use 43 because not divisor of 25, option 1. means firing lots of times when doing nothing doesn't matter. so keep track of interval variable (you can use static variable k

How to use Regex to match PHP time() or microtime() in a string? -

i have regex command matches php time in string: preg_match( '/([a-z]+)_([0-9]{9,})\.jpg/i', $aname, $lmatches ); how can modify match microtime() in same match? examples: foobar_1453887550.jpg (match) foobar_1453887620.8717.jpg (match) foobar_123.jpg (don't match) foobar_adsf123123.jpg (don't match) add optional group using ? : preg_match( '/([a-z]+)_([0-9]{9,})(\.[0-9]{4,})?\.jpg/i', $aname, $lmatches ); here (\.[0-9]{4,})? optional group can present or not in string. considering @trincot remark can change optional group (\.[0-9]+)? if ending zeroes not present in milliseconds. preg_match( '/([a-z]+)_([0-9]{9,})(\.[0-9]+)?\.jpg/i', $aname, $lmatches );

Not able to call service in angularjs -

i getting following error: error: [$injector:unpr] unknown provider: myserviceprovider <- myservice while calling service in angularjs please me solve issue var app = angular.module('app', []) app.controller('mycontroller', ['$scope', 'stringservice', function ($scope, stringservice) { $scope.output = stringservice.processstring(input); }]); var app = angular.module('app', []); app.factory('stringservice', function(){ return{ processstring: function(input){ if(!input){ return input; } var output = ""; for(var = 0; < input.length; i++){ if(i > 0 && input[i] == input[i].touppercase()){ output = output + " "; } output = output + input[i]; } return output; } } }); in: ['$scope', 'myservice

typoscript - TYPO3 6.2 no alternate language content -

i've created multilingual typo3 6.2 website fluid , gridelements. have big problem language translations (btw: same problems occur in typo3 7.6) if create alternative page language no content inside, want show default language , in case german. otherwise, if there is content on translated (english) site, german default should hidden , complete alternativ language content should visible. in case only possible translate exakt these parts german default language , not possible create new content not shown in default language. in typo3-backend can create new content, not shown. if set config.sys_language_overlay = 0 @ typoscript, new content visible, complete default content isn't shown. which settings necessary show complete content @ alternative language , default content empty pages? this have tried far: styles.content.get.select.includerecordswithoutdefaulttranslation = 1 styles.content.getleft.select.includerecordswithoutdefaulttranslation = 1 styles.conte

Display file in java swing GUI -

having problems displaying ".txt" file in java swing gui. i have code read .txt file , display in cmd window cant seem link display in gui. here code reads file: import java.io.*; public class readfile { public static void main (string [] args) throws ioexception{ string inputline = ""; filereader inputfile = new filereader( "player.txt"); bufferedreader br = new bufferedreader(inputfile); system.out.println( "\nthe contents of file player.txt "); // read lines of text file, looping until // null character (ctrl-z) endountered while( ( inputline = br.readline()) != null){ system.out.println(inputline); // write screen } br.close(); // close stream } // end of main method } // end of class here code swing gui import java.awt.event.*; import javax.swing.*; import java.io.*; public class gui extends jframe{ private jbutton button; //set hight , width of interface private static final int width = 500; private static

spring - Why is Swagger's api-docs response wrapped in additional JSON Object? -

i added swagger spring boot application including dependency: <dependency> <groupid>io.springfox</groupid> <artifactid>springfox-swagger2</artifactid> <version>2.3.1</version> </dependency> and adding config class: @configuration @enableswagger2 public class swaggerconfig { @bean public docket api(){ return new docket(documentationtype.swagger_2) .select() .apis(requesthandlerselectors.any()) .paths(predicates.or(pathselectors.regex("..."))) .build() .apiinfo(apiinfo()); } private apiinfo apiinfo() { return new apiinfo(...); } } i can access /v2/api-docs , json seems describe api. however, json wrapped in json object (abbreviated): {"value":"{\"swagger\":\"2.0\",\"info\":...} the {"value": "..."} object isn't needed , causes errors in swagger

ios - Rendering the view on uitableviewcell when viewcontroller is shown again -

here cellforrowatindexpath method: func tableview(tableview: uitableview, cellforrowatindexpath indexpath: nsindexpath) -> uitableviewcell { let documentpartcell = tableview.dequeuereusablecellwithidentifier("documentpartcell", forindexpath: indexpath) as! documentpartcell documentpartcell.documentpart = documentpart return documentpartcell } and here cell class: class documentpartcell: uitableviewcell { @iboutlet weak var documentpartprogress: uilabel! var allfields: int var invalidfields: int var documentpart: documentpart? { didset { self.documentpartprogress.text = "\(int(allfields)! - int(invalidfields)!) / \(allfields)" } basically, documentpartprogress label shows progress of document. flow of app there cell shows progress in vc1. when cell pressed, moves vc2 , can make changes. when answer questions progress changes. when press back button in vc2, goes vc1 , should update documentpar

javascript - react redux router display blank page -

i have index.js like: render( <root store={store} />, document.getelementbyid('root') ) and root.js like: class root extends component { render() { const { store } = this.props return ( <provider store={store}> <reduxrouter /> </provider> ) } } root.proptypes = { store: proptypes.object.isrequired } export default root and routes.js like: export default ( <route path="/" component={app}> </route> ) and app.js like: class app extends component { render() { <div> <p>some cool header</p> </div> } } export default app but when access web via localhost:3000 show blank page.. expect show <p>some cool header</p> it not give error.. issue here.. you have not passed routes reduxrouter component inside of root component render function. why app not being rendered , see blank page! update root.js

java - Accessing hadoop from remote machine -

i have hadoop set (pseudo distributed) on server vm , i'm trying use java api access hdfs. the fs.default.name on server hdfs://0.0.0.0:9000 (as localhost:9000 wouldn't accept requests remote sites). i can connect server on port 9000 $ telnet srv-lab 9000 trying 1*0.*.30.95... connected srv-lab escape character '^]'. ^c which indicates me connection should work fine. java code i'm using is: try { path pt = new path( "hdfs://srv-lab:9000/test.txt"); configuration conf = new configuration(); conf.set("fs.default.name", "hdfs://srv-lab:9000"); filesystem fs = filesystem.get(conf); bufferedreader br = new bufferedreader(new inputstreamreader( fs.open(pt))); string line; line = br.readline(); while (line != null) { system.out.println(line); line = br.readline(); } } catch (exception e) {

Azure SDK Download link for 32 bit Windows -

very silly question. can share me azure download link 32-bit os version microsoft? regards, viswa v. https://www.microsoft.com/en-us/download/details.aspx?id=48178 but instead of manually downloading, recommended use automated one-click install provided web platform installer (x86 version here ).

node.js - Socket.io emit callback not firing on server side? -

my server emits events properly, emit callback never works. in following, nothing logged on console: server: io.sockets.emit('delete hint', {id: id}, function(data){ console.log('callback'); }); client: socket.on('delete hint', function(data){ // display message before deleting $('#' + data.id).fadeout(function(){ $(this).remove(); }); }); i've tried client side code function(data, fn) in case callback needed included on receiving function. i'm using windows , command prompt shows following when socket.io emitting event: websocket writing 5:::{"name":"delete hint", "args":[{"id":"1"}, null]} i can't figure out problem is, doing wrong? a callback executed on sender computer when receiver computer calls have @ code: server: io.sockets.on('connection', connectionfunc); function connectionfunc (so

mysql - SQL query for ASCII Charcters -

i writing query replace ascii charcters. before need search text contains ascii character. select * __item description '%Â%'; how query find descrption under __item table contains character  ?? try: select * __item description '%Â%' collate utf8_general_ci;

javascript - DataTable pagination only can count checkboxes of first page -

i have table, pagination. created script count check boxes checked on table. works on first page, when select second page, doesn't count when select. here script: <script> $(document).ready(function(){ var data = { '300x250': 0, '160x600': 0, '728x90': 0, '300x600': 0, '300x300': 0, '120x600': 0, '100x72': 0, '970x250': 0, '750x200': 0, '120x60': 0, '200x600': 0, } function registerevents() { $(".checkbox").on("change", function() { var value = $(this).is(":checked") ? 1 : -1; var key = $(this).attr('value').split('_')[0]; console.log(key, value); data[key] += value; printdata(); }); } function printdata() { $("#result").html(json.s

XSLT / XPath function to remove trailing characters -

i have situation whereby displaying address in xform, address comes me pre formatted, contains couple of trailing commas, need remove. here code: <xf:output id="address-control" ref="$address" > <xf:label>gp address</xf:label> </xf:output> which, produces output this: house, road, town, , , , , i need strip out trailing commas output becomes: house, road, town thanks in advance using replace($address, '[\s,]+$', '') should remove trailing mix of white space , commas.

c++ - OpenACC parallel kernels not getting generated -

i developing code on pgc++ graphically accelerating code. i using openbabel has eigen dependancy. i have tried using #pragma acc kernel i have tried using #pragma acc routine my compilation command is: "pgc++ -acc -ta=tesla -minfo=all -i/home/pranav/new_installed/include/openbabel-2.0/ -i/home/pranav/new_installed/include/eigen3/ -l/home/pranav/new_installed/lib/openbabel/ main.cpp /home/pranav/new_installed/lib/libopenbabel.so" i getting following error pgcc-s-0155-procedures called in compute region must have acc routine information: openbabel::obmol::settorsion(openbabel::obatom *, openbabel::obatom *, openbabel::obatom *, openbabel::obatom *, double) (main.cpp: 66) pgcc-s-0155-accelerator region ignored; see -minfo messages (main.cpp) bondrot::two(std::vector>, openbabel::obmol, int, openbabel::obmol): 11, include "bondrot.h" 0, accelerator region ignored 66, accelerator restriction: call 'openbabel::obmol::set

objective c - PlaceHolder animates when start typing in TextField in iOS -

Image
how set type of animation in uitextfield ? nowadays, many apps using this. i've found solution. can manage type of animation using multiple labels, , show-hide labels textfielddidbeginediting method. if want nice animation same describe question, try once following third party repository uitextfield . jvfloatlabeledtextfield uifloatlabeltextfield floatlabelfields if looking uitextview equivalent of animation, please visit uifloatlabeltextview repository.

sql server 2008 - Updating drop down list values in SSRS Parameter -

i have problem in report, parameter students need updated have left. at present shows list of students(multi-value) , picking them along other parameters show data in report. my question should delete students database or can restrict them in report parameter shows current enrolled students. thanks, ar delete students not ideal way in terms of maintain historical data. you can update active status in database students have left. , return students status active in result set of ssrs report. please find more here .

objective c - How to Pass a Object to NextViewController in iOS? -

i parsing restkit values.i having entity called ey_connections attributes.just parsing values using rkmappingoperation in viewcontroller.m , stored values of mappingoperation object of ey_connections . viewcontroller.m @interface newconnectionviewcontroller() { dataaccesshandler *dataaccess; rkmappingresult *savedmappingresult; ey_connections *connect; } -(void)requestconnectiondata { nsstring *requestpath = @"user_history/consumer/data.json"; [[rkobjectmanager sharedmanager] getobjectsatpath:requestpath parameters:nil success: ^(rkobjectrequestoperation *operation, rkmappingresult *mappingresult) { nslog(@"result arrray us: %@",mappingresult); savedmappingresult = mappingresult; connect = ((ey_connections *)savedmappingresult.firstobject); } failure: ^(rkobjectrequestoperation *operation, nserror *error) { rklogerror(@"load failed error: %@", error); } ]; } if click save button means,it should pass attribute val

java - Tables in SQL Server database are not auto-created -

i'm trying auto-create tables java in database on microsoft sql server 2012. i'm using jpa , there persistence.xml : <?xml version="1.0" encoding="utf-8"?> <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"> <persistence-unit name="pu" transaction-type="jta"> <provider>org.hibernate.ejb.hibernatepersistence</provider> <jta-data-source>ds</jta-data-source> <class>msg.message</class> <class>msg.response</class> <properties> <property name="hibernate.connection.driver_class" value="com.microsoft.jdbc.sqlserver.sqlserverdriver"/> <property name="hibernate.dialect&qu

windows - XCOPY not recognized as internal or external command -

i new batch file coding. trying use xcopy copying file. first used this: @echo off move mypath\abc.txt mypath\abc.txt.0001 xcopy mypath\abc.txt.bak mypath\abc.txt pause this code working fine. needed take input user, o modified code this: @echo off echo starting application. set /p path=enter path: set /p corruptfilename=enter corrupted file name: set /p oldbackupfilename=enter backup file name restore: set /p correuptedbackupname=enter corrupted backup file name: echo path : echo %path% echo corrupted file name : echo %corruptfilename% echo desired backup file name: echo %correuptedbackupname% echo backup file name restore : echo %oldbackupfilename% move %path%\%corruptfilename% %path%\%correuptedbackupname% call :waitfor 5000>nul xcopy %path%\%oldbackupfilename% %path%\%corruptfilename% pause this code not running. says : the system cannot find batch label specified - waitfor 'xcopy' not recognized internal or external command, operable program

python - Asyncio decode utf-8 with StreamReader -

i getting used asyncio , find task handling quite nice, can difficult mix async libraries traditional io libraries. problem facing how decode async streamreader. the simplest solution read() chunks of byte strings, , decode each chunk - see code below. (in program, wouldn't print each chunk, decode string , send method processing): import asyncio import aiohttp async def get_data(port): url = 'http://localhost:{}/'.format(port) r = await aiohttp.get(url) stream = r.content while not stream.at_eof(): data = await stream.read(4) print(data.decode('utf-8')) this works fine, until there utf-8 character split between chunks. example if response b'm\xc3\xa4dchen mit bi\xc3\x9f\n' , reading chunks of 3 work, chunks of 4 not (as \xc3 , \x9f in different chunks , decoding chunk ending \xc3 raise following error: unicodedecodeerror: 'utf-8' codec can't decode byte 0xc3 in position 3: unexpected end of data

html - CSS background-image property -

here html: <div id="banner" style="background-image: url("img/banner.jpg")"> <img src="img/logo.png" alt="logo" /> </div> and css: #banner { width: auto; height: 100vw; background: url("/img/banner.jpg"); i want banner.jpg background of div full viewport fill... do? add following css code: #banner{ width: %100; }

parsing - awk to parse csv file -

my input file is: 1601260800434:0:0:0:0:0:157:154:1022:1020:764:765:0:0:0:0:0:0:3:0:0:0:796:223:0:596:168:13247:12178:0 1601260800434:0:0:0:0:0:144:143:1100:1103:914:912:0:0:0:0:0:0:0:0:0:0:822:280:0:715:196:13469:12248:0 1601260815434:0:0:0:0:0:184:178:1005:1006:830:829:0:0:0:0:0:0:2:0:0:0:781:225:0:629:200:13227:12170:0 1601260815434:0:0:0:0:0:182:181:1304:1307:912:914:0:0:0:0:0:0:1:0:0:0:988:317:0:720:193:13537:12330:0 1601260830434:0:0:0:0:0:162:157:1064:1065:873:873:0:0:0:0:0:0:5:0:0:0:846:219:0:705:168:13217:12176:0 1601260830434:0:0:0:0:0:173:168:1273:1273:1004:1002:0:0:0:0:0:0:5:0:0:0:939:332:0:771:229:13531:12328:0 how can have sum per column columns when first field same? 1 total 1601260800434, 1 1601260815434, etc. expect output: 1601260800434:0:0:0:0:0:301:297:2122:2123:1678:1677:0:0:0:0:0:0:3:0:0:0:1618:503:0:1311:364:26716:24426:0 1601260815434:0:0:0:0:0:366:359:2309:2313:1742:1743:0:0:0:0:0:0:3:0:0:0:1769:542:0:1349:393:26764:24500:0 1601260830434:0:0:0:0:0:335

c# - how to align PdfPCell or paragraph using iTextSharp? -

Image
i creating 1 table, containing cells paragraphs. in paragraphs, adding 2 chunk objects add image , 3 phrase objects add text , black space following: var headertable = new pdfptable(1); headertable.rundirection = getdirection(lang); headertable.defaultcell.border = rectangle.no_border; headertable.widthpercentage = 100f; var celllogo = new pdfpcell(); celllogo.border = rectangle.no_border; paragraph pheader = new paragraph(); pheader.add(new chunk(logo,0,0)); //image pheader.add(new phrase(" ")); pheader.add(new chunk(_localizationservice.getresource("admin.commmon.hnlrequisition", lang.id), labrecfont)); pheader.add(new phrase(" ")); pheader.add(new chunk(imghnl, 0, 0));//image celllogo.addelement(pheader); headertable.addcell(celllogo); now want each , every element in paragraph aligned getting below output: how can make sure text , images aligned.

css - HTML Semantics - <span> element and validity -

technically speaking block of code valid (would test it's valid): <body><span>some text</span></body> opposed <body><p><span>some text</span></p></body> - know valid yes that's html valid both cases . take on html w3c validator verifrying whther html valid or not.

java - problems when declaring and assigning a value to a variable -

i have class, variable called palabra, don't know how declare it. public paraula() { lletres = new char[maxim]; llargaria = 0; } public static paraula llegir() { paraula nova = new paraula(); botarblancs(); while ((lletra != fisequencia) && // no ha acabat la seqüència (lletra != blanc)) { // hi ha prou espai nova.lletres[nova.llargaria++] = lletra; lletra = leercarteclado(); } return nova; } public string tostring() { string msg = ""; (int idx = 0; idx < llargaria; idx++) { msg += lletres[idx]; } return msg; } public boolean esiguala(paraula b) { boolean iguals = llargaria == b.llargaria; (int idx = 0; (idx < llargaria) && iguals; idx++) { iguals = lletres[idx] == b.lletres[idx]; } return iguals; } public static boolean iguals(paraula a, paraula b) { return a.esiguala(b); } public boolean buida() { return llargaria == 0; } publ

javascript - jQuery chaining vs. callbacks for animation functions -

say have element want animate: $('.hey').show(1000).slideup(1000); what's difference between and: $('.hey').show(1000, function() { $(this).slideup(1000); }); in terms of happens internally? far know, animations asynchronous in jquery. first example, show , slideup should fire @ same time. in second, slideup should fire after show ends. yet, reason, people on answer they're "same". why same despite (obvious) fact work different (in first example, return happen immediately, unlike second one)? yet, reason, people on answer they're "same". you're right, aren't. there's particularly large difference between them if more 1 element matches .hey . quoted code, although sequence of steps take different, end doing same thing. why same despite (obvious) fact work different (in first example, return happen immediately, unlike second one)? in both of examples, code runs , completes ("retu

c++ - Placing window after TaskManager window fails with ERROR_ACCESS_DENIED -

i'm trying place window after taskmanager window , fails error_access_denied : if (setwindowpos(mywindowhndl, taskmanagerhndl, left, top, right - left, bottom - top, swp_noactivate | flags)) { log_error("setwindowpos() succeedded"); } else { log_high("setwindowpos() failed: " << getlasterror()); } is there special taskmanager window , possible overcome this? thanks. not task manager, feature introduced vista known uipi (user interface privilege isolation). here more information. try running application elevated. see if works then. if problem.

objective c - How NSDictionary algorithm works in iOS? -

i need understand how nsdictionary algorithm works in ios? i assuming using hashing algorithm internally in java hashmap uses concept of bucket , hashcode . are mechanism of nsdictionary same of hashmap in java? nsdictionary uses cfdictionary open source apple here . also see let's build nsmutabledictionary mike ash.

javascript - jQuery UI Bounce Effect with CSS Sprite Image -

im trying make social icons bounce using jquery ui bounce effect. im working off template & docs jquery. rest im trying write html,css & js myself have errors in there. im having problem getting icons bounce. think because im using sprite image social icons. can take @ , me out? the jquery & jquery ui in header <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"</script> the css being used: #footer {background:#1c1c1c; padding:40px 0 20px; border-top:4px solid #fff;} #footer {color:#fff;} #footer a:hover {color:#d5d5d5;} #footer .social-icons {float:right;} #footer .copyright img {float:left; margin-right:20px;} #footer .copyright p { font-size:80%; line-height:140%; } #footer .social-icons { } #footer .social-icons li.title {line-height:30px;} #footer .social-icons li {margin:0 0 0 10px; } #footer .soc