灯角

文章 0 评论 0 浏览 23

灯角 2024-11-21 01:14:21

您可以使用生成的行 ID 进行循环,并将颜色基于行 ID 的倍数。让我尝试快速输入一些内容。

You could do a loop with a generated row id, and base the colors on the multiple of the row Id.. let me try typing up something quickly.

jsTree 中不同级别的行使用不同的颜色

灯角 2024-11-20 23:14:16

我确实同意大卫的观点。 Visual Studio 旗舰版/高级版提供了真实数据库开发的完整功能,但 Visual Studio 2010 专业版有一个解决方法。步骤如下所述。

1-在 CommonDatabase 项目中创建一个空白文件“CommonDataPlatform.refactorlog”文件。

2-右键单击“CommonDataPlatform.refactorlog”文件,然后单击属性。将构建操作设置为“部署扩展配置”

3-现在在 IDE 中打开“CommonDataPlatform.refactorlog”并将其视为 xml 文档。在其中写入下面提到的 XML。我强调一个例子。

这里的 Email 是一个表,其中 EmailOldName 作为旧列名,现在我们尝试将 EmailOldColumn 重命名为 EmailAddress。

您可以为其他列名称更改添加许多操作节点。

注意:每个操作节点的密钥必须是唯一的。

希望它能对只有 VS-2010 专业版的开发人员有所帮助:)。

I do agree with David. Complete feature of real database development is available in Ultimate / premium edition of visual studio but there is a workaround for Visual Studio 2010 professional edition. Steps are mentioned below.

1-Create a blank file “CommonDataPlatform.refactorlog” file inside CommonDatabase project.

2-Right click on “CommonDataPlatform.refactorlog” file and click on properties. Set build action to “Deployment extension configuration”

3-Now open “CommonDataPlatform.refactorlog” in IDE and treat this as an xml document. Write below mentioned XML in it. I am highlighting one example.

Here Email is a table with EmailOldName as old column name and now we are trying to rename EmailOldColumn to EmailAddress.

You can add many Operation nodes for other column name changes.

Note: Key for each Operation node has to be unique.

Hope it will help developers having only VS-2010 Professional Edition as well :).

如何使用 Visual Studio 数据库项目重命名列?

灯角 2024-11-20 11:39:55

Till 是在正确的轨道上,但没有给出正确的语法。
代理用于从当前数据访问器加载集合,而不是创建新集合。所以代码将是:

public IEnumerable<Customer> FindCustomers(string partialCustomerName)
{
    if (string.IsNullOrEmpty(partialCustomerName)) 
      throw new ArgumentException("partialCustomerName must be at least one character long");

    var criteria = Criteria.Create<Customer, string>(cust =>   cust.CustomerName, Criteria.ComparisonOp.Like, partialCustomerName + "%");
    int totalRecords;
    var col = new BusinessObjectCollection<Customer>();
    col.LoadWithLimit(criteria, "CustomerName", 0, 20, ref totalRecords);
    return col;
}

应该可以了!
请将答案授予蒂尔,而不是我。他做了最多的研究。我刚刚更正了语法:)

编辑:
在下面关于丑陋的 API 的评论之后,我将包括对该方法的建议更改,以使其看起来更干净(感谢您的建议@GloryDe​​v):

public IEnumerable<Customer> FindCustomers(string partialCustomerName)
{
    if (string.IsNullOrEmpty(partialCustomerName)) 
      throw new ArgumentException("partialCustomerName must be at least one character long");
    var col = new BusinessObjectCollection<Customer>();
    col.LoadWithLimit("CustomerName Like " + partialCustomerName + "%", "CustomerName", 20);
    return col;
}

第二个参数是排序依据的字段,这对于有限制的获取是必要的任何意义。希望这有帮助。

Till is on the right track there, but did not give the correct syntax.
The broker is used to load collections from the current Data Accessor, not for creating new ones. So the code would then be:

public IEnumerable<Customer> FindCustomers(string partialCustomerName)
{
    if (string.IsNullOrEmpty(partialCustomerName)) 
      throw new ArgumentException("partialCustomerName must be at least one character long");

    var criteria = Criteria.Create<Customer, string>(cust =>   cust.CustomerName, Criteria.ComparisonOp.Like, partialCustomerName + "%");
    int totalRecords;
    var col = new BusinessObjectCollection<Customer>();
    col.LoadWithLimit(criteria, "CustomerName", 0, 20, ref totalRecords);
    return col;
}

That should do it!
Please award the answer to Till, not me. He did the most research. I just corrected the syntax :)

EDIT:
After comments below about the ugly API, I will include suggested changes to the method to make it look cleaner (Thanks for your suggestion @GloryDev):

public IEnumerable<Customer> FindCustomers(string partialCustomerName)
{
    if (string.IsNullOrEmpty(partialCustomerName)) 
      throw new ArgumentException("partialCustomerName must be at least one character long");
    var col = new BusinessObjectCollection<Customer>();
    col.LoadWithLimit("CustomerName Like " + partialCustomerName + "%", "CustomerName", 20);
    return col;
}

The Second parameter is the field to order by, which is necessary for a fetch with limits to make any sense. Hope this helps.

在 Habanero 中,我如何限制从数据库返回的对象数量

灯角 2024-11-20 11:36:56

您已经为 prioque * 完成了 typedef

void insert_prioque (prioque prioque_ref *queue, prioque_item item)
                         // ^ complaining about this space

所以,它应该是 -

void insert_prioque (prioque_ref queue, prioque_item item) { /* .... */ }

You have already done a typedef for prioque *

void insert_prioque (prioque prioque_ref *queue, prioque_item item)
                         // ^ complaining about this space

So, it should be -

void insert_prioque (prioque_ref queue, prioque_item item) { /* .... */ }

优先队列插入

灯角 2024-11-20 10:01:49
  1. 在Web2Py中,&|这里不是按位和/或,而是用来构建一个表示数据库查询的特殊对象!它们对应于 SQL 语句中的 ANDOR
  2. containsWeb2Pys DAL
  3. 请参阅 1.reduce
  4. 折叠,一个非常基本的高阶函数,本质上使用给定的函数将列表简化为结果。
  1. In Web2Py & and | are not bitwise and/or here, but are used to build a special object that represents a database query! They correspond to AND and OR in SQL statements
  2. contains is part of Web2Pys DAL
  3. See 1.
  4. reduce is fold, a very fundamental higher order function that essentially reduces a list to a result, using the function given.

Python-reduce 函数和 |操作员

灯角 2024-11-20 09:05:54
if(navigator.onLine){
 //enter code here
}
if(navigator.onLine){
 //enter code here
}

如何检查用户是否连接到互联网

灯角 2024-11-20 07:38:49

您可以使用 flatMap 来实现这一点。这是一个例子:

List(1,2,3,4,5).flatMap(x => if (x%2 == 1) Some(2*x) else None)

这相当于

List(1,2,3,4,5).filter(_%2==1).map(2*)

You can use flatMap for that. Here is an example:

List(1,2,3,4,5).flatMap(x => if (x%2 == 1) Some(2*x) else None)

This is equivalent to

List(1,2,3,4,5).filter(_%2==1).map(2*)

如何根据某种方法的结果收集集合中的元素?

灯角 2024-11-20 07:19:48

答案是:不。即,不会在已初始化的实例上调用 init,但将分配并初始化一个新实例。

这是由于 Three20 将对象关联到其完整 URL,在您的情况下是“tt://tabbar/string”或“tt://tabbar/somethingelse”,因此在查询 TTURLMap,不会找到已经存在的对象,并且将实例化一个新对象。至少,从 Three20 1.0.3 开始是这样。但我想他们并没有改变这一点。

在我看来,共享控制器机制适用于非常特殊的情况,例如设置视图,并且不应将其视为一种 Three20 实现的单例。每次我试图依靠它来更“聪明”地使用 TTURLMap 时,我发现自己又回到了非共享控制器。

The answer is : no. I.e., init will not be called on an already initialized instance, but a new instance will be allocated and initialized.

This is due to Three20 associating the object to its full URL, which in your case is either "tt://tabbar/string" or "tt://tabbar/somethingelse", so that when querying the TTURLMap, no already existing object will be found and a new one will be instantiated. At least, this is true as of Three20 1.0.3. But I guess they have not changed this.

In my opinion, the shared controller mechanism is to be used in very specific cases, like for a setting view, and it should not be thought as a sort of Three20-implemented singleton. Each time I tried to rely on this for more "clever" usage of the TTURLMap, I found myself going back to a non shared controller.

Three20 - 打开共享视图控制器的 url

灯角 2024-11-18 16:51:26

我知道这个问题已经得到解答,但我认为除了压缩之外,您还需要更多选择。

虽然 zip 很好,但它对 JPEG 影响不大,因为 JPEG 已经压缩了。

您可能需要考虑的其他事情是:

  1. 将图像放入内容分发网络(CDN)中,
  2. 使用 gzip 压缩组件(意味着服务器将自动压缩每个响应),并且您不需要编写任何代码来解压缩稍后 - 它由浏览器自动处理。
  3. 既然您提到了 JPEG,您可能想使用 JPEGTran。对所有 JPEG 运行 jpegtran。

    该工具可以执行无损 JPEG 操作,例如旋转,还可以用于优化和删除图像中的注释和其他无用信息(例如 EXIF 信息)。
    jpegtran -copy none -optimize -perfect src.jpg dest.jpg

  4. 使用图像精灵。不要要求浏览器同时下载多张图像,而是要求浏览器只下载一张。

有关详细信息,请阅读:http://developer.yahoo.com/performance/rules.html# opt_images

对于如何提高网站性能的基本检查,您可以尝试在 Firefox 中安装 YSlow(检测无效代码的插件)。

希望有帮助。

I know this question has already answered but I think you need more options other than zipping.

While zip is good, It's not really affect much for JPEG since JPEG has already compressed.

Other thing you may want to consider is :

  1. Put the image in Content Delivery Network (CDN)
  2. Compress components with gzip ( mean the server will automatically zip every response ) and you dont need to write any code to unzip it later - it's handled by the browser automatically.
  3. Since you mention JPEG, you may want to use JPEGTran.Run jpegtran on all your JPEGs.

    This tool does lossless JPEG operations such as rotation and can also be used to optimize and remove comments and other useless information (such as EXIF information) from your images.
    jpegtran -copy none -optimize -perfect src.jpg dest.jpg

  4. Use Image Sprites. Instead of asking browser to download many image at same time, ask the browser to only download one.

For the details read : http://developer.yahoo.com/performance/rules.html#opt_images

For the basic examination how to improve your website performance you can try install YSlow ( plugin to detect uneffecient code ) in Firefox.

Hope that helps.

存储大量小文件:存档与文件系统

灯角 2024-11-18 14:54:08

两行代码 AC 是相同的,执行路径在这两行之后合并(两种情况下要执行的下一行都是 return returnable_status 因此,

编译器正在执行尾部合并优化,对两个源代码行使用相同的汇编代码块。这种优化是预期的并且完全有效,并且不会引起问题。

The two lines of code A and C are identical, and the execution paths merge after those two lines (the next line to be executed in both cases is return returnable_status;.

Thus the compiler is performing tail-merging optimisation, using the same block of assembly code for both source code lines. This optimisation is expected and perfectly valid, and should not cause a problem.

当 IAR MSP430 编译器中的优化设置为高时,会发生指令的疯狂执行

灯角 2024-11-18 14:14:19

您可以使用的另一个解决方案是 SQL Developer。

有了它,您就可以从 csv 文件导入(也可以使用其他分隔文件)。

只需打开表视图,然后:

  • 选择操作
  • 导入数据
  • 查找您的文件
  • 选择您的选项。

您可以选择让 SQL Developer 为您执行插入操作、创建 SQL 插入脚本或为 SQL Loader 脚本创建数据(我自己还没有尝试过此选项)。

当然,如果您只能使用命令行,那么所有这些都是没有意义的,但是如果您能够在本地使用 SQL Developer 进行测试,那么您始终可以部署生成的插入脚本(例如)。

只是在这两个已经很好的答案中添加另一个选项。

Another solution you can use is SQL Developer.

With it, you have the ability to import from a csv file (other delimited files are available).

Just open the table view, then:

  • choose actions
  • import data
  • find your file
  • choose your options.

You have the option to have SQL Developer do the inserts for you, create an sql insert script, or create the data for a SQL Loader script (have not tried this option myself).

Of course all that is moot if you can only use the command line, but if you are able to test it with SQL Developer locally, you can always deploy the generated insert scripts (for example).

Just adding another option to the 2 already very good answers.

Oracle:导入 CSV 文件

灯角 2024-11-18 13:52:42

函数返回东西:这就是它们与过程的区别。因此,当我们执行它们时,我们需要为返回值提供一个容器:

在 SQL*Plus 中,这将是

SQL>   var whatever varchar2(30)
SQL>   exec :whatever := calculateaward('P0001')

顺便说一句,当您的函数执行结果为 COUNT 的查询时,返回值应该具有 NUMBER 数据类型,而不是比 VARCHAR2。

Functions return things: that's what distinguishes them from procedures. So when we execute them we need to provide a receptacle for the returned value:

In SQL*Plus that would be

SQL>   var whatever varchar2(30)
SQL>   exec :whatever := calculateaward('P0001')

By the way, as your function executes a query whose resulot is a COUNT, the returned value ought to have a datatype of NUMBER rather than VARCHAR2.

我在 Oracle 中执行此存储函数时遇到错误

灯角 2024-11-18 13:25:34

耗时最长的一个大型库是 webkit。如果您不需要 webkit,则可以通过

-no-webkit

,并且构建时间应该会显着缩短。相比之下,大多数其他标志(例如 -nomake demos、-nomake 示例,请参阅 rubenvb 的答案)都是微优化。

The one big library taking the longest is webkit. If you don't need webkit, you can pass

-no-webkit

and the build time should go down significantly. Most other flags (like -nomake demos, -nomake examples, see rubenvb's answer) are microoptimization in comparison.

如何缩短Qt make过程?

灯角 2024-11-18 07:47:41

string 类有一个方法 substr() 在这里很有用:

// Substring consisting of 1 character starting at 0-based index 4
string u = test.substr(4, 1); 

这可以很好地推广到任意长度的子字符串。

The string class has a method substr() that would be useful here:

// Substring consisting of 1 character starting at 0-based index 4
string u = test.substr(4, 1); 

This generalizes nicely to substrings of any length.

C++将字符串的元素分配给新字符串

灯角 2024-11-18 03:04:38

您必须按 shift + enter 才能正常工作。

You have to press shift + enter for it to work.

当使用输入功能“scanf”时在 Xcode 4 的调试控制台中

更多

推荐作者

浪漫人生路

文章 0 评论 0

620vip

文章 0 评论 0

羞稚

文章 0 评论 0

走过海棠暮

文章 0 评论 0

你好刘可爱

文章 0 评论 0

陌若浮生

文章 0 评论 0

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文