Posts

Showing posts from June, 2012

Opening pdf data as image in rails views -

i have used rails 4, views <div> <%=image_tag(some_method_path), class: 'image-view' %> </div> controller method def some_method @label_image = base64_incoded image hex send_data @label_image, :type => 'application/pdf', :disposition => 'inline' end the image not opening in view opening pdf if run url in window. how display pdf image in div ? any appreciated as far understood, trying render preview image tag of pdf document. however, not automatic task, , browser won't magically perform conversion you. you need library render pdf , capture preview. not rails problem, it's generic pdf conversion problem. note. question similar how have pdf viewer in ruby

java - How does a tomcat server identify clients for creating session id -

i need learn how tomcat server identify different hosts create unique sessions. according ip ? based on answer question, want able create multiple sessions single client, on server uses httpservletrequest.getsession() create new sessions. possible give predefined session id server, that server creates new session bound session id ? it doesn't identification. each time request comes in , ask session created, creates one. generated session id sent browser in cookie, , browser sends cookie subsequent requests, allows tomcat find associated session. i can't understand you're trying achieve. session doesn't identify server. identifies specific client of web app. each client has own session id. assigning session id server doesn't make sense me.

c# - Applying attributes to the Partial classes -

following partial class: // file - designcontroller.cs [authorize] public partial class designercontroller : apicontroller { // code } [authorize] public partial class designercontroller { // code } i need understand usage of [authorize] or similar attribute on class, fine have on 1 of partial class definition or of them have it. current code compiling need understand runtime issues of above implementation on partial classes attributes merged @ compilation time, yes, can have on 1 class. example: [obsolete] public partial class foo {} [authorize] public partial class foo {} compiles to: [obsolete] [authorize] public partial class foo {} for further information on can @ msdn: partial classes , methods

Automatically assigning variables in Unity3d -

i've made path finding utility works fine. each node has neighboring nodes assigned in builtin array, works smoothly. however, @ moment have assigned these neighboring nodes manually circuitous. the solution want avoid: 1) -and know how to- assign these arrays @ function start() , not able use fast buitlin arrays , starting game takes unnecessarily time. the solution looking for: 2) assign builtin variables in 'bake-like-manner': need run script outside game can interact game , assign variables script @ previous solution could, store variables , assign builtins. i hope explained well. if unclear i'd pleased clarify. in advance!

python - Getting inputs from USB TV remote -

i'm running linux debian port on raspberry pi named debian, , has python 3 , 4 installed, believe. have usb remote looks tv remote i'm trying receive input program, preferably in python, have no idea how input pressed button on usb device relay instructions. i need way index usb input presses, can map them inputs sent on i2c. doesn't have python, have other instructions in , know how import controls. edit: controller ati rf remote sensor plugs usb. http://www.emtcompany.com/ati-100712001-remote-control/101317958.html?gclid=cjwkeaiahiejbrckm_ftxiwyyxcsjabxy0xyp_ozmm7_2ydlkfysth7js-bxk0ngqos68crxrrjkahocqw_w_wcb

c# - Wpf binding update regularly -

i've got complex back-end process runs long period of time. vital stats exposed properties inotifypropertychanged events raised when they're set. i wanted add "elapsed time" proving far more challenging anticipated. i exposed processstartedat datetime , threw converter subtract bound time datetime.now . works (once). after that, since property isn't changing, binding never updated , converter isn't called again. i don't want back-end have timer dedicated updating "elapsed time" property. violates separation of concerns principle. i'd happier timer in ui unsure how force binding refresh without updating property value. even better, there way can tell binding refresh @ regular intervals? <textblock text="{binding path=processstartedat, converter={staticresource elapsedtime}}"/> i throw timer inside valueconverter class , raise event call convert method each time interval hit. ...

php - Error related to AWS Sqs Queue in Laravel -

i error in laravel when trying access queue - class 'aws\sqs\sqsclient' not found my default queue 'sync' , have not required 'sqs' anywhere in composer.json. why happening? compulsory include in newer versions of laravel. i use package: https://github.com/aws/aws-sdk-php-laravel this package aws components works! i recommend you

iis - Enable TLS 1.2 on windows server 2008 R2 -

i trying enable tls 1.2 on windows server 2008 r2. have made registry entries enable tls 1.2 mentioned in below link : http://forums.iis.net/t/1201043.aspx . i have tried powershell script in link : http://www.hass.de/content/setup-your-iis-ssl-perfect-forward-secrecy-and-tls-12 while monitoring through wireshark found client hello message sending version tls 1.2 , protocol showing tlsv1. server hello message showing tlsv1 in protocol field , version tls 1.0 . i don't know if missing enable tls 1.2. think have made registry entries. appreciated. above mentioned services runnig in hasp server , running on 443 port. another strange thing using iis 7.5 server when deploy srvice on 8443 port. running on tls 1.2 ie 9. both iis 7.5 service , hasp server service running in same machine. throgh wireshark showing tcp protocol only. no ssl protocl used here https communication. how possible? also last point if disable sslv3 server registry or remove entries. url still works o...

regex - Extracting U.S. common law case names (e.g., Smith v. Jones) systematically using off-the-shelf NLP software? -

i'd find way extract case names u.s. courts sentences. take predictable pattern, although think may varied capture regexs, thinking using nlp locate them. here few examples of case names (bolded) might used in partial sentences: in united states v. george , court held that... in re. bankruptcy of sir walter williams, iii case southern district of new york... not ashcroft v. iqbal , 556 u.s. 662 (2009) incorrectly decided, also... the court's recent decision in burwell v. hobby lobby stores , no. 13-354 (u.s. jun 30, 2014) implicates first amendment rights... the case of trans world airlines, inc. v. flight attendants correctly decided... i've been experimenting off-the-shelf packages (like textblob python), helps things extract noun phrases -- don't know how take next step , recognize case names unit. how about: ((re\.).*?,.*?\b(?<=\s)(?=[a-z]))|(?!\r|\n|\.)((\s\m[a-z][a-z]+?\m\s).*?v\.\s.*?\b[a-z].*?[a-z]\m)(?!\s[a-z])|ex\sparte\s\b[a-z]...

tfs2012 - MSpec Test Adapter with TFS -

has used mspec test adapter tfs? if yes, can please shed light on how go on doing this? i noticed this post uses console runner. after lots of research , trial , error, figured how make work. it's pretty easy. install mspec test adapter on build server. download mspec test adapter , change file type .zip extract files folder on build server. point "version control path custom assemblies" files in step 3 above. *note: can access window visual studio clicking build > manage build controllers > , selecting controller. ensure in build definition, select visual studio test runner. can accessed test definition > process tab > test > automated tests > test source when run build, should see tests run.

sql - String concatenation in Access VBA -

i trying write macro create query based on user input. user needs input date @ start of macro , macro incorporate date sql query. problem unsure how incorporate date sql select statement. thinking of using string concatenation unsure how in sql statement. sub revh() dim dte string, clientqry string, db database, clientqry1 variant set db = currentdb dte = inputbox("what date data dump run?", "please input date") clientqry = "select distinct " & _ "fn_datadump_all_11032014.[client id], " & _ "fn_datadump_all_11032014.[client name] " & _ "from " & _ "fn_datadump_all_11032014 " & _ "where (((fn_datadump_all_11032014.[client name]) not ""*test*"" ));" clientqry1 = db.createquerydef("newids", clientqry) end sub it easier if use table alias: dte = inputbox("what date data dump run?", "please input date (mmddyyyy)") ...

android - not getting the json data in php -

i creating android application , submit user details android application php @ server side json.but @ server side not getting json data.at server side php json comes android application seems null.i using post method this.i know post method code wrong in php @ server side.but have no idea solve this. please me.thanks in advance. here php code getting json. everytime same message required fields missing. <?php /* * following code create new user row * user details read http post request */ // array json response $response = array(); print_r($_post); // check required fields if (isset($_post['firstname']) && isset($_post['lastname']) && isset($_post['username']) && isset($_post['email']) && isset($_post['password']) && isset($_post['country']) && isset($_post['mobile'])) { echo('bhargavi'); $firstname = $_post['firstname']; $lastname = $_post['las...

c# - Assert.AreEqual fails for int and ulong but not long and uint -

well, hope processor not burned, because: [testmethod] public void tenequalten() { int64 = 10; uint32 b = 10; assert.areequal(a, b); } works fine, this: [testmethod] public void tennotequalten() { int32 = 10; uint64 b = 10; assert.areequal(a, b); } fails miserably. have got same results, or me? if yes, ideas, why? if known issue .net 4.5 sorry spam, not find bug. edit: found duplicate here , explanation here in first method calling assert.areequal<t>(t expected, t actual) t of type int64 , because uint32 implicitly castable int64. same effect if did [testmethod] public void tenequalten() { int64 = 10; uint32 b = 10; assert.areequal(a, (int64)b); } that why first version passes. in second version calling assert.areequal(object expected, object actual) fails because different types , therefor not "equal". you make fir...

html - SVG background image is not showing as it should in Safari/Safari Mobile -

i'm renewing webpage of book publisher has books online. have in jpg i'm migrating svg. i'm doing test of book viewer , way found contain svg image container size make background image. works in chrome, i'm having problems safari desktop , mobile also. both of them shows svg image miss essential part of it. i uploaded see i'm talking about: http://www.edicionesbabilonia.com/svg.html i attach code i've been using: <!doctype svg public “-//w3c//dtd svg 1.1//en” “http://www.w3.org/graphics/svg/1.1/dtd/svg11.dtd”> <html> <head> <style type="text/css"> body, html { height: 100%; width: 100%; margin: 0; padding: 0; } .divsvg { border: 1px solid #999; height: 100%; /* collapse container's height */ width: 50%; /* specify width want (a percentage value, basically) */ /* apply padding using following formul...

Symbolic Math in Haskell -

import control.monad (liftm2) infixl 4 :+:, :-: infixl 5 :*:, :/: data expr = const | (expr a) :+: (expr a) | (expr a) :-: (expr a) | (expr a) :*: (expr a) | (expr a) :/: (expr a) deriving (show, eq) evalexpr (const a) = evalexpr (a :+: b) = liftm2 (+) (evalexpr a) (evalexpr b) evalexpr (a :-: b) = liftm2 (-) (evalexpr a) (evalexpr b) evalexpr (a :*: b) = liftm2 (*) (evalexpr a) (evalexpr b) evalexpr (a :/: b) = if (evalexpr b) == 0 nothing else liftm2 (/) (evalexpr a) (evalexpr b) this symbolic representation of math , evaluation function. have problem limited knowledge of monads , maybe type problem arises me wanting return nothing value if there division 0 in evaluation function. many different reasons when try run evalexpr (const 3) or more complicated fails on runtime. there missing? the version think want is: import control.monad (liftm2) infixl 4 :+:, :-: infixl 5 :*:, :/: data expr = c...

reporting services - SSRS not returning any data with Table-valued parameters -

i'm struggling understanding why adding 1 or more nullable parameters before or after table-valued parameters return empty recordset. i followed example here: http://geekswithblogs.net/gruffcode/archive/2012/06/21/using-table-valued-parameters-with-sql-server-reporting-services.aspx then added parameters mimic environment , cannot more records unless replace @accounttype=null @accounttype=4 here code in dataset: exec( ' declare @customeridlist report.integerlisttabletype ' + @customeridinserts + ' exec rpt_customertransactionsummary @startdate=''' + @startdate + ''', @enddate=''' + @enddate + ''', @customerids = @customeridlist') and sql trace (result: empty recordset): exec sp_executesql n'exec( '' declare @customeridlist report.integerlisttabletype '' + @customeridinserts + '' exec rpt_customertransactionsummary @startdate='''''' + @startdate + '...

Jenkins & email-ext questions -

i've been looking using email-ext plugin our jenkins/dotci setup, can't seem find resource on should storing our templates email? i can modify templates listed "/src/main/resources/hudson/plugins/emailext/templates" contain information want have sent. does email template live in root similar .ci.yml file? you can find "extended e-mail notification" under "manage jenkins" -> "configure system" there can find configuration settings plugin - including "default content"

html - Print embedded PDF from browser with Javascript, HTML5, AngularJS -

i'm loading base64 encoded pdf string javascript server. client application using angularjs, html5. my html looks this: <div id="printablepdfcontainer"> <iframe id="printablepdf" width="100%" height="100%"></iframe> </div> my javascript looks this: var pdfname = 'data:application/pdf;base64,' + data[0].printimage; var embeddedpdf = document.getelementbyid('printablepdf'); embeddedpdf.setattribute('src', pdfname); $scope.printdocument(embeddedpdf); my printdocument funtion looks this: $scope.printdocument = function() { var test = document.getelementbyid('printablepdf'); if (typeof document.getelementbyid('printablepdf').print === 'undefined') { settimeout(function(){$scope.printdocument();}, 1000); } else { var x = document.getelementbyid('printablepdf'); x.print(); } }; the printdocument...

python - having trouble transforming a for loop of numbers -

this have, i'm trying adjust create image below n=11 j in range(10): n=n-1 in range(n): print(i,end=" ") print() image: 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 try this. :) n=10 j in range(10): i=0 in range(j): print n, n = n+1 print ""

nsstring - MutableAttributedString concatenation -

i have tried concatenate attributed string different properties,but not reflecting changes,here code //white color nsmutableattributedstring *attributedstring2 = [[nsmutableattributedstring alloc] initwithdata:[[nsstring stringwithformat:@"%@",readingpartcntnt] datausingencoding:nsunicodestringencoding] options:@{ nsdocumenttypedocumentattribute: nshtmltextdocumenttype } documentattributes:nil error:nil]; [attributedstring2 addattribute:nsforegroundcolorattributename value:[uicolor whitecolor] range:nsmakerange(0, attributedstring2.length)]; [attributedstring2 addattribute:nsfontattributename value:font range:nsmakerange(0, attributedstring2.length)]; //blue color nsmutableattributedstring *attributedstring3 = [[nsmutableattributedstring alloc] initwithdata:[[nsstring stringwithformat:@"%@",readingfootcntnt] datausingencoding:nsunicodestringencoding] options:@{ nsdocumenttypedocumentattribute: nshtmltextdocumenttype } documentattributes:nil error:nil]; [att...

Tomcat 8 Maven Plugin for Java 8 -

is tomcat7-maven-plugin working tomcat 8 server , java 8? can't find tomcat8-maven-plugin . yes can, in pom.xml, add tomcat plugin. (you can use both tomcat 7 , 8): pom.xml <!-- tomcat plugin --> <plugin> <groupid>org.apache.tomcat.maven</groupid> <artifactid>tomcat7-maven-plugin</artifactid> <version>2.2</version> <configuration> <url>http:// localhost:8080/manager/text</url> <server>tomcatserver</server> *(from maven > settings.xml)* <username>*yourtomcatusername*</username> <password>*yourtomcatpassword*</password> </configuration> </plugin> tomcat-users.xml <tomcat-users> <role rolename="manager-gui"/> <role rolename="manager-script"/> <user username="admin" password="password" roles="manager-gui,manager-scrip...

java - Difference between Inversion of Control & Dependency Injection -

ioc , di concept confusing me read lots of views , post of different people , reach conclusion. understand these topics are... inversion of control technique in java making loosely coupled , more maintainable applications, , dependency injection 1 of way achieve concept(technique). inversion of control container inject dependency @ run time java classes make loosely coupled application. is true ? correct me if wrong... ioc generic term meaning rather having application call methods in framework, framework calls implementations provided application. di form of ioc, implementations passed object through constructors/setters/service look-ups, object 'depend' on in order behave correctly. reference : inversion of control vs dependency injection

Default value of variable in bash -

what default value of variable $y in bash scripting? i want perform sum of n input numbers why needed this. if echo $y this show empty (null string) default value. however, set default bash variable, syntax is: var=${1:-default} this sets var value of 1st arg script, if not available sets default

html - Twitter Bootstrap 3 - Columns "inside" an image -

i trying display 3 columns on top of image. i have avoid setting image background-image in css , achieve having <img> element on top of there 3 columns. i tried putting image 12-wide column ( col-md-12 ) , inside column creating row of 3 4-wide ( col-md-4 ) columns. in example below can see have 6 columns in 2 rows. first row has 2 empty columns , 1 column "test" inside it, each 4-wide ( col-md-4 ). whenever set <img> position:absolute i want first row go on top of image . sadly, both of rows go up. my html: <div class="container"> <div class="row"> <div class="col-md-12"> <img class="img-responsive featured" src="http://www.backgroundsy.com/file/large/red-coffee-cup.jpg" /> <div class="row"> <div class="col-md-4 col-sm-6 hidden-sm hidden-xs...

jquery - How can I overlay a html page on an one page design? -

i coding 1 page design - 1 page content on homepage - have different links different external content pages, single.html . searching how can overlay single page on index.html, smooth navigation continue work , stand @ last position user was, example portfolio . on internet read can load content jquery’s function load , seems not work me. the code looks following: $("#buttoncontact").click(function(e){ event.preventdefault(); $.ajax({url:"contact.html",success:function(result){ $("body").html(result); }}); }); perhaps snippet of code doesn’t work me. explanation of code is, when user clicking on button id of buttoncontact , contact.html should loaded overlay on homepage. should markup single page - single.html same index, head stuff etc or should remove snippets of code out of page? on www.dangblast.com see working example of means. click on thumbnail , content overlay whole homepage. simple html. might p...

c++ - Boost shared_ptr object having problems with getting values -

ok... i've spent time 1 this. what doing making list of connections, "strangers" unconfirmed, or denied connection waits ack make sure client got message. host has vector of these strangers boost::shared_ptr, , when stranger accepted, , acked, becomes client, thats not problem. when connection received, new stranger made, runtime error when calling endpoint "(*it)->getendpoint()" inside of sending packet, that's example, same other values, "timed_out". down here stranger class, , usage of sending class stranger : public boost::enable_shared_from_this<stranger> //a short lived object sends reply if connection accepted / denied until ack received or timed out. { private: udp::endpoint end_p_; std::string data_; std::string name_; deadline_timer timeout; public: bool accepted = false; //public check if stranger accepted or not. bool timed_out = false; //we assume packet sending accepting connection because have n...

android - SUM query in multiple table with group by sqlite database -

hello friends have 3 tables property_master , rent_master , expense_master , fields below property_master --> p_id, p_name rent_master --> r_id,p_id,r_amount expense_master --> e_id,p_id,e_amount i want total sum of r_amount, , e_amount single query query below select p.p_id "product code", p.p_name "description", sum(case when ri.r_amount null 0 else ri.r_amount end) "quantity" , sum(case when d.e_amount null 0 else d.e_amount end) "dquantity" property_master p left join rent_master ri on ri.p_id = p.p_id left join expense_master d on d.p_id = p.p_id group p.p_id order sum(ri.r_amount) desc, sum(d.e_amount) desc when run above code give right value r_amount e_amount give double value idea how can solve this? when there 2 different rent_master rows same p_id values, 2 joined rows each matching expense_master row. you have compute sums independent subqueries: select p_id...

osx - Inspecting Element in Safari -

i using latest ios system mac, , have finished completing updates. i trying find developer menu on mac, can't see anywhere? have said if click safari - preferences there should option there, don't see it. any hugely appreciated. thanks in advance kimberley open preferences, select "advanced" tab , check "show develop menu in menu bar" checkbox @ bottom.

Selecting up_votes - down_votes as total_votes and ordering them with laravel -

hi there have trouble getting sum of following query , orderby highest sum. counters::orderby('up_votes - down_votes total_votes', 'desc')->take(10)->get() counters::select(db::raw('*, up_votes - down_votes total_votes'))

Bug with negative amounts in PayPal API -

Image
i'm trying use negative amount paypal adaptive payments api . start with, seems work: 'item' => [ { 'itemprice' => '25.00', 'name' => 'cryptex - 16gb usb drive', 'price' => '25', 'itemcount' => 1 }, { 'quantity' => 1, 'name' => 'special discount', 'price' => '-2.50' }, { 'itemprice' => '5.00', 'name' => 'shipping', 'price' => '5.00', 'itemcount' => 1 } ] here example of see after submitting json, , updating items: as can see, price is correct ... yet there no sign of discounted amount? taking account - otherwise price have been £30, not £27.50 (which after £2.50 discount) what gives? bug in paypals system? fwiw, emails broken - don't show ...

c# - Change color in part of text in textblock -

i need change color in code behind part of text string.. my exaple: textblock1.text = string1 + string2 + string3; string have dynamic values, , want string2 display after running program in blue color , must defined in code behind. its possible? thank you! that working textblock1.inlines.clear(); textblock1.inlines.add(new run(string1)); textblock1.inlines.add(new run(string2) { foreground = brushes.blue });

mongodb - ReactiveMongo with Play 2.3 -

i'm working on play 2.3 reactivemongo. want query db should search id , name or mobile number. ever matches among name , mobile number. the query in db level worked follows. db.enduser.find({$and:[{businessuserid:"1"},{ $or: [{name:"ruthvick"},{mobilenumber:"989"}]}]}) but same write per play syntax not fetching result. query in scala didn't work follows. val cursor: cursor[jsobject] = collectionenduser.find( json.obj("$and"->json.arr(json.obj("businessuserid"->"", "$or"->json.arr(json.obj("name"->"ruthvick", "mobilenumber"->"9686563240"))))) ).cursor[jsobject] kindly review query , me necessary changes. thanks

sql - Search Multiple Columns if parameters aren't null? -

i want search/filter on tables multiple parameters. want if send parameters 0 or null value, won't filter on column. alter procedure [dbo].[search_load] ,@name nvarchar(200) ,@user_id int select [type] ,[record_id] ,[first_name]+space(1)+[last_name] full_name [dbo].[process] [name] = @name , [user_id] = @user_id this proc. if send @name , @user_id , filter both; if send @user_id , must filter [user_id] , or same other. if send @name = '' , @user_id = 0 should return unfiltered data. how can easily? well, can use or clauses i use @name only, in sample mix @name , @table_name where (coalesce(@name, '') = '' or [name] = @name) , (coalesce(@user_id, 0) = 0 or [user_id] = @user_id)

c# - splitting string property and linking with other property -

i have list of objects 2 properties. 1 of properties string, , other string containing comma seperated list. want have split list of parts it's associated other property. i have... objecta { string propertyx string propertyy e.g. "part1,part2,part3" } list<objecta> objectas and objectas want collection containing... {propertyx1, propertyy[0]1 eg. "part1"}, {propertyx1, propertyy[1]1}, {propertyx2, propertyy[0]2} etc.. you use class objecta store both properties , selectmany flatten them: list<objecta> flattenedlist = objectas .selectmany(obj => obj.propertyy.split(',') .select(propy => new objecta { propertyx = obj.propertyx , propertyy = propy })).tolist(); but store without comma in first place ;-)

Which one to use Iteration or Recursion and Why? -

sorry not exact answer other related questions here.in general, if not know beforehand how many iterations or repetitions may need problem . better solution in of cases , why? i think decision depends on problem itself. if had no idea number of iterations of algorithm, use recursive algorithms when feel nature of problem helps me that. for example, if wanted calculate possible non empty subsets given set, use recursive algorithm, , if wanted calculate sum of list of elements, use iterative algorithm. in both cases use other method solve problem, feel more comfortable coding way.

if statement - Is it possible to use synchronous process in functions? -

i=0; if rising_edge (clk) y(i)<=x(i) ; i=:i+1; end if; is block above, possible in function block? if not, there function-like sub-program style achieve this? or there synthetizable 'for loop' usage instead of 'if statement'? you can use procedures: procedure setbits(signal clk : in std_logic; signal y : out std_logic_vector(7 downto 0)) begin in 7 downto 0 loop wait until (rising_edge(clk)); y(i) <= '1'; end loop; end procedure; and this sequential : process begin setbits; wait; end process sequential;

javascript - how to check audio tag load file complete -

i play audio file using audio tag in html 5 duration of file 20 second. when open page, duration of audio tag 14 second. refresh page. can see duration change 14 sec or 20 sec. don't know why. , when file not loaded completely, can't control player. click play bar, not control in other case, file load completely, can control currenttime , play(). file not loaded completely, can use play file 1 time, not control it how sure file load always? you may check using 'onloadeddata', add listener <audio onloadeddata="dothisonload()"> </audio>

php - Zend Framework 2 - pagination -

i have problem pagination. have method getwithpaginationby in model: public function getwithpaginationby($object, $where, $order = null) { $select = $this->tablegateway->getsql()->select(); $select->where($where); if (!empty($order)) { $select->order($order); } $resultsetprototype = new resultset(); $resultsetprototype->setarrayobjectprototype($object); $paginatoradapter = new dbselect($select, $this->tablegateway->getadapter(), $resultsetprototype); $paginator = new paginator($paginatoradapter); return $paginator; } and use in controller $allnews = $this->getposttable()->getwithpaginationby(new post(), array('status_id' => $activestatusid, 'category' => 'news')); next take params routing, set current page number , set item count per page. in tutorial zend documentation. i change name news. foreach($allnews $news) { $news->setname('t...

java - Saving checkbox state for dynamically created checkboxes in Android -

this question has answer here: easy way save values through many appstarts? 1 answer i have created listview consists of application installed on device. when installed applications displayed user, each application have corresponding checkbox. user clicks on multiple checkboxes , corresponding application names saved. what want is, when user again starts application, checkboxes of applications saved user should checked. how can ? can me? in advance. here code applist.java public class applist extends activity { appinfoadapter adapter ; appinfo app_info[] ; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_app_list); final listview listapplication = (listview)findviewbyid(r.id.listapplication); final button b= (button) findviewbyid(r.id.button001); final c...

Drive Realtime API throwing errors every 60s -

Image
every 55 seconds or so, drive realtime api javascript throws typeerror . seems keep working, it's driving automatic error logging totally insane, , of course worries me getting unexplainable errors time of users. you can see error in action @ https://peardeck.com/editor/?state=%7b%22action%22%3a%22create%22%7d if you're willing install our app. wait 60 seconds , you'll see error appear drive.google.com/otservice/api . we've narrowed way down in our testing scaffold - stripped out code after initial opening of realtime document, , still happens every minute or so. errors happen @ same time script seems trying switch between long-polling requests: i'm not sure how long has been going on. realtime team have thoughts? has else noticed behavior? we've been told fix coming soon. not causing problems

opengl es - Loading PNG images but using them as COMPRESSED_RGBA_S3TC_DXT5_EXT in WebGL? -

i'm trying load images in webgl, , uploading them gpu. i'd use compressed texture format, though original images uncompressed/lossless. to upload, i'm doing: gl.teximage2d(gl.texture_2d, 0, gl.rgba, gl.rgba, gl.unsigned_byte, texturesource); in above code, texturesource loaded (say, "texture.png"). it works well, i'd load webgl_compressed_texture_s3tc formats ( compressed_rgb_s3tc_dxt1_ext ) store image in compressed fashion. i make sure extension available , enabled... var ext = gl.getextension("webgl_compressed_texture_s3tc"); var fmt = ext.compressed_rgba_s3tc_dxt5_ext; console.log(fmt); // 33779 but can't use format. using teximage2d() doesn't work: gl.teximage2d(gl.texture_2d, 0, fmt, fmt, gl.unsigned_byte, texturesource); // webgl: invalid_enum: teximage2d: invalid texture format // [.webglrenderingcontext]render warning: texture bound texture unit 0 not renderable. maybe non-power-of-2 , have incompatible textur...

windows - How to automate a file conversion xwm to mp3 with xwmaencode.exe using bat file -

the code required run is: xwmaencode.exe .xwm . wanna make .bat file can allow me drag , drop file or convert of .xwm files within current folder .mp3 preferrably an explanation of each part well, have no clue how .bat files operate, , have limited knowledge on cmd syntax, can manage if don't mind file.xwm.wav (and there utilities out there that'll remove .xwm*), did taken pngout.exe's examples: for %i in (*.xwm) xwmaencode %i %i.wav in case, don't have files spaces, if did, you'd do for %i in (*.xwm) xwmaencode "%i" "%i".wav *powershell might, have no idea

nginx - Safari redirection adding comma causing 404 -

i have website running in nginx , cloudflare. has several url checks , redirection. example, when use hits example.com , redirected example.com/en/ , these done in nginx. in chrome , firefox work fine, in safari, when hit example.com, becomes: http://example.com/en/,%20http://example.com/en/ this causing 404. suggestions?. this wouldn't coming cloudflare's side unless you've manually created pagerule redirect content on site. if haven't manually created pagerule @ cloudflare though can rule out location/cause of issue. if have created pagerule @ cloudflare redirect content i'd suggest opening support ticket directly cloudflare our support team can review specific account settings. p.s. work @ cloudflare.

mysql - Query to get children records of a parent -

i have following table. +-------+--------+-------+ | id| name| parent| +-------+--------+-------+ | 0| a| -1| | 1| b| 0| | 2| c| 1| | 3| d| 2| | 4| e| 2| | 5| f| 2| | 6| g| 2| | 7| h| 2| | 8| i| 2| +-------+--------+-------+ -1 parent means has no parent. hierarchy can go upto 7-8 levels. need children (direct + indirect). tried like: select id, name, @pv:=id 'parent' tbl join (select @pv:=-1)tmp parent=@pv but not work. try query select t1.name lev1, t2.name lev2 tbl1 t1 left join tbl1 t2 on t2.parent = t1.id t1.id = 2; expected output +-------+--------+ | lev1| lev2| +-------+--------+ | c| d| | c| e| | c| f| | c| g| | c| h| | c| i| +-------+--------+ referance

Query on pointer in parse.com Objects in Javascript -

i have class of company has user pointers. query want on company class this: retrieve company rows user object has name equal 'abc' so, how should form query ? var company = parse.object.extend("company"); var query = parse.query(company); query.include("user"); query.equalto("name") ???? is possible write such request in single query ? thanks. you'll need query user first based on name of "abc". in success callback of query, query on company table using objectid returned user query. this: var userquery = parse.query('_user'); var companyquery = parse.query('company'); userquery.equalto('name', 'abc'); userquery.find({ success: function(user) { var userpointer = { __type: 'pointer', classname: '_user', objectid: user.id } companyquery.equalto('user', userpointer); companyquery.find({ success: functio...

oracle11g - How to Implement Spring Integration int-jdbc:stored-proc-outbound-gateway with advanced Oracle type IN parameter -

i trying implement int-jdbc:stored-proc-outbound-gateway executes oracle store procedure advanced oracle type in parameter. i not clear how declare advanced type in parameter. the code , configuration bellow. create or replace procedure poc2 ( d_list in move_audit, db_response out varchar2) begin ..... end poc2; create or replace type move_audit object ( move_id varchar2(50), message varchar2(50) ); create or replace type move_audit_tab table of move_audit; stored-proc-outbound-gateway configuration: <int-jdbc:stored-proc-outbound-gateway id="inparamstorprocgateway" data-source="datasource" request-channel="requestchannel" is-function="false" reply-channel="replychannel" stored-procedure-name="poc2" expect-single-result="false" ignore-column-meta-data="true"> <int-jdbc:sql-parameter-definition name="d_list" direction=...

Multiprocessing in Python: web scraping doesn't speed up -

i use multiprocessing module speed web scraping. goal extract part of html in page , save in parent variable. finally, write variable file. but problem have takes around 1 second process page. my code works, not want: import urllib.request bs4 import beautifulsoup multiprocessing.dummy import pool # thread-based pool multiprocessing import cpu_count def parseweb(url): page = urllib.request.urlopen(url) soup = beautifulsoup(page) h2_tag = soup.find('h2', class_='midashigo') return h2_tag if __name__ == '__main__': file = 'links.txt' # each link on separate line. pool = pool(cpu_count() * 2) open(file, 'r') f: results = pool.map(parseweb, f) open('output.txt', 'w', encoding='utf-8') w: w.write(str(results)) how can modified give full power of multiprocessing? thank you. this process should i/o bound, meaning bottle neck should how can pull down connect...

For single database can i use multiple hibernate configuration file? -

1.for single database can use multiple hibernate configuration file? 2.databasesession factory applicable whole application.is possible create multiple databasesession factory single database. could clarify doubt? in advance. 1) single project or db, multiple hibernate config files can used. this , this makes clear. 2) multiple session factories can created single data source or single db. first define db details in applicationcontext-database.xml as: <bean id="dbname_datasource" class="required_datasource_type" destroy-method="required_type"> <property name="driverclassname" value="required_driver_name" /> <property name="url" value="" /> <property name="username" value="" /> <property name="password" value="" /> <property name="initialsize" value="" /> ...

android - Changing Image on Image View on click -

Image
change image on image view when click on next , prev button , image coming url. i have try change image below method not changing image. imageloader.displayimage(img[0], imgproperty); imgproperty imageview , img[0] having url , displayimage method of lazy loading imagloader class. please me how can change image view image on click. first, make sure img[0] refer image's url. and use imageloader.displayimage method instead of imageloader.displayimage (capital d)

oracle - Is this a PL/SQL bug? -

here's excerpt pl/sql code believe demonstrates pl/sql bug: if guid_ null dbms_output.put_line('guid_ null: ' || guid_); end if; when these lines executed, prints guid_ null: 07d242fcc55000fce0530a30d4928a21 i on oracle 11r2 select * v$version; oracle database 11g enterprise edition release 11.2.0.4.0 - 64bit production pl/sql release 11.2.0.4.0 - production core 11.2.0.4.0 production tns ibm/aix risc system/6000: version 11.2.0.4.0 - production nlsrtl version 11.2.0.4.0 - production i can reproduce following types , anonymous block. sorry length, believe cannot shorten more: create type tq84_t table of varchar2(32); / create type tq84_o object ( dummy number(1), not final member procedure clear ) not final; / show errors create type tq84_d under tq84_o ( g varchar2(32), constructor function tq84_d return self result, overriding member procedure clear ); / show errors create package tq84_h t tq84_t; end tq84_h; / show...

javascript - Checkbox variable outside of function -

i new coding (trying learn) , cant figure out how var of check box value outside of function. javascript: $(document).ready(function() { var quantity= parseint($('#phones').val()); $("#check1 input:checkbox").change(function() { var feature = 0; $("#check1 input:checkbox").each(function() { if ($(this).is(':checked')) { feature += parseint($(this).prop('value')); } }); }); var grand = feature * (quantity * number ('0.1')) var total = quantity + grand }); html: <input id="phones" type="numerical" value="0" style="text-align: right"/> <div id="check1"> <input type="checkbox" value="1" /> function getresult(feature, phones) { if (feature <= 0 || phones <= 0) { return 'error...., enter number of phones , check checkbox'; } return (feature...

gradle - upload an eclipse android library project to maven central -

background have been building android library project in eclipse..it not built gradle , follows old android folder structure now in order upload maven cental first made account @ sonatype , created issue @ jira new project . created repo groupid com.github.amansatija , (for had wait 2 business days until issue resolved ) now created gpg key pair ring after exported eclipse android library project gradle imported in androistudio make sure has become gradle friendly .. after android library project's build system changed gradle followed chris banes maven-push gradle plugin on github deploy library project on maven below details of gradle system my global gradle.properties file (the 1 @ user_homer.gradle\gradle.properties) contains nexus_username=amansatija nexus_password=mushroom@7 signing.keyid=16df7223 signing.password=customer360 signing.secretkeyringfile=mitul_private_key.gpg my project's gradle.properties conatins version_name=0.0.1-snapshot version_...