问题列表 - 第47331页

果园CMS表现

我已经开始在我的一个网站上玩Orchard CMS,并注意到我的主页的初始加载时间相当长.我没有添加太多内容,所以我所看到的是非常接近开箱即用的体验.我怀疑这在某种程度上与在我的共享主机上使用Sql server compact有关,但还不知道有什么内容可以确定这一点.我正在寻找可以检查可能是Orchard加载时间性能瓶颈的事情的建议.

我的下一个计划是将我的网站指向一个非紧凑的SQL服务器,以查看性能是否有所改善,但我很感激任何其他我可以检查的建议.

.net asp.net asp.net-mvc orchardcms asp.net-mvc-3

9
推荐指数
1
解决办法
7390
查看次数

如何在C中编译C程序?

我在c中创建一个可以生成另一个c代码的程序.

如何使用第一个程序在第二个程序生成后立即编译并运行第二个程序?

c

0
推荐指数
1
解决办法
170
查看次数

如何在C中使用calloc()?

如果我的字符串在此程序中超过9个字符,我不应该收到错误吗?

// CString.c
// 2.22.11

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

main()
{
    char *aString = calloc(10, sizeof(char));

    if (aString == NULL)
    {
        return 1;
    }

    printf("PLEASE ENTER A WORD: ");
    scanf("%s", aString);

    printf("YOU TYPED IN: %s\n", aString);
    //printf("STRING LENGTH: %i\n", strlen(aString));
}
Run Code Online (Sandbox Code Playgroud)

谢谢

blargman

c string gcc strlen calloc

3
推荐指数
1
解决办法
9880
查看次数

在Predicate Statement和Float之间使用时崩溃

所以我在我的核心数据中搜索当前地图经度和纬度内的项目.每次我运行声明它都会崩溃.

代码:

    NSError *error = nil;
    NSFetchRequest *boutiqueRequest = [[NSFetchRequest alloc] init];
    NSPredicate *predicateToRun = nil;

    [boutiqueRequest setEntity:[NSEntityDescription entityForName:@"Boutique" inManagedObjectContext:managedObjectContext]];

NSLog(@"NE Longitude: %f", [neCoordLong floatValue]);
NSLog(@"NE Latitude: %f", [neCoordLat floatValue]);
    NSLog(@"SW Longitude: %f", [swCoordLong floatValue]);
    NSLog(@"SW Latitude: %f", [swCoordLat floatValue]);
    NSPredicate *longPredicate = [NSPredicate predicateWithFormat: @"longitude BETWEEN %@", [NSArray arrayWithObjects:neCoordLong, swCoordLong, nil]];
    NSPredicate *latPredicate = [NSPredicate predicateWithFormat: @"latitude BETWEEN %@", [NSArray arrayWithObjects:neCoordLat, swCoordLat, nil]];
    predicateToRun = [NSCompoundPredicate andPredicateWithSubpredicates:[NSArray arrayWithObjects:longPredicate, latPredicate, nil]];

    [boutiqueRequest setPredicate:predicateToRun];
    NSLog(@"%@", [boutiqueRequest predicate]);
    NSArray *results = [managedObjectContext …
Run Code Online (Sandbox Code Playgroud)

iphone floating-point predicate core-data

2
推荐指数
1
解决办法
1484
查看次数

用户单击文本字段时显示弹出窗口?

嗨,我一直在关注如何在用户点击工具栏按钮项时显示弹出窗口的书.它工作正常但我想在用户点击textField时显示popover.这似乎是一些微小的调整.就像改变IBAction"showPopover"方法一样.这是该方法的代码:

- (IBAction)showPopover:(id)sender{

    if(popoverController == nil){   //make sure popover isn't displayed more than once in the view
        popoverController = [[UIPopoverController alloc]initWithContentViewController:popoverDetailContent]; 

    [popoverController presentPopoverFromBarButtonItem:sender permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
    popoverController.delegate = self;
    }
}
Run Code Online (Sandbox Code Playgroud)

除了"presentPopoverFromBarItem"之外还有另一个实例方法叫做"presentPopoverFromRect".我会用它吗?我试着为它编写代码,但我不确定如何将它与我的TextField相关联或如何绘制需要的矩形.任何人都可以帮我这个吗?谢谢.

cocoa-touch objective-c uitextfield uipopovercontroller

4
推荐指数
2
解决办法
2万
查看次数

Windows平台安装程序(WPI)将下载的文件保存在计算机中的哪个位置?

我有一个网络,一个服务器连接到互联网,一些客户端没有.我想首先在我的服务器上下载并安装Microsoft产品,然后让客户端计算机从服务器下载安装程序.

问题是

  1. WPI在哪里保存下载的文件?
  2. 是否可以运行WPI并强制它从已下载的文件安装Microsoft产品,而不是从Microsoft的服务器再次下载.

注意:假设没有许可证问题,希望:-)

web-platform-installer

22
推荐指数
2
解决办法
2万
查看次数

外部排序

在这个网页中:

http://web.eecs.utk.edu/~huangj/CS302S04/notes/external-sorting2.html

将生成的运行合并为连续更大的运行,直到文件排序.

正如我引用的那样,我们如何将产生的运行合并在一起??? 我们没有那么多记忆.

sorting algorithm

13
推荐指数
1
解决办法
1万
查看次数

如何验证JSON对象?

我想验证传入的json对象在服务器端的正确性.有没有标准/最佳方式来做到这一点?你的验证方法是什么?

java validation json

3
推荐指数
1
解决办法
7862
查看次数

创建数据库后没有调用oncreate!

我正在使用帮助器创建一个新的数据库,但是根据创建的文档应该在创建数据库时调用,但是它没有被正确调用.任何PLZ都可以帮我解决这个问题.Plz见下面的代码.

1)有没有办法创建数据库而不是使用帮助器,如果是这样plz建议我!2)在数据库创建中以及杀死数据库时将调用哪些回调?

OpenHelper(Context context) 
  {

     super(context, "examplee.db", null, 1 );
     SQLiteDatabase sqlite = null;       
      Log.w(TAG, "Openhelp database, ");
      sqlite =  context.openOrCreateDatabase("examplee.db", Context.MODE_PRIVATE, null );
      Log.e ( TAG,"SQ lite database object "+sqlite );                
  }

 public void onOpen(SQLiteDatabase db)
 {
     Log.e ( TAG,"On open called ");
 }


  @Override
  public void onCreate(SQLiteDatabase db) 
  {
      Log.w(TAG, " On create ");
      //db.execSQL(sql);
     //db.execSQL("CREATE TABLE " + TABLE_NAME + "(id INTEGER PRIMARY KEY, name TEXT)");
  }

  @Override
  public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) 
  { …
Run Code Online (Sandbox Code Playgroud)

android

3
推荐指数
1
解决办法
3924
查看次数

findViewByID(R.layout.skeleton_activity)返回null

我想在骨架应用程序的OnCreate()中注册一个上下文菜单:

/** Called with the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // Inflate our UI from its XML layout description.
    setContentView(R.layout.skeleton_activity);

    View v = findViewById(R.layout.skeleton_activity);
    registerForContextMenu(v);      

    // Find the text editor view inside the layout, because we
    // want to do various programmatic things with it.
    mEditor = (EditText) findViewById(R.id.editor);

    // Hook up button presses to the appropriate event handler.
    ((Button) findViewById(R.id.back)).setOnClickListener(mBackListener);
    ((Button) findViewById(R.id.clear)).setOnClickListener(mClearListener);

    mEditor.setText(getText(R.string.main_label));
}
Run Code Online (Sandbox Code Playgroud)

调试器告诉我findViewById(R.layout.skeleton_activity)返回null.

@CommonsWare对类似帖子的解决方案是等到onFinishInflate().但是,在他提供的示例项目中,他似乎并不等到onFinishInflate.

我的问题:

  1. registerForContextMenu()可以等到onFinishInflate()吗? …

android

2
推荐指数
1
解决办法
7491
查看次数