走过海棠暮

文章 评论 浏览 25

走过海棠暮 2024-10-08 13:34:48

对于基于 Web 的,您可以尝试用于 Java 的 GWT (Google Web Tookit)。 Flex-AIR将是桌面应用程序的另一个候选者。

For web based, you can try GWT (Google Web Tookit) for java. Flex-AIR will be the another candidate for desktop application.

如何为我自己的应用程序构建一个漂亮的类似 Android 的用户界面

走过海棠暮 2024-10-08 12:37:12

还有另一种方法可以使用 System.Xml 功能来转义此类字符。

您只需将 XmlWriterSettings 的 CheckCharacters 标志设置为 false。

using (XmlWriter xmlWriter = XmlWriter.Create(stringWriter, new XmlWriterSettings { CheckCharacters = false }))
{
  document.Save(xmlWriter);
}

但如果您想读取 xml,则必须将 XmlReaderSettings 的相同标志设置为 false。 :)

using (XmlReader reader = XmlReader.Create(stringReader, new XmlReaderSettings { CheckCharacters = false }))
{
  document = XDocument.Load(reader);
}

There is another way to escape such characters by using System.Xml features.

You just need to set CheckCharacters flag to false for XmlWriterSettings.

using (XmlWriter xmlWriter = XmlWriter.Create(stringWriter, new XmlWriterSettings { CheckCharacters = false }))
{
  document.Save(xmlWriter);
}

But you have to set the same flag to false for XmlReaderSettings if you want to read the xml. :)

using (XmlReader reader = XmlReader.Create(stringReader, new XmlReaderSettings { CheckCharacters = false }))
{
  document = XDocument.Load(reader);
}

在 XML 文件中保存转义字符 0x1b

走过海棠暮 2024-10-08 11:29:17

您应该了解的情况,

CreateFileW(L"D:\\1\\test.txt", GENERIC_READ, 0, 0, CREATE_NEW, 0, 0);
// A file has been created.

CreateFileW(L"D:\\1\\test.txt", GENERIC_READ, 0, 0, OPEN_EXISTING, 0, 0);
// Of course, the file will be opened well.

CreateFileW(L"D:\\1\\\\test.txt", GENERIC_READ, 0, 0, OPEN_EXISTING, 0, 0);
// It works well too. Windows subsystem does canonicalize that.

CreateFileW(L"\\\\?\\D:\\1\\\\test.txt", GENERIC_READ, 0, 0, OPEN_EXISTING, 0, 0);
// '\\?\' prefix tell Windows "Don't touch my path, just send it to filesystem"
// So it will be failed.

http://msdn。 microsoft.com/en-us/library/aa365247(VS.85).aspx#maxpath
我不知道 .NET 如何包装这个 api。我想汉斯·帕桑特可能对此很了解。 :)

The case you should know,

CreateFileW(L"D:\\1\\test.txt", GENERIC_READ, 0, 0, CREATE_NEW, 0, 0);
// A file has been created.

CreateFileW(L"D:\\1\\test.txt", GENERIC_READ, 0, 0, OPEN_EXISTING, 0, 0);
// Of course, the file will be opened well.

CreateFileW(L"D:\\1\\\\test.txt", GENERIC_READ, 0, 0, OPEN_EXISTING, 0, 0);
// It works well too. Windows subsystem does canonicalize that.

CreateFileW(L"\\\\?\\D:\\1\\\\test.txt", GENERIC_READ, 0, 0, OPEN_EXISTING, 0, 0);
// '\\?\' prefix tell Windows "Don't touch my path, just send it to filesystem"
// So it will be failed.

http://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx#maxpath
I have no idea how .NET wraps this api. I guess Hans Passant might knows well about this. :)

File.Copy() 或 Directory.CreateDirectory() 方法的路径变量中的额外斜杠

走过海棠暮 2024-10-08 03:07:27

坦率地说,我真的不知道有什么好的在线网站可以做到这一点。

Google 给了我这个网站,但我尝试了一下,它确实有点麻烦,而且很难合作。

我真的建议你会发现在你的机器上安装一些数据库(如 MySQL / SQL Server Express)并尝试一下会容易得多。

安装 SQL Server Express 等软件非常简单。您只需从此处下载 db + 工具,快速安装即可完成所有设置要获取

示例数据,您可以随时下载 Adventureworks 数据库
列出了有关如何使用 SQL Express 运行 AdventureWorks 数据库的分步详细信息 此处

Frankly, I do not really know of any GOOD online site for doing this.

Google gave me this site but i tried it out and its really a bit cumbersome and difficult to work with.

I would really suggest that you will find it a LOT easier to install some database like MySQL / SQL Server Express on your machine and try things out.

Installing something like SQL Server Express is really easy. You can just download the db + tools from here, a quick install and you will be all set to go

For the sample data, you can always download the Adventureworks database.
Step by step details on how to get the AdventureWorks database running with SQL Express are listed here

假的 mysql 服务器来运行 sql 命令以进行练习

走过海棠暮 2024-10-08 00:52:37

像这样使用 .className

$('.class2 , .class3, .class3').bind('click', function() { 
  alert(this.className);
  location.href = "test.htm"; 
});

您可以 不过,可以是这些类中的 1 到 3 个,包括其他不相关的类。

或者,因为如果您想使用 .hasClass() 测试它,您实际上只有 2 个 这也是一个选项:

$('.class2 , .class3').bind('click', function() { 
  var c = $(this).hasClass("class2") ? "class2" : "class3";
  alert(c);
  location.href = "test.htm"; 
});

You can use .className like this:

$('.class2 , .class3, .class3').bind('click', function() { 
  alert(this.className);
  location.href = "test.htm"; 
});

It can be anywhere from 1 to 3 of those classes though, including other unrelated classes.

Or, since you only actually have 2 if you want to test it using .hasClass() that's an option as well:

$('.class2 , .class3').bind('click', function() { 
  var c = $(this).hasClass("class2") ? "class2" : "class3";
  alert(c);
  location.href = "test.htm"; 
});

多个班级事件在一起,如何获取当前班级名称

走过海棠暮 2024-10-07 21:39:33

正确的答案是来自“max”的答案(手动设置你的 HOME 环境变量),但它可能有助于一些人理解问题发生的原因(随着 Git 在世界各地获得更多用户,这将变得非常常见)。

Cygwin 将 $HOME 设置为 /home/yourname,但该变量在 Windows 环境中未知。因此,如果您打开 bash 窗口并执行 env | grep HOME 你会看到这里提到的所有三个“HOME”变量,你可能想知道为什么 Gitextensions 不使用正确的 cygwin HOME - 这是因为它的 .bat 文件调用看不到它 - 它只看到你看到的内容在 Windows 控制台中进行“设置”。

令人费解的是,为什么它不稍后进行此评估并获取正确的 cygwin 路径,因为它知道如何调用 bash,但是(至少在 2.41 之前的版本中)您必须在设置或 .gitconfig 中进行手动更改。

The correct answer is the one from 'max' (set your HOME env var manually), but it may help some to understand why the problem is happening (as Git gets more users around the world it's going to be very common).

Cygwin sets $HOME to /home/yourname, but that variable is not known in the Windows environment. So if you open a bash window and do env | grep HOME you'll see all three 'HOME' variables mentioned here, and you might wonder why Gitextensions doesn't use your proper cygwin HOME - which is because its .bat file invocation doesn't see it - it only sees what you see from doing 'set' in a windows console.

It's mystifying why it doesn't do this evaluation later and get the proper cygwin path since it knows how to invoke bash, but (at least in versions up to 2.41) you have to do this manual change in the settings or in .gitconfig.

无法获取 git 扩展来将某些内容推送到 github SSH 问题

走过海棠暮 2024-10-07 20:59:06

将文件上传到 Web 服务器时,通常会包含以下信息(或类似信息):

Content-Disposition: form-data; name="fileInput"; filename="myFile.txt"
Content-Type: application/octet-stream

filename 包含文件名或完整路径,具体取决于浏览器。

如果您使用像 Fiddler 这样的程序,您可以准确地看到上传文件时发生的情况。

When a file is uploaded to a web server, the following information is usually included (or similar):

Content-Disposition: form-data; name="fileInput"; filename="myFile.txt"
Content-Type: application/octet-stream

The filename contains either the name of the file or the full path depending on the browser.

If you use a program like Fiddler, you can see exactly what's going on when you upload a file.

使用htm输入类型=文件存储图像

走过海棠暮 2024-10-07 15:10:23

无论您做什么,都要考虑防火墙/NAT。客户端应用程序轮询服务器(启动连接)可能会更容易,否则您尝试在用户计算机中拥有可远程访问的服务器而无需在用户的网络设备上进行一些非常手动的配置,从而引发一系列蠕虫病毒。

一旦你解决了这部分问题,我在你的情况中使用的是.NET Remoting。当时 WCF 还没有问世,当它问世时,它就无法满足我的需求了。 TCP IP 套接字太原始了(我不得不编写太多代码),因此远程处理理想地解决了我的问题(需要一整行代码来设置连接,从那以后一切都是自动的)。

编辑:我使用了一个优秀的第三方库,它使Remoting更加灵活(足够灵活,我仍在等待WCF赶上功能集,以便我停止使用Remoting,但还没有运气! )。查看 http://www.genuinechannels.com/ 以查看它们拥有的所有功能。它包括从服务器到客户端进行调用,这听起来与您需要做的完全一样。一探究竟。

Whatever you do, take firewalling/NAT into account. It might be easier for the client application to poll the server (initiate the connection) otherwise you open a can of worms by trying to have a remotely-accessible server in your user's computer without having to do some very manual configurations on the user's networking equipment.

Once you have that part sorted out, what I used in your situation was .NET Remoting. At the time WCF had not come out and when it did it was to crippled for my needs. TCP IP sockets were too raw (I had to write too much code) and so Remoting solved my problem ideally (a hand full lines of code to set up the connection, and everything was automatic from there on).

EDIT: I use an excellent third party library that makes Remoting even more flexible (flexible enough that I am still waiting for WCF to catch up with the featureset so that I stop using Remoting, and no luck yet!). Check out http://www.genuinechannels.com/ to see all the features they have. It includes making calls from server to client, and that sounds exactly like what you need to do. Check it out.

如何在 .NET 中创建接收器应用程序来接受来自 ASP.NET 页面的消息或请求?

走过海棠暮 2024-10-07 13:19:29

naresh提到的使用变量的方法是查询数据库的好方法,
因为它可以轻松理解查询。

the method to use a variable which is mentioned by naresh is a good way to query the database,
as it creates an ease in understanding the queries.

WHERE 子句中的 MAX()

走过海棠暮 2024-10-07 11:40:30

如果未设置帐户,MFMailComposeViewController 将无法工作。您可以调用[MFMailComposeViewController canSendMail]来检查用户是否至少配置并启用了一个邮件帐户。据我所知,它不会检查用户的设备是否设置正确(即不检查用户名和密码等是否正确)。简而言之:如果邮件应用程序正常工作,您的 MFMailComposeViewController 也将正常工作。如果不起作用,您将需要提供比“不起作用”更详细的问题描述。

If no account is set up, the MFMailComposeViewController cannot work. You can call [MFMailComposeViewController canSendMail] to check if the user has at least one mail account configured and enabled. As far as I know, it does not check if the user's device is set up properly (i.e. no check for correct username and password etc.). In short: If the Mail app works, your MFMailComposeViewController is going to work as well. If it does not, you will need to give a more detailed description of the problem than "does not work".

当 MFMailComposeViewController 不起作用时?

走过海棠暮 2024-10-07 11:33:49

请尝试这个:

String abc = String.Empty;     
      if (tag.Attributes.Contains(@"type"))
      {
          abc = tag.Attributes[@"type"].Value;
      }

Please try this:

String abc = String.Empty;     
      if (tag.Attributes.Contains(@"type"))
      {
          abc = tag.Attributes[@"type"].Value;
      }

HtmlAgilityPack 有属性吗?

走过海棠暮 2024-10-07 11:01:27

对我来说列表刷新: listView.invalidateViews();

它会做:

mDataChanged = true;
rememberSyncState();
requestLayout();
invalidate();

管理某些列表项删除或一次删除所有元素的情况。

在 API 24 中测试。

List refreshing for me: listView.invalidateViews();

It'll do:

mDataChanged = true;
rememberSyncState();
requestLayout();
invalidate();

The case as to manage some list item removal or removal all element at once.

Tested in API 24.

Android 列表视图刷新

走过海棠暮 2024-10-07 07:05:34

不像根据每个请求在服务器上运行它那么酷,但是FWIW,我构建了一个脚本来在我的开发机器上自动编译我的 haml/sass ,所以至少我可以使用 haml/sass 轻松生成我的 WordPress 模板和 CSS: https://gist.github.com/1169586 尽情享受!

Not as cool as running it on the server on a per-request basis, but FWIW, I built a script to auto-compile my haml/sass on my dev machine so at least I can use haml/sass to easily generate my Wordpress templates and CSS: https://gist.github.com/1169586 Enjoy!

Wordpress 与 Haml/Sass

走过海棠暮 2024-10-07 06:07:47

使用双重检查锁定使其成为线程安全的 http://code-o-matic.blogspot.com/2009/05/double-checked-locking-idiom-sweet-in.html 显然,这确实意味着访问惰性值比访问惰性值慢非懒惰者。

It is made thread-safe using double-checked locking http://code-o-matic.blogspot.com/2009/05/double-checked-locking-idiom-sweet-in.html Obviously this does mean that accessing lazy vals is slower than non-lazy ones.

Scala 惰性值:性能损失?线程安全?

更多

推荐作者

hn8888

文章 0 评论 0

liai0114

文章 0 评论 0

以酷

文章 0 评论 0

阿楠

文章 0 评论 0

郝学勇

文章 0 评论 0

烟燃烟灭

文章 0 评论 0

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