Posts

scala - Randomizing the List -

i wrote function choose 1 word randomly lists of words. here code. cannot choose 1 word , cannot print. please tell me what's wrong code. def long(a: int, b: int): string = { var = 5 var b = 100 (i <- args(1)){ if (i > && < b){ val rand = new random(system.currenttimemillis()) val random_index = rand.nextint(new_sun .length) val result = new_sun(random_index) var guess = println("_ " * result.length) } else{ println("you have input word length of 5 < 100") } return i.tostring } } there's lot gone wrong here, it's difficult knowing start. taking 1 fragment @ time: def long really, unbelievably bad name method! def long(a: int, b: int): string = { var = 5 var b = 100 you're taking a , b parameters, shadowing names create vars. parameters useless. for (i <- args(1)){ ...

php - Difference between getRawBody() and getBody() methods of Zend_Http_Response? -

hi wondring whats difference between $response->getbody() , $response->getrawbody(); $this->_client->seturi('http://www.google.com/ig?hl=en'); try { $response = $this->_client->request(); }catch(zend_http_exception $e) { echo 'zend http client failed'; } echo get_class($response); if($response->issuccessful()) { $response->getbody(); $response->getrawbody(); } getrawbody() returns body of http response is. getbody() adjust headers i.e. decompresses content sent gzip or deflate content-encoding headers. or chunked transfer-encoding header. the simplest way figure these questions out in @ code. great learning experience. code edited brevity. public function getrawbody() { return $this->body; } public function getbody() { $body = ''; // decode body if transfer-encoded switch (strtolower...

iphone - Choosing whether to Objective-C after learning C from "C Primer Plus" -

i have development experience in c++, know there different aspects between c , c++. going work on objective-c. there need learn book c primer plus before starting write objective-c code? in addition, have read objective-c programming book dave mark. plan learn cocoa on mac , ios development. videos on lynda.com helpful. iphone there 1 book called beginning iphone development mark lamarche

Syntax highlighting in Oracle browser something like SQL Server Management Studio -

Image
hi use long time ms sql , sql server management studio no start oracle , try sql command in oracle browser hasn’t syntax highlighting. it exist sql server mamagement studio oracle? if happy installing locally (or @ least unzipping it), go xavinou's suggestion of sql developer or 1 of commercial ides such toad or pl/sql developer

ruby on rails - paperclip process file contents before upload -

i want compute hash before uploading file no duplicates stored on server. using paperclip gem, what's best approach processing on file before saving or inserting data in database? activemodel has callback before_create (among others) make ideal place compute before record created. full list of callbacks available, see ruby on rails guides: active record validations , callbacks . class asset has_attached_file :image before_create :do_something def do_something end end

hibernate - Spring Mvc Controller - problem with delete -

i working in j2ee project (pojo layer, dao layer(hibernate), service layer(spring), view(spring mvc)) have table of articles after each row want add link remove it. this view <c:if test="${!empty articles}"> <table> <tr> <th>article id</th> <th>article name</th> <th>article desc</th> <th>added date</th> <th>operation</th> </tr> <c:foreach items="${articles}" var="article"> <tr> <td><c:out value="${article.articleid}"/></td> <td><c:out value="${article.articlename}"/></td> <td><c:out value="${article.articledesc}"/></td> <td><c:out value="${article.addeddate}"/></td> <td><a href="articles/${article.articleid}...

iis - ASP.NET: Errors not viewable despite proper configuration -

i'm having classic (dare typical?) error on asp.net production server, tells me can't view errors. below error displayed below, things i've tried. in iis manager (6.0), application located under 1 of web sites in "web sites". indeed web application, opposed virtual directory (it has gear icon). when trying view error localhost (i.e. server itself), doesn't find application on path, though root web site works fine localhost. not firewall issue because first of all, firewall turned off, , second because root web site works fine localhost. heck, tried connecting through telnet , worked fine , dandy too, , not firewall issue. basically, need view error @ all. won't have fix problem if can see error , fix it, because there wrong in code itself... don't know what, because iis/.net won't tell me. runtime error description: application error occurred on server. current custom error settings application prevent details of application error b...