coldfusion

Yandex API Translator error - 401 API key is invalid

让人想犯罪 __ 提交于 2019-12-13 17:57:53
问题 I registered with Yandex and got a Translate API Key. However when I try to translate with the following code: <CFSET Key = "trnsl.1.1.2014091..........................."> <CFSET lang="en-de"> <CFSET text="Hallo World"> <CFHTTP URL="https://translate.yandex.net/api/v1.5/tr.json/translate?Key=#Key#&lang=#lang#&text=#text#" METHOD = "GET"> </CFHTTP> <CFOUTPUT>#CFHTTP.FileContent#</CFOUTPUT> I get a 401 error "API key is invalid". I also tried with Javascript/CFML but got a similar result. I

Use of CFQUERYPARAM to specify table/column names in SQL

一曲冷凌霜 提交于 2019-12-13 17:46:29
问题 I need to dynamically construct a set of JOIN statements where the table and column names are passed in from another ColdFusion query. When passing the string values to into the statement, CFQUERYPARAM adds single quotes around it - that's part of the point of CFQUERYPARAM. Given that this breaks the SQL statement, is it acceptable not to use CFQUERYPARAM in this case and instead ensure that the incoming query is cleansed, or is there a way round which allows CFQUERYPARAM to be used? (I can

CFWheels Unit Testing?

狂风中的少年 提交于 2019-12-13 17:21:14
问题 I have searched Google and abroad and I cannot find anything about CFWheels Unit Testing. Does anyone know if it exists and if so can you point me in the right direction? Thanks, Darren 回答1: This will more than likely be an "experimental" feature in 1.1 and refined in maintenance releases like 1.1.1 (though the functionality is there supposedly). Unfortunately, our priorities have been in other areas, and we haven't been able to put unit testing of Wheels apps themselves through its paces and

WKHTMLTOPDF and Coldfusion

六眼飞鱼酱① 提交于 2019-12-13 16:17:27
问题 Is it possible to use coldfusion URL variables with WKHTMLTOPDF plugin? I am trying it as follows but only receiving a blank PDF. I'm assuming it's failing because of the URL variables. <cfexecute name="C:\Program Files (x86)\wkhtmltopdf\bin\wkhtmltopdf.exe" arguments="c:\inetpub\wwwroot\serviceticket\reports\dropoff_receipt.cfm?ticket_id=#url.ticketID#&signature_id=#check_signature.id# C:\google.pdf" timeout="10" /> Update 1: Changed the source to a URL, same error though. <cfexecute name="C

Why would regex to separate filename from extension not work in ColdFusion?

若如初见. 提交于 2019-12-13 16:14:19
问题 I'm trying to retrieve a filename without the extension in ColdFusion. I am using the following function: REMatchNoCase( "(.+?)(\.[^.]*$|$)" , "Doe, John 8.15.2012.docx" ); I would like this to return an array like: ["Doe, John 8.15.2012","docx"] but instead I always get an array with one element - the entire filename: ["Doe, John 8.15.2012.docx"] I tried the regex string above on rexv.org and it works as expected, but not on ColdFusion. I got the string from this SO question: Regex: Get

insert operation into a bigquery table

孤街浪徒 提交于 2019-12-13 16:13:13
问题 I want to insert all rows of an SQL server Table into a Bigquery Table having the same schema. The streaming insert row by row is very slow: to insert 1000 rows the execution of the code below took about 10 minutes. In this code I loop over the first 10 files in a certain folder, and I insert the content of this file in a unique SQL Server Table. Once I looped over the desire files, I loop over the SQL Server table (which contain all rows of all files) and I insert the content row by row in a

How do I return a coldfusion struct from a method in a java class (in Lucee)?

拟墨画扇 提交于 2019-12-13 16:09:45
问题 I am writing a java class and would like to return a coldfusion struct from a method. Struct extends Map and other things. I'm not a Java programmer, so I'm not sure how to fix this. Here's the lucee java docs. When I try to compile the following code, I get an error saying that Struct is abstract and can't be instantiated (on the line when I try to create myStruct). I've tried to create a new Map, but that's also abstract. import lucee.runtime.type; public class MyClass { public lucee

Coldfusion Cross site authentication

雨燕双飞 提交于 2019-12-13 15:32:51
问题 Ok, so on the coldfusion site I'm working on I just installed a third party (open source) CF forum known as "Galleon". I asked a similar question a bit ago but now we have progressed a bit. The issue at hand is that it will not recognize -any- variables (sessions, etc) that exist of the parent site proper. The forum itself is stored inside of a sub folder within the site directory.. But when we try to output session variables, which we know have not expired or whatnot, it spits out an error

ColdFusion - DateTime Format with GMT offset

一曲冷凌霜 提交于 2019-12-13 15:25:39
问题 I am using ColdFusion 10 to make some REST calls and the date returned is using a GMT offset. Example: 2013-03-25T14:30:40-04:00 I need this formatted for 2 purposes: Screen Display so it looks something like mm/dd/yyyy hh:mm:ss To Insert into mySQL. I have tried a variety of the CF time/date functions but continue to get the "is not a valid date format" I thought maybe the #ParseDateTime(i.submitted_at,"pop")# would handle it with POP but same issue. Spent a few hours now trying multiple

SQL to Excel loses trailing zeros

流过昼夜 提交于 2019-12-13 15:24:18
问题 I have a SQL table that has columns of prices. The field type is varchar because some of the price fields must have "Market Price" as the data value. I am querying this data via ColdFusion and using cfspreadsheet to create an export: <cfspreadsheet action="write" filename="prices.xlsx" query="qTierPrices" sheetname="Food Pricing" overwrite="yes"> When looking at the spreadsheet, prices like 1.00 become 1 and 4.50 becomes 4.5 in the spreadsheet cells. Is there a way to fix this