Re: [ACFUG Discuss] Re: cfspreadsheet etc. question

2014-03-17 Thread Jason Delmore
I think you are reading the whole sheet in when you use CFSPREADSHEET and
essentially setting the pointer to sheet 2 with the second CFSPREADSHEET
line.  So you are trying to overwrite the existing spreadsheet with the
same objects and CF doesn't like that.

Maybe you should try something like this (I haven't touched CFSPREADSHEET
so I could be way off)

cfspreadsheet action=read
src=#application.rootDir#assets\C3d\IgG_Single_Template.xlsm
name=Patient_Output
cfset
SpreadsheetSetCellValue(Patient_Output,patientResults.patientName,7,5)
cfset SpreadsheetSetCellValue(Patient_Output,patientResults.clinic,8,5)
cfset
SpreadsheetSetCellValue(Patient_Output,DateFormat(patientResults.patientDOB,mm/dd/),9,5)
cfset
SpreadsheetSetCellValue(Patient_Output,DateFormat(patientResults.sampleDate,mm/dd/),10,5)
cfset
SpreadsheetSetCellValue(Patient_Output,DateFormat(patientResults.reportDate,mm/dd/),11,5)
cfset SpreadsheetSetCellValue(Patient_Output,patientResults.doctor,12,5)
cfset SpreadsheetSetCellValue(Patient_Output,link goes here,13,3)

cfset SpreadsheetSetActiveSheetNumber(Patient_Output, 2) !--- here is
where the magic is... ---
cfloop from=1 to=20 index=i
 cfset SpreadsheetSetCellValue(Patient_Output,.5,2,2)
/cfloop
!--- Write both sheets to the new file. ---
cfspreadsheet action=write filename=#theFile# name=Patient_Output
overwrite=true

!--- Redirect user to the patient spreadsheet. ---
cflocation url=/C3d/individual_results/#patientResults.lname#.xlsm


I did CFXL using POI a number of years back.  It's on riaforge.  If nothing
else, looking at the code may give you some inspiration if you decide to
delve into POI.

Best wishes,
Jason


On Mon, Mar 17, 2014 at 8:24 PM, Dawn Hoagland dawnhoagl...@gmail.comwrote:

 FWIW - it's been a while - but I had issues using the pure CF
 implementation of POI for several things.  I started doing my spreadsheet
 manipulation in pure java\POI - and loaded the later, FULL POI in order to
 it (using javaloader).

 I wish I could give you examples, but it's been a couple of years since
 I've messed with it.


 On Mon, Mar 17, 2014 at 2:19 PM, Charlie Arehart char...@carehart.orgwrote:

 Thanks for the update, and not to be antagonistic but it's still not
 clear. :-) Are you saying you reverted back to CF9? Or stayed on 10 by
 changing your datetimeformat references (a new function in CF10, which for
 most is a godsend, but was an incompatibility for you)?

 Either way, whether on 9 or 10, there are updates that must be done, and
 if you (or someone) didn't do them, or may even have done them wrong,
 that's still a possible explanation. So we need to know what update you are
 at. If you're on CF10, just look at the CF Admin system info page's update
 level. If you're on CF9 or earlier, sadly it's not that simple but I
 offered a link below that told how to find out your real update level on
 those releases.

 Finally, separate from that, I had proposed that you might want to share
 some simple code (a complete, self-contained template) that showed what you
 want to work. Maybe one of us would run it and say yes, it does work as
 expected, which would perhaps confirm it's some config issue on your end.
 (Even if not updates, perhaps it's something different in your CF Admin, or
 application.cfc/cfm). But please do check and report the update level also,
 thanks.

 As always, just trying to help.

 /charlie



 *From:* ad...@acfug.org [mailto:ad...@acfug.org] *On Behalf Of *Jeff
 Howard
 *Sent:* Sunday, March 16, 2014 7:24 PM
 *To:* discussion@acfug.org
 *Subject:* Re: [ACFUG Discuss] Re: cfspreadsheet etc. question



 Yeah, well funny thing about that. I contacted the hosting company (that
 I really want to say and dog right now but am refraining) to migrated to a
 CF10 server. What was discussed was that they would migrated the site and
 let me test before updating the DNS. Unfortunately, that is not how it
 worked out and while trying to work on this the entire site went down
 because I had a UDF that I've used for years called DateTimeFormat. It is
 all over my code and as I'm sure you understand, it didn't work out that
 well. So, I did try to update and test but ended up frantically trying to
 get the site back up and running.



 I was following up because I know that what I'm trying to do I did years
 ago working for another company and it was fairly simple (though lengthy
 code). It was 3rd party UDF but worked. I'm almost wondering if I may need
 to create the entire spreadsheet with CF including formulas, etc.



 On Sun, Mar 16, 2014 at 5:07 PM, Charlie Arehart char...@carehart.org
 wrote:

 Jeff, while you await a reply from anyone, and while you did reply kindly
 to my last note, you didn't really answer what I had asked: are you
 confirming you have the LATEST UPDATES installed for whatever version of CF
 you have? You want to rule that out before assuming it just can't work as
 you are trying.

 /charlie



 *From:* ad...@acfug.org 

Re: [ACFUG Discuss] SQL Server Question

2013-05-21 Thread Jason Delmore
I don't think there is anything wrong with using stored procs over inline
SQL to retrieve data.  However, in my view of the world this is application
behavior and not reporting.  Application behavior should be modeled in
objects and the best way is to use persistent components (Hibernate/ORM.)

The code would then look like
claim = entityload(claim, {claimid=1234});
documents = claim.getDocuments();  //  this uses ORM to generate SQL that
really just does select * from documents where claimid=1234
document = documents[1];
formfields = document.getFormFields();

IMHO, there is no value of inline SQL over stored procs other than perhaps
that people seem to do a poor job of version control on stored procs.  An
additional benefit of a stored proc is that database guys will go in and
review and tune a stored proc, but are unlikely to go and edit inline SQL
as that falls in the application space.  I would say leave your stored proc
alone unless you are going to go all the way to ORM.

But... that is just my view of the world.

Jason



On Tue, May 21, 2013 at 9:43 AM, MCG mger...@gmail.com wrote:

 Yes it's been a while, but I've gotten pulled into database design, and
 this group has always been the best place to turn to for technical
 knowledge.

 The team here inherited a crap database, over 200+ tables for an
 unexciting claim system, and is now adding new features.  Yes, views are
 better than straight SQL in the code in the case of many tables for your
 query.  Maybe I've just been out of the game, but the team is using stored
 procedures to build queries to output data on a page, which seems odd to
 me.  Maybe it is fear of the outer join, unions, subqueries.

 But do I have a case for pushing the funky view SQL versus running stored
 procedures?  The case here is nothing exceptional, we are getting data for
 the list of all documents related to a claim and then the one record for
 form fields for a single document for a claim.

 Thanks!

 Mary-Catherine



Re: [ACFUG Discuss] Images as Blobs

2013-04-02 Thread Jason Delmore
Something like this should work...  (totally untested pseudo-code, your
mileage may vary)

cfquery name=imageselectselect blob from tablewithimage/cfquery
img src=data:image/jpeg;base64,#tobase64(imageselect.blob)# /


On Tue, Apr 2, 2013 at 3:19 PM, Mike Staver sta...@fimble.com wrote:

 Thanks for the input Teddy. Yeah, I did look at that - but it's my
 understanding that I would still need to dump the image out onto the file
 system before sending it out via the web server, right? I'm assuming there
 isn't a way around that.


 On 4/1/2013 2:21 PM, Teddy Payne wrote:

 Mike,
 Have you looked into using cfimage tag to reference, render, or
 manipulate BLOB data?  If I recall, you can directly feed a database call
 into a cfimge tag.

 Cheers,
 Teddy

 Sent from my iPad

 On Apr 1, 2013, at 4:12 PM, Mike Staver sta...@fimble.com wrote:

  I've been thinking about keeping all user-uploaded images in the DB for
 one of my projects. I know how I will work the process to get them into the
 DB and keep them off the hard drive. It would go something like:

 1) Image uploaded to temp file system location from form post.

 2) Image inserted into DB as blob.

 3) Temp image removed from file system.

 Displaying the images is a bit more work I think. I assume I'd have to
 follow a similar process in reverse:

 1) Extract image from DB to temp file system location.

 2) Display it in HTML via web server as img tag.

 3) Remove image after a certain period of time...

 Step 3 has me wondering: How long should I wait before removing the
 image from the file system? Meaning - in theory, I could remove the image
 before it would even have a chance to display via the web server, and I
 don't want that. Anybody have a good process to do this already? I'd love
 if there was a way to display an image directly from the DB, but I'm not
 aware of such a method. I'll probably just fall back on leaving those
 images on the file system as part of the display, and have my code check
 for their existence before retrieving them again. I didn't want to have to
 worry about the disk space, but I can't think of another way.


 --**--**-
 To unsubscribe from this list, manage your profile @
 http://www.acfug.org?fa=login.**edituserformhttp://www.acfug.org?fa=login.edituserform

 For more info, see 
 http://www.acfug.org/**mailinglistshttp://www.acfug.org/mailinglists
 Archive @ 
 http://www.mail-archive.com/**discussion%40acfug.org/http://www.mail-archive.com/discussion%40acfug.org/
 List hosted by http://www.fusionlink.com
 --**--**-




 --**--**-
 To unsubscribe from this list, manage your profile @
 http://www.acfug.org?fa
 For more info, see 
 http://www.acfug.org/**mailinglistshttp://www.acfug.org/mailinglists
 Archive @ 
 http://www.mail-archive.com/**discussion%40acfug.org/http://www.mail-archive.com/discussion%40acfug.org/
 List hosted by http://www.fusionlink.com
 --**--**-






 --**--**-
 To unsubscribe from this list, manage your profile @
 http://www.acfug.org?fa=login.**edituserformhttp://www.acfug.org?fa=login.edituserform

 For more info, see 
 http://www.acfug.org/**mailinglistshttp://www.acfug.org/mailinglists
 Archive @ 
 http://www.mail-archive.com/**discussion%40acfug.org/http://www.mail-archive.com/discussion%40acfug.org/
 List hosted by http://www.fusionlink.com
 --**--**-






Re: [ACFUG Discuss] cf9 purchase availability?

2013-01-25 Thread Jason Delmore
It's safe to quote you on it.

http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/volume-licensing/pdfs/pv_esd_customer_faq.pdf



On Fri, Jan 25, 2013 at 4:13 PM, Mike Staver sta...@fimble.com wrote:

 Don't quote me on this, but doesn't Adobe give you a copy of an earlier
 verison of CF if you buy the latest? Meaning, if you subscribe to the
 latest version (10) and then go back to your contact and Adobe and request
 a license key for 9 to use instead, don't they let you do that? I thought
 that was something they introduced with version 10. It's possible I
 misunderstood their new licensing terms, but I thought they did offer this.


 On 1/23/2013 10:39 AM, Steven wrote:

 A coworker and I are coming up short .. in finding viable sources for
 actually purchasing cf9 standard still. We're going to have the need to add
 a couple more licenses to our infrastructure in the near future and we're
 not ready to go to 10. Anyone have any solid leads to a vendor still
 supplying?

 -Steve




 --**--**-
 To unsubscribe from this list, manage your profile @
 http://www.acfug.org?fa=login.**edituserformhttp://www.acfug.org?fa=login.edituserform

 For more info, see 
 http://www.acfug.org/**mailinglistshttp://www.acfug.org/mailinglists
 Archive @ 
 http://www.mail-archive.com/**discussion%40acfug.org/http://www.mail-archive.com/discussion%40acfug.org/
 List hosted by http://www.fusionlink.com
 --**--**-






Re: [ACFUG Discuss] CFLDAP and memory errors

2012-10-09 Thread Jason Delmore
Rob,

I think the memory part of this error message is somewhat misleading.  What
is happening is that the JVM is running out of operating system threads.
 As Charlie points out, you can decrease the heap size and leave more space
for the stack, but at the end of the day you are just nudging up the upward
limit a bit, you can also decrease the stack size used by each thread, but
then you are likely to cause a different memory error.  Life is certainly
better in 64-bit as these limits become somewhat meaningless.

In this case, each CFLDAP request will spawn a new thread and if for some
reason the LDAP requests are queuing or not closing properly or quickly
enough then the system will basically run out at some point when it goes to
create the next thread and error out.

A relatively easy solution although maybe not ideal, would be to manually
manage the LDAP request queue and if the in process requests are getting
too deep, sleep until the queue settles.  I imagine you have spikes in
requests that just need to be leveled out a bit.  You may also want to
store some of the LDAP results in your DB for some period of time as sort
of an auth cache.

Just some thoughts,
Jason



On Tue, Oct 9, 2012 at 2:28 PM, Rob Saxon saxon...@mercer.edu wrote:

 Charlie,

 ** **

 Thanks so much for lending your expertise.  We will take a look at
 lowering the heap space.  We are on a 32-bit server, but it has run for
 several years without issue.  Recently, we added more apps that rely on
 LDAP calls via CFLDAP.  So far, every time this error was thrown, the
 CFFDAP tag was in process. Do you know of any code optimizing strategies
 specific to CFLDAP?

 ** **

 Thanks,

 Rob

 ** **

 *From:* ad...@acfug.org [mailto:ad...@acfug.org] *On Behalf Of *Charlie
 Arehart
 *Sent:* Tuesday, October 09, 2012 1:39 PM
 *To:* discussion@acfug.org
 *Subject:* RE: [ACFUG Discuss] CFLDAP and memory errors

 ** **

 I would suspect that it may be only made worse by increasing the heap. :-)
 Strap on your seatbelts. If the problem was easily understood and solved,
 you’d have found the answer elsewhere. I’ll share here some thoughts you
 don’t see/hear often. It will take a few paragraphs to give proper context,
 though. Sorry for the long-ish email.

 Often (though not always) the “unable to create new native thread” is due
 to CF/the JVM being unable to allocate a new thread in a part of the
 address space OUTSIDE the heap (but within the jrun.exe process space), and
 you don’t “set” this “stack space”. It just gets what’s left over after the
 heap, permgen, and other spaces use memory.

 Well, if you are on 32-bit (where most people got this error), then you
 get only 2GB total addressable space for each process. And the bigger you
 make the heap, the less space is left for this “stack space”. There are
 more details and nuances, but this should help get you started. So believe
 it or not, sometimes lowering the heap is the solution.

 How far can you lower it? Well, until you start getting “outofmemory: java
 heap space” errors (or “gc overhead limit reached”, which means merely that
 the JVM has been trying to do GCs as it gets full, but it’s not able to
 reclaim much.) So yes, it’s a balancing act, to make both errors go away.

 As always, there’s more to this than meets the eye: while sometimes the
 solution is to change the resource limits (add heap, or in this case reduce
 it), but another thought is to find what’s putting pressure on the
 exhausted resource instead. So there may be some other explanation for why
 you are trying to create so many “threads” that can’t fit in that “stack
 space”, or other things putting pressure on that available addressable
 space, thus squeezing the stack space. There can be many reasons for that,
 again too much to get into in email.  

 BTW, if someone would point out the XSS jvm arg as a “solution” for this
 “new native thread” error which they’ve seen offered, I’d argue against
 that. Here’s why: that’s not for setting the size of the stack space, but
 rather for setting the size of each stack entry. And since I can find no
 documentation of what the default is for different versions of the JVM and
 OS, I would be leery of “just changing that” to see if it may help this
 problem.

 (Similarly, and related, when one gets outofmemory in the heap, the
 natural reaction is “increase the heap”, but I’d argue instead you should
 find out what’s putting pressure on the heap, which might be an unusually
 large amount of sessions, perhaps caused by excessive visits by spiders and
 bots, etc. Lowering that “pressure” may be the real “right” answer, and may
 do your server a world of other good.)

 No, you don’t often hear the above, but it’s because a) it can’t be
 communicated in a tweet and b) people tend to repeat what they’ve heard
 from others (in tweets or perhaps in old blog entries, which in my estimate
 seem often to have been more “making guesses” at what was amiss, and
 

Re: [ACFUG Discuss] CF 10 Dynamic Java Loading

2012-09-21 Thread Jason Delmore
Mike,

Your error message sounds to me like a sandbox security type of an error
message.  When you installed CF10, perhaps you went with the secure
settings.  You may have to go into the admin and allow java objects to be
instantiated or something along those lines.

Also, it seems like one option to your class loading issue would be to put
your POI functionality into its own application and then use the
javaSettings application variable.

Probably not much help,
Jason


Re: [ACFUG Discuss] Need a way to redirect users based on country

2012-09-05 Thread Jason Delmore
I think you can really only get the IP reported by the browser so that is
CGI.REMOTE_ADDR (unless they actually use latency tests to figure out
location which can be done but most APIs don't go there.)

At which point, all you are really doing is looking into a DB.  But their
API has a built in map to all the country codes and names (which is in
their source so not hard to replicate either... it's all LGPL)  But if you
decide to just use their DB, you should be able to add the jars to the
classpath and then the code should look something like...

lookupService = createObject(java, com.maxmind.geoip.LookupService);
cl = lookupService.init(C:\geoservice.dat,1);  //  Note '1' is the value
for the GEOIP_MEMORY_CACHE constant... I would suggest replicating the
constants into your code

country = cl.getCountry(CGI.Remote_ADDR).getName());

Hope that helps,
Jason


Re: [ACFUG Discuss] CF DateField show calendar on textbox focus or entry

2011-11-21 Thread Jason Delmore
The UI elements in CF are there if you are goodwith what is there out of
the box and don't want to get too far into customization.  They are there
to make hard things easy.  But I agree with Cameron, that if you want it
a different way than it works out of the box... you should do something
else.  jQuery is a good choice.

You can still use the CFAjaxProxy of course, regardless of what you choose
for a Javascript Library.

Jason


Re: [ACFUG Discuss] Typo in that last message -

2011-11-11 Thread Jason Delmore
Hi Derrick,

It would be a lot easier to debug if you sent a simple use case with the
expected value and what you are getting.  So, take a string foo with a
key of bar, hash that in PHP.  Then do the same in CF.

cfoutput#toBase64(hmac_sha256(foo, bar))#/cfoutput !--- sha 256 or
whatever you want ---

If you send the string you are getting from PHP and we can assume that is
the target, then we can just work on this bit of code until it gets the
same string.
Jason


Re: [ACFUG Discuss] PDFs / Excel Shenanigans

2011-10-11 Thread Jason Delmore
If you're on CF8, I posted CFXL on Riaforge at http://cfxl.riaforge.org/.
 It also uses POI, and you can similarly create multiple sheets.

Jason


Re: [ACFUG Discuss] CFLunch - Midtown Edition

2011-09-22 Thread Jason Delmore
Hey Atlanta CFers, :)

I just joined the list today so I will introduce myself.  As Cameron said, I
recently moved down to Atlanta.  I'm not sure if I am down here for good but
my wife's company asked her to come for a few months and it was hard to pass
up spending the winter in Atlanta (over Boston.) :)

Some of you may know me but for those that do not, I was the
ColdFusion Product Manager at Adobe for a tad under 3 years, for versions
7.0.2 through 9.  If there are things you hate about ColdFusion 8 and 9 I am
partly/mostly to blame (Full CFScript, ORM, and CFBuilder are some of the
things you can throw toilet paper at me for.)  :)  I also contribute to open
source projects in my free time.  ColdFiSH is probably the most widely used
as it is the syntax highlighter used by BlogCFC and there is a MangoBlog
plugin for it as well.  I also did the new BlogCFC Admin UI (by the way, I
also updated the ColdFusion Admin UI that is in use for CF8 and 9.)

I am currently at Markel Insurance (which acquired FirstComp) working
as Director of Technology, where we are working on building the next
generation of their insurance management software.  I have had the pleasure
and fortune to bring on folks like Ray Camden, Sam Farmer, Jared
Rypka-Hauer, David O'Leary, and Steven Erat to work at Markel.  We're
building some cool software.

An Irish pub for lunch was to hard to pass up so I plan on being at the
CFLunch Midtown meetup next week.  Anyhow, I am in Atlanta now.  Please feel
free to drop me a line at jason at delmore.info.

Cheers!
Jason