我在ColdFusion中编码,但是试图留在cfscript中,所以我有一个函数允许我传入一个查询来运行它
<cfquery blah >
#query#
</cfquery>
但不知何故,当我构建查询sql = "SELECT * FROM a WHERE b='#c#'" 并将其传入时,ColdFusion已将单引号替换为2个单引号.所以它变成 WHERE b=''c''了最后的查询.
我尝试过很多不同的方法创建字符串,但我不能只留下一个引用.即使进行字符串替换也没有效果.
知道为什么会这样吗?在这个项目期间,它破坏了我在cfscript中生活的希望
这里有没有人有过在生产中运行OpenBD或Railo的经验?我们有一些传统的CF6.1应用程序需要托管在某处,我想知道OpenBD或Railo是否足够稳定以供生产使用,不需要大量的工作就可以迁移到等等.
我正在开发一个在ColdFusion中仍然有很多脚本的网站.我需要将它移动到新服务器.我更喜欢Apache/Linux而不是IIS/Windows.我已经看到了一些关于在Apache/Linux上运行ColdFusion的信息.这是一个稳定的设置吗?
我需要在一个左,中,右对齐的页脚容器DIV中创建3个DIV.我见过的所有CSS示例都像我一样使用了浮点数.但是,由于某些原因,DotNetNuke没有正确解析CSS.我发现左窗格正确浮动,但右窗格和中间窗格位于其正下方而不是旁边.这是我的ascx文件的片段:
<div id="footer">
<div id="footerleftpane" runat="server">
<dnn:LOGO id="dnnLogo" runat="server" />
<h3>Driving business performance.</h3>
<h3>Practical Sales and Operations Planning</h3>
<h3>for medium sized businesses.</h3>
</div>
<div id="footerRightPane" runat="server">
<dnn:COPYRIGHT id="dnnCopyright" runat="server" /><br />
<dnn:PRIVACY id="dnnPrivacy" runat="server" />
<dnn:TERMS id="dnnTerms" runat="server" />
</div>
<div id="footerMidPane" runat="server">
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
这是我的CSS文件的相关部分:
#footer
{
width: 960px;
border: 1px;
}
#footerleftpane
{
width: 300px;
float: left;
}
#footerRightPane
{
width: 300px;
float: right;
}
#footerMidPane
{
padding:10px;
}
Run Code Online (Sandbox Code Playgroud)
我应该对上面做出哪些改变才能达到理想的布局?
更新:我尝试了建议的更改,但布局仍然无法在此salesandoperationsplanning.net页面上看到,它展示了我想要的内容.
我正在按照Github的说明添加SSH密钥.我已经从我的AWS EC2实例生成了id_rsa.pub文件,但我无法完成使用xclip复制文件内容的步骤,因为我无法将xclip安装到EC2实例上.
sudo yum install
xclip,但是没有用("没有包xclip可用").那么,如何在64位Amazon Linux AMI 2012.09上安装xclip呢?
<input type="date" name="due_date" id="due_date" min="2011-09-01" maxlength="10" class="span8">Chrome中的日期输入用于允许用户查看"弹出"日历以帮助选择日期.我昨天注意到行为已经停止; 输入仅允许用户向上/向下箭头日期部分(月/日/年).我访问了Chrome博客并运行了Google搜索,但无法找到任何关于此更改的提及.为什么行为input type="date"改变了?奇怪的是,这种变化似乎仅限于Bootstrap,因为http://www.w3schools.com/html/tryit.asp?filename=tryhtml5_input_type_date仍然展示了datepicker.
我一直在探索构建我的ColdFusion应用程序的不同方法,并且我正在寻找关于提供应用程序范围UDF的最佳方法的一些意见.
对于我的每个应用程序,我通常使用一些并不真正属于任何特定对象的额外函数.主要是数据操作.我希望这些功能在我的应用程序中可用,既可用于CFM模板,也可用于应用程序实例化的CFC.
我看到它的方式有各种方法来实现这一点,但它们都有自己的局限性:
在应用程序范围中实例化基本Utils CFC.这是我经常使用的方法.所有的功能都可以在应用程序范围内使用,但如果我从多个应用程序实例化相同的CFC,那么它们每个都有自己的应用程序范围 - 这意味着每个都必须实例化自己的基础Utils CFC.这没有什么不对,但感觉我没有足够好地封装CFC.我并不热衷于从CFC中引用应用程序范围.
创建一个基础Utils CFC并使其他所有CFC扩展它.这样可以正常工作,这意味着CFC可以直接从CFC的THIS范围引用Utils功能 - 但这意味着Utils功能保存在每个CFC的内存中.它在概念上也不合适,因为我的其他CFC与Utils CFC没有任何关系.
将我的基础Utils CFC注入我的其他CFC.我一直在玩的另一种方法是在Application范围中实例化我的基础Utils CFC,然后将其作为对象传递给我的其他CFC中的参数.这在概念上和我的封装中都适用.与我在init方法中设置数据源的方式相同,我可以对UDF执行相同的操作.这与UDF包含在每个CFC中的问题相同.当我转储所有的CFC时,我多次得到每个UDF - 但是当我传递一个实例化的对象时,我假设它没有占用任何额外的内存空间.如果有人能证实这一点,那会很有帮助 - 我只是假设!我对这种方法唯一真正的问题是它似乎有点复杂.
让我的应用程序CFC扩展我的Utils CFC.这就是许多框架似乎要做的事情.我没有使用过这种方法,但我确信它有利有弊.
CF直接在Application.cfc中从单独的模板中包含我的UDF这在功能上类似于在Application范围中实例化.
将我的UDF添加到服务器中Components.cfc
这是一个理论上的好主意 - 我可以维护基本Utils的一个副本,并确保服务器上的所有内容都可以访问它们 - 但是,如果我想在多个服务器上运行应用程序,那么它们都将全部需要那些功能.此外,对服务器的任何更新都可能会覆盖组件.它只是感觉像黑客核心 - 我敢肯定我们可以从苦涩的经历中得到所有,这很糟糕.
所以 - 我的问题是:以优雅和可重用的方式扩展CF与UDF的最佳实践是什么?以上任何选项或我没想过的东西?
兄弟部门创建了一个HTML文件,它实际上是少数iframe的支架.每个iframe调用一个报告,该报告托管在Web服务器上,参数略有不同.被叫报告将向未经身份验证的用户显示登录表单,或向已经过身份验证的用户显示报告内容.
scaffold.html:
<html>
<head>
<title>I just show the output from a bunch of report calls</title>
</head>
<body>
<iframe src="https://somesite.com/useful_report.html?parameter1=a¶meter2=1" id="iframe1"></iframe>
<iframe src="https://somesite.com/useful_report.html?parameter1=b¶meter2=2" id="iframe2"></iframe>
<iframe src="https://somesite.com/useful_report.html?parameter1=c¶meter2=3" id="iframe3"></iframe>
<iframe src="https://somesite.com/useful_report.html?parameter1=d¶meter2=4" id="iframe4"></iframe>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
兄弟组织向我们解释说,如果用户登录https://somesite.com,上述设置工作得很好 - 每个iframe都会显示有用的内容...直到几天前.
当我
每个iframe都会在表单上返回https://somesite.com标志.如果我然后在单独的选项卡中打开useful_report.html,则会加载报告内容(证明somesite.com知道我仍然登录‡).
使用开发人员工具,我可以看到util_report.html的请求标头不包含"Cookie:"属性,因此这解释了为什么useful_report.html返回表单上的登录.
我的问题是为什么iframe请求不发送cookie?什么Chrome和/或服务器设置/策略/指令阻止了它?
‡ - 现在知道我知道它知道了.
security iframe google-chrome cross-domain content-security-policy
我正在尝试将ListView项目放入ListView中.目前它们是可点击的(请参阅我的屏幕截图),但它们只能在文本占用的矩形内单击.
我正在使用protected void onListItemClick(ListView l, View v, int position, long id) {
可点击列表项.
这是我的list.xml:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ListView android:id="@+id/android:list"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
<TextView android:id="@+id/android:empty"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/no_favorites"/>
Run Code Online (Sandbox Code Playgroud)
和我的row.xml:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView android:id="@+id/artist"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
<TextView android:id="@+id/songtitle"
android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_alignParentRight="true"/>
<TextView android:id="@+id/album"
android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_alignParentRight="true"/>
<TextView android:id="@+id/playtime"
android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_alignParentRight="true"/>
<TextView android:id="@+id/playlistnum"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_alignParentRight="true"
android:visibility="gone" />
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
而这里的截图例子:(新用户不得发表图片... ...叽有一个超链接!)
在list.xml中,Listview具有android:layout_width ="fill_parent",因此它应该是屏幕的整个宽度.(row.xml中的所有项目也是width ="fill_parent".)我缺少什么?
我有一个递归查询,封装在一个函数中,返回一个层次调查"结构":
CREATE OR REPLACE FUNCTION get_survey_results(IN v_survey_id integer DEFAULT 1, IN v_survey_session_id integer DEFAULT NULL)
RETURNS TABLE(sort_order bigint[], survey_question_id integer, question_text text, required_ind smallint, survey_session_id integer, custom_text text, option_value integer, survey_scale_id integer, survey_scale_type_id integer, parent_survey_question_id integer, parent_survey_scale_option_id integer) AS
$BODY$
BEGIN
RETURN QUERY
WITH RECURSIVE Survey_Structure (PATH, survey_question_id, question_text,
required_ind, survey_session_id, custom_text,
option_value, survey_scale_id, survey_scale_type_id,
parent_survey_question_id, parent_survey_scale_option_id, CYCLE)
AS (
SELECT ARRAY[row_number() OVER (ORDER BY Survey_Question.sort_order)], Survey_Question.survey_question_id, Survey_Question.question_text,
Survey_Question.required_ind, Survey_Response.survey_session_id, Survey_Response.custom_text,
Survey_Scale_Option.option_value, Survey_Question.survey_scale_id, Survey_Scale.survey_scale_type_id,
0 as parent_survey_question_id, 0 AS parent_survey_scale_option_id, …Run Code Online (Sandbox Code Playgroud) cfml ×4
coldfusion ×4
railo ×4
amazon-ec2 ×1
android ×1
apache ×1
cfc ×1
cross-domain ×1
css ×1
datepicker ×1
dotnetnuke ×1
github ×1
html5 ×1
iframe ×1
linux ×1
listview ×1
openbd ×1
postgresql ×1
security ×1
skinning ×1
sql ×1
string ×1
yum ×1