走过海棠暮

文章 评论 浏览 25

走过海棠暮 2024-09-20 09:20:50

安装 ruby​​ 安装程序时,选择“将 ruby​​ 可执行文件添加到路径”选项。然后所有 git/ruby 命令都将从 git bash 运行。

while installing ruby installer, select the option "Add ruby executables to your path" . Then all git/ruby commands will run from git bash.

如何在 Windows 上的一处运行 Ruby 和 GIT 命令

走过海棠暮 2024-09-20 07:24:38

简单的方法

Maven EAR 插件允许 自定义模块文件名,您可以使用project.build.finalName 设置最终名称或 EAR。

更好的方法

覆盖 application.xml中的 分别是 ejb-jar.xml。引用 EJB 3.1 中的可移植全局 JNDI 名称

除上述名称外,如果
EJB 仅公开一个客户端视图
(也就是说它只实现了一个
有接口或无接口视图),
容器还被要求映射
豆子到

java:global/[<应用程序名称>]/<模块名称>/

哪里

  1. 默认为包名称(.ear 文件名),不带
    捆绑扩展。这可以是
    application.xml 中被覆盖。还,
    适用
    仅当 Bean 封装在
    .ear 文件。
  2. 默认为包名称(.war.jar),不带
    捆绑扩展。再说一次,这可以是
    ejb-jar.xml 中被覆盖。
  3. 默认为 bean 的非限定类名。
    但是,如果 @Stateful
    @Stateless@Singleton 使用
    名称属性,然后是值
    指定那里将被用作
    豆名称。

Naive approach

The Maven EAR Plugin allows to Customize A Module Filename and you can set the final name or the EAR using project.build.finalName.

Much better approach

Override the <application-name> and the <module-name> in the application.xml and the ejb-jar.xml respectively. Quoting Portable Global JNDI name in EJB 3.1:

In addition to the above name, if the
EJB exposes just a single client view
(that is it implements just one
interface or the no interface view),
the container is also mandated to map
the bean to

java:global/[<application-name>]/<module-name>/<bean-name>

Where

  1. <aplication-name> defaults to the bundle name (.ear file name) without
    the bundle extension. This can be
    overridden in application.xml. Also,
    <application-name> is applicable
    only if the bean is packaged inside a
    .ear file.
  2. <module-name> defaults to bundle name (.war or .jar) without the
    bundle extension. Again, this can be
    overridden in ejb-jar.xml.
  3. <bean-name> defaults to the unqualified class name of the bean.
    However, if @Stateful or
    @Stateless or @Singleton uses the
    name attribute, then the value
    specified there will be used as the
    bean name.

我如何配置 JNDI 查找的模块和应用程序名称

走过海棠暮 2024-09-20 04:12:21

您绝对应该使用 SoapUI。尤其是在混合环境中。即在混合环境(java、delphi、WCF 等)中,SoapUI 将成为您的常用工具,可以确认哪些有效,哪些无效。它还可用于设置模拟服务,以便您可以针对尚未构建的服务进行测试。即,通过 WSDL,您可以在几分钟内构建一些记录请求并给出响应的东西。这是非常有益的。今后,您将能够使用通用工具验证哪些有效,哪些无效,而不是争论“在技术 x 中有效,所以这一定是您的问题”。

查看 mockservices 演示,其中展示了如何基于 xpath 进行简单的预设响应。非常简单,而且有效。您可以发送响应并返回各种可预测的响应。例如,您发送员工 Tom、Dick、Harry 的更新。配置 SoapUI 模拟服务,为 Tom 返回成功,为 Dick 返回软错误,为 Harry 返回灾难性错误。

IMO,在构建任何 Web 服务之前,最好的起点是在 SoapUI 中构建模拟服务。然后,您可以使用示例有效负载进行测试,看看每个人是否都看到了他们所期望的内容。例如,HR 使用每个人都同意的 WSDL 将一名新员工发送到 Payroll。 Payroll 开发人员甚至还没有编写他的部分代码,但通过查看 SoapUI 中的事务,他发现 EmpID 格式“在我们这边完全不起作用”。现在HR可以做出改变。薪资开发人员还发现,尚未被解雇的员工的终止日期为 1889 年 12 月 31 日。他预计''。现在,开发人员和分析师之间可以进行讨论,而不是稍后在集成或启动期间进行,当时的讨论可能涉及多层 PM、“情况领导”等。

You definitely should be using SoapUI. Especially in a mixed environment. i.e. in a mixed environment (java, delphi, WCF, etc..) SoapUI will be your common tool that can confirm what works and what doesn't. It can also be used to set up mock services so you can test against a service that isn't yet built. i.e. from the WSDL you can build something in minutes that will log requests and give responses. That's hugely beneficial. Down the road, you'll be able to verify what works and what doesn't using the common tool, rather than fighting about "works here in technology x, so it must be a problem at YOUR end".

Look into the mockservices demo where they show how to do simple canned responses based on xpath. Very simple, and effective. You can send a response and return a variety of predictable responses. for example, you send updates for emps Tom, Dick, Harry. Configure your SoapUI mockservice to return success for Tom, soft error for Dick, catastrophic error for Harry.

IMO, the best place to start before building any web service is to build a mockservice in SoapUI. Then you can test with sample payloads and see if everybody is seeing what they expect. i.e. HR sends a new employee to Payroll, using the WSDL that everyone agreed to. The Payroll dev hasn't even coded his part yet, but by looking at the transaction in SoapUI, he sees that the EmpID format is "totally not going to work on our end". Now HR can make a change. The Payroll dev also sees that the Termination Dates are 12/31/1889 for employees that haven't been fired yet. He expected ''. Now a discussion can ensue between the devs and analysts, instead of later on during integration or startup, when the discussion would likely involve several layers of PMs, "situation leads", etc..

SOA 服务测试

走过海棠暮 2024-09-20 04:04:05

我有同样的问题,我解决了。

这个问题与 IE 处于 Quircks 模式有关,因为我在 HTML 的开头有一些无效的标签(我从 .aspx 页面复制源代码,然后留在那里 <%page ..%> 指令当

IE 发现一些奇怪的标签时,它会进入怪异模式,并且

当我删除奇怪的标签时, $(window).width(); 的东西开始工作

。问题。 :)

I had the same problem and i solve it.

The question was related with IE being in Quircks mode, because i had in the begining of the HTML some non valid tags (i copy the source from a .aspx page, and i left there the <%page ..%> directive.

When IE finds some strange tag it enters quircks mode, and some things work diferent.

When i deleted the strange tag, the $(window).width(); stuff begins to work.

Hope this helps someone in the future with my same problem. :)

IE 窗口宽度和高度的 JS/Jquery 语法

走过海棠暮 2024-09-20 03:22:49

我找到了怎么做,我不敢相信我错过了这个属性:

[myTableView setScrollEnabled:NO];

I found out how to do it, I can't believe I missed this property:

[myTableView setScrollEnabled:NO];

UITableView 取消移动

走过海棠暮 2024-09-20 02:12:23

您可以更改 Application_EndRequest() 中的任何标头或任何内容,试试这个

protected void Application_EndRequest()
{
    // removing excessive headers. They don't need to see this.
    Response.Headers.Remove("header_name");
}

You can change any header or anything in Application_EndRequest() try this

protected void Application_EndRequest()
{
    // removing excessive headers. They don't need to see this.
    Response.Headers.Remove("header_name");
}

如何删除 ASP.Net MVC 默认 HTTP 标头?

走过海棠暮 2024-09-19 20:16:47

有几种常见方法可以在 Rails 插件中指定配置设置。

我更喜欢有一个包含插件设置的初始化程序文件。通过向插件添加生成器,可以使用默认设置创建此文件。然后,用户可以运行生成器并轻松查看一个文件中的所有插件设置。

查看 client_side_validations 示例

There are a couple common ways to specify configuration settings in a rails plugin.

I prefer to have an initializer file that contains the plugin settings. This file can be created with the default settings by adding a generator to your plugin. Then the user can run the generator and easily see all the plugin settings in one file.

Checkout the client_side_validations for an example

处理 Rails3 插件中的设置的适当方法?

走过海棠暮 2024-09-19 19:23:30

我的建议是使用 save 方法创建 ISaveableView。
您的每个视图都将实现该接口。
我猜测您的选项卡实现了您所描述的视图。当您单击保存按钮时,您可以将活动选项卡投射到 ISaveableView 并调用其保存方法

My suggestion is to create ISaveableView with save method.
Each of your views will implement the interface.
I am guessing that your tabs implements the views you've described. When you click the save button you can cast the active tab to ISaveableView and call its save method

GUI设计模式,MVP,选项卡控件

走过海棠暮 2024-09-19 17:49:35

我尝试从 Android 应用程序连接 DatabaseServer,最初我在使用 jtds(用于数据库驱动程序支持的 jar 包)时遇到了一些问题,而不是使用 jtds jar 文件,而是使用 mysql-Connector jar 文件来支持数据库驱动程序。
mysql-connector jar 文件“mysql-connector-java-5.1.24-bin.jar”。
将此 jar 文件放入项目的 libs 文件夹中。

一点代码片段:

`String url="jdbc:mysql://(IP-of databaseServer):3306/DBNAME";`
`String driver="org.gjt.mm.mysql.Driver";`
`String username="XYZ";//user must have read-write permission to Database
`String password= "*********";`//user password

`try{
    Class.forName(driver).newInstance();//loading driver
    Connection con = DriverManager.getConnection(url,username,password);
    /*once we get connection we can execute ths SQL command to Remote Database Server with the help mysql-connector driver over Internet*/

}`    
`catch(Exception e){
    e.printStackTrace();
}`

我希望它能起作用。

干杯
拉杰什·P·亚达夫.

I tried to connect DatabaseServer from an Android Application,initially i faced some issue while i was using jtds, jar package for database Driver Support, instead of using jtds jar file use mysql-Connector jar file for Database Driver Support.
mysql-connector jar file "mysql-connector-java-5.1.24-bin.jar".
put this jar file in projects libs folder.

a little bit code snippet :

`String url="jdbc:mysql://(IP-of databaseServer):3306/DBNAME";`
`String driver="org.gjt.mm.mysql.Driver";`
`String username="XYZ";//user must have read-write permission to Database
`String password= "*********";`//user password

`try{
    Class.forName(driver).newInstance();//loading driver
    Connection con = DriverManager.getConnection(url,username,password);
    /*once we get connection we can execute ths SQL command to Remote Database Server with the help mysql-connector driver over Internet*/

}`    
`catch(Exception e){
    e.printStackTrace();
}`

I hope it could work.

Cheers
Rajesh P Yadav.

如何将Android连接到数据库服务器

走过海棠暮 2024-09-19 11:49:45

因为它很容易!从 Java 1.1 到 Java 1.4,只引入了一些微小的语言特性(例如 strictfp)。那么,如果不需要的话,为什么要限制自己呢?因此,假设您编写了一个 StringUtil 类或解析了 Word 文件,那么这根本不重要。从 Java 5 开始,语言就得到了改进,当然还有从 Java 1.0 到 Java 1.1 的内部类。

这仅适用于语言,而不适用于库。当然还有一些有趣的补充。

Because its easy! From Java 1.1 to Java 1.4 just tiny language features were introduced (strictfp for example). So why restrict yourself if you don't need to. So lets say you write a StringUtil class or you parse Word files then is simply does't matter. Just starting with Java 5 you have language improvement and from Java 1.0 to Java 1.1 of course inner classes.

This is just for the language and not so much for the libraries. There are interesting additions of course.

为什么有些框架拒绝放弃对旧 Java 版本的支持?

走过海棠暮 2024-09-19 09:12:01

简短的回答:否。

详细的回答:是的,如果您使用 rgba 颜色而不是 opacity 属性。例如,以下内容将为您提供不透明度为 20% 的黑色背景和完全不透明度的黑色文本:

p {
    background: rgba(0, 0, 0, 0.2);
    color: #000000;
}

对于背景图像,请使用带有 Alpha 通道的 PNG。

Short answer: No.

Long answer: Yes, if you use rgba colors instead of the opacity property. For example, the following would give you a black background with 20% opacity, and black text with full opacity:

p {
    background: rgba(0, 0, 0, 0.2);
    color: #000000;
}

For background images, use a PNG with alpha channels.

CSS不透明度和文本问题

走过海棠暮 2024-09-19 06:45:04

要提取 {} 的内部分组,请使用以下正则表达式:

string extract = Regex.Replace(source, "\{\w(\{\w,\w\})\w\}", "$1");

实际上,如果您想删除逗号....

string extract = Regex.Replace(source, "\{\w\{(\w),(\w)\}\w\}", "{$1 $2}");

要提取没有内部分组的外部分组:

string extract = Regex.Replace(source, "(\{\w)\{\w,\w\}(\w\})", "$1 $2");

如果在您的示例中,a、b、c、d 不是字面意思单个字符,即字母组甚至空格等,

根据您对嵌套的评论 将 \w 替换为 \w+ 甚至 .* ....

string extract = Regex.Replace(source, "(\{\w)\{.*\}(\w\})\w*", "$1 $2");

To extract the inner grouping of {} use the following regular expression:

string extract = Regex.Replace(source, "\{\w(\{\w,\w\})\w\}", "$1");

Actually, if you want to remove the comma....

string extract = Regex.Replace(source, "\{\w\{(\w),(\w)\}\w\}", "{$1 $2}");

To extract the outer without the inner grouping:

string extract = Regex.Replace(source, "(\{\w)\{\w,\w\}(\w\})", "$1 $2");

if in your example a, b, c, d are not literally single characters, that is groups of letters or even spaces, etc replace \w with \w+ or even .*

based on your comment on nesting....

string extract = Regex.Replace(source, "(\{\w)\{.*\}(\w\})\w*", "$1 $2");

使用 C# 删除分隔符

走过海棠暮 2024-09-19 06:38:23
body,html { height:100%; width:100%; padding:0; margin:0; }
.overlay  { position:absolute; top:0px; left:0px; z-index:999; height:100%; width:100%; background:#c1c1c1; }

这应该有效。覆盖层应该是

body,html { height:100%; width:100%; padding:0; margin:0; }
.overlay  { position:absolute; top:0px; left:0px; z-index:999; height:100%; width:100%; background:#c1c1c1; }

This should work. The overlay should be a <div>.

如何使用CSS根据页面高度在页面上设置覆盖

走过海棠暮 2024-09-19 00:25:17

我可能有点偏离基础,但这看起来像是 Rx 框架 非常适合。这样,您就可以转向纯粹的反应式编程,您可以声明在收到所有输入之前不会发送输出。对于外部消费者来说,您的门将充当 IObservable,这在某种程度上相当于 IEnumerable。任何观察者都只是看到输出的枚举,这些输出的发生延迟于输入的接收方式。

这里的主要好处是您可以链接可观察量。因此,如果您想将“与”门的输出链接到“或”门的输入,只需一行代码即可完成。对我来说,Rx 是对电路如何工作进行建模的完美框架,因为每个可观测值的结果都会在下一个可观测值的输入中发挥作用。

首先,我建议您观看 Channel9 上的系列视频

I may be a bit off base, but this looks like something the Rx Framework would be well suited for. With this, you move to a purely reactive form of programming, where you can declare that your output not be sent until all inputs are received. To the outside consumer, your gate would function as an IObservable<bool>, which is somewhat equivalent to an IEnumerable<bool>. Any observer simply sees an enumeration of outputs, which occur in delay to how the inputs are received.

The main benefit here is that you can chain observables. So, if you want to chain the output of an AND gate to the input of an OR gate, you can do that with a single line of code. To me, Rx is the perfect framework for modeling how an electrical circuit would work, since the results of each observable play a role in the input to the next observable.

To get started, I'd recommend viewing the series of videos on Channel9.

C# 中具有延迟输入的 AND 门

走过海棠暮 2024-09-18 20:34:03

Chrome 38 在设备模拟设置中包含网络模拟。您可以选择离线、GPRS、EDGE、3G、DSL 和 WiFi。还模拟增加的延迟。

它不如在真实设备上测试那么准确,但设置速度要快得多。

Chrome 38 includes network emulation in the device emulation settings. You can select from Offline, GPRS, EDGE, 3G, DSL and WiFi. Also emulates increased latency.

It's not as accurate as testing on a real device but it's much quicker to set up.

如何测试 iPhone 上的低带宽条件

更多

推荐作者

lanyue

文章 0 评论 0

海螺姑娘

文章 0 评论 0

Demos

文章 0 评论 0

亢龙有悔

文章 0 评论 0

海未深

文章 0 评论 0

浅忆流年

文章 0 评论 0

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