我正在阅读我的组织中另一位开发人员多年前编写的一些旧代码.在尝试改进此代码时,我发现它使用的查询有一个非常糟糕的问题.
OdbcDataAdapter financialAidDocsQuery =
new OdbcDataAdapter(
@"SELECT a.RRRAREQ_TREQ_CODE,
b.RTVTREQ_SHORT_DESC,
a.RRRAREQ_TRST_DESC,
RRRAREQ_STAT_DATE,
RRRAREQ_EST_DATE,
a.RRRAREQ_SAT_IND,
a.RRRAREQ_SBGI_CODE,
b.RTVTREQ_PERK_MPN_FLAG,
b.RTVTREQ_PCKG_IND,
a.RRRAREQ_MEMO_IND,
a.RRRAREQ_TRK_LTR_IND,
a.RRRAREQ_DISB_IND,
a.RRRAREQ_FUND_CODE,
a.RRRAREQ_SYS_IND
FROM FAISMGR.RRRAREQ a, FAISMGR.RTVTREQ b
WHERE a.RRRAREQ_TREQ_CODE = b.RTVTREQ_CODE
and a.RRRAREQ_PIDM = :PIDM
AND a.RRRAREQ_AIDY_CODE = :AidYear ",
this.bannerOracle);
financialAidDocsQuery.SelectCommand.Parameters.Add(":PIDM", OdbcType.Int, 32).Value = this.pidm;
financialAidDocsQuery.SelectCommand.Parameters.Add(":AidYear", OdbcType.Int, 32).Value = this.aidYear;
DataTable financialAidDocsResults = new DataTable();
financialAidDocsQuery.Fill(financialAidDocsResults);
FADocsGridView.DataSource = financialAidDocsResults;
FADocsGridView.DataBind();
Run Code Online (Sandbox Code Playgroud)
问题是该列a.RRRAREQ_TRST_DESC不存在.在Oracle SQL Developer中运行它时,您可以非常快速地学到这一事实.
奇怪的是?
这段代码有效.
gridview绑定成功.(它不会试图绑定到那个领域.)它已经在生产多年了.
所以,我的问题是......为什么?我从未见过错误的查询工作.我从未见过Oracle允许它或数据提供商破解它.
有谁知道这里发生了什么?
我正在从我没写的PHP应用程序中获取一些表单.为此,我提出了这个聪明的解决方案:
jQuery("form").submit(function(event) {
// get some values from elements on the page:
var the_form = jQuery(this);
var data = the_form.serialize();
var url = the_form.attr( 'action' );
var button = event.originalEvent.explicitOriginalTarget;
data = data + "&" + button.name + "=" + button.value;
// Send the data using post and put the results in a div
jQuery.post( url, data, function() {
//Do something crazy
});
// stop form from submitting normally
if (event.preventDefault)
{
event.preventDefault();
}
else
{
event.returnValue = false;
} …Run Code Online (Sandbox Code Playgroud) 我正在尝试以"2/22/11"格式获取NSString日期并将其转换为以下格式:2011-02-22
这是我的代码:
NSDate *dateTemp = [[NSDate alloc] init];
NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
[dateFormat setDateFormat:@"yyyy-MM-dd"];
dateTemp = [dateFormat dateFromString:newInvoice.date];
newInvoice.date = [dateFormat stringFromDate:dateTemp];
Run Code Online (Sandbox Code Playgroud)
newInvoice.date以NSString开头等于"2/22/11".dateTemp最终没有.newInvoice.date最终也是NIL.
我不能为我的生活找出原因.
我正在使用一个由博主(http://troybrant.net/blog/)编写的类,它接受一个XML字符串并吐出一个NSDictionary.
它很漂亮......完美无缺,除了我在许多元素值的开头有一个奇怪的换行和空白配置.
我一直无法弄明白为什么.我在这里上课,所以我可以得到第二双眼睛...看看是否有人注意到他正在使用的方法中有任何可疑的东西.
//
// XMLReader.m
//
#import "XMLReader.h"
NSString *const kXMLReaderTextNodeKey = @"text";
@interface XMLReader (Internal)
- (id)initWithError:(NSError **)error;
- (NSDictionary *)objectWithData:(NSData *)data;
@end
@implementation XMLReader
#pragma mark -
#pragma mark Public methods
+ (NSDictionary *)dictionaryForXMLData:(NSData *)data error:(NSError **)error
{
XMLReader *reader = [[XMLReader alloc] initWithError:error];
NSDictionary *rootDictionary = [reader objectWithData:data];
[reader release];
return rootDictionary;
}
+ (NSDictionary *)dictionaryForXMLString:(NSString *)string error:(NSError **)error
{
NSData *data = [string dataUsingEncoding:NSUTF8StringEncoding];
return [XMLReader dictionaryForXMLData:data error:error];
}
#pragma mark -
#pragma …Run Code Online (Sandbox Code Playgroud) 我喜欢分组的默认背景UITableView.我想在标准上使用它UIView.
我无法找到任何人提出这个问题或任何参考如何实现它.
有关如何做到这一点的任何建议?它甚至可以在创建和图像之外,并将其作为背景加载吗?
问候,好吧,我很困惑.我的任务是更新PHP脚本,该脚本使用BulkAPI将一些数据插入到Opportunity实体中.
除了Bulk API为某些明确定义的自定义字段返回此错误之外,这一切都很顺利:
InvalidBatch : Field name not found : cv__Acknowledged__c
Run Code Online (Sandbox Code Playgroud)
和类似的.
当我发现我使用的WSDL版本相当陈旧时,我认为我终于找到了问题(Partner WSDL).所以我迅速重新生成了WSDL.唯一的问题?企业,合作伙伴等......所有这些......都不包括这些领域.它们都来自Common Ground软件包并以cv_开头
我甚至试图在Workbench中的对象资源管理器以及Force.com IDE中的架构资源管理器中找到它们.
所以,请...借给我你的经验.我该如何更新这些值?
提前致谢!
克里夫
截图来证明我有正确的访问权限:

编辑 - 这是我的代码:
require_once 'soapclient/SforcePartnerClient.php';
require_once 'BulkApiClient.php';
$mySforceConnection = new SforcePartnerClient();
$mySoapClient = $mySforceConnection->createConnection(APP.'plugins'.DS.'salesforce_bulk_api_client'.DS.'vendors'.DS.'soapclient'.DS.'partner.wsdl.xml');
$mylogin = $mySforceConnection->login('redacted@redacted.com', 'redactedSessionredactedPassword');
$myBulkApiConnection = new BulkApiClient($mylogin->serverUrl, $mylogin->sessionId);
$job = new JobInfo();
$job->setObject('Opportunity');
$job->setOpertion('upsert');
$job->setContentType('CSV');
$job->setConcurrencyMode('Parallel');
$job->setExternalIdFieldName('Id');
$job = $myBulkApiConnection->createJob($job);
$batch = $myBulkApiConnection->createBatch($job, $insert);
$myBulkApiConnection->updateJobState($job->getId(), 'Closed');
$times = 1;
while($batch->getState() == 'Queued' || $batch->getState() == 'InProgress')
{
$batch = $myBulkApiConnection->getBatchInfo($job->getId(), $batch->getId());
sleep(pow(1.5, $times++));
} …Run Code Online (Sandbox Code Playgroud) 我有一个UITableViewController是另一个的详细视图UITableViewController.
在该表上是标有"日期"的单元格.使用Apple的"DateCell"示例(http://developer.apple.com/library/ios/#samplecode/DateCell/Introduction/Intro.html),我试图UIDatePicker在您触摸单元格时添加一个.
我完全按照示例的方式连接了所有内容.我改变的唯一一件事就是我didSelectRowAtIndexPath在这里编写了代码:
if(indexPath.section == 1 && indexPath.row == 0)
{
//Date picker stuff
}
Run Code Online (Sandbox Code Playgroud)
这是为了确保它仅在按下正确的单元格时运行.
对于我的生活,我无法让它发挥作用.单击它只会将其变为蓝色(已选中).反复点击它什么都不做.
如果我滚动到UITableView的底部,单击它会动画一个白色矩形.重复单击最终会覆盖整个表格视图.
这对我来说没有多大意义.请..我可以这样做吗?
如果你想要更多代码,我可以提供它,但它几乎与DateCell代码相同.我大部分都是复制/粘贴的.
提前致谢,
克里夫
在"只是为了好玩"下提交此文件,您将如何做到这一点:
currencyLabels = [[NSMutableArray alloc] initWithObjects:@"Canadian Dollars", @"Euros", @"British Pounds", @"U.S. Dollars", @"United Arab Emirates Dirhams", @"Afghanistan Afghanis", @"Albania Leke", @"Armenia Drams", @"Netherlands Antilles Guilders", @"Angola Kwanza", @"Argentina Pesos", @"Aruba Guilders/Florins", @"Azerbaijan Manats", @"Bosnia/Herzegovina Convertible Marka", @"Barbados Dollars", @"Bangladesh Taka", @"Bulgaria Leva", @"Bahrain Dinars", @"Burundi Francs", @"Bermuda Dollars", @"Brunei Darussalam Dollars", @"Bolivia Bolivianos", @"Brazil Brazil Real", @"Bahamas Dollars", @"Bhutan Ngultrum", @"Botswana Pulas", @"Belarus Rubles", @"Belize Dollars", @"Congo/Kinshasa Congolese Francs", @"Switzerland Francs", @"Chile Pesos", @"China Yuan Renminbi", @"Colombia Pesos", @"Costa Rica …Run Code Online (Sandbox Code Playgroud) 我有一个很好的对象,描述了一个相对较大的数据集.我决定在对象中实现一些辅助功能.
基本上,我不是使用NSString的标准setter,而是定义自己的setter并同时设置另一个对象.
例如:
-(void) setNumber:(NSString *)number_in
{
number = [number_in copy];
title = @"Invoice ";
title = [title stringByAppendingString:number];
}
Run Code Online (Sandbox Code Playgroud)
我知道我需要"标题"作为某种格式的财产.标题是基于数字的,所以我创建了一个setter来一键设置数字和标题.(标题有默认的合成setter ......我没有在其他地方定义它)
出于某种原因,我将消息发送到解除分配的实例错误.如果我删除这个setter,代码工作正常.
我的属性定义在这里:
@property (nonatomic, copy) NSString *number;
@property (nonatomic, copy) NSString *title;
Run Code Online (Sandbox Code Playgroud)
我试过保留,但没有用.我设置malloc堆栈日志并记录下来:
Alloc: Block address: 0x06054520 length: 32
Stack - pthread: 0xa003f540 number of frames: 30
0: 0x903ba1dc in malloc_zone_malloc
1: 0x102b80d in _CFRuntimeCreateInstance
2: 0x102d745 in __CFStringCreateImmutableFunnel3
3: 0x10824dd in _CFStringCreateWithBytesNoCopy
4: 0xae222e in -[NSPlaceholderString initWithCStringNoCopy:length:freeWhenDone:]
5: 0xaf9e8e in _NSNewStringByAppendingStrings
6: 0xaf9a76 in -[NSString stringByAppendingString:]
7: …Run Code Online (Sandbox Code Playgroud) iphone ×6
cocoa-touch ×5
objective-c ×5
uitableview ×2
c# ×1
gridview ×1
ios4 ×1
javascript ×1
jquery ×1
nsdate ×1
nsdictionary ×1
nsxmlparser ×1
odbc ×1
oracle ×1
salesforce ×1
setter ×1
sql ×1
uidatepicker ×1
uikit ×1
uiview ×1