我最近更新了我的ubuntu,我想在我的Ubuntu 13.10中编程,并且正在设置apache2,每次运行命令时:
sudo a2ensite default
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
错误默认站点不存在
我该如何解决这个问题?
为什么javascript文件加载两次?
$(window).load(function() {
$(function() {
console.log('hi');
});
});
Run Code Online (Sandbox Code Playgroud)
这是控制台输出:
vm和Categories都是同一个文件
问题不仅仅在于console.log,我称之为jquery"click"的任何函数都会被触发两次!
scrollingPage.js:
/**
* fullPage 1.3.1
* https://github.com/alvarotrigo/fullPage.js
* MIT licensed
*
* Copyright (C) 2013 alvarotrigo.com - A project by Alvaro Trigo
*/
(function($) {
$('.PageData').live('mouseleave' ,function(){
window.windowScrollOF = false;
});
$('.PageData').live('mouseenter', function(){
window.windowScrollOF = true;
});
$('.CatData').live('mouseleave' ,function(){
window.windowScrollOF = false;
});
$('.CatData').live('mouseenter', function(){
window.windowScrollOF = true;
});
$.fn.fullpage = function(options) {
// Create some defaults, extending them with any options that were provided
options = $.extend({
"verticalCentered" …
Run Code Online (Sandbox Code Playgroud) 我想这个使用钥匙串存储在iOS上的密码与storybored来存储用户的电子邮件和密码进行登录.
在我的m文件中:
....
....
#import "KeychainItemWrapper.m"
....
....
KeychainItemWrapper* keychain = [[KeychainItemWrapper alloc] initWithIdentifier:@"KeychainTest" accessGroup:nil];
[keychain setObject:kSecAttrAccessibleWhenUnlocked forKey:kSecAttrAccessible];
NSLog(@"%@, %@", [keychain objectForKey:kSecAttrAccount], [keychain objectForKey:kSecValueData]);
[keychain setObject:@"example@email.com" forKey:kSecAttrAccount];
[keychain setObject:@"MySuperSecretPassword" forKey:kSecValueData];
NSLog(@"%@, %@", [keychain objectForKey:kSecAttrAccount], [keychain objectForKey:kSecValueData]);
Run Code Online (Sandbox Code Playgroud)
但我收到以下错误:
Implicit conversion of C pointer type 'CFTypeRef' (aka 'const void *') to Objective-C pointer type 'id' requires a bridged cast
Run Code Online (Sandbox Code Playgroud)
我有一个页面显示来自不同远程服务器的大量图像.http://example.com/img/email_star0.png'height ='150'/>
现在假设这个图像不存在,我在我的html中得到一个(x).无论如何我可以检测到这个图像不存在并用本地图像替换这个(x)而不必使用Curl检查文件是否存在于远程服务器上(或者使用JQuery),从而节省时间?这可以在当地完成吗?
谢谢你的帮助
这就是我向ListView添加项目的方法:
public class ServersAdapter extends ArrayAdapter<String> {
public ServersAdapter(Context context, int resource, int textViewResourceId, String[] servers) {
super(context, resource, textViewResourceId, servers);
Log.d("noc", "ServersAdapterin: ");
// TODO Auto-generated constructor stub
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
Log.d("noc", "getView: ");
LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View row = inflater.inflate(R.layout.servers_list, parent, false);
Log.d("noc", "inflate: ");
//datasource = new ServersDataSource(getContext());
datasource.open();
//servir list
Log.d("noc", "ServersDataSource: ");
Server[] servers = datasource.getAllServers();
ImageView iv = (ImageView) row.findViewById(R.id.imageView1);
TextView tv = (TextView) …
Run Code Online (Sandbox Code Playgroud) omnipay没有完整的文档!我试图在授权后进行捕获,但我似乎无法做到正确.
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
use Omnipay\Common\GatewayFactory;
class Welcome extends CI_Controller {
function __construct() {
parent::__construct();
$this->load->helper('url');
}
public function authorize() {
$gateway = GatewayFactory::create('PayPal_Express');
$gateway->setUsername('***');
$gateway->setPassword('***');
$gateway->setSignature('***');
$gateway->setTestMode(true);
$response = $gateway->authorize(
array(
'cancelUrl' => base_url('welcome/authorize_return'),
'returnUrl' => base_url('welcome/authorize_return'),
'amount' => '1.99',
'currency' => 'USD'
)
)->send();
$response->redirect();
}
public function authorize_return() {
$gateway = GatewayFactory::create('PayPal_Express');
$gateway->setUsername('***');
$gateway->setPassword('***');
$gateway->setSignature('***');
$gateway->setTestMode(true);
$response = $gateway->completeAuthorize(
array(
'cancelUrl' => base_url('welcome/authorize_return'),
'returnUrl' => base_url('welcome/authorize_return'),
'amount' => '1.99',
'currency' => 'USD' …
Run Code Online (Sandbox Code Playgroud) 我有一个css文件,我不想改变(出于我自己的原因)所以我所做的是创建一个新的css文件,我覆盖每个需要更改的css行.现在我该如何取消这行代码:
@media (max-width: 480px)
.nav-collapse {
-webkit-transform: translate3d(0, 0, 0);
}
Run Code Online (Sandbox Code Playgroud)
我想禁用-webkit-transform,它会产生一些问题.另一件事我想知道这究竟是做什么的?也许我可以用另一种方式解决这个问题.
我将ubuntu更新为13.10后设置虚拟主机有困难!! 这是我试过的:
启动终端并键入:
sudo a2enmod vhost_alias
Run Code Online (Sandbox Code Playgroud)
如果您没有收到任何错误消息,并且您的回复如下所示,那么您就是在正确的轨道上.
Enabling module vhost_alias.
Run '/etc/init.d/apache2 restart' to activate new configuration!
Run Code Online (Sandbox Code Playgroud)
接下来要做的是通过键入来访问sites-available目录
cd /etc/apache2/sites-available/
Run Code Online (Sandbox Code Playgroud)
好的,现在我们在apaches目录中,其中虚拟主机的所有定义文件都是.我们想要复制默认模板一,密码命名为default
sudo cp default our-test-site
Run Code Online (Sandbox Code Playgroud)
这将创建一个名为our-test-site的默认模板的副本(当然,您应该将其替换为您想要的任何内容).让我们编辑它,输入
sudo gedit our-test-site
Run Code Online (Sandbox Code Playgroud)
这将在编辑器中打开文件,下面是默认vhost文件的内容(如果你做了一些自定义,通常是YMMV)
ServerAdmin webmaster@localhost
DocumentRoot /var/www
Options FollowSymLinks
AllowOverride None
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
ErrorLog /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn …
Run Code Online (Sandbox Code Playgroud) 这是我的第一个项目libGDX
,我正在尝试循环一个com.badlogic.gdx.utils.Array
:
//properties
...
private Array<Item> items;
...
//constructor
...
items = new Array<Item>();
...
//render method
...
for (Item item : items) {
item.update(deltaTime);
}
...
Run Code Online (Sandbox Code Playgroud)
Android Studioitems
在悬停时突出显示消息:
使用不可重入迭代器方法:Array.iterator()
每次调用该方法时,LibGDX 集合上的迭代器方法都会返回相同的迭代器实例。对于嵌套或多线程迭代,使用适当的构造函数创建一个新的迭代器
我不确定如何解决这个问题,或者这是否只是一种通知类型的错误,从长远来看它是否会影响任何事情。
任何想法这是什么以及如何解决它?
来自Android开发,我使用SharedPreferences存储用户名和密码以使用OutputStreamWriter和HttpURLConnection登录到服务器。现在在iOS 中我使用NSMutableURLRequest发送用户名和密码。是否有任何的iOS存储喜欢的用户名和密码SharedPreferences中的iOS?请记住,这是敏感数据,因此需要确保安全。
我收到以下格式的json字符串:
{"27":{"id":"27","uid":"4","title":"teamer.zapto.org","url":"www.google.jo","ip":"74.125.234.63","enabled":"1","services":{"Http 1":{"status":"1","ts":"1355058071"}},"fetch_interval":"60","ping_shift":"0"},
"30":{"id":"30","uid":"4","title":"google","url":"www.google.com","ip":"74.125.234.114","enabled":"1","services":{"Http 1":{"status":"1","ts":"1355058079"}},"fetch_interval":"60","ping_shift":"0"},
"31":{"id":"31","uid":"4","title":"facebook.com","url":"facebook.com","ip":"69.171.247.21","enabled":"1","services":{"Http 1":{"status":"1","ts":"1355058095"}},"fetch_interval":"60","ping_shift":"0"},
"32":{"id":"32","uid":"4","title":"ebir","url":"www.ebir.com","ip":"74.52.50.226","enabled":"1","services":{"Ftp":{"status":"1","ts":"1355058073"},"Http 1":{"status":"1","ts":"1355058073"}},"fetch_interval":"60","ping_shift":"0"},
"33":{"id":"33","uid":"4","title":"zapto","url":"teamer.zapto.org","ip":"200.35.150.6","enabled":"1","services":{"Http 1":{"status":"0","ts":"1355056146"}},"fetch_interval":"3600","ping_shift":"2"},
"35":{"id":"35","uid":"4","title":"vogella.com","url":"vogella.com","ip":"46.163.79.226","enabled":"1","services":{"Ftp":{"status":"1","ts":"1355058098"},"Http 1":{"status":"1","ts":"1355058098"}},"fetch_interval":"60","ping_shift":"0"},
"36":{"id":"36","uid":"4","title":"msn","url":"www.msn.com","ip":"131.253.13.140","enabled":"1","services":{"Http 1":{"status":"1","ts":"1355058103"}},"fetch_interval":"60","ping_shift":"0"},
"37":{"id":"37","uid":"4","title":"dubizzle.com","url":"www.dubizzle.com","ip":"94.236.93.152","enabled":"1","services":{"Http 1":{"status":"1","ts":"1355058068"}},"fetch_interval":"60","ping_shift":"0"},
"38":{"id":"38","uid":"4","title":"olx.jo","url":"olx.jo","ip":"204.74.99.100","enabled":"1","services":{"Http 1":{"status":"1","ts":"1355058108"}},"fetch_interval":"60","ping_shift":"0"},
"40":{"id":"40","uid":"4","title":"www.sukar.com","url":"www.sukar.com","ip":"72.52.8.195","enabled":"1","services":{"Ftp":{"status":"0","ts":"1355058092"},"Http 1":{"status":"1","ts":"1355058092"}},"fetch_interval":"60","ping_shift":"0"}}
Run Code Online (Sandbox Code Playgroud)
你可以看到键是数字(27,30,31,...)并且不是连续的.如何从这样的json获取数据?我知道它必须是某种循环取决于长度,但我无法弄清楚如何这样做.通常我会用jObject.getString("id")
,但因为我不知道字符串是什么我能做什么?
嗨,我试图将诸如"abc-d1_23QWEwer"之类的刺痛转换为int数
StringBuilder sb = new StringBuilder();
int intServiceName = 0;
String stringServiceValue;
for (int i = 0; i < serviceName.length(); i++){
if (DEBUG) Log.i(TAG, "serviceName.length() loop i: " + i);
sb.append(String.valueOf(Character.getNumericValue(serviceName.charAt(i))));
if (DEBUG) Log.i(TAG, "serviceName.length() loop i after: " + i);
}
if (DEBUG) Log.i(TAG, "serviceName.length() loop end2");
stringServiceValue = sb.toString();
if (DEBUG) Log.i(TAG, "serviceName.length() loop end: "+stringServiceValue.replaceAll("\\D+",""));
stringServiceValue = stringServiceValue.replaceAll("\\D+","");
if (DEBUG) Log.i(TAG, "serviceName.length() loop endstringServiceValue: "+ stringServiceValue);
intServiceName = Integer.parseInt(stringServiceValue);
if (DEBUG) Log.i(TAG, "serviceName.length() loop end123123: "+ String.valueOf(intServiceName)); …
Run Code Online (Sandbox Code Playgroud) 这是我到目前为止,一个包含4个项目的表,你必须相互匹配两个图像.每件商品都有正面和背面两张图片,就像卡片一样.
<table style="padding-left:5px;" width="410" border="0" cellpadding="0" cellspacing="5">
<tr>
<td>
<div id="Wrapper">
<div class="Card" id="Card1">
<div id="Back1" class="Back">
<img src="/assets/public/images/thumb_60x60_18-Feb-2014/23301.png" width="60" height="60" alt="Back">
</div>
<div id="Front1" class="Front">
<img src="/assets/images/BlockCover.png" width="90" height="90" alt="Front">
</div>
</div>
</div>
</td>
<td>
<div id="Wrapper">
<div class="Card" id="Card2">
<div id="Back2" class="Back">
<img src="/assets/public/images/thumb_60x60_18-Feb-2014/25662.png" width="60" height="60" alt="Back">
</div>
<div id="Front2" class="Front">
<img src="/assets/images/BlockCover.png" width="90" height="90" alt="Front">
</div>
</div>
</div>
</td>
<td>
<div id="Wrapper">
<div class="Card" id="Card3">
<div id="Back3" class="Back">
<img src="/assets/public/images/thumb_60x60_18-Feb-2014/22963.png" width="60" height="60" alt="Back">
</div>
<div id="Front3" class="Front"> …
Run Code Online (Sandbox Code Playgroud) android ×4
java ×3
php ×3
html ×2
ios ×2
virtualhost ×2
.htaccess ×1
apache ×1
apache2 ×1
cocoa-touch ×1
credentials ×1
css ×1
int ×1
javascript ×1
json ×1
keychain ×1
lamp ×1
libgdx ×1
mod-rewrite ×1
objective-c ×1
omnipay ×1
passwords ×1
reentrancy ×1
string ×1
ubuntu ×1
ubuntu-13.10 ×1