我正在寻找一种简单的方法来为每个表单添加一组字段.
我找到了一种扩展AbstractType的buildForm方法,并使用该方法添加更多字段.
在创建表单时,我给出了我的新类型的名称(如何创建自定义表单字段类型).
在我看来,这是一种简单的方法,但每种形式仅限于一种类型.
是否有更好的方法来实现这样的目标?
我已经阅读了symfony的食谱,但我只找到了如何扩展现有表单而不是如何使用我的字段创建自己的表单"模板".
我有一个gitlab服务器版本"Gitlab 6.0.2 10b0b8f".我想连接"Jenkins CI"用于构建目的.为此,我关注 - http://doc.gitlab.com/ee/integration/jenkins.html.但在项目服务中,我无法看到"Jenkins CI".只有我能看到"Gitlab CI".你能帮我么.任何例子都会受到批评.
我找到了一个在VM中安装Android-x86的简单指南(指南).
连接到Eclipse并且一切正常,但在VM上安装我的应用程序失败并出现以下错误:
06-21 22:40:26.390: INFO/PackageManager(2439): /data/app/xyz.apk changed; unpacking
06-21 22:40:26.390: ERROR/PackageManager(2439): Package xyz has mismatched uid: 10044 on disk, 10045 in settings
06-21 22:40:26.390: WARN/PackageManager(2439): Native ABI mismatch from package file
06-21 22:40:26.390: WARN/PackageManager(2439): Package couldn't be installed in /data/app/xyz-1.apk
Run Code Online (Sandbox Code Playgroud)
我在谷歌搜索错误,发现一个小的Python脚本来解决问题,但它不起作用(脚本).执行脚本后,我得到了同样的错误.
我使用Android-x86 2.2泛型,更多细节可以在这里找到:2.2版
有没有可能解决这个问题?
编辑:
我测试了所有2.2版本.只有泛型和sparta一般工作,但没有人接受我的apk.
也试过adb install <packagefile>.
EDIT2:
我试过@Vlad的推荐工具.它在签署apk后部分工作.最后我使用了apkTools并用apktool中的new替换了apkEdit的旧文件.
但是adb的安装会挂起等待设备的消息或什么都没有.如果我相信eclipse DDMS,每次我尝试安装apk时,与设备的连接都会丢失.
这是我尝试安装普通 apk 时的失败:Failure [INSTALL_FAILED_INVALID_APK]
我试图从我的Android/Java源代码访问Basecamp API ....
import org.apache.http.HttpResponse;
import org.apache.http.StatusLine;
import org.apache.http.client.ResponseHandler;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.BasicResponseHandler;
import org.apache.http.impl.client.DefaultHttpClient;
import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebView;
public class BCActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
DefaultHttpClient httpClient = new DefaultHttpClient();
//final String url = "https://encrypted.google.com/webhp?hl=en"; //This url works
final String url = "https://username:password@projectsource.basecamphq.com/people.xml"; //This don't
HttpGet http = new HttpGet(url);
http.addHeader("Accept", "application/xml");
http.addHeader("Content-Type", "application/xml");
try {
// HttpResponse response = …Run Code Online (Sandbox Code Playgroud) 我想计算一些数组中的值的数量.
count和之间有什么区别sizeof?
$recips = array();
echo count($recips);
echo sizeof($recips);
Run Code Online (Sandbox Code Playgroud) 我在我的Mac OS X Mavericks机器上运行Jenkins 2.0.我正在尝试从内部服务器下载存储库.但是,这个工作挂了git fetch电话10分钟,然后超时.
如果我手动运行git clone或git fetch从shell脚本(来自Jenkins),我得到相同的整体结果,除了作业无休止地挂起.
我可以从终端运行clone或fetch命令就好了.
我想知道这是否是某种需要解决的用户权限错误.
这是日志:
Started by user Colin Basnett
Building in workspace /Users/Shared/Jenkins/Home/workspace/Service
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url http://192.168.4.40/Bonobo.Git.Server/Service.git # timeout=10
Fetching upstream changes from http://192.168.4.40/Bonobo.Git.Server/Service.git
> git --version # timeout=10
using .gitcredentials to set credentials
> git config --local credential.username jenkins # timeout=10
> git config --local credential.helper store …Run Code Online (Sandbox Code Playgroud) 我们已升级到Jenkins 2.0,升级后我们无法创建新作业,而单击New Item则指向空白页面,下面是当时捕获的日志错误,
Apr 28, 2016 6:07:09 PM org.eclipse.jetty.util.log.JavaUtilLog warn
WARNING: Error while serving http://ci.test.com:8080/view/All/itemCategories
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:320)
at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:163)
at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:96)
at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:124)
at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
at org.kohsuke.stapler.MetaClass$5.doDispatch(MetaClass.java:233)
at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:649)
at org.kohsuke.stapler.Stapler.service(Stapler.java:238)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)
at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:135)
at com.smartcodeltd.jenkinsci.plugin.assetbundler.filters.LessCSS.doFilter(LessCSS.java:46)
at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:132)
at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:126)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:49)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at jenkins.security.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:117)
at …Run Code Online (Sandbox Code Playgroud) 我对C不太熟悉,但我需要在我的java代码中使用C库.我已经创建了DLL并且能够很好地访问它,但我试图从C代码返回一个int数组到java代码.
在CI中,您可以简单地返回一个指向数组的指针,但它的工作方式与我在Java代码中的预期不同.这是C代码:
int * getConusXY(double latitude, double longitude) {
maparam stcprm;
double reflat = 25, reflon = -95,
lat1 = 20.191999, lon1 = -121.54001,
x1 = 0, y1 = 0, x2 = 1073, y2 = 689,
gsize = 5.079, scaLat = 25, scaLon = -95, orient = 0;
double x, y;
int* xy;
xy = malloc(2 * sizeof *xy);
stlmbr(&stcprm, reflat, reflon);
stcm1p(&stcprm, x1, y1, lat1, lon1, scaLat, scaLon, gsize, orient);
cll2xy(&stcprm, latitude, longitude, &x, &y);
xy[0] = (int) x; …Run Code Online (Sandbox Code Playgroud) 如何在Android中轻松生成Synth和弦声音?我想能够使用8bit动态生成游戏音乐.尝试使用AudioTrack,但尚未获得好听的效果.
有什么例子吗?
我尝试了以下代码但没有成功:
public class BitLoose {
private final int duration = 1; // seconds
private final int sampleRate = 4200;
private final int numSamples = duration * sampleRate;
private final double sample[] = new double[numSamples];
final AudioTrack audioTrack;
public BitLoose() {
audioTrack = new AudioTrack(AudioManager.STREAM_MUSIC,
sampleRate, AudioFormat.CHANNEL_CONFIGURATION_MONO,
AudioFormat.ENCODING_PCM_8BIT, numSamples,
AudioTrack.MODE_STREAM);
audioTrack.play();
}
public void addTone(final int freqOfTone) {
// fill out the array
for (int i = 0; i < numSamples; ++i) {
sample[i] = Math.sin(2 * …Run Code Online (Sandbox Code Playgroud) 我正在使用Win32 ListView32.
当选择ListView中的行时,它具有深蓝色.可以通过单击或通过调用以编程方式选择行ListView_SetItemState(hwnd, index, LVIS_SELECTED, LVIS_SELECTED);.
当ListView控件焦点丢失时,所选行变为灰色.
无论焦点如何,如何保持选定的深蓝色行?