我注意到使用letter-spacing和text-align:center的奇怪行为.
增加空间,使文本更接近元素的左边距.
HTML
<div>
<p>- Foo Bar Zan -</p>
</div>
Run Code Online (Sandbox Code Playgroud)
CSS
div {
width: 400px;
height:400px;
background-color: #3b0d3b;
text-align:center;
margin:auto;
}
p {
color:#fff;
margin-top: 40px;
text-align:center;
padding-top:30px;
font-size: 1.2em;
letter-spacing:.9em; <--- Here is the problem
}
Run Code Online (Sandbox Code Playgroud)
我已经创建了一个codepen来展示我的意思.
我在上一次Firefox和Chrome上发现了相同的行为.有没有办法解决这个问题?
我使用http://www.fontsquirrel.com/创建了一个@ font-face工具包.
它工作正常,但Windows上的结果与mac上的结果不同.
在Windows上,字体似乎有一个错误的抗锯齿:
这是Mac上带有FF,Chrome或Safari的结果(全部更新到上一版本).
这是Windows上使用FF或Chrome的结果.
如您所见,结果不一样.在Windows上,字体更粗,更粗糙.
我怎么解决这个问题?
我正在尝试开发一个webapp,让用户浏览他的Active Directory联系人.
我有两个帐户:一个用于注册应用程序(开发者帐户),另一个用户是可以访问Office365(用户帐户)的普通用户.
我已经按照Azure AD Graph API文档设置了一个Javascript客户端.
到现在为止,我能够提示用户登录并检索访问令牌,但是当我尝试发出请求时,我总是收到401错误.
我是Azure的新手,所以我真的不明白问题是在我的应用程序配置中还是在我的代码中.
我可以使用我的用户帐户浏览Graph API资源管理器,因此我认为他没有错过访问它的授权.
我真的很困惑.
我尝试添加我正在做的所有步骤,希望有人可以指出错误.
要求1:
Url: https://login.windows.net/{my tenant id or common (both are working) }/oauth2/authorize
Method: GET
Params:
redirect_uri // my redirect url, the same I registered in my application. It is just a page that returns the content of the URL
client_id // my client id
response_type // code
state // a random generated string, not required, but reccomanded
resource // https://graph.windows.net
Run Code Online (Sandbox Code Playgroud)
回复1:
code // A …
Run Code Online (Sandbox Code Playgroud) 我将一个Loopback应用程序部署到Heroku,但它一直崩溃并出现错误
Web process failed to bind to $PORT within 60 seconds of launch
我知道它可以连接到Heroku的动态端口,所以我将我的端口设置为进程环境
app.start = function () {
// start the web server
var port = process.env.PORT || 3000;
app.set('port', port);
app.use(loopback.static(path.resolve(__dirname, '../client')));
app.use(loopback.static(path.resolve(__dirname, '../.tmp')));
return app.listen(function () {
app.emit('started');
console.log('Web server listening at: %s', app.get('url'));
});
};
Run Code Online (Sandbox Code Playgroud)
但这并没有解决问题.
任何的想法?
我想在我的rails应用程序中进行就地搜索.
我使用了button_to_remote和原型,但现在我正在使用JQuery,所以我改为link_to.
这是我的代码:
<%= link_to "Search", {:action => "geocode", :with => "'address='+$('#{address_helper_id}').value"}, :method => :post, :remote => true %>
Run Code Online (Sandbox Code Playgroud)
我想将地址文本字段传递给我的控制器,但输出不是我所期望的.
/mycontroller/geocode?with=%27address%3D%27%2B%24%28%27record_location___address%27%29.value
Run Code Online (Sandbox Code Playgroud)
我如何提交我的价值?
我必须匹配字符串中n个特殊字符的出现次数.
我想创建一个包含所有这些字符的数组(它们是20+)并创建一个匹配它们的函数.
我只是在字符串中有特殊字符的总数,所以我可以对它们进行一些数学计算.
所以在这个例子中:
NSString *myString = @"My string #full# of speci@l ch@rs & symbols";
NSArray *myArray = [NSArray arrayWithObjects:@"#",@"@",@"&",nil];
Run Code Online (Sandbox Code Playgroud)
该函数应返回5.
是否更容易匹配不在数组中的字符,获取字符串长度并输出原始字符串和没有特殊字符的字符串之间的差异?
这是最好的解决方案吗?
是否可以将虚拟属性添加到ngResource?我创建了这样的服务
app.factory('Person', ['$resource', function($resource) {
return $resource('api/path/:personId', {
personId: '@_id'
}, {
update: {
method: 'PUT'
}
});
}])
Run Code Online (Sandbox Code Playgroud)
Person
有一个属性name
和一个属性surname
.
我想fullname
通过添加fullname
返回的虚拟属性来检索resource.name + resource surname
.
我知道我可以在控制器中添加它,但是将它添加到服务中会使它更加便携.我试过这样的事
app.factory('Person', ['$resource', function($resource) {
return $resource('api/path/:personId', {
personId: '@_id'
}, {
update: {
method: 'PUT'
},
fullname: function(resource){
return resource.name + ' ' + resource.surname;
}
});
});
}])
Run Code Online (Sandbox Code Playgroud)
但它不起作用.
我试图在iOS项目中使用Cocoapods和一些自定义配置.
我有3个(Dev,Stage,Prod),每个人都有一些习惯GCC_PREPROCESSOR_DEFINITIONS
.我已经看到周围的人向我们建议#include <path-to-pods.xcconfig>
,但这似乎是旧的方式来做到这一点.
我见过Cocoapods 0.39
会根据我的配置自动生成配置文件并自动将它们添加到我的目标中(这很好).这篇文章
也证实了这一点,他正在谈论创建Podfiles的"新方法".问题是这些文件不包含我的配置.
我试图用xcodeproj
和link_with
,但没有成功.有谁知道处理Cocoapods +自定义xcconfig文件的正确方法是什么?
我有两种版本的相同 Android 应用程序,内置 React Native(Lite 和 Pro)。
我能够在应用程序和 gradle 风格中注入特定变量,因此我可以让这两个应用程序在运行时表现不同。
然而,这两种风格最终会包含来自相同的相同模块,package.json
即使这两种风格之一不具有所有功能,因此不需要所有模块和清单合并设置的权限。
有没有办法在构建阶段包含/排除模块而不必复制所有内容?
举个例子:Lite 版本不需要相机,但因为我包含react-native-camera
在 my 中package.json
,Lite 版本最终需要相机许可,即使它不使用它。
我想根据产品所属的属性集创建不同的产品视图:Magento 是否提供了执行此操作的方法?
- 更新 -
按照我添加的 dan.codes 建议
$update->addHandle('PRODUCT_ATTRIBUTE_SET_ID_'.$product->getAttributeSetId());
Run Code Online (Sandbox Code Playgroud)
到 Mage_Catalog_ProductController (我复制了 ProductController.php 并将其放在 local/Mage/Catalog/controllers/ 中)。
然后我将其添加到catalog.xml
<PRODUCT_ATTRIBUTE_SET_ID_9> // PRODUCT ID of Book Attribute Set
<label>Catalog Product View (Book)</label>
<reference name="product.info">
<block type="catalog/product_view_type_book" name="product.info.book" as="product_type_data" template="catalog/product/view/attribute_set/book.phtml">
<block type="core/text_list" name="product.info.book.extra" as="product_type_data_extra"/>
</block>
</reference>
</PRODUCT_ATTRIBUTE_SET_ID_9>
Run Code Online (Sandbox Code Playgroud)
刚过
<PRODUCT_TYPE_virtual translate="label" module="catalog">
<label>Catalog Product View (Virtual)</label>
<reference name="product.info">
<block type="catalog/product_view_type_virtual" name="product.info.virtual" as="product_type_data" template="catalog/product/view/type/virtual.phtml">
<block type="core/text_list" name="product.info.virtual.extra" as="product_type_data_extra"/>
</block>
</reference>
</PRODUCT_TYPE_virtual>
Run Code Online (Sandbox Code Playgroud)
然后我创建了catalog/product/view/attribute_set/book.phtml,但它没有显示在我的产品视图页面中。
- 更新 Magento 1.5 -
我注意到处理程序更新已在最后一个 Magento 版本中移动。
$update->addHandle('PRODUCT_TYPE_'.$product->getTypeId());
$update->addHandle('PRODUCT_'.$product->getId());
Run Code Online (Sandbox Code Playgroud)
现在位于 Mage/Catalog/Helper/Product/View.php 中。
我已经测试过了,效果仍然很好!
css ×2
angularjs ×1
antialiasing ×1
attributes ×1
azure ×1
character ×1
cocoapods ×1
crash ×1
express ×1
font-face ×1
heroku ×1
html ×1
in-place ×1
ios ×1
iphone ×1
jquery ×1
link-to ×1
loopbackjs ×1
magento ×1
ngresource ×1
node.js ×1
nsarray ×1
nsrange ×1
objective-c ×1
office365 ×1
product ×1
react-native ×1
search ×1
templates ×1
xcconfig ×1