Posts

Showing posts from March, 2013

arpack - how to run an MPI example in PARPACK -

i able compile psndrv1.f , example in arpack/parpack/example/mpi folder. however, when run program command mpirun -np 4 a.out , got following error. [.th:9951] *** error occurred in mpi_allreduce [.th:9951] *** on communicator mpi_comm_world [.th:9951] *** mpi_err_op: invalid reduce operation [.th:9951] *** mpi_errors_are_fatal: mpi job abort -------------------------------------------------------------------------- mpirun has exited due process rank 0 pid 9951 on node superinfra.ku.ac.th exiting improperly. there 2 reasons oc cur: 1. process did not call "init" before exiting, others in job did. can cause job hang indefinitely while waits processes call "init". rule, if 1 process calls "init", processes must call "init" prior termination. 2. process called "init", exited without calling "finalize". rule, processes call "init" must call "finalize" prior exiting or considered "abnormal termina

r - Can I score PMML with Ruby? -

i've been googling, , of efforts around pmml , data modeling focussed around java. there way score ruby? i'm considering using https://github.com/clbustos/rinruby have direct access r... load .rda model, call predict() method in r predefined variables, , save result regular 'ol ruby variable. seems pretty straight forward, no? so, can ruby handle pmml? rinruby solution production-worthy? suggestions, or reading material should checkout appreciated! i'm working on gem called scoruby , loads pmml models , scores on production. supports naive bayes, decision tree, random forest , gradient boosted models love support new models demand. regarding rinruby not sure if main purpose scoring on production, , don't know time performance.

c# paypal rest api transaction search -

so have spent bit of time reading paypal rest api docs. struggling see how can list of completed transactions given date range (1 day). i have inherited application uses form post method capture payment , there webservice callback provides status of transaction. thing captured call status , transaction reference. i trying date range of transactions reconciliation purposes appreciate pointers regarding api. have looked @ getting single 'sale' using /v1/payments/sale/ show sales created using rest api, not how has been created. my solution in c#. appreciated. use startdate , enddate according https://developer.paypal.com/webapps/developer/docs/classic/api/merchant/transactionsearch_api_operation_nvp/ or responses , use timestamps create range inside c# in filter response.

input - Arduino Converting AnalogInput(0-1024) to a 1-10 scale -

i'm new @ coding , i'm trying make meter 1-10 scale using analog inputs 0-1024. i'd reverse analog inputs. analog input 1024 0 in scale , analog input 0 10 in scale. sorry if easy code make started coding. you! you should able use map function achieve want. try following: int val = analogread(0); int newval = map(val, 0, 1023, 10, 0); the first 2 numbers range of input value , second pair of numbers range want input mapped to. have @ arduino reference map function . note: don't have arduino on hand can't double check works.

java - javax.enterprise.inject.Vetoed Open web beans, which jar? -

i'm wanting try out open web beans 1.6.2, jars lists on it's website adding cdi support java se application openwebbeans-spi.jar openwebbeans-impl.jar geronimo-jcdi_1.0_spec.jar geronimo-atinject_1.0_spec.jar geronimo-interceptor_1.2_spec.jar geronimo-annotation_1.2_spec.jar don't seem contain javax.enterprise.inject.vetoed annotation, i've had add cdi-api 1.2 dependency resolve issue, i'm not sure if correct other cdi dependencies resolved above? here dependencies have in pom, correct? <dependency> <groupid>org.apache.openwebbeans</groupid> <artifactid>openwebbeans-impl</artifactid> <version>1.6.2</version> </dependency> <dependency> <groupid>org.apache.openwebbeans</groupid> <artifactid>openwebbeans-spi</artifactid> <version>1.6.2</version> </dependency> <dependency> <groupid

javascript - how to send parameters from js to php codeigniter -

i don't know i'm doing wrong , im stuck in part of project appreciated here html: <form id="form_search" method="post" action="/controler/something"> <select id="tip_fam" maxlength="100" > <option value="1">something 001</option> <option value="2">something 002</option> <option value="3">something 003</option> <ul id="print" class="bot"><li>print</li></ul> </form> js: $("#print").click(function(){ url = base_url+"index.php/almacen/product/create_pdf/"+$("#tip_fam").val(); window.open(url,'',"width=800,height=600,menubars=no,resizable=no;") }); php (codeigniter) : public function create_pdf(){ $tip_fam = $this->input->post('tip_fam'); i thought value of select way when print in var_dump(), show

spring - Behaviour of REST service using HTTPServletRequest and using @PathVariable -

below 2 scenarios came across while coding services project in school. scenario 1 @requestmapping("/customer/firstname/") public customerrepresentation getcustomersbyfirstname(httpservletrequest request) { string name = request.getparameter("fname"); list<customer> customer = customeractivity.findbycustfirstname(name); // etc } scenario 2 @requestmapping(value="/customer/firstname/{fname}",method = requestmethod.get, produces = {"text/html","application/json", "application/xml"}) public @responsebody list<customerrepresentation> getcustomersbyfirstname(@pathvariable("fname") string name) { list<customer> customer = customeractivity.findbycustfirstname(name); // etc } behaviour: if use first approach, able access results using link browser , postman. if use second approach, able access results using postman when specify accept headers. if use browser gives me err

runtime - Reducing a quadratic algorithm to linear time -

i trying write algorithm runs in o(n) time. essentially, takes integer n , multiplies sum coefficient. however, first attempt @ writing algorithm runs in o(n^2) time. (see below.) there way can reduce runtime? for = 1 n num1 = i/n num2 = 0 j = n-1 num2 = num2 + 1/j result[i] = num1 * num2 your current approach running in quadratic time because, each element in sequence 1..n iterating on sequence again. can remove work realizing need compute num2 summation once . after this, can reused. num2 = 0 j = 1 n-1 num2 = num2 + 1/j = 1 n num1 = i/n if (i > 1) num2 = num2 - 1/(i-1) // reuse summation subtracting result[i] = num1 * num2 // off portion don't want value of

javascript - How can I apply scrollbars to each individual part of a Canvas split into parts? -

i have website set 1 javascript file calls 3 others , sets them parts of canvas. there way set scroll bars scroll through each part individually? have been looking @ html can't figure out how apply 1 part because main function sets parts, , because type of game , needs draw things , update them, can't separate code. set heights containers , apply css .container { overflow-y: scroll; height: 300px; }

Reading XML Sub Items in VB.NET -

please have in xml file: <?xml version="1.0" encoding="utf-8"?> <!--xml database.--> <data> <student> <name>john e.</name> <tests> <test> <lesson>mathematics</lesson> <grade>a</grade> </test> <test> <lesson>physics</lesson> <grade>a+</grade> </test> </tests> </student> <!-- sidenote: jessica didn't attend physics exam--> <student> <name>jessica b</name> <tests> <test> <lesson>mathematics</lesson> <grade>b</grade> </test> </tests> </student> </data> i'm trying display tests each student had. have 1 textbox in application(textbox1) , want type "john e." or "jessica b." , give me tests have made. already added

vb.net - DataGridView Handle OnHandleCreate Resetting Selected Rows -

we have microsoft excel com addin creates taskpane user. based on "plug-in" user loads, taskpane populated corresponding usercontrol , displayed on screen. these usercontrols typically involve use of datagridviews, , save rows user has selected, each time plug-in loaded, selected rows selected user. however, have found in process of loading usercontrol onto taskpane, , making taskpane visible, several external code methods fire, reset selection of datagridview. below events: system.windows.forms.dll!system.windows.forms.datagridview.onselectionchanged(system.eventargs e) + 0x88 bytes system.windows.forms.dll!system.windows.forms.datagridview.flushselectionchanged () + 0x37 bytes system.windows.forms.dll!system.windows.forms.datagridview.clearselection(int columnindexexception, int rowindexexception, bool selectexceptionelement) + 0x304 bytes system.windows.forms.dll!system.windows.forms.datagridview.setandselectcurrentcelladdress(int columnindex, int r

Libwebsockets libwebsocket_client_connect function parameters -

this signature of libwebsocket_client_connect() struct libwebsocket * libwebsocket_client_connect(struct libwebsocket_context * context, const char *address, int port, int ssl_connection, const char *path, const char * host, const char * origin, const char * protocol, int ietf_version_or_minus_one) here explain path parameter means? in doc written path - websocket path on server. couldnt proper meaning. path refers "path" websockets endpoint/uri located on server. when run sample code websocket server available online, server runs @ localhost:9000 .here there no path , can give "/" path in libwebsocket_client_connect(). but in cases server may running @ specified uri on server www.myserver:9000/inside/inside/websockets/endpoint in above case path " /inside/inside/websockets/endpoint ".

php - Yii2 - how to set main config param pagination pageSizeLimit? -

i want set main config param pagesizelimit in class pagination. example: (/backend/config/main.php) 'pagination' => [ 'class' => 'yii\data\pagination', [ 'pagesizelimit' => [1, 1000], ] ], but not working. so, how set defaults entire site? thank much! you can use dependency injection container purpose. define default parameter's value in bootstrapping section of config: \yii::$container->set('yii\data\pagination', [ 'pagesizelimit' => [1, 1000], ]); read more on in guide https://github.com/yiisoft/yii2/blob/master/docs/guide/concept-configurations.md

html - Twitter Bootstrap does not work when using IP Address but works in "localhost" -

i need , advice issue facing in learning twitter bootstrap. using exact code w3schools putting collapsible navbar. i using eclipse , apache tomcat local server. i seeing 2 different outputs same code. for weird reasons, unable upload images.. :( site when run on "localhost" ( http://localhost:8080/test.html ) site when run on "ip address" ( http://my-ip:8080/test.html ) <!doctype html> <html lang="en"> <head> <title>bootstrap case</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.

php - Remove parentheses in start and end of JSON using javascript -

i doing api request in php through curl. result of request json. but, json between parentheses, this: ({ "version": "3.2.2 build 276 (20121126)", "type": "clipquery", "select": { "query": "world" }, "limit": "", "numberofresults": 17, "results": [ ], "errors": [ ], "debug": { "runtime": 0.046874046325684 } }) jsonlint says json invalid. , that's correct. but, can't find how remove parentheses.

Need to implement web socket client with environment running on java 6 -

i need implement web socket client , environment running on java 6. per java api websocket (jsr-356), java 7 required implement same. there way can implement web socket client using java 6? regards pawan there many websocket client libraries written in java. don't have write own. nv-websocket-client can work on java 6. see this consideration points in selecting websocket client implementation written in java.

operating system - Difference between message queues and mailboxes -

in operating system difference between message queues , mailboxes. i suspect there no universally accepted definition makes message queue versus mailbox. each rtos may use different terminology , implementation details you'd have @ each rtos individually. generally speaking of common differences include: is size of messages sent through queue/mailbox fixed or can message size vary? does queue/mailbox hold reference message or copy of message? can queue/mailbox hold 1 message, multiple messages, or unlimited messages?

java - Well Formed String using Stack and HashMap -

examples of formed , not formed strings are: 1. “a3{dje(dg[ff]k)wa65}” - formed 2. “bbb[bm98{wjhg]333}” - not formed 3. “cby(ddd(wklp)behop” - not formed supported brackets {}, [] , () here trying , it's returning false reason. import java.util.hashmap; import java.util.map; import java.util.stack; public class wellformedstringcheck { public static boolean iswellformed(string input){ if(input == null) return true; stack<character> stack = new stack<>(); map<character,character> map = new hashmap<character,character>(); map.put('{', '}'); map.put('(', ')'); map.put('[', ']'); for(int = 0 ; < input.length(); i++){ char s = input.charat(i); if(s == '[' || s == '{' || s == '(' ) stack.push(s); if(s == ']' || s == 

html - Bootstrap container-fluid not responsive after certain width -

i using bootstrap 3.3.5 grid system. html ( not sure it'll help ) <body> <div class="container-fluid containerresize"> <header class="row"> ... </header> <main class="row"> ... </main> </div> </body> css ( for .containerresize ) .containerresize { height: 100%; padding-right: 0; } this error temperamental. sometimes container resize down whatever size lot of time when resize width below 970px , container not longer resize , stay @ 970px. interfering responsive design components within container rely on it's width. i'm running in chrome . i've had suggestion might chrome related issue? any appreciated. edit it works in firefox

javascript - AngularJS textarea newline on enter key -

i developing angularjs application same how post answers , questions on stackoverflow , live preview of our answers or question below textarea. here trial code: index.html- <div ng-app="bindhtmlexample" ng-controller="examplecontroller"> <textarea ng-model="myhtml"></textarea> <div ng-bind-html="myhtml"></div> </div> script.js- (function(angular) { 'use strict'; angular.module('bindhtmlexample', ['ngsanitize']) .controller('examplecontroller', ['$scope', function($scope) { $scope.myhtml = 'i <code>html</code>string ' + '<a href="#">links!</a> , other <em>stuff</em>'; }]); })(window.angular); when user types in textarea, user can see live preview of he/she typing in <div ng-bind-html="myhtml"></div> . when user types html code, show re

python - finding canvas boundary of a photo frame -

Image
have photo frame 1 above. starting center, how u find rectangle maximum area can used draw (all pixels in rectangle must rgb(255,255,255)? i need find x , y coordinate of point , b shown in picture. one of approach this: starting center, , expand boundary graph above. not sure how write loop(s) that. you should use flood fill algorithm: link . suggest use sets store pixels altered in set; way number of recursions done can reduced. edit: didn't read question well. still, flood fill used, if used it on circle expanded. start single pixel, center of circle. set radius lager 1 unit. find pixels within circle, colours using flood fill. if same color, goto 2. if not, have radius finding rectangle next. this algorithm may give possible solution, there may more one, depending on frame - should start developing using simple frame correctness of solution can judged easily. edit: based on comment, problem find largest area axis-parallel rectangle in polygon -

javascript - gulp sourcemaps and chrome developer not working together when two plugins are used -

here task: gulp.src(widget + "/widget.es6") .pipe(sourcemaps.init()) .pipe(babel({ modules: 'amd' })) .pipe(uglify()) .pipe(rename('widget.js')) .pipe(sourcemaps.write('./' + widget + "/")) .pipe(gulp.dest(widget + "/")); the issue when place break in gc developer in resulting minified widget.js takes me other widget.js not minified (but not original widget.es6). assume product of babel pipe. in other words gcd interpreting sourcemap , taking me 1 step in chain (just beyond uglification). if comment out uglification, sourcemap works (i.e. taken widget.js (now not minified) -> widget.es6 (es6 file). i hoping source map take me minified widget.js -> es6 file (which after sourcemaps.init() call).

Is it possible to change the company domain name in android studio after creating the project? -

when created android project in android studio, found field company domain name .i have created name first. want change company domain name. possible change? please me solve issue ! you can able change domain using following steps. example trying change domain name com.example com.example1 . package name should com.example.application_name . right click on package name in project explorer , select refactor -> move . a new popup ask kind of refactor need do. in select first 1 move package 'com.example.application_name' package. , click ok . a new warning window show package in multiple places. click yes on warning. a new dialog opened. in that, change to package value new domain name com.example1 , make sure check box enabled search in comments , string , search text occurrences , click refactor . new dialog open , ask confirmation create new package. click yes . in bottom window ll search named com.example , ask refactor. click do refactor in th

scala - Monad transformer for Disjunction and Future -

i have code returning future[string \/ response] , monad instances both disjunction , future , function getresult: response => [string \/ result] . written several nested functions , want see following for { response <- getresponse result <- getresult(response) } yield result // future[string \/ result] as can understand monad transformers using purpose , similar things if had option instead of \/ . unfortunately couldn't found futuret nor disjunctiont (although xort exists cats). so, possible write monad transformer above purpose? may exist or don't understand something. you can use scalaz.eithert combine effects of \/ (disjunction) , monad, in case future . def getresponse: future[string \/ response] = ??? def getresult(resp: reponse): future[string \/ result] = ??? (for { response <- eithert(getresponse) result <- eithert(getresult(response)) } yield result).run // future[string \/ result] or change return types of ge

android - What drains the battery more: A longliving Service that does not do much or a many shortlived IntentServices -

i designing application collect different data lot of sensors , store them in db, continuously. sensors using google play's fused location provider , activity detection. (there ui well, ui barely launched, happening in background) i got 2 different ways this: 1) start longliving service so start long-living service (with sticky flag), run in background. service register periodic location , activity updates , - in between updates - nothing. pros: app initialized once cons: service running 24x7 2) register pendingintent , use shortlived intentservice now google play's location provider support registration of pendingintent instead of callback [see here]( https://developers.google.com/android/reference/com/google/android/gms/location/fusedlocationproviderapi#requestlocationupdates(com.google.android.gms.common.api.googleapiclient%2c%20com.google.android.gms.location.locationrequest%2c%20android.app.pendingintent) recommended background tasks. pros: app can 

xamarin.ios - Xamarin iOS set plist values -

i have own plist setting values, added under resources folder. can read these value not reset them through code. for resetting have nsmutabledictionary dictionary = nsmutabledictionary.fromfile (filename); nsobject value = nsobject.fromobject(newurl); nsstring key = new nsstring("webpage url"); dictionary.setvalueforkey (value, key); the code not change value kay. first, don't see place write dictionary file. think if fix problem. second, why not store application settings in nsuserdefaults , think it's little bit more clean: var value = nsuserdefaults.standarduserdefaults.stringforkey("page-url") nsuserdefaults.standarduserdefaults.setstring(value, "page-url");

c# - Running program in Windows service and get "Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))" -

i create program, launches program through com registry. main routine looks this: processstartinfo start = new processstartinfo(); start.filename = @"e:\main\debug\executive.exe"; start.windowstyle = processwindowstyle.hidden; start.createnowindow = true; start.arguments = "/run " + arguments[0]; using (process proc = process.start(start))... executive.exe launch program looking through registry. if run routine inside vs2013 or through command line, ok. if put in protected override void onstart(string[] args) method of sindows service. class not registered error. suggestion should at? main goal run executive.exe windows service. we've had luck in past using regsvr32.exe windows command line utility register dlls when ran problem. more info on can found here .

javascript - Getting Error: getaddrinfo ENOTFOUND using https -

i have created simple class: import https 'https'; class request { constructor(opts) { this.hostname = opts.hostname; } init(method, path, data = {}) { const optsreq = { hostname: this.hostname, path: path, method: method }; return new promise((resolve, reject) => { const req = https.request(optsreq, (response) => resolve(response)); req.on('error', (error) => { console.log(error); reject(error); }); req.end(json.stringify(data)); }); } get(path) { return this.init('get', path); } post(path, data) { return this.init('post', path, data); } put(path) { return this.init('put', path); } delete(path) { return this.init('delete', path); } patch(path) { return this.init('pat

google apps script - Customise authorization pop-up -

Image
is there way add text or modify information displayed on authorization box appears when user has enable script? in current form box far terse users stand chance granting access script. deployed on internal domain space. unfortunately there no way customize authorization dialogs @ time. when roll out scripts organizations, send brief introductory email includes list of instructions on how access tool, , include mention of authorization process in list. i've had success users taking approach. eg: click link load tool: [link] google prompt authorize script, click allow may access xyz purpose of zyx ...

Submit PHP form with 6000 rows data -

Image
actually have form taking approx 6000 data , when submit insert these 6000 rows insert mysq-db taking time , of time hanged. note : rows created excel upload , after upload of excel created rows(6000) on php script (view) page. , after click on submit button store these rows data mysql-db. my php/html page contains: prod_id prod_name prod_sku created_on created_by modified_on modified_by 1 samsung xyz 2015-07-17 1 2015-08-18 1 2 micromax abc 2015-07-17 1 2015-08-18 1 3 htc des pqr 2015-07-17 4 2015-08-18 4 4 htc fly mvc 2015-07-17 44 2015-08-18 44 5 lg g2 uvw 2015-07-17 66 2015-08-18 66 6 lg g4 xyz 2015-07-17 22 2015-08-18 22 7 sony lmn 2015-07-17 44 2015-08-18 44 8 dell def 2015-07-17 1 2015-08-18 1 image excel for loading huge amounts

python - CSV File Attachment Error: 'bytes' object has no attribute 'encode' -

i need create csv file , send email attachment. want create file in memory not occupy space in file system. seem have working except error when try send email: 'bytes' object has no attribute 'encode' ideas what's going wrong? django.core.mail import emailmultialternatives import csv, io csvfile = io.stringio() fieldnames = ['user_id', 'user_name', 'user_forecast', 'is_correct', 'correct_answer', 'forecast_to_event_seconds'] writer = csv.dictwriter(csvfile, fieldnames=fieldnames) writer.writeheader() f in forecasts: writer.writerow({'user_id': f.profile.id, 'user_name': f.profile.name, 'user_forecast': f.answer_text, 'is_correct': f.is_correct, 'correct_answer': correct_answer, 'forecast_to_event_seconds': (event_end-f.created_on).total_seconds()}) # send email csv attachment subject=&#

arrays - Python how to save dictionary with cyrillic symbols into json file -

#!/usr/bin/env python # -*- coding: utf-8 -*- import json d = {'a':'текст', 'b':{ 'a':'текст2', 'b':'текст3' }} print(d) w = open('log', 'w') json.dump(d,w, ensure_ascii=false) w.close() it gives me: unicodeencodeerror: 'ascii' codec can't encode characters in position 1-5: ordinal not in range(128) post full traceback, error coming print statement when fails decode dictionary object. reason print statement cannot decode contents if have cyrillic text in it. here how save json dictionary contains cyrillics: mydictionary = {'a':'текст'} filename = "myoutfile" open(filename, 'w') jsonfile: json.dump(mydictionary, jsonfile, ensure_ascii=false) the trick reading in json dictionary , doing things it. to read in json dictionary: with open(filename, 'r') jsonfile: newdictonary = json.load(jsonfile) now

How can I create the material design shadows in SVG using SVG filters -

i have found this svg creates of shadows works in chrome (firefox , safari on os x not display shadows) i'm trying reimplement visual of material design in pure svg project , i'm interested in solution follows of design requirements elevation shadows section in material design specs. i have programatic control on generated svg so, if parameters of filters easier express in computations based on elevation, please specify so. this comprehensive drop shadow filter structure duplicates functionality of drop shadow control in photoshop. wrote mini-app allow change of these parameters , copy , paste resulting filter: http://codepen.io/mullany/pen/sjopz <filter id="drop-shadow" color-interpolation-filters="srgb" x="-50%" y="-50%" height="200%" width="200%"> <!-- take source alpha, offset angle/distance , blur size --> <feoffset id="offset" in="sourcealpha" dx="-5.4

asp.net mvc 4 - How can I render different div on the basis of a list object that is passed to the partial view from the main view? -

i stuck in situation not able render multiple div's on basis of list of object. below code have written: main view <div class="section-wrap break " id="serviceplan_prioritysection" data-bind="foreach:applicationview.viewmodel.listmembers()"> @{html.renderpartial("~/views/home/serviceplan/_priority1.cshtml");} </div> partial view <div class="priority-timeline"> <div class="timeline-list"> <div class="timeline-list-items" style="margin-left: 75px"> <h6 data-bind="text:hasvalue(title())?title():'&nbsp;'"></h6> <div class="timeline-bar" id="resizable" data-bind="foreach:applicationview.viewmodel.listmembers()[0].upcomingactivities()"> <div class="priority-icon"> @*<img src="service-plan/image/img_1.png" alt=

sql - Result of SELECT statement as Input Value PHP -

i have query echos results of row... <?php $sql = "select dba_name, contact_owner, phone, confirmation_code, physical_address, physical_city, physical_state, physical_zip, urep mpas"; $result = $conn->query($sql); ?> later, echo results user see... <?php if ($result->num_rows > 0) { while($row = $result->fetch_assoc()) { echo "<strong>confirmation code: " . $row["confirmation_code"]. "<br></strong>"; ..... ?> further in code, want use same result value of hidden field. i've tried few things no success. value blank/empty. here's recent attempt. <?php echo "<input hidden name='confc' value='".$row['confirmation_code']."'>" ; ?> i'm sure it's simple not doing, hoping can me out. i've tried looking around web answer, having hard time coming answer applies specific issue. i'm pretty you've d

linux - Ubuntu: reboot "Failed to talk to init daemon" after 15.04 -> 15.10 update -

i had patched 15.04 installation , did do-release-update. it's vm popular hoster, have root , have performed earlier similar upgrades on machine no problems. @ end of update advised reboot, usual, entered "reboot" got message in title , @ prompt. i have plesk access container thought i'd reboot there - bad mistake: after shutdown nothing came , couldn't ssh in. tech support guys "did mysql" (sorry vague, that's got) , i'm now. however, think i'm in same situation because trying "reboot" gives same "failed talk init daemon" message. the server seems stable enough in serving sites ok, i'm not happy being fragile. can't update kernel, amongst other things. what heck happened during update? turns out down vm image hosting provider running not being compatible 15.10. i'm sure isn't widespread ubuntu issue.

jquery - array_chunk in Javascript, after Appending a big chunk using ForLoop -

(in edit part @ bottom, have included code got closest) explanation: have ajax post, fetches data controller. on success, have loop each post: success: function(data) { var posts = data['data']; var postscount = data['per_page']; var frag = document.createdocumentfragment(); for(i=0; < postscount; i++){ frag.appendchild(postelem(posts)); } document.getelementbyid('content').appendchild(frag); } i have function function postelement() creates eachpost div, appends child divs eachpost , returns it function postelem(posts){ var eachpost = document.createelement('div'); eachpost.classname = "col-md-4 eachpost"; //and big chunk of code appends `eachpost`. return eachpost; } this works until here the structure got working in html, , want achieve in javascript looks this: <div id="content"> @foreach (array_chunk($posts->all(), 3) $row) <div

c# - Remove marks on X-Axis -

i use wpf toolkit draw chart. bind list<keyvaluepair<string,int>> chart datacontext - result chart lineseries . on x-axis there marks (what mean - small lines on axis). <chartingtoolkit:lineseries dependentvaluepath="value" independentvaluepath="key" itemssource="{binding}" datacontext="{binding}" margin="5.5,0,0,3"/> when specify x-axis <chartingtoolkit:chart.axes> <chartingtoolkit:linearaxis orientation="x"> <chartingtoolkit:linearaxis.majortickmarkstyle> <style targettype="line"> <setter property="stroke" value="#bdb3ce" /> <setter property="strokethickness" value="0" /> <setter property="

reactjs - TransformError when running React Native Getting Started project (iOS) -

Image
i'm having trouble getting react native getting started project run. i followed guide: https://facebook.github.io/react-native/docs/getting-started.html when try run project xcode, packager gets " transform" error appears in simulator. transformerror: /users/alexandertworowsky/projects/awesomeproject/node_modules/react-native/packager/react-packager/src/dependencyresolver/polyfills/prelude_dev.js: unknown plugin "node-env-inline" here versions: os x yosemite 10.10.1 node 4.2.1 xcode 6.4 react native 0.12.0 does know how resolve this? any appreciated! had same problem. had ~/.babelrc mucking up. tried find rm -rf node_modules npm cache clean changed versions of node npm install finally... solution me was: sudo lsof -n -i4tcp:8081 kill process , rerun react-native run-ios

jquery - AJAX requests waiting for each other even though they are async? -

it seems ajax requests waiting each other without reason. make them async, in fact code: $.ajax({ url: e.action, data: getfilterdata(), type: "post" }).done(function (data) { // } when fire 3 times actions different, so: first time need 100ms , second 5ms , third 5ms . in network tab see second coming after 105ms , not 5 , , third after 110ms not 5ms . so seems async calls handled in kind of queue system in mvc on server side , don't know why.

Using google web fonts in app script -

i have tried using <link href='https://fonts.googleapis.com/css?family=enriqueta|cantarell' rel='stylesheet' type='text/css'/> to include above fonts enriqueta , cantarell in app script not working.is there other way use above fonts in app script? you're using outdated version of htmlservice sandbox, should add sandbox iframe after evaluate , show everywhere in documentation: https://developers.google.com/apps-script/guides/html/best-practices also, urls loaded must served secure ( https ), noted gerardo.

PHPStorm Mysql datasource: Permission denied: connect -

i started getting error : java.net.socketexception: permission denied: connect when try run query against mysql data source on phpstrom 9.0.2 solved, thread helped , due socket initialisation issue: http://answers.microsoft.com/en-us/ie/forum/ie10-windows_7/how-to-fix-failed-windows-sockets-initialization/b41917dd-b608-4149-bda6-8aa40acdb643?auth=1

Ho do I send a parameter to a subreport on a form using VBA in MS Access 2010 -

i trying following: on form embedded sub-report want send parameters sub-report aren't linked form i considered using "arg" section of docmd.open how pass sub-report? there anyway directly address subreport? i did try link field on form using master/child relation seems limit single record thanks you can not send parameters directly subreport, beacuse embedded. openargs opening main form, not sub. but can refer directly subreport main form control, e.g.: me.parent!controlname or parent subreport: me!subreport1.report!controlname this nice table shows, how refer sub elements (just replace form report) or parent elements http://access.mvps.org/access/forms/frm0031.htm if want change data in sub-element, change recordsource in sub event in main.

ruby - rails rspec expected is not json -

my spec doesn't seem behaving properly, or rather code isn't. here's test: describe 'get #show' before(:each) @os = factorygirl.create :deployer_os :os end 'returns operating systems' os_response = json_response expect(os_response).to eql @os end { should respond_with 200 } end factory: factorygirl.define factory :deployer_os, :class => 'deployeros' platform 'darwin' version '10.10' description 'yosemite' end end result: failure/error: expect(os_response).to eql @os expected: #<deployeros id: 120, platform: "darwin", version: "10.10", description: "yosemite", created_at: "2015-10-15 07:03:44", updated_at: "2015-10-15 07:03:44"> got: {:deployer=>[{:id=>120, :platform=>"darwin", :version=>"10.10", :description=>"yosemite", :created_at=>"2015-10-15t

c# - WPF: Validation vs. Converters -

with converter, can differentiate between @ least 4 types of behavior regarding update of source value: converting proper value (-> update source) returning null (-> indicate error) throwing exception , activating exception validation rule (-> indicate error) returning binding.donothing (-> don't update source, don't indicate error eiter) with validationrule , can discriminate between success (-> update source) , failure (-> don't update source), cannot simulate behavior associated binding.donothing is there way use validationrule in way similar binding.donothing behavior of converters? the intents of converters , validationrules pretty different. converters take 1 value , make another. 4 cases mention common enough converting: it; it's null; blow up; ignore. validationrules yes/no things - they're valid or they're not. while might make sense have "ignore" option, there isn't one. the closest semantica

angularjs - missing './lib/_stream_passthrough.js'? -

i encounter problem while launching angular (yo angular): invoke angular:controller:/usr/lib/node_modules/generator-angular/app/index.js identical app/scripts/controllers/main.js identical test/spec/controllers/main.js module.js:339 throw err; ^ error: cannot find module './lib/_stream_passthrough.js' @ function.module._resolvefilename (module.js:337:15) @ function.module._load (module.js:287:25) @ module.require (module.js:366:17) @ require (module.js:385:17) @ object.<anonymous> (/usr/lib/node_modules/generator-karma/node_modules/yeoman-generator/node_modules/download/node_modules/readable-stream/passthrough.js:1:80) i have no idea how solve it. guess module did not install don't understand error message! had problem before , me ? cheers angular v: v1.4.7 node -v : v4.2.1

java - Spring mvc doesn't work post method in form -

when started write application, form submited , createannotation method worked. doesn't work. why? way method executes in controller, , post doesn't. @controller @requestmapping("/annotation") public class annotationcontroller { @requestmapping(value = "/new", method = requestmethod.post) public string createannotation(@modelattribute annotation annotation, bindingresult result){ annotationservice.create(annotation); return "redirect:/annotation/annotations.htm"; } } <form action="${pagecontext.request.contextpath}/annotation/new" method="post"> <div class="form-group"> <label for="text">annotation name</label> <input type="text" class="form-control" id="text" placeholder="annotation name" name="name"/> </div> <div class="form-group"> <label for=&q

node.js - sequelize CreateAssociation return parent instance instead of child created instance -

i have issue createassociation method. here's code : user create curves //user create curves function savecurves(user, functions){ var curves = json.parse(functions); (var = 0; < curves.length; i++) { (function(i,user,curves){ user.createcurve({ i_min: curves[i].i_min, i_max: curves[i].i_max, }).then(function(curve){ savefunction(curve,curves[i].fn,curves[i].variables); }); })(i,user,curves); } } //save function after creating curves depends on function savefunction(curve,fct,variables){ return curve.createfunction({ fn: fct }).then(function(math_function){ savevariables(math_function,variables); return; }) } //save variables associated function function savevariables(fn, variables){ for(var j= 0; j < variables.length; j++){ (function(j,fn,variables){ fn.createvariable({ name: variables[j].name, function_id: fn.id })

angularjs - Submitting form from ngFormController -

i've made own form directive <if-form form="vm.form" submit="vm.sendform()"><if-fields></if-fields></if-form> in directive have regular form <form name="vm.form">....</form> in vm.form have ngformcontroller (with $invalid, $dirty, $error , on). i want submit form outside <if-form> . how can submit form using vm.form ? want pass validation. possible? you can use ng-click call submit function anywhere: ng-click="vm.sendform()" or can associate separate submit button using form="" <input type="submit" value="submit" form="vmform">

convolution - NAN when I use ReLU activation function in convolutional neural network Lenet-5 -

i did programmed convolution neural network lenet-5. made modifications: i replaced activation function of output neurons in last layer rbf softmah. subsampling layers maxpooling layers. learning method backpropagation as result, network working correctly. after tried replace sigmoid output of each neuron in feature maps relu (rectifier linear unit). result, network began learn faster, if not choose low speed, nan value. for small set of input data, simpler use lower speed of learning. when comes more 1,000 examples, network working, in end nan again. why there nan when using relu? lenet architecture not relu?

java - Nuxeo workflow types -

nuxeo workflows easy create studio , deploy on server, it's possibility integrate jbpm process instance of nuxeo (find information that). want know possibilities of creating workflows in nuxeo without studio. because studio it's not free, jbpm it's third party solution need integrate, can create workflow without studio or jbpm in nuxeo, , how can done? you can without nuxeo studio: generates nuxeo bundle contains no secret code "only" standard xml contributions nuxeo framework. point writing complex customization such advanced workflow takes time, requires knowledge of nuxeo model , involved components may not easy orchestrate hand. must understand the concept of extension points . then, have browse documentation, source code, api or the platform explorer in order manually write extensions points. see how contribute extension . you should start reading code generated studio. point right components. nuxeo ide great free tool. complement studi

How to scroll to the selected form field when key board shown in android app with javascript or jQuery? -

i used code window scroll top in android app. scrolling total body. not till selected form field. want scroll till selected form field. here code var is_keyboard = false; var is_landscape = false; var initial_screen_size = window.innerheight; window.addeventlistener("resize", function() { var currentheight = window.innerheight; is_keyboard = (window.innerheight < initial_screen_size); is_landscape = (screen.height < screen.width); var keyboardsize = (initial_screen_size - currentheight); if (keyboardsize > 0) { alert("keyboard shown! size is: " + keyboardsize); } else { alert("keyboard closed!"); } alert('screen resized. currentheight: ' + currentheight + " - originalheight: " + initial_screen_size); }, false); to scroll selected field need set class

Scala reduce duplicate code from inheritance -

class characterfilter extends filter[character] { def _name(n: string) = { data = data.filter(c => c.name == n) } } class npcfilter extends characterfilter { def name(n: string) = { _name(n); } } class playerfilter extends characterfilter { def name(n: string) = { _name(n); } } i'm building classes filter through data. npcfilter , playerfilter should share methods characterfilter . however, want each filter return @ end can chain functions this: .name("john").age(18).race(white) at first tried this, doesn't give result want, because left characterfilter after calling name instead of npcfilter or playerfilter desired. class characterfilter extends filter[character] { def name(n: string) = { data = data.filter(c => c.name == n); } } class npcfilter extends characterfilter { } class playerfilter extends characterfilter { } so first example works how want to, feels repetitive (especially once add more functions). there way make more

asp.net - Timeout error for AWS SNSClient Publish request -

Image
here piece of code : //publishing topic snsclient.publish(new publishrequest { subject = constants.snstopicmessage, message = snsmessageobj.tostring(), topicarn = settings.topicarn }); i getting below error : the underlying connection closed: connection expected kept alive closed server. and here screenshot of detailed error: but not able idea how solve this. hint or link helpful. we had exact same issue happen us. got error 40 times day, less 0.1% of successful push notifications sent out. our solution? update awssdk nuget package 1.5.30.1 2.3.52.0 (the latest v2 release ease-of-upgrade). updated, errors stopped happening. looked through lots of release notes , couldn't find mentioning issue. have no idea why update worked, did. i hope helps , else fix issue.

Download file from provided URL in Android Studio -

i new. trying write code in android studio - program download file using provided url link. please help! thanks!!! to start , can asynctask. refer link do check following : user has internet connection available make sure have right permissions (internet , write_external_storage); access_network_state if want check internet availability. make sure directory going download files exist , has write permissions. use asynctask download file. for downloading file refer thread .its pretty detailed. hope helps

c# - Block access to project directory programmatically -

i have wcf service running in visual studio. when running service, project's file structure shows in browser, , have directory containing files user interface. in web.config, have option (interfaceenabled) enabling/disabling interface. when set disabled, disable access directory containing interface files, don't know how this. i know setting "hiddensegment" in web.config can this, need programmatically based on value of interfaceenabled. how can this? in advance! without coding whole thing use string setting = webconfigurationmanager.appsettings["settingname"] then if setting true or ever condition like, change directory permissions using directory.setaccesscontrol there few articles on changing folder permissions in c# unsure if idea begin changing perms folder while app running might cause issues or not work.

sql - oracle query which selects grouped data -

i can't handle sql statement , have ask help. table contain 3 column: column1 column2 column3 12345 1 sometext1 23456 1 sometext2 34567 1 sometext3 45678 2 sometext4 56789 2 sometext5 i'm trying write query select data like: 12345 1 sometext1 12345 1 sometext2 12345 1 sometext3 23456 1 sometext1 23456 1 sometext2 23456 1 sometext3 34567 1 sometext1 34567 1 sometext2 34567 1 sometext3 45678 2 sometext4 45678 2 sometext5 56789 2 sometext4 56789 2 sometext5 generally 1 row looks: column1 column2 column3 **12345** **1** **sometext1** 23456 1 **sometext2** 34567 1 **sometext3** 45678 2 sometext4 56789 2 sometext5 and on... if understand right, need: select t1.column1, t1.column2, t2.column3 your_table t1 join your_table t2 on t1.column2=t2.column2

php - Error Gd Libraries in Symfony -

i want use gd library symfony have error warning: imagecreatefromjpeg(): gd-jpeg: jpeg library reports unrecoverable error: my script in controller is if (extension_loaded('gd') && function_exists('gd_info')) { echo "php gd library enabled in system."; } else { echo "php gd library not enabled on system."; } echo phpinfo(); $filename = $this->get('kernel')->getrootdir() . '/../web/logo/logo.png'; $percent = 0.5; // content type // header('content-type: image/jpeg'); // new sizes list($width, $height) = getimagesize($filename); $newwidth = $width * $percent; $newheight = $height * $percent; // load $thumb = imagecreatetruecolor($newwidth, $newheight); $source = imagecreatefromjpeg($filename); // resize imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight,