Posts

Showing posts from July, 2014

Inner Join based on column value in SQL Server 2008 -

i join 2 tables based on column value if pm.servicelevelid value 1 or null inner join on u.facilityid if pm.servicelevelid value 2 inner join on u.facilityserviceid these 2 tables pm, u have these columns: providermessages messageid, facilityserviceid, servicelevelid, facilityid, providertypeid user_fa facilityserviceid, userfacilityid, facilityid currently, have inner join select distinct messageid, userfacilityid, 9 #providermessages inner join #user_fa on (#user_fa.facilityid = #providermessages.facilityid or #providermessages.facilityid null) , (#user_fa.facilityserviceid = #providermessages.facilityserviceid) select distinct messageid, userfacilityid, 9 #providermessages join #user_fa on #providermessages.servicelevelid in (null,1,2) , ( ( #providermessages.servicelevelid in (null,1) , #user_fa.facilityid = #providermessages.facilityid)

ORA-011033: ORACLE initialization or shutdown in progress can't connect to HR -

i trying open oracle , connect hr schema got error. don't know how fix it: ora-011033: oracle initialization or shutdown in progress cause: attempt made log in while oracle being started or shutdown your oracle instance is, error message says, in middle of shutting down or starting up. wait shut down properly, start again, , connect.

Android/iOS Analytics Enhanced ecommerce not showing anything -

i've followed steps google documentation . i've configured analytics account show enhanced reports. i've tried posibilites docs examples i'm getting no hits. i've tried in ios same results. reason?: product product = new product() .setid("p12345") .setname("android warhol t-shirt") .setcategory("apparel/t-shirts") .setbrand("google") .setvariant("black") .setprice(29.20) .setquantity(1); // add step number , additional info checkout action. productaction productaction = new productaction(productaction.action_checkout) .setcheckoutstep(1) .setcheckoutoptions("visa"); hitbuilders.eventbuilder builder = new hitbuilders.eventbuilder() .addproduct(product) .setproductaction(productaction) .setcategory("ecommerce") .setaction("checkout start"); tracker.setscreenname("checkoutstep1"); t.send(builder.build()); (i've test

INT vs DECIMAL for "Price" column in mysql? -

i saw answers similar questions here , here . seems suggested use decimal type price. however, since price won't go below 1 cent, can use int type price changing unit "dollar" "cent"? e.g $7.99 same 799 cents. is there advantage choose int on decimal(9,2), regarding storage space, read/write speed, performance when using functions (min, max, sum etc) or other aspects? i'd recommend representing currency values in smallest applicable unit plain old integer. things dollars means using cents, though on occasions may need use smaller unit. instance of paying out 5% commissions on transactions few cents each rounding otherwise turn them zero. in case using "millicents" might work better. while fixed-place decimal(9,2) column preserve values faithfully, application platform you're using may not treat them nicely , result in bizarre floating-point behaviour kicking in if you're not careful. it can little annoying have conver

c# - NCalc using symbols in custom function name -

let's in expression input make functions stand out special prefix $ : var expr = "your name $proper([firstname]) $upper([lastname])"; where write custom functions $proper , $upper . however, console errors "no viable alternative @ character '$'". works if rid of symbol, or use underscore. is there way use symbol characters in function names in ncalc ? doesn't work when function begins number (as in, if wanted shorthand function name double 2x ). (sort of similar ncalc evaluation error no viable alternative @ input ',' )

Define Excel's column width with R -

the final product excel csv spreadsheet has more 250 columns. wondering if there way determine column width in excel r? i using write.csv2, produces column width in excel equal 8,43. write.csv2(df, na = "", file= "final.csv") if possible looking trick vary of them @ once or specific ones. running vba r option? thank help! please check package xlsx . using generating excel files , pretty good. there method setcolumnwidth can you. check here more detailed example xlsx package functionality. so here working example using package xlsx . df <- data.frame(matrix(rnorm(100),nc=10)) library(xlsx) # must save xls or xlsx file... write.xlsx(df,"final.xlsx", row.names=false) # load wb <- loadworkbook("final.xlsx") sheets <- getsheets(wb) # set widths 20 setcolumnwidth(sheets[[1]], colindex=1:ncol(df), colwidth=20) saveworkbook(wb,"final.xlsx") # autosize column widths autosizecolumn(sheets[[1]], colin

concurrency - Processing web pages concurrently with Ruby -

i trying process content of different pages given array of urls, using ruby thread . however, when trying open url error: #<socketerror: getaddrinfo: name or service not known> this how trying it: sites.each |site| threads << thread.new(site) |url| puts url #web = open(url) { |i| i.read } # same issue opening web way web = net::http.new(url, 443).get('/', nil) lock.synchronize new_md5[sites_hash[url]] = digest::md5.hexdigest(web) end end end sites array of urls. the same program sequential works alright: sites.each { |site| web = open(site) { |i| i.read } new_md5 << digest::md5.hexdigest(web) } what's problem? ugh. you're going open thread every site have process? if have 10,000 sites? instead, set limit on number of threads, , turn sites queue , , have each thread remove site, process , site. if there no more sites in queue, thread can exit. the example

Ubuntu 14 Apache server, page loading icon doesn't disappear -

i'm new lamp stack. set correctly, works fine, can view sample php file, 1 thing irritates me page loading icon. still active page still loading, whole content of page has been loaded. not know how fix problem. tried ask google found nothing, tried restart apache server problem not solved. followed tutorial: https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu bug or else?

c++ - Is there any way round to make this template specialisation link? -

i have tried following hierarchy , doesn't link. call c->execute() not seen since seems masked execute in derived , doesn't find adequate type use. have thought if there problem, have show @ compilation. have tried gcc 4.8 online , borland compiler on windows. error message similar in both cases. in order of: /tmp/ccrt5mny.o:(.rodata._ztv7derivedi5typece[_ztv7derivedi5typece]+0x10): undefined reference `derived<typec>::execute()' collect2: error: ld returned 1 exit status i grateful pointers. #include <iostream> class basetype { public: basetype() {} virtual void execute() { std::cout << "basetype execute..." << std::endl; }; protected: }; struct typea; struct typeb; struct typec; class derived2 : public basetype { public: derived2() : basetype() {} virtual void execute() { std::cout << "derived execute2" << std::endl; } protected: }; template <typename t> class derived :

python - PySchools topic 3 Q8 -

the question is for quadratic equation in form of ax 2 + bx + c, discriminant, d b 2 -4ac. write function return following output depending on discriminant. d > 0: 2 real roots. d = 0: 1 real root. d < 0: 2 complex roots. examples >>> quadratic(1, 2, 3) 'this equation has 2 complex roots.' >>> quadratic(1, 3, 2) 'this equation has 2 real roots.' >>> quadratic(1, 4, 4) 'this equation has 1 real root.' python gave "private test cases failed" error. error? def quadrtic(a,b,c): d=b**2-4*a*c if d<0: return "this equation has 2 complex roots." elif d==1: return "this equation has 2 real roots." elif d==0 or d==1: return "this equation has 1 real root." your if blocks should be def quadrtic(a,b,c): d = b**2 - 4*a*c if d < 0: return "this equation has 2 complex roots." elif d > 0:

ios - Can We Keep the Same Version Number in iTunes Connect on Release? -

this question has answer here: which ios app version/build number(s) must incremented upon app store release? 7 answers i have ios app version number 2.0.0 , build number 2.0.0. found there bug in version 2.0.0 , want patch , quick update. not want increment version number if possible because small fix. i have been working on android while. android allows keeping versionname (a.k.a. version number on ios) , incrementing versioncode (similar build number on ios) is possible release ios build same version number? incrementing build number in info.plist me achieve wanted? if small fix, version number can 2.0.1 there not way release same version number , many reasons. lets have 2.0.0 in store , has small bug, release 2.0.0 again patch it. week later, getting reports of app crashing in version 2.0.0. code base at? if small bug , not important fix, mayb

powershell - Need windows script to run simple for loop across all the parameters listed in a text file -

i need run windows "net view" command against each of these values in test.txt file. test.txt contains list of servers below: \\lb042073 \\lb042425 \\lb042507 \\lb045196 i need run "net view" command against each of these servers. below command not work: get-content test.txt | %{& net view} thanks in advance. in powershell: get-content test.txt | %{net view $_} get-content - read file outputting each line individually | - pipeline character. works same in windows , *nix. passes output of 1 command input of next command % - alias foreach-object . loop construct code each object in list { - beginning of code block net view $_ - runs net.exe program passing 2 parameters view , contents of special $_ variable. $_ variable in foreach-object loop holds input item current iteration of loop. } - end of code block

jquery - jqgrid paging buttons not enabled -

Image
i don't see wrong code paging buttons not displayed function loadagencies(action, user, fa) { $grid = $("#grdagencies"); $grid.jqgrid({ url: "dhfollowup.ashx?1=1", postdata: { action: action, user: user, fano: fa }, height: 320, width: 760, datatype: "json", mtype: "get", colnames: ['mark reports', 'oa #', 'oper. agency', 'ob #', 'building name','survey count', 'cadr', 'select', 'entid'], colmodel: [ { name: 'ab', index: 'ab', width: 45, formatter: 'checkbox', formatoptions: { disabled: false }, align: 'center', sortable: false, search: false, hidden: true}, //, align: 'center' { name: 'oano', index: 'oano', width: 30, sortable: false, search: false, align: 'center', editable: false }, { name: 'oa

matlab - Given two strings, how do I find number of reoccurences of one in another? -

for example, s1='abc' , s2='kokoabckokabckoab' . output should 3 . (number of times s1 appears in s2). not allowed use for or strfind . can use reshape , repmat , size . i thought of reshaping s2, contain of possible strings of 3s: s2 = kok oko koa oab .... etc but i'm having troubles here.. assuming have matrix reshaped format have in post, can replicate s1 , stack string such has many rows there in reshaped s2 matrix, equality operator. rows consist of 1s means have found match , search rows total sum equal total length of s1 . referring back post on dividing string overlapping substrings , can decompose string have posted in question so: %// define s1 , s2 here s1 = 'abc'; len = length(s1); s2 = 'kokoabckokabckoab'; %// hankel starts here c = (1 : len).'; r = (len : length(s2)).'; nr = length(r); nc = length(c); x = [ c; r((2:nr)') ]; %-- build vector of user da

c++ - template functions for points with x,y,z and points with x(), y(), z() -

i work lot point clouds, , use lot pcl , eigen libraries. points in pcl have .x .y , .z public members. points in eigen have .x() .y() , .z() i find myself writing function 1 point type , calling creating temp point convert 1 type other: e.g. void f(const eigen::vector3d &p) { ... } pcl::pointxyz p; f(eigen::vector3d(p.x, p.y, p.z); to further complicate problem, pcl points come in various types: xyz, xyzrgb, xyzn, etc. (see http://pointclouds.org/documentation/tutorials/adding_custom_ptype.php ) , eigen vectors come in several types well: vector3d doubles , vecto3f floats, both specialization of matrix type (see http://eigen.tuxfamily.org/dox/group__matrixtypedefs.html ) i wondering if there template specialization magic incantation invoked avoid that, i.e. detect whether point type has .x() or .x , use appropriately. if don't want fuss around sfinae, can use nice built in maps in pcl , use eigen cast function instead of constructing eigen::vector3d t

python - Move base coordinates Tkinter -

i want move coordinates on tkinter canvas bottom left corner (0, 0) , meaning top right corner (height, width) . how this? simplest way write function inverts vertical coordinate, given canvas height , desired element height passed in.

php - Multiple input file upload -

i'm trying create part of form uploads 5 images. @ moment i'm trying fix validation of images. 5 images can uploaded, form contains 5 input fields these (i know can upload multiple files in 1 input design designed this, not choice). so firstly check see if image checkbox has been checked (this runs fine) , try , check see if there image uploaded, , each 1 image try , run basic validation (file size & type). $imagesarray = array("order-desc-img", "order-desc-img-1","order-desc-img-2", "order-desc-img-3", "order-desc-img-4"); //names of file inputs if (isset($_post['images'])){ //check checkbox $imagesquantity = 1; //update variable show has been checked foreach ($imagesarray $image) { //loop through each item in array $image_target_dir = "../uploads/images/"; $image_name = basename($_files[$image]["name"]);

php - Wamp Server 2.5 (PHP5.5) Cant activate sqlsrv module -

Image
i updated wamp server , got problem now. my sqlsrv extension wont loaded correctly. dont know problem because dont errors on startup. error log clean. there little red triangle instead of check in php extension list: some information: windows server 2012 x64 wamp 2.5 32bit php5.5 the warning icon means 1 of 2 things :- either extension= line in php.ini dll points not in \ext folder or dll exists in ext folder not in php.ini which 1 in case. if updated wampserver sqlserver dll not come php install default, have download microsoft site.

python - Django Debug Toolbar text garbled -

Image
i upgraded python packages latest versions. 1 of ones upgraded django debug toolbar django website development. every page has garbled text on it: what can fix this? know it's django debug toolbar causing because when remove settings.py file renders correctly.

angularjs - withCredentials oboe request -

i working neo4j graph database offers rest url's free. , trying hook angular module provides oboe client side streaming: https://github.com/ronb/angular-oboe i trying better understand how add username:password credentials in request header in effort transcribe curl command > curl --user username:password http://localhost:7474/auth/list https://github.com/neo4j-contrib/authentication-extension in usage section of angular-oboe readme, outlines parameters request $scope.mydata = oboe({ url: '/api/mydata', pattern: '{index}', pagesize: 100 }); i have hunch add line withcredentials listed on oboe repo https://github.com/jimhigson/oboe.js-website/blob/master/content/api.md oboe({ url: string, method: string, // optional headers: object, // optional body: string|object, // optional cached: boolean, // optional withcredentials: boolean // optional, browser }) but i'm n

replace text in multiple footer and/or primary footer word vba -

i wanted replace text in footer of word doc. docs might have primary header , footer, have multiple headers , footers. here's code: sub changedate() selection.homekey unit:=wdstory activewindow.activepane.view.seekview = wdseekcurrentpagefooter check1: selection.find .text = "dec 01, 2015" .replacement.text = "dec 01, 2015" .forward = true .wrap = wdfindask .format = false .matchcase = false .matchwholeword = false .matchwildcards = false .matchsoundslike = false .matchallwordforms = false end selection.find.execute replace:=wdreplaceall activewindow.activepane.view.nextheaderfooter on error goto cont goto check1 cont: activewindow.activepane.view.seekview = wdseekmaindocument end sub on multiple footer documents works fine, if 1 footer available shows error. you need move on error line in code. otherwise,

javascript - Round a timestamp to the nearest date -

i need group bunch of items in web app date created. each item has exact timestamp, e.g. 1417628530199 . i'm using moment.js , " time now " feature convert these raw timestamps nice readable dates, e.g. 2 days ago . want use readable date header group of items created on same date. the problem raw timestamps specific - 2 items created on same date minute apart each have unique timestamp. header 2 days ago first item underneath, header 2 days ago second item underneath, etc. what's best way round raw timestamps nearest date, items created on same date have exact same timestamp , can grouped together? try this: date.prototype.formatdate = function() { var yyyy = this.getfullyear().tostring(); var mm = (this.getmonth()+1).tostring(); var dd = this.getdate().tostring(); return yyyy + (mm[1]?mm:"0"+mm[0]) + (dd[1]?dd:"0"+dd[0]); }; var utcseconds = 1417903843000, d = new date(0); d.setutcseconds(math.round( u

c# - I want an object(bird) rotate right when falling -

there code: watched tutorial on youtube ( https://www.youtube.com/watch?v=dwtob3j1ytg ). tried follow steps, misspelled because rotating right while falling thing not working me :( please help! if need more information ask me! using unityengine; using system.collections; public class birdmovement : monobehaviour { vector3 velocity = vector3.zero; public vector3 gravity; public vector3 flapvelocity; public float maxspeed = 5f; public float forwardspeed = 1f; bool didflap = false; // graphic & input updates here void update() { if (input.getkeydown(keycode.space) || input.getmousebuttondown(0)) { didflap = true; } } // physics engine updates here void fixedupdate () { velocity.x = forwardspeed; velocity += gravity * time.deltatime; if (didflap == true) { didflap = false; if(velocity.y < 0) velocity.y = 0;

arrays - Recursive Method For Checking All Possible Values (C) -

i'm writing program reads in integer value (n), , creates chess table dimensions (nxn). have see if there way place n queens on board in such way none of them attack each other (for of unfamiliar chess, queens can attack piece in same column or row them, piece sits on diagonal passes through queen). values stored in array (int board[n]), set -1. value in board[0] correspond row queen in column 0 located at. initially, values set @ -1, means there no piece in said row. i'm trying find way in pass every possible set of coordinates (essentially every possible array of length n, , values can range between 0 , n-1) through method checks see if valid way lay out pieces, , if there layout works, must pass array method visualizes it, so: * * q * q * * * * * * q * q * * the methods checking , outputting set , working, need figure out how generate possible permutations of array stores coordinates. edit: here code far (updated of 2pm, december 6th): #include <stdio.h>

database - Padding size of Crow's Foot Attribute in Visio 2013? -

just simple question me, have been searched hours didn't find any. i'm making database design using crow's foot database notation in ms visio 2013, here's design looks padding of each attributes surroundings big. how reduce them? can't find tool it, have tried increase font size paddings seems being bigger too. thanks before best solution the best solution have found edit crow's foot stencil. can done using following steps (all diagrams referencing stencil must closed): in windows explorer navigate directory: %programfiles%\microsoft office\office15\visio content\1033\ right click , edit dbcrow_m.vssx (for metric) or dbcrow_u.vssx (for us). might want them first. in visio turn on developer mode if haven't already. file->options->advanced under general select run in developer mode . right click on shape want change, example attribute or primary key attribute. select edit master -> edit master shape . the shape open.

Google Line charts Customizing vAxes with string and define position -

i try implement line chart string on xaxie , vaxie. vaxie want start 10eme , finish 1er value. possible switch these values? today : 10eme 9eme 8eme 7eme 6eme 4eme 3eme 2eme 1er 1 journee / 2 journee / 3 journee / ... target : 1er 2eme 3eme 4eme 5eme 6eme 7eme 8eme 9eme 10eme 1 journee / 2 journee / 3 journee / ... <!doctype html> <html> <head> <script type="text/javascript" src="https://www.google.com/jsapi"></script> <script type="text/javascript"> google.load("visualization", "1", {packages:["corechart"]}); google.setonloadcallback(drawchart); function drawchart() { var data = google.visualization.arraytodatatable([ ['journee', 'position'], ['1 journee', 10], ['2 journee', 7], ['3 journee', 7], ['4

javascript - Send a string through an http request -

i starting learn how use xmlhttprequest , started this example w3schools want modify in order send string. new code: <!doctype html> <html> <head> <script> function loadxmldoc() { var xmlhttp; var str="sent string"; xmlhttp=new xmlhttprequest(); xmlhttp.open("get","ajax_info.txt",true); xmlhttp.send(str); alert(xmlhttp.responsetext); } </script> </head> <body> <div id="mydiv"><h2>let ajax change text</h2></div> <button type="button" onclick="loadxmldoc()">change content</button> </body> </html> i want output response , see if string sent alert returns nothing. empty window. doing wrong? also, found example in question adds these lines of code: http.setrequestheader("content-type", "application/x-www-form-urlencoded"); http.setrequestheader("content-length", params.length)

Excel Drop Down in Shared Mode -

when change excel workbook shared mode , try copy , paste rows have drop down lists (data validation list), drop down disappears. it works fine long workbook not shared. solutions? shared workbooks have severe limitations. functionality disabled in shared workbooks. other stuff starts fall apart. consensus amongst excel experts shared workbooks should avoided, because it's not quesiton of if when become corrupt. shared workbooks impossible troubleshoot. yes, excel offers feature, never designed simultaneous multi-user write access data set. if need functionality, you'd better off database access or sql. don't shoot messenger.

c - How to compare number against an interval? ( x > (1,10)) -

how compare 1 number against interval. is there way shorten expression: if ((x%10) == 1 || (x%10) == 2 || (x%10) == 3 || (x%10) == 4 ) // ... till number 9. assuming x integer, there 10 possible values. , 1 not checked, 0, false integer. if (x % 10) { ...

java - SQLite apostrophe causes force close - .replace("'", "''") does not resolve the issue -

i have sqlite query i'm attempting run force closing due apostrophe in title string. i've attempted resolve using title.replace("'", "''") , title.replace("'", "\\") title.replaceall("'", "\"); still force closing due apostrophe - , when debug - apostrophe still exists in title - can point on may have done wrong here? source snippet: string title = info.get(meetinginfo.meeting_title); string selectionclause = events.dtstart + " = '" + starttime + "' , " + events.dtend + " = '" + endtime + "' , " + events.title + " = '" + title.replace("'", "\\") + "'"; you should use parametrized commands: cursor res = db.rawquery("select * events dtstart = ? , dtend = ? , title = ?;", new string[]{ starttime, endt

java - Jetty Websocket connection - ignore self signed certs -

is there way (other opening browser , accepting self signed certificate) tell jetty websockets ignore self signed certificate errors when opening websocket connections? have verified code works in environment valid certificate exists, definately related using self signed certs in other environments. public static void main(string[] args) { string desturi = "wss://example.ws.uri.com"; if (args.length > 0) { desturi = args[0]; } sslcontextfactory sslcontextfactory = new sslcontextfactory(); websocketclient client = new websocketclient(sslcontextfactory); simpleechosocket socket = new simpleechosocket(); try { client.start(); uri echouri = new uri(desturi); clientupgraderequest request = new clientupgraderequest(); client.connect(socket, echouri, request); system.out.printf("connecting : %s%n", echouri); socket.awaitclose(5, timeunit.seconds); } catch (throwable t) {

java - FileWritingMessageHandler (int-file:outbound-channel-adapter) is slow for single-file storing multiple-messages use case -

Image
i'm using spring 4.1.2 spring integration 4.1.0. i have use case i'd produce single file contain row each message flowed channel. messages received of type string . file nice-to-have file, meaning it's not necessary have writing file within same transaction of master flow. async wire-tap pattern implemented use-case. messages written file need in same order received in (so either 1 thread need process them or need aggregator wait multiple threads complete write them in original order). i wanted feel performant way handle use-case tried few tests. make bit easier tests not using async wire-tap (but mentioned in use-case because perhaps suggestions might involve batching/buffering solutions). the general flow came "define integration flow" section of link: https://spring.io/guides/gs/integration/ the main options tried were: use int-file:outbound-channel-adapter (which creates filewritingmessagehandler ) along transformer appends newline each

knockout.js - How to bind Bootstrap datepicker with Knockout within Durandal framework -

i wanted avoid lumping onto existing question . so i'm trying use jsfiddle within durandal framework have main.js configured require bindings (please notice observable: true): define(['durandal/system', 'durandal/app', 'durandal/viewlocator', 'modules/logger', 'modules/bindings', 'modules/hubservice'], function (system, app, viewlocator, logger, bindings, hubservice) { app.configureplugins({ router: true, dialog: true, widget: true, observable: true }); i've set bindings.js composite binding handler so: composition.addbindinghandler('datepicker', { init: function (element, valueaccessor, allbindingsaccessor, viewmodel) { var unwrap = ko.utils.unwrapobservable; var datasource = valueaccessor(); var binding = allbindingsaccessor(); var options = { keyboardnavigation: true, todayhighlight: true, autoclose: true,

html - Background and transparent effect -

http://codepen.io/alemarch/pen/yyeowx <div id="back"> bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla </div> <div id="front">g</div> and css #back { white-space: pre; background-color: #000; color: } #front { margin-top:-170px; padding-left: 20px; font-size: 150px; color: transparent; background-color: rgb(255,255,0); -webkit-background-clip: text; -moz-background-clip: text; background-clip: text; //position: relative; } this code work chrome.. ask how run in firefox? must use svg? in chrome, how change color of bla bla bla (now if use forecolor of bla bla different of background color transparent effect lost)? why, in chrome, if change position (ex relative) transparent effect lost too? thanks.

java - change default locale for junit test -

how change default locale junit test. current locale en. want test es_es. tried: system.setproperty("locale", "es_es"); but doesn't seem work. you can set default locale locale.setdefault . sets default locale instance of java virtual machine. not affect host locale. locale.setdefault(new locale("es", "es")); testing following resource files: test.properties message=yes test_es_es.properties message=sí here main function, no change default locale (en_us): public static void main(string[] args) { resourcebundle test = resourcebundle.getbundle("test"); system.out.println(test.getstring("message")); } output: yes here main function, change test locale (es_es): public static void main(string[] args) { locale.setdefault(new locale("es", "es")); resourcebundle test = resourcebundle.getbundle("test"); system.out.println(test.getstri

java - Printing multiple JTables as one job -- Book object only prints 1st table -

for number of reasons, i'm trying combine output of multiple jtables single print job. after tearing hair out trying build pdfs, , combing java api, settled on book class. printing code looks this. try { printerjob printer = printerjob.getprinterjob(); //set 1/2 " margins , orientation pageformat pf = printer.defaultpage(); pf.setorientation(pageformat.landscape); paper paper = new paper(); double margin = 36; // half inch paper.setimageablearea(margin, margin, paper.getwidth() - margin * 2, paper.getheight() - margin * 2); pf.setpaper(paper); book printjob = new book(); // note next line: getalltables() returns arraylist of jtables (jtable t : getalltables() ) printjob.append(t.getprintable(printmode.fit_width, null, null), pf,2); printer.setpageable(printjob); system.out.println(printjob.getnumberofpages()); if (printer.printdialog()) printer.print(); } catch (printerexception e)