我是二郎和螺纹钢的新手
最近我读了关于螺纹钢的教程
但我觉得东西后失踪,例如compile
和generate
我跑我与followging命令的应用程序rel/${nodeid}/bin/${nodeid} console
测试代码等等.但是当我关闭控制台总是我需要杀了我的自我epmd.exe
(从进程资源管理器).
有一些关于使用螺纹钢更完整的教程吗?
我有我的风格
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="MYTheme" parent="...">
<item name="android:navigationBarColor">@color/navigationBarColor</item>
</style>
</resources>
Run Code Online (Sandbox Code Playgroud)
我知道我可以改变导航栏的颜色
getWindow().setNavigationBarColor(...);
Run Code Online (Sandbox Code Playgroud)
我想用动画改变颜色,当前颜色和新颜色之间的过渡
我的代码如下:
sub new {
my $class = shift;
my $self = bless {}, $class;
$self->initialize();
return $self;
}
sub initialize
{
my $self = shift;
$self->connect();
$self->{'dbh'}
->do("CREATE TABLE IF NOT EXISTS 'settings' (Id INTEGER PRIMARY KEY, Option TEXT, Value TEXT)");
}
sub connect
{
my $self = shift;
$self->{'dbh'} = DBI->connect($self->DSN, "", "", {
RaiseError => 1,
AutoCommit => 1
});
die "Can't connect" unless($self->{'dbh'});
}
sub no_options
{
my$self = shift;
$self->{'dbh'}->prepare("SELECT COUNT(*) as Total FROM settings");
# …
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用Angular.js和Couchdb配置一个简单的服务
var App = angular.module('myapp', ['ngResource'], function(){});
App.factory('products', ['$resource', function($resource) {
var Products = $resource(
'http://localhost\\:5984/products/_all_docs',
{},
{ all: { method: 'GET'} }
);
return {
all: function() {
return Products.all();
}
};
}]);
Run Code Online (Sandbox Code Playgroud)
当我products.all()
从我的控制器打电话时,我总是得到
OPTIONS /productos/_all_docs HTTP/1.1
Host: localhost:5984
Connection: keep-alive
Access-Control-Request-Method: GET
Pragma: no-cache
Cache-Control: no-cache
Origin: http://localhost:8000
User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17
Access-Control-Request-Headers: accept, origin, x-requested-with
Accept: */*
DNT: 1
Referer: http://localhost:8000/
Accept-Encoding: gzip,deflate,sdch
Accept-Language: es-419,es;q=0.8
Accept-Charset: …
Run Code Online (Sandbox Code Playgroud) 我有两个活动MainActivity
,OtherActivity
从主要我打电话给其他并等待结果
final Intent other = new Intent(this, OtherActivity.class);
startActivityForResult(other, MY_REQUEST_CODE);
Run Code Online (Sandbox Code Playgroud)
在OtherActivity
我有一个按钮完成该过程
final Button btn = (Button) findViewById(R.id.btn_finish);
btn.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (BuildConfig.DEBUG) Log.i(TAG, "Closing");
setResult(COMPLETE_PROCESS);
finalize();
}
});
Run Code Online (Sandbox Code Playgroud)
问题是OtherActivity
屏幕上的遗骸
我试着在perl中执行以下伪代码
#!/usr/bin/perl -w
#App.pm
use strict;
use OtherModule;
use Other2Module;
sub App::hashF
{
my $hash_funtion = {
'login' => OtherModule::login,
'logout' => Other2Module::logout
};
my($module, $params) = @_;
return $hash->{$module}($params);
}
Run Code Online (Sandbox Code Playgroud)
但我得到的错误如下: - 不能使用字符串("login")作为子程序ref而"strict refs" - 不能使用bareword("OtherModelo")作为HASH ref而"strict refs"
我正在尝试写一个正则表达式,但我无法传递单词space
我有这样的数据文件(由另一个实用程序生成)
* field : 100
blahbla : <Set>
scree : <what>
.Cont.asasd :
Othreaol : Value, Other value
Point->IP : 0.0.0.0 Port 5060
Run Code Online (Sandbox Code Playgroud)
模式必须匹配并捕获这样的数据
"field" "100"
"blahbla" "<Set>"
"scree" "<what>"
".Cont.asasd" ""
"Othreaol" "Value, Other value"
Run Code Online (Sandbox Code Playgroud)
我早期的解决方案是
/^([\s\*]+)([\w]+[\s\.\-\>]{0,2}[\w]+)(\s*\:\s)(.*)/
Run Code Online (Sandbox Code Playgroud)
但我有一些字符串的问题
Z.15 example : No
Run Code Online (Sandbox Code Playgroud)
空间阻止模式匹配
H.25 miss here : No
Run Code Online (Sandbox Code Playgroud)
同样的事情在这里
我有一个类似的文件
line1 word1 word2 word4 etc..
line2 word1 word2 word4 etc..
Run Code Online (Sandbox Code Playgroud)
我知道我可以用cut -d ' ' -fx
命令提取单词,但我想在一个操作中提取并分配许多单词.
while read line;do
echo $line | awk '{ word1=$1; word2=$2 }'
# usage $word1, $word2, etc.
done < $file
Run Code Online (Sandbox Code Playgroud)
这可能吗?
jose 1234 2011/12/01
maria 2345 2010/04/10
Run Code Online (Sandbox Code Playgroud)
脚本
while read line;do
echo $line | awk '{ name=$1; counter=$2, date=$3 }'
# usage $name, $counter, $date, etc
done < $file
Run Code Online (Sandbox Code Playgroud) 我有一个带有两个活动的应用程序(MainActivity和WelcomeActividy)都延伸自 android.support.v4.app.FragmentActivity
WelcomeActivity使用ViewFlipper显示片段(Step1,Step2,...,StepN),一步使用片段列表(CategoryStarredFragment),WelcomeActivity没有问题
MainActivity使用tabhost进行显示片段,所有工作正常但是当尝试包含相同的CategoryStarredFragment(在WelcomeActivity中正常工作)时,我得到一个例外
04-11 15:32:28.197: E/AndroidRuntime(16124): Caused by: java.lang.ClassNotFoundException: android.view.fragment in loader dalvik.system.PathClassLoader[/data/app/com.package.apk]
Run Code Online (Sandbox Code Playgroud)
我想这是生成问题的tabhost的实现
这里的 MainActivity.java
public class MainActivity extends FragmentActivity implements OnTabChangeListener {
private TabHost mTabHost;
private SparseArray<Class<?>> mSparseFragments = new SparseArray<Class<?>>(){{
put(R.id.tab_home, HomeFragment.class);
// other tabs
put(R.id.tab_settings, SettingsFragment.class);
}};
private SparseArray<String> mSparseTags = new SparseArray<String>(){{
put(R.id.tab_home, "home");
// other tabs
put(R.id.tab_settings, "settings");
}};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
initTabs();
}
private void initTabs() {
mTabHost = (TabHost)findViewById(android.R.id.tabhost);
mTabHost.setup();
mTabHost.setOnTabChangedListener(this);
mTabHost.addTab(buildTabSpec("home", R.string.title_tab_home, R.layout.regular_home_fragment));
// other …
Run Code Online (Sandbox Code Playgroud) 我有一个太复杂的查询,但我可以将相同的复杂查询写入两个简单查询
我想要做:
getLoaderManager().initLoader(0, null, new EntityLoader());
getLoaderManager().initLoader(0, null, new EntityCounterLoader());
Run Code Online (Sandbox Code Playgroud)
这是在同一个FragmentList中可行吗?
尝试获取https资源时,我总是得到同样的错误:
org.springframework.web.client.ResourceAccessException: I/O error: No peer certificate; nested exception is javax.net.ssl.SSLPeerUnverifiedException: No peer certificate
Run Code Online (Sandbox Code Playgroud)
我有一个自签名虚拟主机,我的应用程序运行,应用程序正常,http
但我需要https
.
这是我的Android应用程序中的代码:
mRestTemplate = new RestTemplate();
mRestTemplate.getMessageConverters().add(new GsonHttpMessageConverter());
mRestTemplate.setRequestFactory(new HttpComponentsClientHttpRequestFactory());
final ResponseObject responseObject = mRestTemplate.postForObject(APP_URL, requestObject, ResponseObject.class);
Run Code Online (Sandbox Code Playgroud)
我尝试了@nilesh提出的解决方案但没有奏效.
我尝试了这个解决方案同样的错误
HttpParams params = new BasicHttpParams();
HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);
HttpProtocolParams.setContentCharset(params, HTTP.DEFAULT_CONTENT_CHARSET);
HttpProtocolParams.setUseExpectContinue(params, true);
SchemeRegistry schReg = new SchemeRegistry();
schReg.register(new Scheme("http", PlainSocketFactory.getSocketFactory(), 80));
schReg.register(new Scheme("https", SSLSocketFactory.getSocketFactory(), 443));
ClientConnectionManager conMgr = new ThreadSafeClientConnManager(params, schReg);
client = DefaultHttpClient(conMgr, params);
final HttpComponentsClientHttpRequestFactory factory = new HttpComponentsClientHttpRequestFactory(); …
Run Code Online (Sandbox Code Playgroud)android ×5
perl ×3
angularjs ×1
bash ×1
couchdb ×1
dbi ×1
erlang ×1
httprequest ×1
rebar ×1
regex ×1
resttemplate ×1
self-signed ×1
spring ×1
ssl ×1