我正在寻找将数字转换为阿拉伯语单词的 JavaScript 函数
例如
- 23 > ????? ??????
- 53 > ????? ??????
- .... > ....
我找到了一些解决方案,但都是 .net
我在网上搜索过,但找不到任何解决方案(好吧,我在用阿拉伯语搜索时无法理解;))
select2组件可以配置为接受新值,如在Select2下拉列表中询问但是允许用户使用新值?
你可以在http://jsfiddle.net/pHSdP/646/看到它,代码如下:
$("#tags").select2({
createSearchChoice: function (term, data) {
if ($(data).filter(function () {
return this.text.localeCompare(term) === 0;
}).length === 0) {
return {
id: term,
text: term
};
}
},
multiple: false,
data: [{
id: 0,
text: 'story'
}, {
id: 1,
text: 'bug'
}, {
id: 2,
text: 'task'
}]
});
Run Code Online (Sandbox Code Playgroud)
问题是,如果输入新值并按Enter键或按Tab键,则新值仅添加到列表中.
是否可以将select2组件设置为在使用类型时接受此新值并保留select2.(就像普通的html输入标签一样,通过点击屏幕上的某个位置保留你输入的值)
我发现select2有select2-blur事件,但我找不到获取这个新值并将其添加到列表的方法?!
我试图动态更改工具提示位置,但它不起作用.
<input type="text" id="sample" title="Tip">
<button name="change me" id="changeBtn">Change Tool Tip!</button>
Run Code Online (Sandbox Code Playgroud)
而对于js:
//Initiall tooltip for all elements
$("[title!='']").tooltip();
$("#changeBtn").click(function () {
//Change tooltip placment
$("#sample").tooltip({placement : 'left'}).tooltip('show');
})
Run Code Online (Sandbox Code Playgroud)
我在点击更改Twitter Bootstrap Tooltip内容时找到了一个很好的答案,其中显示了如何使用tooltip('fixTitle')方法动态更改工具提示文本.但找不到放置的东西.
我们正在使用OpenCSV.csv是
id,fname,lname,address.line1,address.line2
Run Code Online (Sandbox Code Playgroud)
豆子是
Person{
String id;
String lname;
String fname;
Address address;
}
Address{
String line1;
String line2;
}
Run Code Online (Sandbox Code Playgroud)
是否可以Address用opencsv 填充嵌套对象!在opencsv.bean和opencsv.bean.customconverter有一些类,这似乎可以做我想做的,但我找不到任何样品.
我已经看到使用OpenCSV将 Parse CSV转换为多个/嵌套bean类型?但答案集中在SuperCSV,这不是我想要的.
我们使用 android sdk 26 和 butterknife 8.8.1
有HomeActivity一个导航标题,导航标题还包含一些文本视图。可以绑定吗TextViews?HomeActivity!
这是一些描述我的问题的代码
该类HomeActivity的布局如下
<android.support.v4.widget.DrawerLayout ....
<android.support.design.widget.NavigationView
android:id="@+id/nav_view"
.....
app:headerLayout="@layout/nav_header"
app:menu="@menu/activity_navigation_drawer" />
</android.support.v4.widget.DrawerLayout>
Run Code Online (Sandbox Code Playgroud)
nav_header 中有一些 TextView
<LinearLayout ....
<TextView
android:id="@+id/userinfo_vo_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="TextView" />
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
是否可以绑定userinfo_vo_name文本视图的id HomeActivity,简单BindView失败
//fails
@BindView(R.id.userinfo_vo_name)
TextView userinfoName;
Run Code Online (Sandbox Code Playgroud)
当然,我已经调用ButterKnife.bind(this);了onCreate方法,但似乎还不够。
java android dependency-injection navigation-drawer butterknife
我的Action类有以下方法,
1.add
2.edit
3.loadEdit
4.remove
5.list
6.execute
Run Code Online (Sandbox Code Playgroud)
在这个我需要应用验证添加和编辑..如何需要在struts.xml.I配置,然后,
<action name="editComment" method="edit"
class="com.mmm.ehspreg2.web.action.product.CommentAction">
<result name="success">/jsp/propertyManager/loadList.jsp</result>
</action>
<action name="removeComment" method="remove"
class="com.mmm.ehspreg2.web.action.product.CommentAction">
<interceptor-ref name="validation">
<param name="excludeMethods">remove</param>
</interceptor-ref>
<result type="tiles">listComment</result>
<result type="tiles" name="input">listComment</result>
</action>
Run Code Online (Sandbox Code Playgroud)
当我像这样配置它时,不会调用remove action方法.我不明白这个问题.请协助.
我们在方法中定义一个新的TreeMap并将其传递给另一个方法:
TreeMap aTreeMap = new TreeMap();
//call another method to doSonthing woth map
doSomeThing(aTreeMap)
Run Code Online (Sandbox Code Playgroud)
的doSomething()是如下:
doSomething(Map aMap){
//Make a new copy of
TreeMap aTreeMap = new TreeMap(aMap);
}
Run Code Online (Sandbox Code Playgroud)
新的TreeMap会使用数据吗?!
考虑使用 spring 4 的基于 Web 的应用程序。spring bean 配置文件在 web.xml 中定义,如下所示:
<context-param>
<param-name>spring.profiles.active</param-name>
<param-value>prod,edb,cas</param-value>
</context-param>
Run Code Online (Sandbox Code Playgroud)
现在考虑一个 bean 在 spring-applicaiton-context.xml 中定义为
<util:properties id="myPolicy"
location=
"classpath:/configs/${ACCESS-ACTIVE-PROFILE-SECOND-ITEM}/my-policy.properties" />
Run Code Online (Sandbox Code Playgroud)
我是否可以访问活动配置文件列表并选择第二个(在我的示例 edb 中)。通过这种方式,我可以在活动配置文件更改时动态加载我的资源。
这可能有帮助!当网络应用程序使用以下代码启动时,我可以获得活动配置文件:
public void contextInitialized(ServletContextEvent event){
ApplicationContext applicationContext = WebApplicationContextUtils
.getWebApplicationContext(event.getServletContext());
String activeProfiles[] = applicationContext.getEnvironment().getActiveProfiles();
system.out.print(activeProfiles[1])
}
Run Code Online (Sandbox Code Playgroud) 请考虑这个例子。
一个示例Web应用程序要求scheduler.start()其启动。调度程序配置为将其作业存储在DB中。
该应用程序被复制到六个Web服务器上。
因此,如果启动六个Web服务器,则在单个DB上将有六个具有相同名称的调度程序。如https://quartz-scheduler.org/documentation/quartz-2.1.x/cookbook/MultipleSchedulers中所述:
切勿针对运行(start()ed)具有相同调度程序名称的任何其他实例的同一组数据库表启动(scheduler.start())非集群实例。您可能会遇到严重的数据损坏,并且肯定会遇到不稳定的行为。
因此,这将失败。
我的问题是,如果我确定我所有的工作@DisallowConcurrentExecution都会胜任工作,否则仍然失败?
如果@DisallowConcurrentExecution没有帮助,我应该手动将一台服务器配置为某些主机
public class StartUp implements ServletContextListener {
public void contextInitialized(ServletContextEvent event) {
if(THIS_IS_MASTER_TOMCAT){
scheduler.start()
}
}
Run Code Online (Sandbox Code Playgroud)
有更好的方法吗?
从配置切换apache-tomcat-8.5.23到apache-tomcat-8.5.50 配置ErrorReportValve不起作用。我在 8.5.23 中进行了如下设置,并且它有效(Tomcat 不显示服务器信息或错误)。
<Valve className="org.apache.catalina.valves.ErrorReportValve"
showReport="false"
showServerInfo="false"/>
Run Code Online (Sandbox Code Playgroud)
升级到8.5.50tomcat后显示服务器信息和报告,即使我已将其设置为false
这是 Tomcat 显示的示例堆栈跟踪和服务器信息
任何意见?