问题列表 - 第47017页

如何循环应用程序内存?

我编写了自己的C#应用​​程序,其中包含int(int intfoo = 1234;)和string(string stringfoo = "This is a test string";).

现在我正在研究一个应该循环并找到这些值的内存阅读器.

我如何循环,起点是什么,端点是什么?我读过的地方开始是0x00100000,其他地方是0x00400000.对于我使用7372 kB的小应用程序,最终会是什么?

最后,我如何循环找到我intfoostringfoo

c#

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

Cocos2D禁用CCMenu

我是Cocos2d的新手.我将创建一个具有菜单(CClayer)的示例游戏,其中每个菜单项将CClayer作为子菜单添加到菜单层.现在我将设置图层作为子图层添加到菜单图层.当我选择设置图层时,菜单图层中检测到的触摸不在设置图层中.如何在菜单层中禁用CCMenu.

菜单层:包含CCMenu; 设置图层:其中也包含CCMenu;

帮我,

cocos2d-iphone

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

如何在JTable单元格中使用JLists?

我想要一个简单的方法将JList放在JTable的列中.我已经有了JLists和表,但是当放入表中时,Jlists显示为Strings,这是正常的,因为我使用DefaultTableModel.我已经将getColumnClass()重写为:

public Class<? extends Object> getColumnClass(int c)
{
    return getValueAt(0, c).getClass();
}
Run Code Online (Sandbox Code Playgroud)

但这只是格式化整数和浮点值.

我想也应该覆盖setValueAt()getValueAt(),以便在调用JList.getSelectedValues()时返回字符串数组,但我无法弄清楚如何.
我还希望单元格可以编辑,因此用户可以从JList中选择一个或多个选项.编辑一行后,我使用Save按钮将更改保存在数据库中,所以我认为我不需要ListSelectionListener,JList.getSelectedValues()可以正常工作.

我知道这是一个常见问题,但我在这里找不到答案.如果这是重复,请告诉我,我将删除它.

java swing jtable jlist

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

如何在Silverlight中使TextBlock的文本变为粗体?

我正在用C#开发window phone 7应用程序.我是窗口手机7应用程序的新手.我也是银光的新手.我想动态生成Texblock的粗体文本.我想仅为文本的某些部分生成粗体文本.我使用以下代码

IncometextBlock.Text = "Income entries on " + selectedDate.ToShortDateString() + "        Page - "+SelectedButtonName+"";
Run Code Online (Sandbox Code Playgroud)

我希望输出为

" 2011121日收入条目页面 - A "

我想要上面的输出.如何制作上述要求的粗体文字?能否请您提供我可以解决上述问题的任何代码或链接.如果我做错了什么,请指导我.

silverlight textblock dynamic-data windows-phone-7

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

PHP如何检索此值?

我有一种情况需要获取变量的值,其中变量的名称od在第二个变量的字符串中传递.

例如

$abc = 'the value I want';

$def = 'abc';
Run Code Online (Sandbox Code Playgroud)

$ def是我唯一可以访问的变量名称.在这种情况下,我如何获得$ abc的值.

干杯

php variables

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

以编程方式更改动画的UISwitch状态

我有一个UITableView,其中包含一些包含UISwitches的单元格:

UISwitch* actSwitch = (UISwitch*)[cell viewWithTag: SWITCH_TAG];
[actSwitch addTarget: self
              action: @selector(actSwitchChanged:) 
    forControlEvents: UIControlEventValueChanged];
BOOL value = [appSettings.lock_when_inactive boolValue];
[actSwitch setOn: value animated:NO];
Run Code Online (Sandbox Code Playgroud)

我还想覆盖didSelectRowAtIndexPath:方法来执行相应UISwitch的切换:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

    NSString *cellType = [self typeOfCellForIndexPath:indexPath];
    if ( cellType  == @"CellWithSwitch" )
    {
        UISwitch* actSwitch = (UISwitch*)[[[self tableView] cellForRowAtIndexPath:indexPath ] viewWithTag: SWITCH_TAG];
        BOOL value = [actSwitch isOn];
        [actSwitch setOn:!value animated:YES]; // <-- HERE IS THE PROBLEM
        [self actSwitchChanged: actSwitch];
    }
    else if ( cellType == @"CellWithoutSwitch" )
    {
        // …
Run Code Online (Sandbox Code Playgroud)

iphone animation objective-c uikit uiswitch

5
推荐指数
1
解决办法
9371
查看次数

在zend中保存自定义自动加载器的位置?

我试图通过制作自定义自动加载器在我的应用程序中使用phpThumb.

class My_Loader_Autoloader_PhpThumb implements Zend_Loader_Autoloader_Interface {

   static protected $php_thumb_classes = array(
      'PhpThumb'        => 'PhpThumb.inc.php',
      'ThumbBase'       => 'ThumbBase.inc.php',
      'PhpThumbFactory' => 'ThumbLib.inc.php',
      'GdThumb'         => 'GdThumb.inc.php',
      'GdReflectionLib' => 'thumb_plugins/gd_reflection.inc.php',
   );

  /**
   * Autoload a class
   *
   * @param   string $class
   * @return  mixed
   *          False [if unable to load $class]
   *          get_class($class) [if $class is successfully loaded]
   */
   public function autoload($class) {
      $file = APPLICATION_PATH . '/../library/PhpThumb/' . self::$php_thumb_classes[$class];
      if (is_file($file)) {
         require_once($file);
         return $class;
      }
      return false;
   }
}
Run Code Online (Sandbox Code Playgroud)

我 …

php oop model-view-controller zend-framework

5
推荐指数
1
解决办法
1671
查看次数

关于安装eclipse插件的问题

有一天,我遇到了这个问题:Eclipse的Bash脚本插件?,这个想法很棒.

所以我去了下载网站下载了这个插件,但我没有手动安装任何eclipse插件,所以我真的不知道如何安装一个.

我解压缩了我下载的这个zip文件,它看起来像这样:

在此输入图像描述

接下来我该怎么办,如何安装此插件?谢谢

当我尝试使用从本地目录安装新软件安装它时,我收到此错误:

Cannot complete the install because one or more required items could not be found.
  Software being installed: ShellEd 2.0.0.201007201532-1--773533H735D97 (net.sourceforge.shelled.feature.group 2.0.0.201007201532-1--773533H735D97)
  Missing requirement: ShellEd UI 0.0.0.201007201532 (net.sourceforge.shelled.ui 0.0.0.201007201532) requires 'bundle org.eclipse.dltk.launching [2.0.0,3.0.0)' but it could not be found
  Cannot satisfy dependency:
    From: ShellEd 2.0.0.201007201532-1--773533H735D97 (net.sourceforge.shelled.feature.group 2.0.0.201007201532-1--773533H735D97)
    To: net.sourceforge.shelled.ui [0.0.0.201007201532]
Run Code Online (Sandbox Code Playgroud)

问题2:

Cannot complete the install because one or more required items could not be found.
  Software being installed: ShellEd 2.0.0.201007201532-1--773533H735D97 (net.sourceforge.shelled.feature.group 2.0.0.201007201532-1--773533H735D97)
  Missing requirement: …
Run Code Online (Sandbox Code Playgroud)

java eclipse eclipse-plugin

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

将UTF8输入从JSP表单传输到Spring控制器会破坏变音符号

可能重复:
UTF-8编码和http参数

我有一个带有纯UTF8标头的UTF8编码的JSP(文本文件也编码为UTF-8)和该页面内的表单:

<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8"  pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> </head>
<body>
This is a funny German character: ß
<form action="utf.do" method="post">
<input type="text" name="p" value="${p}" />
<input type="submit" value="OK"/>
</form>
Run Code Online (Sandbox Code Playgroud)

然后我在后端有一个很好的Spring支持的@Controller:

@Controller
public class UTFCtl {
@RequestMapping("/utf.do")
public ModelAndView handleUTF(@RequestParam(value="p", required=false) String anUTFString) {
    ModelAndView ret = new ModelAndView("utf");
    ret.addObject("p", anUTFString);
    return ret;
     }
 }
Run Code Online (Sandbox Code Playgroud)

如您所见,表单通过POST传输其数据.在表单字段中键入一些德语变音符会在后端产生一堆破碎的字符.因此hähöhü,在提交后,在表单字段上提交会产生hähöhü值.我使用了调试器并且var值已经被加扰,这意味着Spring/Tomcat/Servlet没有正确检测到编码,或者浏览器没有正确编码我的输入.同事们对此的通常回应是:在ISO中对德国进行编码或在传输之前使用Javascript进行编码.这不应该是必要的,不是吗?我的意思是,这是2011年,这就是UTF8的优点! …

html java jsp spring-mvc utf-8

5
推荐指数
1
解决办法
9739
查看次数

在UITableView moveRowAtIndexPath方法期间崩溃

我有一系列字符串,我已经在我的uitableview中显示了.

当我的uitableview启用了编辑时,我正在尝试将一个字符串从第4行移动到第3行,当我调试此代码时,我在代码的索引部分插入对象中获得EXC_BAD_ACCESS.

[myStringsArray insertObject:name atIndex:toIndexPath.row]; 
Run Code Online (Sandbox Code Playgroud)

但是,如果我不调试,只是构建和运行,我打印以下行,然后它崩溃而没有在我的控制台中看到EXC_BAD_ACCESS.

NSLog(@"re-ordered myStringsArray array");
Run Code Online (Sandbox Code Playgroud)

这是我的moveRowAtIndexPath方法的所有代码:

// Override to support rearranging the table view.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
    NSArray *paths = NSSearchPathForDirectoriesInDomains( NSDocumentDirectory, NSUserDomainMask, YES); 
    NSString *documentsDirectoryPath = [paths objectAtIndex:0]; 
    NSString *path = [documentsDirectoryPath stringByAppendingPathComponent:@"MyStrings.plist"]; 

    //re-order array
    NSString *name = [myStringsArray objectAtIndex:fromIndexPath.row];
    [myStringsArray removeObjectAtIndex:fromIndexPath.row];
    [myStringsArray insertObject:name atIndex:toIndexPath.row];

    NSLog(@"re-ordered myStringsArray array");
    if([myStringsArray writeToFile:path atomically: YES]){NSLog(@"write succesful");}
    else {NSLog(@"write failed");}

    [myTable reloadData];
}
Run Code Online (Sandbox Code Playgroud)

任何想法为什么它认为我试图访问不存在的东西?

纠正我,如果我错了,但我的可变数组已经分配,​​如果删除方法有效,为什么插入方法不起作用?

谢谢

iphone crash uitableview nsmutablearray ios4

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