I am looking for something like the getdimensions() method from
cfx_imageflare
http://efflare.com/products/cfx_imageflare/documentation/font.html
My first response did not show up, so I am resending.
Anyway, you might try java.awt.font.TextLayout. I do not think CF image objects
retain the
don't know how to use this in a CFMX 7 environment.
I'm going to use this code to augment unzip code found
at http://www.rewindlife.com/archives/41.cfm
You can compile the above code into a java class. Then place the .class file
(or jar) into the CF classpath and reboot. Then you can
I'll compare what you did to the original
code -- should give me a nice insight in Java vs CF.
Yes. Keep in mind it is slightly different from the last example. That example
extends the ZipFile class and calls the verify function inside the class's
constructor. It's similar to extending a
You may want to try using TextLayout instead of FontMetrics getStringBounds()
for a more accurate measurement. The Font API mentions
The logical bounds does not always enclose all the text. For example, in some
languages and in some fonts, accent marks can be positioned above the ascent or
Can anyone take a look at the example code and tell me how I would go about
modifying the code in order to return *one* coldfusion query that contains
*all* of the results that I could then sort or page through as a Q of Q?
Interesting question. Merge them with a QoQ. You need to fiddle with the
s. isaac dealey ^ new epoch
Oh the cffeed queries... you have to use Q of Q to get that.
Nice. That is much cleaner. I forgot you can use reuse the query name like
that. CF did not seem to like the select * with union for some reason. So I
changed it to select (column names) and it worked
Welcome. Yeah QoQ doesn't set the variable until after it creates the
resultset, same way you can say myVar = listToArray(myVar), you're declaring
the name of the var you want to set before you're telling it to fetch its
value from the same var name. :P
Yes, definite failure of imagination on my
What is up with the frames also?
I do not know about Dreamweaver, but I prefer the no frames version too. For
older tags and functions I often use the 6.1 version. It is quicker to load and
does _not_ use frames. I have even resorted to disabling javascript
occasionally ;)
It would be
When did the LiveDocs ever load fast?? ;-)
Version 6.1 or earlier ;)
~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
I am trying to kill the process htmldoc.exe, using pskill.exe, however
i keep getting the following error
It might be waiting for acceptance of the EULA. If you are using a newer
version, try adding the flag -accepteula
~|
I am trying to kill the process htmldoc.exe, using pskill.exe, however
i keep getting the following error
Sorry if this is a duplicate. The first response never appeared.
The program may be waiting for an acceptance of the EULA. If you are using an
newer version, try using the -accepteula
Has anyone done that? the CFcontent tag is the closest thing pops up,
it does some job but still have tons of garbage. If possible I prefer
not to use third party bla bla.
I do not think there is a way to extract text only from a binary Word document
without using a third party component
Is it possible for Coldfusion to
convert these files to be similar enough to overlay them?
You could overlay the images using the java image classes. Though I do not know
if the transparency will work the way you are expecting.
Test
~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w
Archive:
Absolutely right, good way to be sure of that is to use DateDiff() as it
specifically compares the date unit you want which is days in this case:
..
Don't have to fiddle with the dates that way.
True, but functions can mess with the indexes. For that reason I usually use
CreateODBCDate with
FrameworkManager and MessageFactory are being imported. they are in .
JAR files provided by the customer. I just cannot get the main to
get executed, foget about moving forward.
What error are you receiving? Did you first create the necessary objects before
calling main()?
cfscript
Is it just me or are others having trouble posting?
Interesting. I can already see my response on nabble, but not on HOF
http://www.nabble.com/Problem-Posting-to15417379.html
~|
Adobe® ColdFusion® 8 software 8 is the most
Is it just me or are others having trouble posting? I'm finding that
its taking hours before a posting appears - I'm using the web-site
(not email) and Firefox.
No, it is not just you. I noticed the same thing.
~|
Adobe®
I want to use a relative path when instantiating a CFC. Can this be done
when using createObject()? Can it be done at all?
There is also a UDF at cflib that allows relative paths. Though it does use
coldfusion.runtime.TemplateProxy. So it might not work in CF8 if access to
internal java
Is there some easier, programmatic way to write the resulting html page
to file without too much manual fiddling around?
Use cfhttp to grab the content in conjunction with the path/file attributes to
save it to an html file.
Any other suggestions?
Wrap the whole thing in a set nocount on/set nocount off to prevent rowcounts
from interfering with the query results.
~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
My original query was something like this:
cfquery name=someqry datasource=somedns
Insert into sometable (somefields)
Select somefields from someothertable
Select SCOPE_IDENTITY() as someid
Where someID=cfqueryparam cfsqltype=cf_sql_integer
value=#arguments.someId#
/cfquery
Is there a typo in
You could call a stored proc instead and send out the identity column as
an output parameter, but I'm guessing you don't want to have to re-write
all that...
Yes, but an insert / select .. from table should work just by adding set
nocount.
What is this nocount and why do I have to use it.
Also can we confirm that this is a cf8 bug?
Drivers process the results of each statement. Including those that only return
a rowcount like updates or inserts: ie (1) row inserted. Cfquery is only
supposed to return one resultset. Rowcounts
It is a bug because it works differently from cf7.
Not in my opinion. cfquery is only supposed to return one resultset. So to me
that makes CF7's behavior a fluke/wrong. Yes, you can run multiple statements
inside a cfquery, but I do not think it was intended as a replacement for
stored
do you have any advice on whether this is possible please
Try
cfdump var=#theQuery.getMetadata().getQueryMetaData(theQuery)#
You know all this stuff is undocumented right? ;-)
~|
Adobe® ColdFusion® 8 software 8 is the most
but i need them to be exactly how they are in the database
This metadata will not give you that. Not exactly. It will return the columns
as they are typed in your sql statement. That may or may not be the same as
what is in your database.
On ColdFusion 8 check out cfdbinfo .
Adam Haskell
Yes. That is probably your best bet if you always need the exact case that is
in the database. If you are running a prior version, try your database's
metadata tables. Like ms sql's information_schema views.
thanks, this only gets the column names, i need the whole resultset
but i think it may be easier for me to hard code this myself.
Yes. You will need to use the returned array in combination with your query to
get the data you need. That will have to be hand coded.
is a good way around the
thanks very much ill do this
I just remembered there is a better method and this one _is_ documented ;-)
cfdump var=#getMetaData(theQuery)#
Though again, it returns the case used in your sql statement. Not the exact
case of the column names in your database.
is there a way i can get a list of the primary keys returned in the query
From the cfquery? Probably not. Though you can use cfdbinfo to get information
about primary and foreign key columns in a table(s).
http://livedocs.adobe.com/coldfusion/8/htmldocs/Tags_d-e_01.html
i know many programmers believe that 'select *' is the devils tool but
that will be the answer to my issue i believe as then it will return
the actual case in the db. thats what i am currently finding
anyway!!!
Yes, it makes sense that 'select *' would use the column info from the
The error crops up when the loop encounters a field that has null data.
I am using ListFix, and i thought that this would solve the problem, but
it doesn't.
cfloop index=record list=#ListFix(fileData)# delimiters=#chr(9)#
Is that the correct loop logic? Should you not be splitting on new
The error crops up when the loop encounters a field that has null data.
I am using ListFix, and i thought that this would solve the problem, but
it doesn't.
My first response has not shown up yet, so I am reposting.
Are you certain your loop logic is correct? Should you not be splitting the
I don't think it's necessary for the loop to work, but at the time I
think I ended up putting listFix() on everything coming out of the CSV I
was parsing. Taking it out doesn't change anything.
That is not the only issue. Is each line in your CSV really delimited by a tab
(9) or is some
That is not the only issue. Is each line in your CSV really delimited
by a tab (9) or is some combination of line feed/carriage return?
Darn. Seems all of my back logged responses are appearing at once ;)
~|
Adobe®
I can't find an example of the correct syntax for the AllowOverWrite option,
does anyone have an example, please?
I can't find an example of the correct syntax for the AllowOverWrite option,
does anyone have an example, please?
Note, using false causes CF to throw an exception if the key already
yeah, I had noticed that my delimiters were not correct. I changed them
back to chr(10) and chr(13). I still am having issues with null
values. Going to just keep plugging away.
Since you are using CF8, I would try Azadi's suggestion. But I would also
output the #record# value, before and
I've got so far ...
Take a look at the mid() function.
CFSET digits = len(getdon.recordcount) to get the number
Btw, should that not be len(theNumber) instead of recordCount?
~|
Adobe® ColdFusion® 8 software 8 is the
I've got a silly problem with CF_SQL_TIMESTAMP and CF_SQL_DATE changing my
dates from dd/mm/ to mm/dd/.
Most of the standard date functions use U.S. date formatting rules. So I
imagine 12/04/2008 would be converted to December 4th not April 12th.
You might try parsing it into a less
This problem only started occuring with DW CS3, btw.
I do not use DW. So I am not sure how or even if it would affect the parsing of
dates. As I understand it, CF parses the cfqueryparam value into a date object
before the sql is sent to your database. Since most CF date functions use U.S.
Hi Jenny,
I think the correct function to be using here is LSParseDateTime. That will
return a valid date object. What happens when you do this?
cfset yourDate = 12/04/2008
cfqueryparam value=#LSParseDateTime(yourDate)# cfsqltype=cf_sql_timestamp
Pft, you should come live in the UK where your ISP will sell the
entire
contents of all your HTTP traffic to a spyware company.
Nice to know ethics are alive and well in the 21st century ;-)
~|
Adobe® ColdFusion® 8
Does Access have a random number generator function?
Not one that works with CF, IIRC. Failing that I think William's suggestion
may be the way to go with Access.
~|
Adobe® ColdFusion® 8 software 8 is the most important and
What line of code is generating the error?
~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w
Archive:
It wouldnt need to work with CF???
Yes, it would. More specifically with the Access drivers used by CF.
I have not tried the code you posted. But I seem to recall a function used to
retrieve random records in Access that stopped working around MX6. Possibly it
was not supported by the
Trevor Austen wrote:
cfset variables.filelink =
cfif evaluate(variables.fileLink) neq
I do not think you need the evaluate, but if you name the file field
sequentially like this
input type=file name=fileLink1...
input type=file name=fileLink2...
input type=file
Just another reason to kick Access in the balls and move on to a better DB...
Yes, Access would not be my first choice, but I know not everyone has a choice
about using it ;-)
Your concept is definitely solid. But I just tried the code and it does not
work. So Rnd must the be problematic
seems like alot of noddling...
When it comes to functions, check cflib.org first ;-)
http://www.cflib.org/udf.cfm?ID=757
~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
Wrong link. This is the correct one.
http://www.cflib.org/udf.cfm?ID=317
~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
i found a function called byteconvert already in use in our code.
Sounds familiar ;-)
http://www.cflib.org/udf.cfm?ID=317
~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
Regex is not a strong suite for me.
Bruce
I am not a regex expert either, but what about using form.fieldNames to replace
the input fields by name? To be safe you might follow it up with another
blanket input.. replace. Just in case some of the field names do not match
for some reason.
cfset
The extra replaces are for the radio buttons. Basically what I am trying
to do now is match the submitted radio to the column it corresponds to
but it is not working correctly. I thought that if I found the header
field from the form they would match up but that is not correct. Can
anyone see
CF 8
All I am coming up with is looping. A regex guru might be able to come up with
a better alternative.
!--- use single replace for open/close form tag ---
cfset NewContentBlock =
REReplace(contentBlock,/*form[^]*,,ALL)
cfset matches = reMatchNoCase('input\s+[^]*',
The biggest problem I am having is getting the columns for the form to
line up properly (they are a series of radio buttons). I can get all of
the values and the text fields fill in properly. The radio button values
fill in with what I select, just not in the correct column.
Did you ever try
The problem with that is the same problem as the previous example I
posted though.
Try searching for dates between 10/15/2006 and 04/14/2007
Given those search dates, how do you want to handle records with a year only
(2006 or 2007). Same question for the month.
Original code: newValue was being created inside the cfif's, but was
not there in the last CFSET.
You are right. It should before the cfif.
Also, form.FieldNames were not being found
until I added the loop before the CFIF's.
That should not happen. As long as the form was submitted, I
I get an error
Variable TEMP is undefined.
I get an error too.
~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k
cfset list = valuelist(myquery.columnName) /
... or use the QuotedValueList() function, if the values need to be quoted.
~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
It's a CGI var, which means it will exist on some servers and not others.
Cool. I did not realize that.
I didn't realise that the cgi 'scope' was searched automatically by CF when
trying to identify a variable. Why oh why?!
I forgot how many scopes CF searches. One more reason to scope
cfqueryparam doesn't care that the input is not quoted:
Duh! Even better.
~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
I can create this class with CreateObject(Java,
coldfusion.sql.QueryTable) from a CF page, but my java code (running
in the same JVM, configured as a servlet) apparently cannot.
BTW, I compile the java code using a reference to the cfusion.jar file
on my local machine; the code only runs inside a
cfheader name=content-length value=#ArrayLen(ExcelByteData)#/
cfheader name=content-disposition value=attachment; filename=#xls_file#
..
Obviously this is because 6 doesn't have this attribute.
Assuming you do not wish to write the bytes to disk, you could write to the
response outputstream.
Just curious, what is the method signature? I would have expected
ArrayList, Vector, etcetera to work, since they all implement java.
util.List.
Also, what does your java wrapper look like?
~|
Adobe® ColdFusion® 8
i'm working with an incredibly picky java lib. one key method requires a java
List (really, it barfs on ArrayList, etc.).
Just curious, what is the method signature? I would have expected ArrayList,
Vector, etcetera to work, since they all implement java.util.List.
me too but as i said it's incredibly picky (it being jfreechart). it wants a
java.util.List nothing else. it's signature:
You are not kidding. It does seem to be picky.
Can you psych-it-out by using java.util.Arrays.asList(...)?
A List is a List. There has to be some other explanation for the
weirdness.
Duh! I was accidentally calling init(). Obviously that does not work with an
abstract class ;)
This seems to work:
cfscript
cfArray = [ javacast(double, 15.0), javacast(double, 22.5) ];
Box = createObject(java,
Paul, what exactly is the error? Is CF not finding it?
Can we see the code you're attempting at least?
Yes, please. Because I am able to pass in a CF array without problem. Granted,
I am using an abstract class.
~|
Adobe®
It is like sox
isn't closing and leaving memory like it should be, but if I run it
directly from the command line, I don't have that problem.
Try Ben Forta's tip of adding /c as an argument. This tells the command
interpreter to run and terminate upon completion. I had a similar problem
select *, exists (
select *
from orders
where date between #date1# and #date2#
) as hasOrdered
from customers
order by name, id
Use CFQUERYPARAM, of course.
Another variation is a left join. Ditto on using cfqueryparam.
SELECT
c.ID,
c.Name,
c.Email,
SUM(CASE WHEN o.Date IS NULL THEN 0
I dont believe this is working with Access DB
SUM(CASE WHEN o.Date IS NULL THEN 0 ELSE 1 END) ordersFound
I think Access's version of CASE is IIF(..). Try using IIF instead and also try
the query Barney suggested. One of them should work.
Actually, to answer my own question, I think that if I call the close()
method for the passed JDBC recordset after I've done with using it in other
methods then this should do the trick. Am I right?
Actually, to answer my own question, I think that if I call the close()
method for the passed
Yes, I can convert it into a cfquery object, and a lot of the time I will,
but I also want to be able to insert the data into another table in another
db which I can do directly rather than converting it to a query first.
Hence the reason to split it into separate methods.
Personally I would
I have a log file that I'm looking to parse. I only care about the
last entry. Is it possible to read in the file, then loop over it from
the end, rather than the beginning? Here's the code I've got right now.
It works well, but why loop over parts that aren't needed right?
I do not think
Here is a down-and-dirty example.
I realized the snippet above does not account for lines broken across the
grabBytes barrier. So that alteration is needed. But the code snippet should
give the basic idea at least.
~|
I haven't tried it myself, but Java does have a tail command that
should do exactly what you want.
m!ke
That sounds very promising. I will take a look at that. Thanks.
~|
Adobe® ColdFusion® 8 software 8 is the most important
I haven't tried it myself, but Java does have a tail command that
should do exactly what you want.
m!ke
Michael,
I have done some searching, but I am still unclear on the tail command. I may
be overlooking the obvious, as I have not had my full measure of coffee yet ;-)
Can you tell me a
Sorry for the confusion. I meant OS rather than Java. It's been a
long week for me. ;^)
If it helps, you are not the only one .. ;-)
If you are on *nix, there is a built-in tail command.
Yes, it has been a while, but *nix tail was my first thought. But I guess I
was still hoping there was
You could shell out (CFEXECUTE) the tail command to get those lines.
Michael,
Good suggestion. Tail works very well. Cheers.
cfset numOfLines = 10
cfset logFilePath = server.coldFusion.rootDir /logs/exception.log
cfexecute name=c:\program files\Windows Resource Kits\tools\tail.exe
therefore how would you translate this formatting stated above
cfscript
outFile = createObject(java, java.io.File).init( e:\temp\excel\test.xls
);
workBook=createObject(java,jxl.Workbook).createWorkbook(outFile);
labelObj=createObject(java,jxl.write.Label);
Just remember to add 1 to the result.
And remember java will perform a case sensitive search. So indexOf(XYZ) may
return different results than indexOf(xyz).
cfset myArray = [ apple, xyz, orange, pear]
cfset index1 = myArray.indexOf(XYZ) + 1
cfset index2 = myArray.indexOf(xyz) + 1
cfoutput
Keep in mind I am reading this with only half a brain today ..
Here is what I have now.
cfoutputcfsavecontent variable=querytouselogparser select *
from C:\ColdFusion8\logs\application.log
-i:csv/cfsavecontent/cfoutput
It looks like you have the .exe (logparser) in the arguments. If that
ie. ditch the logparser command
Yes .. what he said ;-)
~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j
Archive:
cfprocparam dbvarname=@affiliateID
variable=#val(arguments.affiliateID)# cfsqltype=CF_SQL_INTEGER /
I think the attribute should be value not variable. Also, I thought
dbvarname was deprecated ?
~|
Adobe® ColdFusion®
OT: SQL 2005 Studio Express - find and replace with newline character
Does anyone know how to find and a character and replace it _with_ a newline
using SQL Server 2005 Studio Express? For example, I would like to replace all
|'s in the following string
one|two|three|four|five|six
So
CHAR(13) + CHAR(10)
Thanks, but I mean using Studio Express's find + replace option. It is such a
simple thing, but it has me stumped. I have tried every combination I can think
of. No joy.
~|
Adobe® ColdFusion® 8 software 8
You're doing a code search? I assumed you were trying to format data being
returned by a query.
Sort of. I am working with some ad-hoc sql scripts. Sorry, if I was not clear.
I know this is OT. I posted in the hopes that someone else using Express Studio
might know the magical character(s).
Just to follow up: From what I can tell you cannot use special characters with
the find + replace option in the Studio Express _editor_. I ended up using
another editor.
Thanks for the response Sonny. I know my original question was about as clear
as .. mud ;-)
Yep, you are right. Works with jpg but not with gif or png.
It may have to do with the color pallete of the gif you are using. For example
if you run the following code, the text appears red on the Google logo.
Presumably because the logo's color palette contains red, or a very similar
color.
Perhaps it has to do with the color palette that the .gif
is created with?
Yes, I think so too.
~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
Any ideas anyone. :)
William
It depends on which driver you are using. Something like this should work with
ColdFusion 8. I have no clue if there any differences for remote databases ;-)
cfscript
Class =
createObject(java,java.lang.Class).forName(com.mysql.jdbc.Driver);
I've tried and got it all plugged in with no success and it would be
just my luck that the How To Use link would be broken on the website.
I have been working on it for about 4 hours. Time to ask for help.
Client is coming at 11 tomorrow and I have to have something for them
to look at.
I think I have everything correct, but the background of my
dynamically created image is black. Nothing I do will change that.
..
cfset myImage=ImageNew(,500,20)
Not to rule out other options, but try setting the background color when the
image object is created:
cfset
I don't think it's a case issue. I tried it with mixed, all lower and
all upper and continue to get the same response.
Do any of these apply?
http://www.bennadel.com/blog/80-ColdFusion-SQL-Error-Table-Is-Not-Indexable-By-Name.htm
When there are records with duplicate
emails addresses, I need to include one of them.
So you are trying to display one record for each email address?
You could try something like this. Not tested, but the idea is to select a
single PK for each email. Then use a JOIN to display the details
You could try something like this. Not tested, but the idea is to
select a single PK for each email. Then use a JOIN to display the
details for those PK's.
Note, the previous query assumes it does not matter which record is returned.
I need to get a record set used to pick a winner, including just one
of the records from the duplicate email entries.
If it does not matter which one, try the query I posted in my first response.
The syntax is not tested, but it has the right concept.
It also begs the question, if they were only supposed to have one
entry
per e-mail address, why wasn't there error checking or a constraint on
the table to force this in the first place?
True enough. I was thinking the same thing myself ;-)
cfset active_photos = #replace(active_photos,
That just gave me a file with the text, active_photos, and a return
symbol after it...
Remove the quotes from active_photos so CF knows it is a variable to be
evaluated ;-)
cfset active_photos = #replace(active_photos,
#chr(10)chr(13)##chr(10)chr(13)#, , All)#
Also, check Barney's suggestion:
replace sequential newlines with a single newline and such.
~|
Adobe® ColdFusion® 8 software 8 is
1 - 100 of 156 matches
Mail list logo