走过海棠暮

文章 评论 浏览 25

走过海棠暮 2024-08-16 22:39:40

在不知道您的数据是什么格式的情况下,我只能建议您查看 tapply 函数。来自帮助:

> n <- 17; fac <- factor(rep(1:3, length = n), levels = 1:5)
> tapply(1:n, fac, sum)
 1  2  3  4  5 
51 57 45 NA NA 

Without knowing what format your data is in, I can only suggest you look at the tapply function. From the help:

> n <- 17; fac <- factor(rep(1:3, length = n), levels = 1:5)
> tapply(1:n, fac, sum)
 1  2  3  4  5 
51 57 45 NA NA 

按分类变量求和

走过海棠暮 2024-08-16 22:11:58

我会将您的工作副本恢复到修订版 9,在本地进行更改(手动或使用 diff),然后提交。然后,工作副本应为修订版 11,并且您的两项更改均已到位。

I would revert your working copy to revision 9, make your changes locally (manually of with diff), then commit. The working copy should then be at revision 11 with both of your changes in place.

提交到以前的版本

走过海棠暮 2024-08-16 20:43:22

您基本上是通过编辑自己回答的,但更优雅的东西会更好。即不要先将它们全部删除,只需确定哪些需要添加,哪些需要删除,哪些需要保留。

例如(空中代码)

List<string> selectedSubscriptions; //This is passed in from the form using the model binder
List<string> mailingListsToRemove = GetCurrentMailingLists(); //Looks odd but bear with me
List<string> mailingListsToAdd = new List<string>();

//Loop through all the mailing lists they had selected
foreach (string selectedMailingList in selectedSubscriptions)
{
    //if the mailing list exists in the list to remove, remove it from that list
    //because they obviously don't want it removed
    //Remember that this list also contains their current lists.
    if (mailingListsToRemove.Contains(selectedMailingList))
    {
        mailingListsToRemove.Remove(selectedMailingList);
    }
    else //If it's not in the list to remove then add it
    {
        mailingListsToAdd.Add(selectedMailingList);
    }
}

因此,在该循环结束时,您应该有两个列表 - 一个包含用户想要删除的所有邮件列表,另一个包含他们想要订阅的所有新邮件列表。他们已经订阅并且仍然希望订阅的邮件列表应该保留。

HTH,
查尔斯

You basically answered it yourself with the edit but something a bit more elegant would be better. I.e. Don't delete them all first, just determin which need to be added, which need to be deleted and which need to just remain.

E.g. (air code)

List<string> selectedSubscriptions; //This is passed in from the form using the model binder
List<string> mailingListsToRemove = GetCurrentMailingLists(); //Looks odd but bear with me
List<string> mailingListsToAdd = new List<string>();

//Loop through all the mailing lists they had selected
foreach (string selectedMailingList in selectedSubscriptions)
{
    //if the mailing list exists in the list to remove, remove it from that list
    //because they obviously don't want it removed
    //Remember that this list also contains their current lists.
    if (mailingListsToRemove.Contains(selectedMailingList))
    {
        mailingListsToRemove.Remove(selectedMailingList);
    }
    else //If it's not in the list to remove then add it
    {
        mailingListsToAdd.Add(selectedMailingList);
    }
}

So at the end of that loop you should have two lists - one containing all the mailing lists that the user wants removed and one containing all the new mailing lists they want to be subscribed to. The mailing lists that they were already subscribed to and still wish to be subscribed to should just be left alone.

HTHs,
Charles

确定 ASP.NET MVC 中哪些复选框未选中?

走过海棠暮 2024-08-16 19:41:09

Intellidimension 提供了一个名为 语义服务器,在 Microsoft 的 SQL Server 2005 或 2008 之上开发。它可以轻松扩展到数亿个三元组,我知道他们至少有一个客户很高兴运行包含超过十亿条语句的企业部署。

我是他们处理数据集的客户之一> 1亿。我们的计划是向数百亿条报表迈进。

Intellidimension provides a solution called Semantic Server that is developed on top of Microsoft's SQL Server 2005 or 2008. It easily scales to the hundreds of millions of triples and I know they have at least one customer happily running an enterprise deployment with over a billion statements.

I am one of their customers working with datasets > 100 million. Our plans are to move towards the 10s of billions of statements.

可以处理大型 RDF 数据集的企业级数据库?

走过海棠暮 2024-08-16 09:28:10

类型化数据集不支持可为 null 的类型。它们支持可为空的列。

类型化数据集生成器创建不可为空的属性和相关方法来处理空值。如果您创建 DateTime 类型的 MyDate 列并将 AllowDbNull 设置为 true,则 DataRow code> 子类将实现一个名为 MyDate 的不可为 null 的 DateTime 属性、一个 SetMyDateNull() 方法和一个 IsMyDateNull()< /代码> 方法。这意味着,如果您想在代码中使用可空类型,则必须这样做:

DateTime? myDateTime = myRow.IsMyDateNull() ? null : (DateTime?) row.MyDate;

虽然这并没有完全违背使用类型化数据集的目的,但它确实很糟糕。令人沮丧的是,类型化数据集以比 System.Data 扩展方法更不可用的方式实现可为空列。

特别糟糕,因为类型化数据集确实在某些地方使用可空类型 - 例如,包含所述可空 DateTime 列的表的 AddRow() 方法上面将采用 DateTime? 参数。

很久以前,我在 MSDN 论坛上询问过这个问题,最终 ADO 项目经理解释说,可空类型是与类型化数据集同时实现的,他的团队没有时间通过​​ .NET 将两者完全集成2.0 的发布日期。据我所知,从那时起他们就没有向类型化数据集添加新功能。

Typed data sets don't support nullable types. They support nullable columns.

The typed data set generator creates non-nullable properties and related methods for handling null values. If you create a MyDate column of type DateTime and AllowDbNull set to true, the DataRow subclass will implement a non-nullable DateTime property named MyDate, a SetMyDateNull() method, and an IsMyDateNull() method. This means that if you want to use a nullable type in your code, you have to do this:

DateTime? myDateTime = myRow.IsMyDateNull() ? null : (DateTime?) row.MyDate;

While this doesn't totally defeat the purpose of using typed data sets, it really sucks. It's frustrating that typed data sets implement nullable columns in a way that's less usable than the System.Data extension methods, for instance.

Is particularly bad because typed data sets do use nullable types in some places - for instance, the Add<TableName>Row() method for the table containing the nullable DateTime column described above will take a DateTime? parameter.

Long ago, I asked about this issue on the MSDN forums, and ultimately the ADO project manager explained that nullable types were implemented at the same time as typed data sets, and his team didn't have time to fully integrate the two by .NET 2.0's ship date. And so far as I can tell, they haven't added new features to typed data sets since then.

Table 可以为 null DateTime,但 DataSet 抛出异常?

走过海棠暮 2024-08-16 04:37:53

我不相信这样的清单存在。
您需要对每个国家/地区进行研究并自行建立这样的列表。最好的办法当然是让律师帮你调查。

无论如何,你需要它做什么?如果它是驻留在 X 国家/地区服务器上的 Web 应用程序,您只需遵守该国家/地区的要求。人们可以从世界任何地方访问您的应用程序这一事实将不是您所担心的。

I do not believe such a list exists.
You need to research for each country and build such a list on your own. The best way is of course let a lawyer investigate that for you.

Anyway, what do you need it for? If it's a web application that resides on servers in a country X you only need to comply with that country requirements. The fact that people can access your application from anywhere in the world will not be your concern.

如何获取所有国家/地区的列表以及该国家/地区不允许的加密标准

走过海棠暮 2024-08-16 03:55:30

您在控制台或 *.bat 文件中编写一些内容。

SET CLASSPATH=C:\java\apache-tomcat-7.0.53\lib\servlet-api.jar

You write something in console or *.bat-file.

SET CLASSPATH=C:\java\apache-tomcat-7.0.53\lib\servlet-api.jar

导入 javax.servlet 失败

走过海棠暮 2024-08-16 03:46:52

问题已解决...我只是在列表框进行数据绑定时设置选定的值。

Problem solved... I just set the selected values when the listbox is being databound.

如何在 gridview editItemTemplate 内的列表框中选择多个值?

走过海棠暮 2024-08-16 03:20:21

只需对 Joaquin Alberto 的答案做一点小小的调整就可以解决样式问题。只需替换自定义适配器中的 getDropDownView 函数,如下所示,

@Override
    public View getDropDownView(int position, View convertView, ViewGroup parent) {
        View v = super.getDropDownView(position, convertView, parent);
        TextView tv = ((TextView) v);
        tv.setText(values[position].getName());
        tv.setTextColor(Color.BLACK);
        return v;
    }

Just a small tweak to Joaquin Alberto's answer can solve the style issue.Just replace the getDropDownView function in the custom adapter as below,

@Override
    public View getDropDownView(int position, View convertView, ViewGroup parent) {
        View v = super.getDropDownView(position, convertView, parent);
        TextView tv = ((TextView) v);
        tv.setText(values[position].getName());
        tv.setTextColor(Color.BLACK);
        return v;
    }

Android:如何将微调器绑定到自定义对象列表?

走过海棠暮 2024-08-15 15:03:23

我想简要概述一下这种编程风格,也许下次我会更详细地解释它。

首先,3 层概念涉及将您正在设计的程序或应用程序分为 3 层,第一层用于在称为 CRUD 的操作中操作数据库,CRUD 代表{创建、读取、更新、删除}数据数据库,使用任何类型的数据库:例如 Oracle、SQLserver、MySql 等。这意味着您可以将应用程序与任何类型的数据库连接,而无需将连接字符串指定为“仅一个数据库”,我们下次将获得更多详细信息。

第二层是业务层,包括用户数据验证和其他类似的操作,在其中处理业务规则和程序的核心,
第三层也是最后一层是表示层,涉及用户输入和 UI 用户界面{输入的不同形式}

坦率地说,您可以将解决方案{程序,应用程序,网站}划分为子程序以避免数据丢失,组织您的工作,并将应用程序的开发分配给团队成员。

在我看来,这是在开发过程中应该学习的一件伟大的事情,正如grapeVine告诉我的那样,如果你想丰富你的知识和经验,那么你应该认识到这个重要的主题。

I'd like to give a brief overview about this style of programming and maybe I'll explain it in more details next time.

First of all, the 3-Tire concept engages dividing your program or application you are designing into 3 layers, the first layer is for manipulating the database in the operation called CRUD which stands for {Create,Read,Update,Delete} data from your database, using any kind of Databases : for example Oracle,SQLserver,MySql etc. That means you can connect your application with any type of databases without specifying a connection String to Only one database and we'll get more details about this next time.

The Second layer is Business layer which includes user data verification and other similar operations in which you process your business rules and the core of program,
The Third and Last layer is the Presentation layer which relates to User input and UI User Interfaces {The different forms for Input}

Frankly you can divide your Solution {Program,Application,Website} to sub-Programs to avoid data loss,organize your work, and to divide the development of your application among a team members.

in my point of view this is a great thing should be learnt in development, and as I was told by the grapeVine, if you want to enrich your knowledge and experience then you should be acknowledged about this important subject.

三层架构?

走过海棠暮 2024-08-15 14:31:26

当您以愚蠢的编码呈现 XML/HTML 文档时,& 符号是您对 XML 和 HTML(以及 SGML)的变音符号进行编码的方式。

当您以理解元音变音的编码(例如 UTF-8 等 Unicode 编码之一,或具有您当时需要的字符的良好字符集之一)呈现 XML/HTML 文档时,您实际上应该使用变音符号,而不是 & 符号

因此,& 符号是 XML 编码的文本,而元音变音符号是 DOM、JavaScript 和 jQuery 看到的真实文本。在解析 XML/HTML 时,在文本到达 DOM/JavaScript/jQuery 之前,& 符号会被解码为变音符号。

The ampersands are how you encode the umlauts for XML and HTML (and SGML) when you are rendering the XML/HTML document in a stupid encoding.

When you render the XML/HTML document in an encoding that understands umlauts, such as one of the Unicode encodings like UTF-8, or one of the nice charsets that has the characters you need at that moment, you should actually use the umlauts, not the ampersands.

So with the ampersands is XML-encoded text, while with the umlauts is the real text that the DOM and JavaScript and jQuery see. The ampersands are decoded into the umlauts when the XML/HTML is parsed, before the text gets to DOM/JavaScript/jQuery.

如何阻止 jQuery 转义我的重音字符?

走过海棠暮 2024-08-15 07:16:09

您必须将安全组件添加到控制器的 $components 数组中:

public $components = array('安全');

当您使用表单助手创建表单时,CakePHP 将自动向您的表单添加一个随机数。

You have to add the Security component to the $components array of your controller(s):

public $components = array('Security');

CakePHP will then automatically add a nonce to your form when you use the Form helper to create your forms.

CakePHP 和 CSRF

走过海棠暮 2024-08-15 06:49:18

您编写的代码是 javascript,而 javascript 使用值中没有 innerText

var txtSft=document.getElementById('<id of sfttext>');
txtSft.value=_nSft;

The code you have written is a javascript there is no innerText in javascript use value instead

var txtSft=document.getElementById('<id of sfttext>');
txtSft.value=_nSft;

如何使用 JavaScript 在文本框中相乘并设置相乘值

走过海棠暮 2024-08-15 06:46:48

这里是说明。

需要一个 DLL,可以从免费提供 Creative Blaster 驱动程序。

另请参阅此项目 - 似乎支持许多语言,包括 vbscript

如果您不喜欢 vbscript 想法,Perl有一个非常好的库 MP3::Tag 或类似的东西(只需谷歌搜索 perl+mp3+tag);假设您愿意安装 Windows Perl(Strawberry 或 Active Perl)

Here are instructions.

There's a DLL required which can be gotten from freely available Creative Blaster drivers.

Also see this project - seems to support many languages including vbscript

If you're not wedded to vbscript idea, Perl has a very nice library MP3::Tag or somesuch (just google for perl+mp3+tag); assuming you're game for installing Windows Perl (Strawberry or Active Perl)

如何从脚本向 Windows Media Player 的 MP3 添加元数据

走过海棠暮 2024-08-15 06:32:25

使用Dimitrije Djekanovic授予 建议,这是当前 API 版本的工作版本 3.49(2022 年 5 月中旬):

/* hides the x image */
button.gm-ui-hover-effect > span {
  display: none !important;
}

/* inserts the customized and clickable image instead */
button.gm-ui-hover-effect {
  opacity: 1 !important;
  background: url('close.svg') center center !important;
  background-repeat: no-repeat !important;
  background-size: 16px 16px !important;
  /* above is a good size or uncomment the next line */
  /* background-size: contain !important; */
}

要对此进行测试,请转到 StackBlitz 演示,由 官方文档并粘贴style.css文件,同时将background更改为:

background: url('https://upload.wikimedia.org/wikipedia/commons/thumb/5/51/Mr._Smiley_Face.svg/414px-Mr._Smiley_Face.svg.png')
    center center !important;

output

Using what Dimitrije Djekanovic and Grant suggested, here is a working version for the current API version 3.49 (Mid-May of 2022):

/* hides the x image */
button.gm-ui-hover-effect > span {
  display: none !important;
}

/* inserts the customized and clickable image instead */
button.gm-ui-hover-effect {
  opacity: 1 !important;
  background: url('close.svg') center center !important;
  background-repeat: no-repeat !important;
  background-size: 16px 16px !important;
  /* above is a good size or uncomment the next line */
  /* background-size: contain !important; */
}

To test this, go to the StackBlitz demo provided by the official documentation and paste the style.css file while having background changed to:

background: url('https://upload.wikimedia.org/wikipedia/commons/thumb/5/51/Mr._Smiley_Face.svg/414px-Mr._Smiley_Face.svg.png')
    center center !important;

output

更改 Google 地图信息窗口关闭图标

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