有没有人知道使用JSF 2.0功能(Facelets,复合组件,模板,Ajax,导航等)的完整JSF 2.0示例或开源应用程序.学习一些最佳实践将是一个很好的参考.我在谈论你也将在生产中使用的应用程序.我所知道的只有ScrumToys和PetCatalog,它们随NetBeans 6.9一起提供,并且是"类似教程"的应用程序.
嗨,我正在为DroidX编写一个480x854的应用程序.我按如下方式设置了AVD:
target:API level 7
skin:480x854
hw.lcd.density:160
而已.模拟器加载很好,看起来很棒,但我的应用程序由于某种原因没有fill_parent.看这里:

它不会一直向上扩展,我不知道为什么.这是我的XML:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ImageView android:src="@drawable/logo_recruiting"
android:background="#FF000000"
android:adjustViewBounds="true"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="30dip" />
<LinearLayout android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center"
android:background="@drawable/menu_background">
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_marginBottom="25dip"
android:text="@string/events"
android:textColor="#FFFFFFFF"
android:textSize="22dip"
android:paddingBottom="5dip"
android:background="@drawable/events_button"
android:onClick="launchEventsMap"
android:id="@+id/events_button"
/>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_marginBottom="25dip"
android:text="@string/jobs"
android:textColor="#FFFFFFFF"
android:textSize="22dip"
android:paddingBottom="5dip"
android:background="@drawable/jobs_button"
android:id="@+id/jobs_button"
/>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_marginBottom="25dip"
android:text="@string/applicants"
android:textColor="#FFFFFFFF"
android:textSize="22dip"
android:paddingBottom="5dip"
android:background="@drawable/applicants_button"
android:id="@+id/applicants_button"
/>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_marginBottom="25dip"
android:text="@string/resumes"
android:textColor="#FFFFFFFF"
android:textSize="22dip"
android:paddingBottom="5dip"
android:background="@drawable/resumes_button"
android:id="@+id/resumes_button"
/>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_marginBottom="25dip" …Run Code Online (Sandbox Code Playgroud) 问题分为两部分.第一个是概念性的.接下来在Scala中更具体地看待同一个问题.
我来自命令式编程背景(C++,Java).我一直在探索函数式编程,特别是Scala.
纯函数式编程的一些主要原则:
尽管现代JVM对于创建对象非常有效,并且垃圾收集对于短期对象来说非常便宜,但是最小化对象创建可能更好吗?至少在并发和锁定不是问题的单线程应用程序中.由于Scala是一种混合范例,如果需要,可以选择使用可变对象编写命令式代码.但是,作为一个花了很多年时间试图重用对象并最小化分配的人.我希望对那些甚至不允许这样的思想流派有一个很好的理解.
作为一个特例,我对本教程中的 代码片段感到有些惊讶6.它有一个Java版本的Quicksort,后面是一个整洁的Scala实现.
这是我尝试对实现进行基准测试.我没有做过详细的剖析.但是,我的猜测是Scala版本较慢,因为分配的对象数是线性的(每个递归调用一个).尾调用优化是否有可能发挥作用?如果我是对的,Scala支持自我递归调用的尾调用优化.所以,它应该只是帮助它.我正在使用Scala 2.8.
public class QuickSortJ {
public static void sort(int[] xs) {
sort(xs, 0, xs.length -1 );
}
static void sort(int[] xs, int l, int r) {
if (r >= l) return;
int pivot = xs[l];
int a = l; int b = r;
while (a <= b){
while (xs[a] <= pivot) a++;
while (xs[b] > pivot) …Run Code Online (Sandbox Code Playgroud) 我需要在HTML中的按钮内放置小图标(例如我需要在我的网站上有facebook按钮,在按钮第一个F图标内,然后是"facebook").怎么做 ?
目前使用devise&rails 3,有一个用户编辑页面:/ users/edit
我想将其拆分为更好的用户界面,例如:
/account/settings
/account/password
/account/notices
/account/disable
Run Code Online (Sandbox Code Playgroud)
此外,我还要求用户在用户想要更改密码时输入当前密码.
有了设计,为了实现这一点,这需要一个新的控制器,还是可以用路由处理?
此外,目前,编辑页面位于此处:app/views/devise/registrations
你建议在那里添加这些页面吗?或者在/ app/views/users中?
谢谢
我们被要求在代码中提供所有可能的错误消息以用于支持目的.
不幸的是它们并不都位于资源文件中,所以我想如果我们可以获得应用程序中所有字符串的列表,我们就可以从那里过滤出错误消息.
有什么能让我在C#应用程序中执行此操作吗?
干杯
可能重复:
调用的=>标记是什么?
嘿,
在LINQ中,=>运算符的名称是什么,例如:
list.Where(a => a.value == 5);
Run Code Online (Sandbox Code Playgroud) 我用Java编写了一个计算2的幂的程序,但它看起来非常低效.对于较小的功率(比如2 ^ 4000),它可以在不到一秒的时间内完成.但是,我正在考虑计算2 ^ 43112609,这比最大的已知素数大一个.超过1200万个数字,运行需要很长时间.到目前为止,这是我的代码:
import java.io.*;
public class Power
{
private static byte x = 2;
private static int y = 43112609;
private static byte[] a = {x};
private static byte[] b = {1};
private static byte[] product;
private static int size = 2;
private static int prev = 1;
private static int count = 0;
private static int delay = 0;
public static void main(String[] args) throws IOException
{
File f = new File("number.txt");
FileOutputStream output = new …Run Code Online (Sandbox Code Playgroud) 我有一个清单:
IEnumerable<Person> people
Run Code Online (Sandbox Code Playgroud)
我想得到这个:
IEnumerable<Dog> peoplesDogs
Run Code Online (Sandbox Code Playgroud)
其中狗是的财产的人的对象,也是一个
IEnumerable<Dog>
Run Code Online (Sandbox Code Playgroud) 是否有一个很好的工具可以根据一些原始模板自动生成jUnit测试用例?这样,测试用例可以由没有大量Java或jUnit背景的工程师编写.作为背景信息,这是用于黑盒测试.如果有一些其他替代方法来运行回归测试而不是使用jUnit,我也很感激听到它.
谢谢