走过海棠暮

文章 评论 浏览 25

走过海棠暮 2024-09-13 22:26:52

有什么东西不能与 CurrentDB.Collat​​ingOrder 一起使用吗?我不知道你在哪里查找结果数字的值,但在我的美国数据库中,它返回 1033,这是非常熟悉的美国英语字符集。

啊,是的,如果我进入 VBE 中的对象浏览器并搜索 Collat​​ingOrder,其中一个结果会显示一个名为 Collat​​ingOrderEnum 的 ENUM,通过依次单击每个,您可以看到它的值。

DBEngine(0)(0).Collat​​ingOrder 是相同的属性,并且可以与外部 Access 中的 DAO 一起使用。也许有一种方法可以使用 ADO/OLEDB 来获取它,但我不使用它们中的任何一个,因此无法为您指明正确的方向。

Is there something not working with CurrentDB.CollatingOrder? I don't know where you look up the value of the resulting number, but in my American DBs, it returns 1033, which is quite familiar as the American English character set.

Ah, yes, if I go into the Object Browser in the VBE and search for CollatingOrder, one of the results shows an ENUM called CollatingOrderEnum, and by clicking on each in turn, you can see its value.

DBEngine(0)(0).CollatingOrder is the same property, and can be used with DAO from outside Access. There is, perhaps, a way to get it with ADO/OLEDB, but I don't use either of them so can't point you in the right direction there.

如何找到 MS Access 数据库的字符编码?

走过海棠暮 2024-09-13 16:00:19

查看 JSDT wiki 页面,发现 Javascript 编辑器的语法检查和其他功能似乎并未内置到 JSP 编辑器中。我也有同样的抱怨。

http://wiki.eclipse.org/JSDT

请注意,并非所有 Javascript 编辑器扩展点都受支持然而。我假设这些扩展是必要的,以便将您想要的 Javascript 编辑器功能集成到 JSP 编辑器中。

Looking at the JSDT wiki page, it appears that syntax checking and other features of the Javascript editor are not built into the JSP editor. I have the same complaint.

http://wiki.eclipse.org/JSDT

Note that not all the Javascript editor extension points are supported yet. I am assuming these extensions are necessary in order to integrate the Javascript editor features you want into the JSP editor.

JSP 文件中的 Javascript 语法检查不起作用

走过海棠暮 2024-09-13 12:03:11

我认为这取决于用户访问包含图像的视图的频率。如果它太大并且需要花费大量时间来加载,我可以建议您一个解决方法:

您在内存中存储该图像的另一个小副本,当您需要加载大图像时,先显示小图像,然后再显示小图像。大图已加载,替换小图。所以,你可以节省内存,让用户减少在黑屏中的等待。

如果加载时间不长,访问也不频繁,你可以直接从内存中释放

I think it depends on how frequenly user will access the view that have the image. If it is too big and take a lot of time to load, I can suggest you a workaround:

You store another small copy of that image in memory, when you need to load the big image, show the small image first and then when the big image is loaded, replace the small one. So, you can save the memory and let the user less waiting in the blank screen

If it doesn't take time to load and is not frequently accessed, you can go ahead and release from the memory

iphone UITabBarController 问题

走过海棠暮 2024-09-13 11:38:10

== 假设表 ==

订单 (id、country_id、state_id)

订单产品 (id、order_id、product_id、价格)

== 查询 ==

总销售额:

SELECT country_id, state_id, SUM(price)
FROM orders_products op, orders o 
WHERE op.order_id = o.id 
GROUP BY country_id, state_id

平均销售额:

SELECT country_id, state_id, AVG(price) * COUNT(order_id) 
FROM orders_products op, orders o 
WHERE op.order_id = o.id 
GROUP BY country_id, state_id, order_id

每个州/国家/地区总销售额的百分比:

SELECT country_id, state_id, SUM(price) * 100 /
    (SELECT SUM(price) FROM orders_products op2) 
FROM orders_products op, orders o 
WHERE op.order_id = o.id 
GROUP BY country_id, state_id

== Assumed Tables ==

orders (id, country_id, state_id)

orders_products (id, order_id, product_id, price)

== Queries ==

Total sales:

SELECT country_id, state_id, SUM(price)
FROM orders_products op, orders o 
WHERE op.order_id = o.id 
GROUP BY country_id, state_id

Average Sale Amount:

SELECT country_id, state_id, AVG(price) * COUNT(order_id) 
FROM orders_products op, orders o 
WHERE op.order_id = o.id 
GROUP BY country_id, state_id, order_id

The % of total sales per state/country:

SELECT country_id, state_id, SUM(price) * 100 /
    (SELECT SUM(price) FROM orders_products op2) 
FROM orders_products op, orders o 
WHERE op.order_id = o.id 
GROUP BY country_id, state_id

MySQL 查询“按国家和州/省列出的销售报告”

走过海棠暮 2024-09-13 06:30:26

在 Ruby 中,块基本上是可以传递给任何方法并由任何方法执行的代码块。块始终与方法一起使用,方法通常向块提供数据(作为参数)。

块广泛用于 Ruby gem(包括 Rails)和编写良好的 Ruby 代码中。它们不是对象,因此不能分配给变量。

基本语法

块是由 { } 或 do..end 括起来的一段代码。按照约定,大括号语法应用于单行块,而 do..end 语法应用于多行块。

{ # This is a single line block }

do
  # This is a multi-line block
end 

任何方法都可以接收块作为隐式参数。块由方法内的yield 语句执行。基本语法是:

def meditate
  print "Today we will practice zazen"
  yield # This indicates the method is expecting a block
end 

# We are passing a block as an argument to the meditate method
meditate { print " for 40 minutes." }

Output:
Today we will practice zazen for 40 minutes.

当到达yield语句时,meditate方法将控制权交给块,​​执行块内的代码并将控制权返回给方法,该方法在yield语句之后立即恢复执行。

当一个方法包含yield语句时,它期望在调用时接收一个块。如果未提供块,则一旦到达yield 语句就会抛出异常。我们可以使该块可选并避免引发异常:

def meditate
  puts "Today we will practice zazen."
  yield if block_given? 
end meditate

Output:
Today we will practice zazen. 

不可能将多个块传递给一个方法。每种方法只能接收一个块。

查看更多信息:http://www.zenruby.info /2016/04/introduction-to-blocks-in-ruby.html

In Ruby, a block is basically a chunk of code that can be passed to and executed by any method. Blocks are always used with methods, which usually feed data to them (as arguments).

Blocks are widely used in Ruby gems (including Rails) and in well-written Ruby code. They are not objects, hence cannot be assigned to variables.

Basic Syntax

A block is a piece of code enclosed by { } or do..end. By convention, the curly brace syntax should be used for single-line blocks and the do..end syntax should be used for multi-line blocks.

{ # This is a single line block }

do
  # This is a multi-line block
end 

Any method can receive a block as an implicit argument. A block is executed by the yield statement within a method. The basic syntax is:

def meditate
  print "Today we will practice zazen"
  yield # This indicates the method is expecting a block
end 

# We are passing a block as an argument to the meditate method
meditate { print " for 40 minutes." }

Output:
Today we will practice zazen for 40 minutes.

When the yield statement is reached, the meditate method yields control to the block, the code within the block is executed and control is returned to the method, which resumes execution immediately following the yield statement.

When a method contains a yield statement, it is expecting to receive a block at calling time. If a block is not provided, an exception will be thrown once the yield statement is reached. We can make the block optional and avoid an exception from being raised:

def meditate
  puts "Today we will practice zazen."
  yield if block_given? 
end meditate

Output:
Today we will practice zazen. 

It is not possible to pass multiple blocks to a method. Each method can receive only one block.

See more at: http://www.zenruby.info/2016/04/introduction-to-blocks-in-ruby.html

Ruby 中的块和收益

走过海棠暮 2024-09-13 03:12:05

告诉你团队里的那个家伙,别再过早地优化头脑了! (但以一种很好的方式)。

像这样的开发人员可能会毒害团队,充满低级优化神话,所有这些都可能是真实的,或者对于某些特定供应商或查询模式在某个时间点是真实的,或者可能仅在理论上真实,但从未真实在实践中。根据这些神话采取行动是一种代价高昂的时间浪费,并且可能会破坏原本良好的设计。

他可能是出于好意,想为团队贡献自己的知识。不幸的是,他错了。就基准是否能证明他的陈述正确或错误而言,这并没有错。他错了,因为这不是设计数据库的方式。是否使字段可以为 NULL 的问题是一个关于数据域的问题,目的是为了定义字段的类型。应该根据该字段没有价值意味着什么来回答这个问题。

Tell that guy on your team to get his prematurely optimizin' head out of his ass! (But in a nice way).

Developers like that can be poison to the team, full of low-level optimization myths, all of which may be true or have been true at one point in time for some specific vendor or query pattern, or possibly only true in theory but never true in practice. Acting upon these myths is a costly waste of time, and can destroy an otherwise good design.

He probably means well and wants to contribute his knowledge to the team. Unfortunately, he is wrong. Not wrong in the sense of whether a benchmark will prove his statement correct or incorrect. He's wrong in the sense that this is not how you design a database. The question of whether to make a field NULL-able is a question about domain of the data for the purposes of defining the type of the field. It should be answered in terms of what it means for the field to have no value.

可空数据类型与非空 varchar 数据类型 - 哪个查询速度更快?

走过海棠暮 2024-09-12 17:45:35

图像视图应该有一个属性来保存图像数组,并且控制器应该将此属性设置为其图像数组。 (当然,图像视图应该创建自己的数组浅表副本。)

图像(路径)

假设您指的是路径名,图像不是路径,路径也不是图像。控制器应该加载图像并将图像传递到视图。视图不应该关心图像可能来自哪里。

The images view should have a property to hold an array of images, and the controller should set this property to its array of images. (The images view should, of course, make its own shallow copy of the array.)

images (paths)

Assuming you mean pathnames, images are not paths, and paths are not images. The controller should load the images and pass the images off to the view. The view should not care where the images might have come from.

Cocoa:如何将按钮连接到视图?

走过海棠暮 2024-09-12 15:59:18

您需要为可变的 data 使用不同的数据结构 - 您可以修改 final 变量,但不能分配给它。也许 java.util.Vector 或类似的东西可以满足您的需求。

You need to use a different data structure for data which is mutable - you can modify a final variable, but not assign to it. Perhaps a java.util.Vector or similar would suit your needs here.

引用内部类中的非最终变量数据

走过海棠暮 2024-09-12 12:10:20

我在 document.click 上解决这个误解的方法。

  1. 在标签正文下一个标签之后添加到 html

    <代码><正文>;

    ...

  2. 该标签的一些样式

    `#overlaySection {
      位置:固定;
      顶部:0;
      左:0;
      z 索引:1;
      宽度:100%;
      高度:100%;
      背景:rgba(255, 255, 255, 0);
      光标:指针;
      可见性:隐藏;
      不透明度:0;
      内容: ””;
    }
    #overlaySection.active {
     不透明度:1;
     可见性:可见;
    }`
    
  3. 一些 JQuery 人员

    // 在文档单击时隐藏覆盖
    $('#overlaySection').click(function(){
    $(this).removeClass('active');
    });

以及激活此叠加层的主要内容

$('.dropdown > span').click(function() {
    ...
    $('#overlaySection').addClass('active');
    ...
});

希望这种方法对某人有用。快乐编码!

My approach to solve this misunderstanding on document.click.

  1. Add into html after tag body next tag

    <body>
    <div id="overlaySection" onclick="void(0)"></div>
    ...
    </body>

  2. Some style for that tag

    `#overlaySection {
      position: fixed;
      top: 0;
      left: 0;
      z-index: 1;
      width: 100%;
      height: 100%;
      background: rgba(255, 255, 255, 0);
      cursor: pointer;
      visibility: hidden;
      opacity: 0;
      content: "";
    }
    #overlaySection.active {
     opacity: 1;
     visibility: visible;
    }`
    
  3. Some JQuery staff

    // hide overlay on document click
    $('#overlaySection').click(function(){
    $(this).removeClass('active');
    });

and the main thing to active this overlay

$('.dropdown > span').click(function() {
    ...
    $('#overlaySection').addClass('active');
    ...
});

Hope this approach will be useful to someone. Happy coding!

如何在 iPhone Web 应用程序中使用 jQuery 进行点击事件

走过海棠暮 2024-09-12 08:26:30

在我看来,就像大多数东西一样,它们是工具,有适当的用途,也有不适当的用途。强制转换可能是工具经常被不当使用的一个领域,例如,使用 reinterpret_castint 和指针类型之间进行强制转换(这可能会在同时使用这两种类型的平台上中断)大小不同),或者纯粹作为一种 hack 来 const_cast 消除常量性,等等。

如果您知道它们的用途和预期用途,那么按照它们的设计目的使用它们绝对没有问题。

IMO, like most things, they're tools, with appropriate uses and inappropriate ones. Casting is probably an area where the tools frequently get used inappropriately, for example, to cast between an int and pointer type with a reinterpret_cast (which can break on platforms where the two are different sizes), or to const_cast away constness purely as a hack, and so on.

If you know what they're for and the intended uses, there's absolutely nothing wrong with using them for what they were designed for.

是 C++显式转换真的那么糟糕吗?

走过海棠暮 2024-09-12 00:51:16
new function($) {
    $.fn.setCursorPosition = function(pos) {
        // function body omitted, not relevant to question

       // You are safe to always use $ here 
    }
} (jQuery);

jQuery.fn.setCursorPosition = function(pos) {
    // function body omitted, not relevant to question

    // you have to make sure $ was not overwritten before using it here..
}
new function($) {
    $.fn.setCursorPosition = function(pos) {
        // function body omitted, not relevant to question

       // You are safe to always use $ here 
    }
} (jQuery);

and

jQuery.fn.setCursorPosition = function(pos) {
    // function body omitted, not relevant to question

    // you have to make sure $ was not overwritten before using it here..
}

扩展 jQuery 的奇怪语法

走过海棠暮 2024-09-12 00:19:53

我会提出另一种观点,并说这是一个阴影问题。好的版本是使用 Gouraud 着色之类的东西来平滑事物。这是 YouTube 上的一个视频,用于说明效果OpenGL GLSL Gouraud Shading,所以我的第一个猜测是你需要打开阴影。

I will throw in another opinion, and say that it is a shading problem. The good version is using something like Gouraud shading to smooth things out. Here is a video off of YouTube to illustrate the effect OpenGL GLSL Gouraud Shading so my first guess is that you need to turn on shading.

高品质纹理

走过海棠暮 2024-09-11 19:58:08

在 JavaScript 中,不建议使用 for-in 循环遍历数组,但最好使用 for 循环,例如:

for(var i=0, len=myArray.length; i < len; i++){}

它也经过优化(“缓存”数组长度)。如果您想了解更多信息,阅读我关于该主题的帖子

In JavaScript it's not advisable to loop through an Array with a for-in loop, but it's better to use a for loop such as:

for(var i=0, len=myArray.length; i < len; i++){}

It's optimized as well ("caching" the array length). If you'd like to learn more, read my post on the subject.

在 JavaScript 中循环遍历数组

走过海棠暮 2024-09-11 17:22:59

这是无效的 XML,因此任何解析器都不应正确解析它。

但在现实世界中您确实会遇到这种手工制作的无效 XML。我的解决方案是手动将 CDATA 标记插入数据。例如,

  <data><![CDATA[ garbage with &invalid characters ]]></data>

当然,您将按原样取回数据,并且您必须自己处理无效字符。

This is invalid XML so no parser should parse it without error.

But you do encounter such hand-crafted invalid XML in real world. My solution is to manually insert CDATA markers to the data. For example,

  <data><![CDATA[ garbage with &invalid characters ]]></data>

Of course, you will get the data back as is and you have to deal with the invalid characters yourself.

如何告诉 Java SAX 解析器忽略无效字符引用?

走过海棠暮 2024-09-11 12:55:37

尝试使用 -pathForResource:ofType: 代替。

NSString* sourceFilePath = [[NSBundle mainBundle] pathForResource:file ofType:nil];

Try using -pathForResource:ofType: instead.

NSString* sourceFilePath = [[NSBundle mainBundle] pathForResource:file ofType:nil];

UIWebview 没有显示我希望它显示的内容

更多

推荐作者

lee_heart

文章 0 评论 0

huangxaiorui

文章 0 评论 0

ゞ记忆︶ㄣ

文章 0 评论 0

画离情绘悲伤

文章 0 评论 0

文章 0 评论 0

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