Posts

Showing posts from July, 2012

javascript - AngularJS $scope.model is undefined -

angularjs $scope.model undefined when initialize via javascript <button ngf-select="upload($file)">Выбрать</button> <span id="photospan"></span> <input type="text" id="photo" name="uploadphoto" ng-model="uploadphoto"> here initialization code: document.getelementbyid("photo").value = filename; $("#photospan").text(resp.config.data.file.name); console.log('success ' + resp.config.data.file.name + 'uploaded. response: ' + resp.data); so createexpositionresource.photo = $scope.uploadphoto; console.log('--------------'+$scope.uploadphoto); returns undefined . what doing wrong? thank you! what doing wrong? using jquery: have @ question: "thinking in angularjs" if have jquery background? you should replace document.getelementbyid("pho...

cabal - Installing Haskell dependencies like `pip -r requirements.pip` -

i new haskell , having problems cabal . performing following operations, $ cabal sandbox init $ cabal install parsec alex happy haddock mtl followed by $ cabal configure --enable-tests resolving dependencies... configuring scheme-0.1.0.0... cabal: @ least following dependencies missing: alex >=2.3, cabal >=1.22, haddock >=2.15, happy >=1.18 i using $ cabal --version cabal-install version 1.22.8.0 using version 1.22.7.0 of cabal library i deleted sandbox , created new one $ cabal sandbox remove $ cabal sandbox init so use: $ cabal install --dependencies-only $ cabal configure --enable-tests but suffer same issue there, both yield same error, namely resolving dependencies... configuring scheme-0.1.0.0... cabal: @ least following dependencies missing: alex >=2.3, cabal >=1.22, doctest >=0.8, haddock >=2.15, happy >=1.18 this .cabal file, name: scheme version: 0.1.0...

javascript - How to close jQuery dialog when button inside iFrame is clicked? -

this question has answer here: close jquery ui dialog iframe 4 answers i have jquery dialog iframe added dialog when opened. how close dialog wen button(button present in html of iframe) clicked. i tried contents inside iframe using contents() getting [object object] many people have mentioned cant access content of cross domain , here no other domain involved @ all. window.parent.$("#dialogdiv").dialog('close'); that's solves problem..

jquery - AngularJS - Does scrolling to an element belong in a directive? -

i'm aware dom manipulation belongs in directives rather controllers, i'm hung on whether scrolling element (with jquery's scrolltop ) considered dom manipulation and/or should moved directive. my page dynamically generated (using grails) , small bootstrap dropdown placed on corner of page facilitate scrolling places within lengthy document: <a ng-click="scrollto('question${ subquestion.id}')"> the ${} replaced number when sent client. my scrollto function within controller rather simple , works: $scope.scrollto = function(id) { $('html, body').animate({ scrolltop: $('#' + id).offset().top - 50 }, 1000); }; i'm using ui-router , using $uiviewscroll scroll element; seemed more in line angular way need 50px offset because of navigation bar , prefer animation (both don't seem option $uiviewscroll ). questions: does scrolling element have digest consequences true dom manipulation? is scrolli...

Elasticsearch - Autocomplete return word/term/token suggestions instead of whole documents -

i trying implement simple auto completion query terms. there many different approaches of them return documents instead of terms - or authors stopped explaining point , not able adapt. a user typing in query - e.g. phil want provide list of term completion suggestions philipp, philius, philadelphia, ... i able document matches via (edge)ngrams, phrase_prefix , on am stuck @ retrieving matching terms (completion suggestions). can give me hint? i have documents {"title":"...", "description":"...", "content":"..."} fields have larger string values field content contains fulltext content. i not want suggest whole title of document containing e.g. philadelphia. word "philadelphia". looking that, myself. in solr relatively simple configure (although pain build , keep up-to-date) using solr.spellcheckcomponent. somehow same underlying lucene functionality used differently between solr , elasticse...

web scraping - Webscrapping an alternate version/hidden item from a webpage using python beautifulsoup -

i trying webscrap information (points scored, tackles made, time played, position, etc...) top14 rugby players website. each player info page : http://www.lnr.fr/rugby-top-14/joueurs/nicholas-abendanon each player, can info 2015-2016 season easily, need info 2014-2015 season. problem is, when open corresponding link ( http://www.lnr.fr/rugby-top-14/joueurs/nicholas-abendanon#season=14535 ) source code same , info program scrap 2015-2016 data. can't seem find way info previous seasons though appears on webpage. knows how solve ? here code player gave example. import bs4 lxml import html import requests import string import _pickle pickle bs4 import beautifulsoup dic={} url_player='http://www.lnr.fr/rugby-top-14/joueurs/nicholas-abendanon' page = requests.get(url_player) html=page.content parsed_html = beautifulsoup(html) body=parsed_html.body saison14_15=body.find('a',attrs={'data-title':'saison 2014-2015'}) link=saison14_15['href...

aggregation framework - mongodb aggregate average of array elements -

i have collection of documents in mongodb 2.6.11 'cpu' array showing [cpu0,cpu1], see example below { cpu: [ '100','20' ], hostname: 'host1',_id: 1 }, { cpu: [ '40','30' ], hostname: 'host1',_id: 2 }, etc i'm looking average cpu on 'host1' ['70','25'] ( because '100'+'40'/2='70' , '20'+'30'='25' ). trying aggregate cpu1 not giving me right result db.collection.aggregate( [ { $group: { _id:"hostname", avgcpu: {$avg: "$cpu.1"} } } ] ); in mongodb 2.6 positional notation in aggregation unsupported, need $unwind document, , on next stage perform $avg . in mondodb 3.2 however, have $arrayelemat operator return element @ specified index { $arrayelemat: [ <array>, <idx> ] } based on document structure posted, query wo...

Wcf returns "success" just for first time and subsequent calls return "timeout" -

i researched problem couldn't find useful result. tried configure web.config , iis configurations (disabling cache etc.) result negative. when make request restful using wcf, of wcf methods works fine everytime of wcf methods work first time returning success, subsequent calls' results return "timeout ". when restart iis , , end iis worker task on task manager , debug wcf service, troubled methods work fine first time. please me thank in advance for ex: [request] localhost/service1.svc/getdata?value=8 [response] "you entered: 8" getdata method works fine but arm method; [request first] localhost/service1.svc/arm?pass=1234&type=2 [response first] {"data":true,"error":false,"message":"success"} [request subsequents] localhost/service1.svc/arm?pass=1234&type=2 [response subsequents] {"data":false,"error":true,"message":"request timeout. please try ag...

javascript - JSON How to return an objects name instead of its value -

json objects have "name : value" relationship. need way return objects name instead of value. for example, if animals[0].species return value "feline", how instead return name "species"? the function i'm writing requires me check if objects name equal input of function before return value of object. i have searched stackoverflow , w3schools solution, no success. var animals = [ { "animal": "cat", "species": "feline", "likes": "yarn", "dislikes" : "water" }, { "animal": "dog", "species": "canine", "likes": "rubber balls", "dislikes": "thunder" } ]; function lookup(property){ if (animals[0].property == "species") { return animals[0].species; } } lookup("species"); you're missing quotes around species function ...

c# - Check if parameter is already chosen in console -

i'm writing flesch index calculator , want able start program console command , .exe itself. want read in .txt files in console command fleschindexcalc.exe -f "path of file" , able select calculation formula either english text parameter -e or german text -g . when start console command: type in parameters myself. when start .exe: program asks language , have write g or e , press enter . now question: how can tell program while starting console chose language doesn't ask me again started .exe? here's got: (if need more code fleschscore.cs ask :) ) namespace flesch_reading_ease { public class program { public static void main(string[] args) { string filename = string.empty; string[] parameters = new string[] { "-f", "-g", "-e" }; console.writeline("flesch reading ease"); console.writeline(""); if (args.length ...

c++ - Qt use same model for QListView and QTableView -

i'm trying use same model display pieces of information on 2 different kind of view. i need show information 150 objects have description , can either on or off. one of view summary of on/off states of objects in table (15 10) of icons. the other view list of 150 rows display state of objects , descriptions. i tried subclass qabstracttablemodel , return different rowcount , columncount value depending of view used , works (my 150 objects shown in table , in list) remove clear separation between model , view given need tell model view using , doesn't work expected when try link 2 selection models of views because qmodelindexes change when row , columns counts change. any idea of better approach problem or way solve selection issue? edit due @ramtheconqueror response: the response ramtheconqueror led me right direction surprisingly discovered proxymodel takes overriden columncount , rowcount function account widget size calculation not use them widget indexes. ...

How to Encrypt Yii2 url -

i want encrypt yii2 url parameters example: http://localhost/school/backend/web/index.php?r=user%2fview&id=20 20 must encrypt. whats simplest way in yii2 achieve this. you can use this. if have lot of parameters don't advice because performance problems. if still want can send data 1 parameter encode json. decrease process count 1 time encrypt decrypt. $decrypt = \yii::$app->security->decryptbykey($_get['id'], \yii::$app->request->cookievalidationkey); $encrypt=\yii::$app->security->encryptbykey($id, \yii::$app->request->cookievalidationkey);

python - Cython dictionary / map -

i have list of element, label pairs this: [(e1, l1), (e2, l2), (e3, l1)] i have count how many labels 2 element have in common - ie. in list above e1 and e3 have label l1 in common , 1 label in common. i have python implementation: def common_count(e_l_list): count = defaultdict(int) l_list = defaultdict(set) e1, l in e_l_list: e2 in l_list[l]: if e1 == e2: continue elif e1 > e2: count[e1,e2] += 1 else: count[e2,e1] += 1 l_list[l].add(e1) return count it takes list 1 above , computes dictionary of element pairs , counts. result list above should give {(e1, e2): 1} now have scale millions of elements , labels , though cython solution save cpu time , memory. can't find docs on how use maps in cython. how implement above in pure cython? it can asumed elements , labels unsigned integers. thanks in advance :-) i think trying on complica...

php - HTML string from API not being converted to HTML rendered entities -

i'm receiving chunk of html via api call , trying put html template render. but, instead of rendering, it's being printed out if string. example of html string api: \u0026lt;p\u0026gt;\u0026lt;strong\u0026gt;hello world\u0026lt;/strong\u0026gt;\u0026lt;/p\u0026gt; then in controller convert string html entities $content = htmlspecialchars_decode($response['content']); the issue i'm having in view, html printed (tags , all) instead of being rendered html: in view code: <?= $content ?> end result: <p><strong>hello world</strong></p> how can html chunk render in view? your data looks double-encoded. try $content = htmlspecialchars_decode(htmlspecialchars_decode($response['content']));

python - How to get a SQL Server stored procedure returned rowset using pyodbc? -

my question in close connection stackoverflow/9915788 . i using pyodbc upload data external sql database , use stored procedure of database. procedure returns 2 things: a rowset (a single row contains text "success" if procedure worked fine or text "fail" followed available reason if failed) an integer value (0 success, -1 failure) i managed read out integer value using approach described in link above, read out rowset because further information in case of errors. any ideas how this? i'm not sql expert, in understanding rowset should "cursor like" object since should possible loop row; how in select statement? this how integer value: def callstoredproc(conn, procname, *args): sql = """set nocount on; declare @ret int exec @ret = %s %s select @ret""" % (procname, ','.join(['?'] * len(args))) return conn.execute(sql, args).fetchall() but have...

php - Connecting to database to retrieve and parse JSON data? -

i trying making basic html page 1 of professor's databases has. problem not know how data database , parse correctly. example, here have far. want print name of satellites. <html> <head><title>testing</title></head> <body> <p>this above php.</p> <?php $json = file_get_contents("https://db.satnogs.org/api/satellites/ ?format=json"); $data = json_decode($json); echo $data->{"name"}; ?> <p>this under php. </p> </body> </html> and gives me webpage says: this above php. under php. with data should between 2 lines missing. don't error, either. know there lot of resources answer question i've looked on stack overflow , other webpages , can't find answer helps me understand problem or solve it. also, i'm not quite sure if should using php. suggestion solve problem appreciated. as can see, if visit website https://db.satnogs.org/api/satellite...

php - ZF2 Redis: how to set expiration time for a key -

i have set redis on server store information zend framework 2. now, can store information, can not give them expiration time naturally renew after while. i have not found documentations step , seems me rather obscure. my code: page: config/autoload/cache.global.php return array( 'caches' => array( 'redis' => array ( 'adapter' => array ( 'name' => 'redis', 'lifetime' => 60, //doesn't work 'options' => array ( 'server' => array ( 'host' => 'x.x.x.x', 'port' => x ), 'ttl' => 10, // seems have no effect 'namespace' => 'mycache', ), ), ) ) ); in controller : .. use zend\cache\storagefactor...

python - skip-thought Theano model - list not declared -

i have defined list x take contents of file , feed preprocessor of skip-though model in theano. error says x not defined . https://github.com/ryankiros/skip-thoughts/blob/master/skipthoughts.py def encode(model, x, use_norm=true, verbose=true, batch_size=128, use_eos=false): """ encode sentences in list x. each entry return vector """ # first, preprocessing x = preprocess(x) # word dictionary , init d = defaultdict(lambda : 0) w in model['utable'].keys(): d[w] = 1 ufeatures = numpy.zeros((len(x), model['uoptions']['dim']), dtype='float32') bfeatures = numpy.zeros((len(x), 2 * model['boptions']['dim']), dtype='float32') # length dictionary ds = defaultdict(list) captions = [s.split() s in x] i,s in enumerate(captions): ds[len(s)].append(i) def preprocess(text): """ preprocess text encoder ...

c# - Generic Delete in Entity Framework -

i have generic delete method dodelete<mytable>(int batchsize, mydatabasecontext) this methods builds ids ( list<int> deleteid ) upto batchsize count , call bulkdelete<t>(mydatabasecontext, t => deleteid.contains(t.recordid)) however approach not work because unaware <t> has property recordid (even though recordid property). i have tried: int rows = bulkdelete<t>(mydatabasecontext, "recordid in (100001,100002)"); this actual method delete, have overload accepts string predicate. public int bulkdelete<t>(mydatabasecontext context, expression<func<t, bool>> predicate) t : class { int rows = context.set<t>().where(predicate).delete(); return rows; } as @mason says, can create interface recordid property entities implement, generic t=>deleteid.contains(t.recordid) compile: // interface public interface irecordidentity { int recordid {get;set;} } // sample class public cla...

java - ERROR 7405 --- [ main] o.s.boot.SpringApplication : Application startup failed -

i using gradle 2.9 , springbootversion = '1.3.1.release' build successful jar deployment not successful. these logs: 2016-02-05 20:44:13.905 warn 7405 --- [ main] ationconfigembeddedwebapplicationcontext : exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.beancreationexception: error creating bean name 'entitymanagerfactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/hibernatejpaautoconfiguration.class]: invocation of init method failed; nested exception java.lang.noclassdeffounderror: org/hibernate/boot/registry/classloading/internal/classloaderserviceimpl$work 2016-02-05 20:44:13.916 info 7405 --- [ main] o.apache.catalina.core.standardservice : stopping service tomcat 2016-02-05 20:44:13.942 error 7405 --- [ main] o.s.boot.springapplication : application startup failed org.springframework.beans.factory.beancr...

javascript - How to mock download attribute of a link? -

i working on updating app angular 1.2 angular 1.4 , in course, broke of karma tests. easy fixes, there few can't working. tests rely on checking if download attribute defined determine how download required file. before upgrade, tests set elem.download. after upgrade, can't seem set download. here how i'm setting element tests: var link = document.createelement('a'); link.download = undefined; and in code itself, simple if(link.download !== undefined) { //do stuff (this test works) } else { //do other stuff (this test doesn't work) } when try set link.download undefined, still going first branch. if try pass empty object in, errors because various properties undefined, though code doesn't seem looking @ properties. i have tried setting link.download = null , changing if statement use typeof tl;dr how set download attribute undefined? here simple plunker issue. the value set download converted string value, undefi...

MVC jquery image src Url.Content quotes issue -

i have js file dynamically changing image src. this current code trying : $("#prodfront").attr("src", '@url.content("~/order_images/campaigns/"' + campaignkey + '"/"' + id + '"/general/front.png"")'); my image located @ location : root folder/order_images/campaigns/ 765662bd-06ec-4925-8611-f147e232a124/1/general/front.png $("#prodfront").attr("src", '@url.content("~/order_images/campaigns/ 765662bd-06ec-4925-8611-f147e232a124/1/general/front.png")'); but code goes location http://localhost:50209/buynow/index/@url.content(%22~/order_images/ campaigns/765662bd-06ec-4925-8611-f147e232a124/1/general/front.png%22) i can view image here : http://localhost:50209/order_images/campaigns/765662bd-06ec-4925-8611- f147e232a124/1/general/front.png can please these quotes. thank you. as campaignkey , id javascript variable. can't use ...

C# operator overloading performance -

i looking @ c# basic example of operator overloading: public static vector operator + (vector lhs, vector rhs) { vector result = new vector(lhs); result.x += rhs.x; result.y += rhs.y; result.z += rhs.z; return result; } and wondering, performance-wise same thing overload + operator this? public static vector operator + (vector lhs, vector rhs) { vector result = new vector(); result.x = rhs.x + lhs.x; result.y = rhs.y + lhs.y; result.z = rhs.z + lhs.z; return result; } are there differences first , second example? what's best solution , why? your second method written incorrectly: you're adding .x property of rhs everything. i'm going assume simple mistake, , meant have same behavior between 2 methods. these 2 examples call different constructor overloads, haven't included code for. if can assume first example's constructor sets x , y , , z properties on object, difference should first 1 needs load val...

paypal - Trouble getting the correct pay response from the PPMessage.php Core File when using PPMessage::init() function? -

i'm working in custom paypal adaptive payments gateway , i'm having problems getting right pay response (new payresponse) in php. have tracked error , found in core file ppmessage.php. payment gateway can create following paykey paypal adaptive payments: $resp = array ( 'responseenvelope.timestamp' => '2016-02-05t06:57:57.098-08:00', 'responseenvelope.ack' => 'success', 'responseenvelope.correlationid' => 'e24f3c602852a', 'responseenvelope.build' => '17820627', 'paykey' => 'ap-62k58588w7248331v', 'paymentexecstatus' => 'created', ); when want translate pay response following: $ret = new payresponse; $ret->init($resp); payresponse extends ppmessage defines method init. however, core file ppmessage gives me following answer: ret=payresponse::__set_state( array( 'responseenvelope' => null, ...

rust - How can I improve compile times when I have a large HashMap literal? -

i have large hashmap of physical measurements (300k+ entries of 3-element tuples), i'd keep hashmap (i move out sqlite db , query it, i'd rather not, performance reasons). including literal makes compile times…long. there better approach? serialise disk in binary format, , load hashmap when binary executes / library loaded? developing , testing using subset works fine, need full data production… so you're hardcoding hash map? seems perfect hashing problem, see https://github.com/sfackler/rust-phf crate. as compile times, offload hash table separate crate , cargo recompile crate when hash table data changes.

keypress - Letting User Specify Own C# KeyCodes for Making Shortcuts -

i want let user press key combination , set combination perform action. example: control/p i can capture keys in keydown event, it's bit more complicated because key combination should not allowed, such control/c , control/v, since these used perform windows operations, don't want alter. does know of prepared list can use make sure user entering acceptable key combination? did before, , hoping not have re-invent wheel. thanks. create blacklist of ones don't want allow them override. you can use e.g. keyboard shortcuts windows reference.

Looking for a lossless compression algorithm, for 100-250 byte stings with a pattern -

each string built , date, time, day of weeks, random number of fixed size, url , few other blocks, semicolons between them. all suggestions appreciated! try smaz . written purpose. mileage may vary.

javascript - Page Redirect and set request custom request header -

i looking way redirect web app , set custom request header. manly because web app going expecting custom header user name call "remote_user" set user name to. i exploring use of java servlet or maybe writing java script this. var client = new xmlhttprequest(); client.open("post", "/log"); client.setrequestheader("remote_user", "user1"); window.location.href = "http://myserver.com:8080/webapp/"; i seeing page getting redirected don't see custom request headers function customheader(remoteinput, userinput) { var client = new xmlhttprequest(); client.open("post", "/log"); client.setrequestheader(remoteinput, userinput); window.location.href = "http://myserver.com:8080/webapp/"; } now execute function: customheader("something", "user42"); if misinterpreting question, please reply!

javascript - Form validity using Angular ng-repeat -

i have angular form parsing json data. i'm rendering using ng-repeat . however, i'm having issue in form never becomes valid when radio button in each group selected. i suspect issue lies ng-model in each input, can't seem figure out correct way dynamically create ng-model inside ng-repeat . form block code: <form name="posttestform"> <alert ng-repeat="alert in alerts" type="{{alert.type}}" close="closealert($index)">{{alert.msg}}</alert> <div class="well question-well" ng-repeat="question in questions"> <p> <strong>{{question.question}}</strong> </p> <ul> <li ng-repeat="answers in question.answers"> <input ng-model="q[question.id]" type="radio" name="q{{question.id}}" value="{{answers.id}}" required="...

java - Using Synchronized with Thread-Safe Collection? -

suppose have following code: private concurrenthashmap<integer, book> shelf; public library(concurrenthashmap<integer, book> shelf){ this.shelf = new concurrenthashmap<integer, book>(shelf); } given i'm using thread safe collection following method okay use or need worry thread safety? public void addbook(int index, book add){ shelf.put(index, add); } if above method isn't safe use, adding synchronized proper way of doing it? so, public synchronized void addbook(int index, book add){ shelf.put(index, add); } the synchronized keyword puts mutex lock around entire addbook method. a concurrenthashmap ensures operations (such put) threadsafe, using retrieval operations (such get) in conjunction might cause come across situation retrieving contents hashmap @ same time putting, , unexpected results. individually, methods in concurrenthashmap thread-safe, used in conjunction in s...

c# - How OpenXmlReader.Skip supposed to work? -

from documentation : skips child elements of current node. here code: var reader = documentformat.openxml.openxmlreader.create(worksheetpart); // header while (reader.read()) { if (reader.elementtype == typeof (row)) // reader @ row r="1" { headers = getheaders((row)reader.loadcurrentelement(), _doc.workbookpart); reader.readnextsibling(); // reader @ row r="2" break; } } //... reader.skip(); // reader @ row r="3" worksheet xml (cut): <x:sheetdata xmlns:x="http://schemas.openxmlformats.org/spreadsheetml/2006/main"> <x:row r="1" spans="1:1"> <x:c r="a1" s="1" t="s"> <x:v>36</x:v> </x:c> </x:row> <x:row r="2" spans="1:1"> <!-- before calling skip reader here --> <x:c r="a2" s="1" t="s"> <x:v...

c# - UWP navigation causing Access Viloation -

i converting wp 8.1 app uwp , interested in using prism thought build app ground up. have created page button navigates page, deployed app , gave go. when click button navigate following code executed private void button1_click(object sender, routedeventargs e) { this.frame.navigate(typeof(testpage)); } which crashes app. when @ output window in vs2015 see following @ bottom. the program '[4760] myapp.exe' has exited code -1073741819 (0xc0000005) 'access violation'. both pages have viewmodels , set using prisms viewmodellocator.autowireviewmodel . tried clearing properties of viewmodels empty no code did nothing. put breakpoint in view model constructor , reach point when debugging. any ideas means or else look? update: issue looks caused control template. narrowed issue down button control commenting out xaml , adding things 1 one. found control causing issue removed binding , style template. added binding , ok, added template , issue occurred. ...

xslt - Russian doll to Venetian blind xsl transformation -

i have been trying write xslt transformation convert 'russian doll' style xsd 'venetian blind' one. i have written not work intended. have following xsd document: <?xml version="1.0" encoding="utf-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/xmlschema" xmlns:tns="gx" targetnamespace="gx" elementformdefault="qualified" attributeformdefault="unqualified"> <xs:complextype name="toptype"> <xs:sequence> <xs:element name="requestor" type="xs:string" nillable="false" minoccurs="0" maxoccurs="1"/> <xs:element name="return_cancelled_customers" nillable="false" minoccurs="0" maxoccurs="1"> <xs:complextype> <xs:sequence> <xs:element name="external_custo...

linux - Sending Mail via Telnet -

i tried send email via telnet. doesn't accept data part. following problem occured. $ telnet 74.125.68.109 25 trying 74.125.68.109... connected 74.125.68.109. escape character '^]'. 220 smtp.gmail.com esmtp xr8sm26040278pab.26 - gsmtp mail from: mohangtrichy@gmail.com 503 5.5.1 ehlo/helo first. xr8sm26040278pab.26 - gsmtp mail to: raju10anand@gmail.com 503 5.5.1 ehlo/helo first. xr8sm26040278pab.26 - gsmtp data 503 5.5.1 ehlo/helo first. xr8sm26040278pab.26 - gsmtp mail sent telnet... 502 5.5.1 unrecognized command. xr8sm26040278pab.26 - gsmtp ^] telnet> connection closed. $ here problem after data command. there mistake did. 74.125.68.109 mail address of gmail. it's telling you aren't saying helo first command. after each line it's yelling @ again didn't helo

Why there is a "nil" at the end of output in clojure -

i wondering why there "nil" @ end of output in clojure. here code: (defn foo [x &argu] (print x &argu)) and other question "&argu" mean here? variadic argument or something? thank much! the repl (or whatever execution environment using) lets know output of evaluation of code. have written function not return anything. in such cases nil returned convention. nil clojure's marker nothing/null . code doing printing - 'side effect'. it important note nil proper value in clojure. in contrast languages won't let compare undefined/unknown value proper value - doing generate exception. normally there's space, [x & argu] . matters - please put space in code , try again. means function takes 1 or more parameters. quite correct in saying 'varadic'. most languages have concepts of 'nil' , 'varadic arguments'. because clojure functional language whole thinking around 'only returning...

google oauth - Gmail label request fails with http 403 (forbidden) -

i have application uses oauth 2 access gmail. working fine users. users, however, application fails @ point of trying read gmail labels, http error 403 (forbidden). keep in mind previous api call, have accessed user profile successfully. here call fails: get /gmail/v1/users/user.name@domain.com/labels?access_token=ya29.fwi_zl1rf3xoiqchnzpbhmjvljhrpofkh4a9mvvwhyro6h09qx5rnkv76zkt7e6-sezr i requesting following scopes when getting access token, , user has logged in google , accepted request access (and can see when @ security dashboard): https://www.googleapis.com/auth/calendar https://www.googleapis.com/auth/userinfo.profile https://www.google.com/m8/feeds https://www.googleapis.com/auth/tasks https://www.googleapis.com/auth/gmail.labels https://mail.google.com/ note added gmail.labels scope in @ attempt fix this. again, code working fine users - why users fail label request? use shorthand value me instead of user.name@domain.com , user access token belongs ...

Display a Matlab struct as a table -

i have struct. want display content of struct table. use following transformation: atable = struct2table(astruct); disp(atable); which returns astruct = localname: {'example.cdf'} size: '1 kb' modifiedtime: '10-may-2010 21:35:00' atable = localname size modifiedtime _____________ ____ ____________ 'example.cdf' 1 kb [1x20 char] the value of modifiedtime not correct. hope display value, not array. can tell me how can that? if string longer 10 chars, display size rather string itself. cellstrings displays string 143 chars , truncates ... . effect inherited internal call evalc(cellstr) . struct2table(struct('char10', '1234567890', 'char11','11234567890','cellstring11',{{repmat('1',1,144)}})) ans = char10 char11 cellstring11 ...