问题列表 - 第43143页

VisualStudio中的Windows GUI应用程序

在VS 2010中使用GUI编写(希望本机)C++应用程序的有效方法是什么?

我记得大约10年前我使用过MFC,今天有什么重大变化吗?

c++ windows user-interface visual-studio-2010

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

删除CSS圆角晕的最佳方法是什么?

我得到了一个小圆角光环效果,我想摆脱它.在此示例中,查找红色圆圈中的效果.这是效果的放大:

替代文字

我似乎记得有一段时间回来读一篇关于这个问题的文章.有人有这篇文章的链接吗?否则,任何摆脱光环的好方法?

这是因为dl所有四个角都是圆形的.这允许dl圆形的底部.该dt坐在过dl,并拥有top lefttop right边角圆润.但是dl曲线后面的dt曲线略微溢出,导致光环.

我的解决方案是增加边界半径dl,使其隐藏在dt角落后面.但它似乎是一个黑客,并增加了相当多的CSS.我想知道是否有更好的解决方案.这里没有光环:

替代文字

css rounded-corners css3

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

MySQL LAST_INSERT_ID()与多个记录INSERT语句一起使用

如果我使用一个执行单个记录插入的循环插入多个记录,则返回的最后一个插入ID是预期的最后一个.但是,如果我执行多个记录插入语句:

INSERT INTO people (name,age)
VALUES ('William',25), ('Bart',15), ('Mary',12);
Run Code Online (Sandbox Code Playgroud)

假设上面三个是表中插入的第一个记录.在insert语句之后我期望最后一个插入id返回3,但它返回1.有问题的语句的第一个插入id.

那么有人可以确认这是否是LAST_INSERT_ID()多个记录INSERT语句的上下文中的正常行为.所以我可以将我的代码基于它.

mysql insert lastinsertid

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

Delphi - 读取文件到StringList,然后删除并写回文件

我目前正在开发一个程序来生成Delphi 2010中的文件哈希.作为其中的一部分,我可以选择创建用户预设,例如用户可以创建/保存/删除的哈希算法的预定义选择.我有创建和加载代码正常工作.它使用ComboBox并从文件"fhpre.ini"加载,在此文件中是用户预设,格式为: -

PresetName
PresetCode(12位数字符串,使用0表示不散列,1表示do)

在应用程序加载时,它会将此文件中的数据加载到ComboBox和一个数组中,其中ComboBox的ItemIndex与数组中0和1的相应正确字符串相匹配.

现在我需要实现一项功能,让用户从列表中删除预设.到目前为止,我的代码如下,

procedure TForm1.Panel23Click(Sender : TObject);

var
fil : textfile;
contents : TStringList;
x,i : integer;
filline : ansistring;
filestream : TFileStream;

begin //Start Procedure

//Load data into StringList
contents := TStringList.Create;
fileStream := TFileStream.Create((GetAppData+'\RFA\fhpre.ini'), fmShareDenyNone);
Contents.LoadFromStream(fileStream);
fileStream.Destroy();

//Search for relevant Preset
i := 0;
if ComboBox4.Text <> Contents[i] then
begin
Repeat
i := i + 1;
Until ComboBox4.Text = Contents[i];
end;

contents.Delete(i); //Delete Relevant Preset Name
contents.Delete(i); //Delete Preset Digit String

//Write StringList back …
Run Code Online (Sandbox Code Playgroud)

delphi file tstringlist

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

Google App Engine应用程序错误5

我经常收到此应用程序错误.这是什么意思 ?

File "/base/data/home/apps/0xxopdp/10.347467753731922836/matrices.py", line 215, in insert_into_db
    obj.put()
  File "/base/python_runtime/python_lib/versions/1/google/appengine/ext/db/__init__.py", line 895, in put
    return datastore.Put(self._entity, config=config)
  File "/base/python_runtime/python_lib/versions/1/google/appengine/api/datastore.py", line 404, in Put
    return _GetConnection().async_put(config, entities, extra_hook).get_result()
  File "/base/python_runtime/python_lib/versions/1/google/appengine/datastore/datastore_rpc.py", line 601, in get_result
    self.check_success()
  File "/base/python_runtime/python_lib/versions/1/google/appengine/datastore/datastore_rpc.py", line 572, in check_success
    rpc.check_success()
  File "/base/python_runtime/python_lib/versions/1/google/appengine/api/apiproxy_stub_map.py", line 502, in check_success
    self.__rpc.CheckSuccess()
  File "/base/python_runtime/python_lib/versions/1/google/appengine/api/apiproxy_rpc.py", line 126, in CheckSuccess
    raise self.exception
ApplicationError: ApplicationError: 5
Run Code Online (Sandbox Code Playgroud)

我确实多次调用数据存储区.是什么导致了这个问题

google-app-engine

7
推荐指数
1
解决办法
1874
查看次数

为什么ASP.NET MVC不使用通用操作方法?

一般问题,当我开始实现ASP.NET MVC时,我发现自己要求,通过框架避免装箱和拆箱(查看"View"的签名),为什么他们不会简单地使用通用方法进行操作?也许他们"应该"但他们没有,但也许有人知道一个很好的理由.

提前致谢!

对不起,一个例子就是这样......

Edit(int id)
{
  ...
  if(...)
    View<Contact>("Edit");
  else
    View<ShoppingCart>("Cart");
}
Run Code Online (Sandbox Code Playgroud)

编辑 更新示例以更准确地反映我的问题

asp.net-mvc

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

删除默认选择行Datagrid视图

DataGridView默认情况下,选择并突出显示一行.如何删除此默认选择和突出显示?

datagrid

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

下面的TextView在同一行上的EditText和Button?

我试图在EditTexta旁边有一个小部件Button,也有一个TextView底部.本EditText应该调整,并相应地填满屏幕,而按钮的宽度应该永远只有它所需要的是(我通过设置宽度这样做wrap_content).

我想要完成的布局应该是相对的.下面是我到目前为止的代码(其中一些在StackOverflow上找到).删除TextView为EditText和Button提供了所需的外观,但是当添加TextView时,视图非常糟糕.

任何见解都会有帮助!

<?xml version="1.0" encoding="utf-8"?>
  <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
                android:layout_height="wrap_content" 
                android:orientation="horizontal"
                android:layout_width="fill_parent"
  >
    <EditText android:text="@+id/EditText01" 
              android:id="@+id/EditText01"
              android:layout_height="wrap_content" 
              android:layout_weight="1"
              android:layout_width="fill_parent"
    />

    <Button android:text="@+id/Button01" 
            android:id="@+id/Button01"
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content"
    />

    <TextView android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:text="@string/hello"
    />

</LinearLayout>
Run Code Online (Sandbox Code Playgroud)

android android-layout

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

扩展方法返回使用泛型

是否可以使用扩展方法返回泛型类型?

例如,我有以下方法:

// Convenience method to obtain a field within a row (as a double type) 
public static double GetDouble(this DataRow row, string field) {
    if (row != null && row.Table.Columns.Contains(field))
    {
        object value = row[field];
        if (value != null && value != DBNull.Value)
            return Convert.ToDouble(value);
    }
    return 0;
}
Run Code Online (Sandbox Code Playgroud)

目前使用如下:

double value = row.GetDouble("tangible-equity");
Run Code Online (Sandbox Code Playgroud)

但我想使用以下代码:

double value = row.Get<double>("tangible-equity");
Run Code Online (Sandbox Code Playgroud)

这是可能的,如果是这样,该方法会是什么样的?

c# generics extension-methods

8
推荐指数
1
解决办法
3422
查看次数

如何将CDN加速技术应用于图标?

通常的做法是使用CDN缓存javascript,css,font等等...但是这似乎并没有扩展到图标到相同的程度(可能因为每个网站都喜欢具有独特的外观和感觉?)

是否有广泛使用的CDN托管的图标集,这些图标集通常足以从CDN托管中提供显着的速度提升,并且可能已经使用该CDN从另一个站点预先缓存.

一个例子是:http: //cdnjs.cloudflare.com,其内容可浏览https://github.com/cdnjs/cdnjs/tree/master

它主机所在的一些图标集:

/ajax/libs/twitter-bootstrap/2.3.2/img/glyphicons-halflings.png
/ajax/libs/fatcow-icons/...
/ajax/libs/foundicons/3.0.0/svgs/...
/ajax/libs/aui/5.4.0/aui/css/icons/...
/ajax/libs/topcoat-icons/0.2.0/svg/...
/ajax/libs/jqueryui/1.10.3/css/base/images/...
*jqueryui is also hosted on ajax.googleapis.com and others but is a limited set
Run Code Online (Sandbox Code Playgroud)

和bootstrap halflings图标集一样:

http://netdna.bootstrapcdn.com/bootswatch/2.3.2/img/glyphicons-halflings.png
http://ajax.aspnetcdn.com/ajax/bootstrap/2.3.2/img/glyphicons-halflings.png
http://www.bootstrapcdn.com/twitter-bootstrap/2.3.1/img/glyphicons-halflings.png
Run Code Online (Sandbox Code Playgroud)

performance icons cdn css-sprites

16
推荐指数
3
解决办法
5315
查看次数