Posts

Showing posts from May, 2013

r - Error (as ‘lib’ is unspecified) to install rjava -

i installing rjava on 64bit machine, running windows 7, , encountering weirdest message. below log. has seen before? in advance. install.packages("rjava") installing package ‘c:/users/laila.rothe/documents/r/win-library/3.2’ (as ‘lib’ unspecified) trying url 'http://cran.rstudio.com/bin/windows/contrib/3.2/rjava_0.9-6.zip' content type 'application/zip' length 761928 bytes (744 kb) downloaded 744 kb package ‘rjava’ unpacked , md5 sums checked downloaded binary packages in c:\users\laila.rothe\appdata\local\temp\rtmpmcecqy\downloaded_packages library(rjava) error : .onload failed in loadnamespace() 'rjava', details: call: indl(x, as.logical(local), as.logical(now), ...) error: unable load shared object 'c:/users/laila.rothe/documents r/win-library/3.2/rjava/libs/x64/rjava.dll': loadlibrary failure: specified module not found. error: package or namespace load failed ‘rjava’

php - Split interface into multiple when using repository pattern in Laravel 5 -

i have eloquentcompanyrepository class implements companyrepository interface. interface consist of such methods find , all , save , other common methods. plus has methods saveemail , savecall , savesms . apart eloquentcompanyrepository there other classes have saveemail , savecall, savesms methods. i want split companyrepository interface separate files. basic eloquentrepository , interfaces emailablecontract , callablecontract , smsablecontract . however don't understand, binding in service provider? interface should use in controllers? there situation when repository implement eloquentrepository , emailablecontract example. , can't use both interfaces in controller, since if want eloquentcompanyrepository class , implements these 2 interfaces, should use in $app->bind? i don't repeat these methods find, all, saveemail etc in multiple repositories in laravel 5 have called contextual binding . can bind given implementations different contr...

python - Merging(2 lists) X Coordinate List and Y Coordinate List to Get(1 list) XY Coordinate List -

i have list of: xvalues = [1,2,3,4,5,6,7,8,9,10] and list of: yvalues = [n1,n2,n3,n4,n5,n6,n7,n8,n9,n10] the y-values random thats why being notated are. i want merge these 2 lists 1 list this: xyvalues = [(1,n1),(2,n2),(3,n3),(4,n4),(5,n5),(6,n6),(7,n7),(8,n8),(9,n9),(10,n10)] and plot them on top of: x = numpy.linspace(0,15,100) y = 1 plt.plot(x,y,'g') can done? you need zip: xvalues = [1,2,3,4,5,6,7,8,9,10] yvalues = ["n1","n2","n3","n4","n5","n6","n7","n8","n9","n10"] print(zip(xvalues,yvalues)) output: [(1, 'n1'), (2, 'n2'), (3, 'n3'), (4, 'n4'), (5, 'n5'), (6, 'n6'), (7, 'n7'), (8, 'n8'), (9, 'n9'), (10, 'n10')]

css - Lato Hairline Light doesn't render in firefox -

Image
but in chrome! css: h3 { font-family: 'lato hairline light'; font-size: 20px; text-align: center; opacity: 0; color: lime; animation-fill-mode: forwards; animation-name: fadein; animation-timing-function: ease-in; animation-duration: 1s; animation-delay: 1s; } renders fine in chrome: but renders default font in firefox: this happens "light" version of lato hairline. if use "lato" or "lato hairline", renders fine in both browsers. why happen , how can fix it? edit: added @font-face { font-family: 'lato hairline'; src: url('lato-hairline.ttf') format('truetype'); } edit2: "lato hairline" font-weight set normal not same "lato hairline light". here's "lato hairline light" + bold: here's "lato ha...

javascript - AngularJS and getting ng-click to work on dynamically loaded html -

i wonder if little here. trying build small image gallery using angularjs , laravel. far working out great. problem having when dynamically load 1 of html files, ng-click directive not seem work on dynamic content. have looked , came across $compile option, cannot life of me see how can implement it. any 1 have idea of need do? have attached code working below: controller code app.controller('myphotos', function ($scope, $timeout, $http, $document, $modal, $log, $sce, $compile) { $scope.loadalbums = function () { $scope.loading = "<div class='text-center'><strong>...loading...</strong></div>"; $scope.isloading = true; $http({ method: 'get', url: '/my/photos/fetch/albums' }).success(function (data) { var htmlcontent = $compile(data.albums)($scope); $scope.gallerycontent = $sce.trustashtml(data.albums); $log.log(data.albums); $scope.isloading ...

javascript - Function inside setTimeout doesn't modify $scope variables / CSS properties -

i'm battling settimeout(), unable grasp problem be. first thought scope problem can't fix it. i'd delay hiding/unhiding of div let css transition on opacity kick in when click alert_button fade hide alert, fades , i'm left invisible div. delayed $scope.alert_token doesn't switch 'true' , opacity of alert stuck on 1. app.js : angular.module('myapp', []) .controller('myctrl', function($scope) { $scope.alert_token = true // hide if true $scope.alert_message = "" $scope.p_name = "" $scope.isinarray = function(arr, item) { // if item in array if (arr.indexof(item) > -1) { $scope.alert_token = !$scope.alert_token $scope.alert_message = "entry exists" settimeout(function() { document.getelementbyid("alert").style.opacity = "1" }, 305) } else ... } $scope.submit = func...

php - How to customize a 404 error page (ubuntu nginx) -

i in process of setting own website, , 1 of things have run ugly 404 error page. running lemp stack on ubuntu, default error page nginx page. needless say, not how default error pages look, , change it. have seen various methods of how this, lot of them deal apache (which may same), .htaccess, etc. however, sure there must easier way this. isn't 404 page simple .html page should able edit? how can edit default 404 page in easiest way possible without using else's? the answer yes, there easy way customize 404 page html file, @ least on lemp stack. assuming have not re-organized "too many" files, thing needs done create single file. explanation: if go /etc/nginx/sites-available/default.conf , open it, notice block looks similar this: server { listen 80 default_server; listen [::]:80 default_server ipv6only=on; root /usr/share/nginx/html; index index.php index.html index.htm; # make site accessible http://localhost/ server_...

javascript - Need help debugging vowel counting JS -

this question exact duplicate of: why code not count vowels? [duplicate] 3 answers i need debug segment of code class , have fixed number of things i'm not sure why doesnt work. supposed count number of vowels in phrase , return them in div element believe. returns "undefined vowels" here html <!doctype html> <html> <!-- vowels.html --> <head> <meta charset="utf-8"> <title>vowels</title> <link rel="stylesheet" href="../css/easy.css"> <script src="vowels.js"></script> </head> <body> <header> <h1>i'd buy vowel</h1> </header> <main> <label> type phrase here: <input type='text' id='textbox'> </input...

python - How to make panda3d accept controls faster? -

hi trying make game on panda3d v 1.8.1 (python) controls seem sloppy. 1 has keep keys pressed second or 2 make things happen. there way make panda3d accept controls faster ? here's code of key handler : class keyhandler(directobject): def __init__(self): self.accept('arrow_left-repeat', self.lookleft) self.accept('arrow_right-repeat', self.lookright) self.accept('arrow_up-repeat', self.lookup) self.accept('arrow_down-repeat', self.lookdown) self.accept('w-repeat', self.moveforward) self.accept('s-repeat', self.movebackward) self.accept('a-repeat', self.moveleft) self.accept('d-repeat', self.moveright) self.accept('q-repeat', self.movedown) self.accept('e-repeat', self.moveup) self.accept('space', self.dotask) def lookleft(self): global camxy camxy += 2 def lookright(s...

rust - Variable binding: moving a &mut or borrowing the referent? -

this code fails expected @ let c = a; compile error "use of moved value: a ": fn main() { let a: &mut i32 = &mut 0; let b = a; let c = a; } a moved b , no longer available assignment c. far, good. however, if annotate b 's type , leave else alone: fn main() { let a: &mut i32 = &mut 0; let b: &mut i32 = a; let c = a; } the code fails again @ let c = a; but time different error message: "cannot move out of a because borrowed ... borrow of *a occurs here: let b: &mut i32 = a; " so, if annotate b 's type: no move of a b , instead "re"-borrow of *a ? what missing? cheers. so, if annotate b 's type: no move of a b , instead "re"-borrow of *a ? what missing? absolutely nothing, in case these 2 operations semantically similar (and equivalent if a , b belong same scope). either move reference a b , making a moved value, , no longer available....

ember.js - Why is a "ManyToOne" relation treated differently when serializing in ember-data? -

my question highly related " ember data: saving relationships " don't care embedding - want working onetomany (bi-directional) relationship. take example following models: app.child = ds.model.extend({ name: ds.attr('string'), toys: ds.hasmany('toy'), }); app.toy = ds.model.extend({ name: ds.attr('string'), child: ds.belongsto('child') }); and following object creations/saves: var store = this.get('store'); store.createrecord('child', {name: 'herbert'}).save().then(child => { return store.createrecord('toy', {name: 'kazoo', child: child}).save()) }).then(toy => { child.get('toys').pushobject(toy); return child.save(); }); i expect child, when serialized, reference toy. e.g. like { 'name': 'herbert', 'toys': [ 1 ] } but doesn't. because "manytoone" relation ship , ember-data won't serialize these:...

excel vba working with worksheetfunction -

this question has answer here: why range work, not cells? 1 answer hi have quick question implementing worksheetfuncion across multiple sheets. don't quite understand why code produces application defined or object defined error in line count = application.worksheetfunction.countblank(ws.range(cells(2, 6), cells(14, 6))) a portion of code shown below dim ws worksheet dim integer, j integer, k integer, x integer, y integer, z integer dim lastrow integer, lastcoln integer dim rowht double dim count integer, total integer lastrow = sheet2.usedrange.row - 1 + sheet2.usedrange.rows.count lastcoln = sheet2.usedrange.column - 1 + sheet2.usedrange.columns.count each ws in thisworkbook.worksheets if ws.name <> "legend" , ws.name <> "master schedule" lastrow = ws.usedrange.rows.count ws.range("a" & lastrow + 1) = "...

ios - Can I scroll WKInterfaceGroup programmatically? -

i have label long text , button inside wkinterfacegroup. can scroll group top on button's touch handler? no. way programmatically scroll interface watchkit scrolling specific row in wkinterfacetable .

rpmbuild - Using shebang in a spec file without it being a comment -

i need make small wrapper script around binary i'm packing in rpm. wrapper script needs "#!/bin/sh" @ top. when that, "#..." treated comment. no, don't comment that. is there way use predefined variable or escape sequence make shebang (on first line)? here's little code in .spec file: %build echo #!/bin/bash > foobar echo export ld_library_path=/opt/foobar/foobar/lib >> foobar echo /opt/foobar/lib/foobar >> foobar echo exit $? >> foobar ... result of 1st line in %build cycle "+ echo." must take different approach? if so, approach? just coming question. quote hash-bang. 'nuff said.thanks.

signalr.client - Can SignalR connection IDs be faked? -

just how connection id determined in signalr? user purposefully use person's connection id pretend them? obviously there's difficulty of determining person's connection id since there's many possible ids. however, application make users aware of other user's connection ids because application requires peers interact , i've used connection id unique user id. can connection ids chosen users? , can users somehow switch another, known id or there other protection in place? i refer connection ids obtained server side via context.connectionid . no. connection id assigned server. apart connection id server sends connection token calculated using few pieces of information including connection id. if server receives request connection id , connection token don't match request rejected. if want understand how signalr protocol works in general read post wrote time ago . if want more details on connection id , connection token read this .

use matlab to handle pajek .net file? -

i have .net file in pajek format. thinking use matlab analysis of data in file. after searching online, found toolbox in matlab name sbetoolbox. considering installing toolbox matlab might bit time-consuming, since not have administrative access pc currently. have better idea use matlab pajek .net file? many time , attention.

jQuery toggleClass and bootstrap dropdown on hover -

what not understand. have function: function dropdown_opened(){ if ( jquery('#autocollapse').hasclass('collapsed') ) { }else{ jquery('.dropdown').hover(function() { jquery(this).toggleclass('open'); console.log('aaaaa'); }); } } i set windows.resize event ... when #autocollapse have class "collapse" fires console.log('aaaaa'). what try make bootstrap dropdown active dropdown-toggle button state opened menu - on hover. what wrong? should in way remove hover ?

angularjs - JWT Exists Check -- Where To Do It? -

i have login service handling initial jwt creation , getting user data fine out of payload. the problem having place code check make sure jwt exists , valid on every page change? have auth service function called isauthed , want check make sure not false. my initial idea put code in app.run , not having luck it. if (authsvc.gettoken() === undefined || !authsvc.isauthed(authsvc.gettoken())) { $window.location.href = "http://localhost:3000/#/login"; else { // continue run rest of .run function. } the first check in conditional above calls function pulls jwt local storage. so, want make sure not undefined. next check see if token valid. if either of conditions fail, route user login page. what trying ensure if hits localhost:3000/#/app/dashboard getting kicked login page. should handling via resolve parameter in route instead have parent app put resolve in , should check authentication childs? i have seen many different ways checking authentica...

return multi dimension array to excel from c++ xll -

this works fine when try pass 1 dimension array __declspec(dllexport) lpxloper testarray() { xloper xlvalues[2]; xlvalues[0].xltype = xltypenum; xlvalues[1].xltype = xltypenum; xlvalues[0].val.num = 123; xlvalues[1].val.num = 345; static xloper xlarray; xlarray.xltype = xltypemulti | xlbitdllfree; xlarray.val.array.rows = 2; xlarray.val.array.columns = 1; xlarray.val.array.lparray = &xlvalues[0]; return (lpxloper)&xlarray; } but when try pass multi dimension array, function returns #num! __declspec(dllexport) lpxloper testarray1() { xloper xlvalues[2][2]; xlvalues[0][0].xltype = xltypenum; xlvalues[0][1].xltype = xltypenum; xlvalues[1][0].xltype = xltypenum; xlvalues[1][1].xltype = xltypenum; xlvalues[0][0].val.num = 123; xlvalues[0][1].val.num = 456; xlvalues[1][0].val.num = 345; xlvalues[1][1].val.num = 43456; static xloper xlarray; xlarray.xltype = xltypemulti | xlbitdllfree;...

php - Whether to use FOSRestBundle or just json_encode()? -

i creating api symfony 2. i'm using fosrestbundle this. since bundle , json_encode() return same result, why should use bundle? why shouldn't use json_encode() encode array json returning response? why should use bundle? well depends on requirements are. if you're trying develop restful apis or fancy things should go bundle. if you're trying display json data front end go simple json_encode .

Getting the width of a path drawn on a XAML canvas -

i'm drawing canvas programmatically, given bunch of path data somewhere else , adding canvas as // done more elaborately, pathfigurecollection figures = getpathfigurecollection(); var path = new path { data = new pathgeometry { figures = figures }, fill = getfill(), stroke = getstroke(), strokethickness = getthickness() }; mycanvas.children.add(path); now, have canvas in scrollviewer , want make sure can scroll way reveal entire path (actually path s - have several, generated same way) no further. tried this: var drawingwidth = mycanvas.children .oftype<frameworkelement>() .max(e => canvas.getleft(e) + e.actualwidth); mycanvas.width = drawingwidth; this works other elements (the drawing has few text blocks , ellipses), paths both canvas.getleft(e) , e.actualwith (as other things tried e.rendersize.width , e.desiredsize.with ) return 0 . since element extends farthest right path, results in canv...

Sign Firefox extensions -

we have 2 firefox extensions - first mac , second windows. extension mac distributed through addons.mozilla.org site extension windows through our own installer app.they same things have different code. have identical uuid. did not have problem before mozilla asked sign extensions. unfortunatelly, if try sign extension windows(distributed throug our installer) "duplicate uuid" error. is there way avoid without changing uuid? example, can submit 2 versions 1 app? if not, happened if change uuid? our users have problem? if code can compiled 1 addon, ie separate sections differ individual files , import based on os, 2 addons can merged , uploaded mozilla 1 addon. on other hand if codes radically different can not merged, need use different uuid. i haven't come across many addons os specific not made work on other oses.

ios - BLE connection iPhone through Settings -

current status , have ble device uses ancs thought place ot ask question. my ble device lights led when phone rings , receive ancs messages on iphone in notification center. i want build app interacts ble device has ancs , have options section, have ability to connect ble device doing scan , connecting, question when connected ble device iphone , receive ancs messages , how connect app ble device , communicate , while connected iphone. any guidance direction appreciated. jz not sure if this post solve issue, sounds similar problem , might point in right direction (ios isnt thing, cant give information) hope helps.

windows phone 8 - XamarinForms ListView item fill with -

Image
how can force templateitem expand , fill entire width of listview? as can see in screenshot, listview has red background, , items have white background. the code of datatemplate: <datatemplate x:key="informationmessagetemplate"> <stacklayout orientation="horizontal" backgroundcolor="#ffffff" horizontaloptions="fillandexpand"> <label fontattributes="bold" text="{binding sender}" /> <label text=" chegou na sala" horizontaloptions="fillandexpand"/> </stacklayout> </datatemplate> try putting stacklayout in viewcell: <datatemplate x:key="informationmessagetemplate"> <viewcell> <viewcell.view> <stacklayout orientation="horizontal" backgroundcolor="#ffffff" horizontaloptions="fillandexpand"> <label fontattributes="bold...

vba - Numbers in array not being sorted numerically -

the program using ibm data collection 6.0 (used program surveys). the issue i'm having how storing values question. values categories [1, 2, 3, 4, ... 59, 60] (numeric order) labeled values in different order: 1 2 11 12 13 14 15 16 17 18 19 20 3 21 22 23 24 25 26 27 28 29 30 4 31 32 33 34 35 36 37 38 39 40 5 41 42 43 44 45 46 47 48 49 50 6 51 52 53 54 55 56 57 58 59 60 7 8 9 10 can explain me how being sorted , if there easy algorithm put in numeric order? thanks! it used sorted alphabetically add leading zeroes this example, may help sub test() dim dic object: set dic = createobject("scripting.dictionary") dim n%, key variant n = 1 while n < 101 dic.add right("000" & n, 3), nothing n = n + 1 wend each key in dic debug.print key next key end sub can sorted need 001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 ...

excel - Subscript out of range when referencing a worksheet in another workbook from a variable -

see picture: http://s12.postimg.org/ov8djtuh9/capture.jpg context: trying activate sheet (variable: csheet) in workbook , paste data there copied data different workbook. i'm getting subscript out of range error whenever try activate directly using variable (i.e. worksheets(name).activate) or try define worksheet using variable , activate it. i've tried other coding styles, using "with worksheet" etc. , code lot longer started on because every time fix something, else goes wrong. so, sticking basics. appreciated. sub gensumrep() dim autosr workbook dim asrsheet worksheet dim tempwb workbook dim datawb workbook dim secname string dim oldcell string dim nsname string dim csheet worksheet set autosr = activeworkbook set asrsheet = autosr.activesheet = 3 10 secname = asrsheet.range("d" & a).value if secname <> "" workbooks.open range("b" & a).value set tempwb = activeworkbook 'tempwb.window...

java - How do I enforce blank lines around non-orphaned braces in Eclipse? -

the eclipse format tool (luna) not account enforcing 1 blank line before , after non-orphaned brace on non-function declaration. for (...) { , if (...) { , } else { , } catch (...) { enforcing 0 blank lines before orphaned closing brace } . enforcing 1 blank line after orphaned closing brace, except when followed orphaned closing brace (rule 2 trumping rule 3). terminology: non-orphaned = paired operator/keyword non-function = not class or method declaration example: ... somecall(); } // orphan close brace - no blank line before or after } // orphan close brace – blank line after someothercall(); } // orphan close brace – no blank line before ... string result; int foo = 1000; // blank line (int x = 0; x < foo; x++) { // blank line if (x < value) { ...

mysql - Patterns for Docker DB Snapshot -

what pattern making docker image containing database snapshot? essentially want create docker image when starts has database running in particular state. i'm not bothered persisting changes database (it should possible write database, don't care whether changes hang around after restart). i've seen couple of repos on docker registry load data dump on startup, quite slow. i've worked out how create empty database image, set running, add data it, commit snapshot, feels quite convoluted. feels there should better pattern doing this. i'm hoping else has had problem , has come pattern it. in particular case need use mysql 5.1 none of repos on docker registry quite work because old version, i'm happy copy 1 , adapt it.

ibm mobilefirst - Preview Mode on Production Server -

we've migrated 5.0.6 worklight. preview mode working in 5.0.6 console. after migrating 7.0 , uploading common.wlapp file, getting following errors , cannot preview app. should preview mode work on production mobilefirst platform server version 7.0? use quick testing of our mobile app , connectivity our adapters. post http://serverurl/appname/authorization/v1/clients/preview 404 (not found) there no more preview mode in production environment, there bug in initial release of v7.0 preview button still available while underlying code no longer there. make sure apply latest ifix release server installation. can downloaded ibm fix central. related question: preview not working on mobilefirst platform foundation server 7.0

javascript - Understanding Express routing in conjunction with AngularJS (using mean.js boilerplate) -

i developing web application mean.js boilerplate code. added view application (the 'analysis' page) creating analysis module , added route logic following code. //setting route angular.module('analysis').config(['$stateprovider', function($stateprovider) { // projects state routing $stateprovider. state('imageanalysis', { url: '/image_analysis', templateurl: 'modules/analysis/views/tools.client.view.html' }); } ]); this works dandy, can go homepage.com/image_analysis , see tools.client.view.html page. my goal have page visible user logged in. first approach check if user logged in angular routes logic, has proven difficult me. read check authentication in front end unsafe. i've decided check if user logged in express routing. here example of express routing looks 1 of other angularjs modules module.exports = function(app) { var users = require('../../a...

javascript - D3js find closest point on circle -

what i'm trying achieve take current coordinates of mousemove event , match them coordinates of closest location on circle. i've managed partially working using loop iterates on each possible point in circle , compares coordinates in order find closest point: (var = math.pi; > -math.pi; -= 0.01) { // coords of current point in circle: var curx = math.sin(i+math.pi / 2)*radius + 200, cury = math.sin(i)*radius + 200; // conditional attempts find coords of point closest cursor... if (math.abs((x - curx)) < distancex && math.abs((y - cury)) < distancey ) { distancex = math.abs((x - curx)); distancey = math.abs((y - cury)); // , assigns values newx/newy variables newx = curx; newy = cury; } } the trouble solution return wrong coordinates , i'm not sur...

jquery - Change background-color with input value -

i have form in user can set hexa color. want put block next input "color" , block change background color according input value. want make dynamically, bit color picker. think can js don't know how. rails if can help. i have <div class="field color"> <label for="activite_color">color</label> <input type="text" value="bf4139" name="activite[color]" id="activite_color" /> <span class="col-lg-1" style="background:#bf4139;"></span> </div> and fiddle add maxlength="6" textbox : html: <input type="text" value="bf4139" name="activite[color]" id="activite_color" maxlength="6" /> javascript: $('#activite_color').on('keyup', function() { $('.col-lg-1').css('background', '#' + $(this).val()); }); demo: https://js...

javascript - Self-references in object literal declarations -

is there way following work in javascript? var foo = { a: 5, b: 6, c: this.a + this.b // doesn't work }; in current form, code throws reference error since this doesn't refer foo . is there way have values in object literal's properties depend on other properties declared earlier? you like: var foo = { a: 5, b: 6, init: function() { this.c = this.a + this.b; return this; } }.init(); this kind of 1 time initialization of object. note assigning return value of init() foo , therefore have return this .

mpmovieplayercontroller - Akamai Token Protection stream cant play in IOS -

i developer in iptv. have developed our application in android , want move on ios devices. akamai our cdn. @ moment have simple ios application able play hls streams. can navigate through each channel , streams played correctly. protect our streams planned use token. have implemented token on android experiencing difficulties on ios. streams protected token won't play, screen remains black. here example of stream http://this_is_my_stream_protected_with_token.m3u8? token =exp=1432902926~acl= *~hmac=1e1d2afa7e7fbca72b0da6f5820ba1063446631e75fea80093c8183b619c0acc if try play stream in application,screen remains black in other hand if open vlc or player in webbrowser ( http://www.flashls.org/latest/examples/chromeless/ ) playes correctly. i have created function makes http request on link , server response is: #extm3u #ext-x-version:3 #ext-x-stream-inf:bandwidth=1629884,codecs="avc1.77.31,mp4a.40.2",resolution=640x360 chunklist.m3u8?__token__=exp%3d1432902926%...

jquery - How to set start date in 2amigos Datepicker in Yii2 -

i want set start date in 2amigos datepicker using jquery or whatever is. my start date 1960-01-01 . and how display datepicker: <?= $form->field($model, 'ecs_cheque_dd_date')->widget(datepicker::classname(), [ 'inline' => false, 'clientoptions' => [ 'autoclose' => true, 'format' => 'yyyy-m-dd', ], ]) ?> <?= $form->field($model, 'ecs_cheque_dd_date')->widget(datepicker::classname(), [ 'inline' => false, 'clientoptions' => [ 'autoclose' => true, 'format' => 'yyyy-mm-dd', 'startdate' => date('1960-01-01'), ], ]) ?>

c# - Private Constructor in SqlConnection class Takes Parameter SqlConnection class -

i inspection sqlconnection .net reflector . i noticed there private constructor, interestingly takes parameter sqlconnection class. the main question wonder * why sqlconnection takes sqlconnection class? * , use of private constructors? private sqlconnection(sqlconnection connection) { this._reconnectlock = new object(); this._originalconnectionid = guid.empty; this.objectid = interlocked.increment(ref _objecttypecount); gc.suppressfinalize(this); this.copyfrom(connection); this._connectionstring = connection._connectionstring; if (connection._credential != null) { securestring password = connection._credential.password.copy(); password.makereadonly(); this._credential = new sqlcredential(connection._credential.userid, password); } } public sqlconnection() { this._reconnectlock = new object(); this._originalconnectionid = guid.empty; this.objectid = interlocked.increment(ref _objecttypecount); gc...

java - How to pass queues between ExecutorsServices that are in different classes? -

i have created 2 patterns: 1 starts class x (which contains thread started executorservice , name es), second 1 starts class y (which contains thread started es ). now, both of them started inside class z es . however, z starts group of threads ( es again) directly itself. public class z { ... public static void main(string [] args) { service=executors.newfixedthreadpool(xnum); for(int k=0; k < xnum; k++){ x x=new x(k); service.submit(x); } service=executors.newfixedthreadpool(ynum); for(int k=0; k < ynum; k++){ y y=new y(k); service.submit(y); } service=executors.newfixedthreadpool(znum); for(int k=0; k < znum; k++){ directthread dt=new directthread(queue1, queue2, queue3); service.submit(dt); } } } inside class x there many threads, 1 interests me particularly": public class x{ ... public void run(){ ...

java - Spring POST Request IllegalStateException -

i have got java rest service in spring. everything's working fine, yesterday modified service worked fine before. still working, everything, when want save html form (and send server), exception. debugged dont it. every value seems transferred correct. , not find "private call" too. exception is: 2015-05-29 14:00:20.853 warn 2623 --- [nio-9000-exec-3] .c.j.mappingjackson2httpmessageconverter : failed evaluate serialization type [void]: java.lang.illegalstateexception: failed instantiate standard serializer (of type com.fasterxml.jackson.databind.ser.std.nullserializer): class com.fasterxml.jackson.databind.ser.basicserializerfactory can not access member of class com.fasterxml.jackson.databind.ser.std.nullserializer modifiers "private" ok know bit time has gone now, solved migration of spring 3.2 4.1.1: trouble json serialization the magic code line was: @responsestatus(value = httpstatus.ok) at controller, because returned "void...

css - HTML Display table to fit screen size -

i have table of links image gallery want able fit screen size if window size reduced. @ moment stays same size. <table class="images" id="albums"> <tr> <td> <a href="academy-blitz-may-2014.html" ><img id="academy-blitz-may-2014" src="img/album-covers/academy-blitz-may-2014.jpg" title="academy blitz may 2014"/></a> </td> <td> <a href="academy-blitz-october-2014.html" ><img id="academy-blitz-october-2014" src="img/album-covers/academy-blitz-october-2014.jpg" title="academy blitz october 2014"/></a> </td> <td> <a href="academy-blitz-november-2012.html" ><img id="academy-blitz-november-2012" src="img/album-covers/academy-blitz-november-2012.jpg" title="academy blitz november 2012"/></a> </td> ...

ios - UITableViewRowAction change backgroundcolor on press -

i created instance of uitableviewrowaction in -(nsarray *)tableview:(uitableview *)tableview editactionsforrowatindexpath:(nsindexpath *)indexpath and have handler block when row action triggered: handler:^(uitableviewrowaction *action, nsindexpath *indexpath) you have row action parameter can used not create retain cycles , have index path. i've tried setting backgroundcolor of new row action this: [action setbackgroundcolor:[uicolor greencolor]]; but did not change anything. tried setneedsdisplay on button object of row action, without luck. any idea how can change backgroundcolor while row actions still visible? thanks xcoder here implementation of same , works well. should solve problem well.. - (nsarray *)tableview:(uitableview *)tableview editactionsforrowatindexpath:(nsindexpath *)indexpath { uitableviewrowaction *one = [uitableviewrowaction rowactionwithstyle:0 title:@"one" handler:^(uitableviewrowaction *action, nsindex...

email - Mailer Error: Extension missing: openssl in php -

after of edited email.php source code, here, <?php // $email , $message data being // posted page our html contact form $email = $_request['email'] ; $message = $_request['message'] ; require_once('class.phpmailer.php'); require 'phpmailerautoload.php'; require 'class.smtp.php'; $mail = new phpmailer(); $body='hellooooo'; $mail->issmtp(); $mail->host = "ssl://smtp.gmail.com"; // specify main , backup server $mail->smtpauth = true; // turn on smtp authentication $mail->username = "mygmailid@gmail.com"; // smtp username $mail->password = "mygmailpassword"; // smtp password $mailer->smtpsecure = 'ssl'; $mailer->port = 465;//587; $mail->addaddress("bradm@inmotiontesting.com", "brad markle"); $mail->setfrom('rajaselva.csc@gmail.com','selva rani'); $mail->wordwrap = 50; $mail->ishtml(true); $mail->subject = "you ...

angularjs - Angular loading page without template -

i have spa uses angular routing. have link open specific page (not using template) when clicked. in other words have links act regular links , redirect user new page. don't want these links load inside of template. surely has possible right? many thanks, kiran if understood question right, wanna replace enitre current page redirect new external page? if so, can definately using $location service s follows: $window.location.href = 'http://www.google.com'; just put ng-click, inject $location service controller , go. further documentation on : https://docs.angularjs.org/guide/ $location similar question on : redirect new page in angularjs using $location

unity3d - Smooth camera rotation unity -

i create third person camera. camera move in sync mouse move. create script camera move, work when speed high starts shake. how force camera move smooth? vector3 rotation = new vector3(); rotation = this.transform.rotation.eulerangles; float ver = input.mouseposition.y - mouse_position.y; difference_y = difference_y ?? ver; rotation.y += (float)(((input.mouseposition.x - mouse_position.x) / one_degree_per_pixel_hor)); rotation.x += (float)((-(input.mouseposition.y - mouse_position.y) / one_degree_per_pixel_ver)); rotation.z = 0; if (difference_y != 0) { // forward tilt if (difference_y < 0) { if (rotation.x > max_slope_forward && rotation.x < max_slope_back) rotation.x = max_slope_forward; } // tilt else { if (rotation.x < max_slope_back && rotation.x > max_slope_forward && rotation.x != max_slope_forward) rotation.x = max_slope_back; } } difference_y = ver; this.transform.rotate(new vector3(-inp...

ios - How to get timezone by latitude and longitude -

this question has answer here: how time zone location using latitude , longitude coordinates? 13 answers i need display date , time based on given lat/long in app. worked google api timezone id, should work offline too. there way timezone without being connected internet? try 1 : cllocation *location = [[cllocation alloc] initwithlatitude:50.449846 longitude:30.523629]; nstimezone *timezone = [[aptimezones sharedinstance] timezonewithlocation:location]; nslog(@"%@", timezone); find library here : https://github.com/alterplay/aptimezones you can code (answered https://stackoverflow.com/a/27054583/3202193 ): cllocation *currentlocaiton = [[cllocation alloc] initwithlatitude:latitude longitude:longitude]; [geocoder reversegeocodelocation:currentlocaiton completionhandler:^(nsarray *placema...

javascript - AngularJS: avoid using $timeout to wait for image loading completion -

i'm trying create own image carousel angularjs directive; want keep lightweight , unopinionated possibile, thought i'd create <carousel></carousel> wrapper set of <img> elements, so: <carousel> <img ng-repeat="image in images" ng-src="{{image.src}}" alt=""/> </carousel> what directive create <div class="carousel"> element images transcluded. now, still haven't coded part images slide or fade in/out cause there's 1 issues i'd out of way first: want assign carousel , images therein same height (computed height of shortest image) avoid carousel changing height when taller image gets displayed, or avoid cropping image in case carousel had fixed height. so jotted down this jsfiddle demonstrate, far best solution found compute heights of transcluded images relies on 2 nested $timeout s 100-ms delay. looks me more hack anything. wondering if there's "proper" wa...

c - How to convert unsigned char to signed integer using Neon SIMD -

how convert variable of data type uint8_t int32_t using neon? not find intrinsic doing this. assuming want convert vector of 16 x 8 bit ints 4 vectors of 4 x 32 bit ints, can first unpacking 16 bits , again 32 bits: // load 8 bit vector uint8x16_t v = vld1q_u8(p); // load vector of 16 x 8 bits ints p // unpack 16 bits int16x8_t vl = vreinterpretq_s16_u16(vmovl_u8(vget_low_u8(v))); // 0..7 int16x8_t vh = vreinterpretq_s16_u16(vmovl_u8(vget_high_u8(v))); // 8..15 // unpack 32 bits int32x4_t vll = vmovl_s16(vget_low_s16(vl)); // 0..3 int32x4_t vlh = vmovl_s16(vget_high_s16(vl)); // 4..7 int32x4_t vhl = vmovl_s16(vget_low_s16(vh)); // 8..11 int32x4_t vhh = vmovl_s16(vget_high_s16(vh)); // 12..15

java - jUnit change behavior of a method -

i have make junit tests methods , can't change source code. there possibility change behavior of function without change source code? straight-forward example: class , b source code (can't change them). want change behavior of run() method when call in b through testing() in junit test. ideas? public class { public string run(){ return "test"; } } public class b { public void testing() { string froma = new a().run(); //i want mocked result here system.out.println(froma); } } public class c { @test public void junittest() { new b().testing(); // , here want call testing method b "mock return" run() } } you can use mockito , powermock : import org.junit.before; import org.junit.test; import org.junit.runner.runwith; import org.powermock.api.mockito.powermockito; import org.powermock.core.classloader.annotations.preparefortest; import org.powermock.modules.junit4.p...

gulp copying from source to destination is not working -

var gulp=require('gulp'), gutil=require('gulp-util'); gulp.task('default',function(){ gulp.src('g:\node\node_modules\npm\test\gulpfile.js').pipe(gulp.dest('g:\node\node_modules\npm\test\sample')); return gutil.log("inside"); }); i'm beginner gulp.js . have tried cpoy file source loaction destination location. doesn't show errors. file not copied in destination location. tried different locations still doesn't work. try with gulp.task('default', function(){ return gulp.src('./gulpfile.js') .pipe(gulp.dest('./sample/'); });

node.js - Date Query MySQL -

i want make query select row table... the query : select date dbuser; +------------+ | date | +------------+ | 2015-05-28 | | 2015-05-29 | | 1994-11-11 | | 2010-01-01 | | 2003-04-30 | +------------+ but output it's not same: { date: thu may 28 2015 00:00:00 gmt+0200 (romance summer time) } { date: fri may 29 2015 00:00:00 gmt+0200 (romance summer time) } { date: fri nov 11 1994 00:00:00 gmt+0100 (romance standard time) } { date: fri jan 01 2010 00:00:00 gmt+0100 (romance standard time) } { date: wed apr 30 2003 00:00:00 gmt+0200 (romance summer time) } i want output table yyyy-dd-mm: 2015-05-28 2015-05-29 1994-11-11 2010-01-01 2003-04-30 my code: app.get('/admin', function(req, res){ connection.query("select date dbsuer", function(err, results) { if (err) throw err; console.log(results); res.send(results); }); }); im using nodejs server side ! app.get('/admin', function(req, res){ connection.quer...