在我的HTML5应用中,我使用Google Map v3并在地图上添加了几个标记.放置新标记和更改图标很容易,但我希望能够构建像谷歌纵横中使用的标记.这些标记设置有图标图像和漂亮的边框.
关于如何做到这一点的任何想法?
我目前正在开发我的第一个Android应用程序.在列表视图中,我需要在每行中包含以下组织:
我最终得到了像这样的row.xml文件,但这并不像我期望的那样工作.你知道这个文件中是否缺少明显的东西吗?非常感谢,吕克
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="?android:attr/listPreferredItemHeight"
android:padding="6dip">
<ImageView
android:id="@+id/icon"
android:layout_width="48px"
android:layout_height="48px"
android:layout_marginRight="0dip"
android:src="@drawable/icon" />
<LinearLayout
android:orientation="vertical"
android:layout_width="0dip"
android:layout_weight="1"
android:layout_height="wrap_content">
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="16dp"
android:textStyle="bold"
android:text="TITLE"
android:paddingLeft="5dp"
/>
<TextView
android:id="@+id/description"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textSize="14dp"
android:text="DESCRIPTION"
android:paddingLeft="5dp"
/>
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:layout_weight="1"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_gravity="right">
<ImageButton
android:id="@+id/button_modify"
android:layout_width="16px"
android:layout_height="16px"
android:src="@drawable/deleteicon"
/>
<ImageButton
android:id="@+id/button_delete"
android:layout_width="16px"
android:layout_height="16px"
android:src="@drawable/modifyicon"
/>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
假设我们是15/07/2010,我想获得前一周的第一天,也就是7月5日.我有以下方法,但它不起作用.似乎我的工作日属性有问题......
+ (NSDate *)getFirstDayOfPreviousWeek
{
// Get current date
NSCalendar *cal = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
NSDate *now = [NSDate date];
// Get today date at midnight
NSDateComponents *components = [cal components:( NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit | NSHourCalendarUnit | NSMinuteCalendarUnit | NSSecondCalendarUnit | NSTimeZoneCalendarUnit) fromDate:now];
[components setHour:0];
[components setMinute:0];
[components setSecond:0];
NSInteger *dayNbr = [components weekday];
NSLog(@"week day:%@",dayNbr); // CRASH
NSDate *todayMidnight = [cal dateFromComponents:components];
// Get first day of previous week midnight
components = [[[NSDateComponents alloc] init] autorelease];
NSInteger …Run Code Online (Sandbox Code Playgroud) 我开发了一款iPhone应用程序,现在我需要它才能在iPad上运行.在模拟器上,应用程序仅在一个小窗口中显示(x2缩放使应用程序能够全屏工作)但有没有办法让应用程序直接在全屏显示?
非常感谢,
吕克
我正在试图找出关于铁轨关系的一些事情.我不久前已经发布了一个关于特定项目的问题,但我真的不明白在底层数据库中做了什么.
我有一个Project模型和一个Client模型.一个项目belongs_to :client=>我需要手动添加client_id项目表(带有迁移).
A Client has_many :projects=>我不需要在DB中做任何事情(没有迁移).这些project.client和client.projects方法都可用.
我有一个Group模型和一个User模型.
一个Group has_and_belongs_to_many :user
一个User has_and_belongs_to_many :group
然后我需要创建一个迁移联合打造的表一中user_id和group_id指针.
我真的没有看到rails和关系数据库之间的边界.为什么我有时需要添加外键但不总是?这个has_many关系是如何处理的,因为我没有在底层数据库中为这个特殊的人做任何事情?
我有时会丢失:)
感谢致敬,
吕克
我想让所有学生的最后一个分数在15到20之间。为此,我使用mongoose在mongoDB中执行以下查询:模型运行良好(所有其他查询都可以)。
Pupils.find({"marks[-1].value": {'$lt' : 20 }, "marks[-1].value" : { '$gt' : 15 }}, function(err, things){
Run Code Online (Sandbox Code Playgroud)
这是行不通的,有什么我想念的吗?
*更新*
我发现类似:
Pupils.find({ "marks[-1].value": {$gt : 15, $lt : 20}});
Run Code Online (Sandbox Code Playgroud)
但这也不起作用。在这种情况下,是否有办法获取标记数组的最后一个标记?
我有一个nginx服务器作为node.js应用程序的前端.
当请求到达应用程序时,我想稍微修改它(请求)并将其转发到另一个node.js应用程序.最好的方法是什么?
我在考虑节点代理,但是当我在节点应用程序中使用expressjs时,我不确定如何使用node-proxy和同时表达.
任何的想法 ?
UPDATE
我可以在expressjs路由中使用res.redirect转发到其他node.js应用程序吗?我刚试过这个,但它没有按预期工作.
从我的ubuntu(10.04)框中,我没有问题发送电子邮件:
echo "hello" | mail -s 'test email' my_gmail_nickname@gmail.com
Run Code Online (Sandbox Code Playgroud)
当我尝试从同一台机器上运行的node.js应用程序发送电子邮件时,它不起作用.
var nodemailer = require('nodemailer');
nodemailer.SMTP = {
host: 'localhost'
}
nodemailer.send_mail(
{
sender: 'me@example.com',
to:'my_gmail_nickname@gmail.com',
subject:'Hello!',
html: 'test',
body:'test'
},
function(error, success){
console.log(error);
console.log(success);
console.log('Message ' + success ? 'sent' : 'failed');
});
Run Code Online (Sandbox Code Playgroud)
我有错误消息:
me@luc:~/gridteams/services/gpshop$ cat nohup.out
{ stack: [Getter/Setter],
arguments: undefined,
type: undefined,
message: 'ECONNREFUSED, Connection refused',
errno: 111,
code: 'ECONNREFUSED',
syscall: 'connect' }
null
sent
Run Code Online (Sandbox Code Playgroud)
我看到连接被拒绝但不明白我为什么会收到此错误.你觉得缺少什么?
我使用以下代码在用户的位置显示地图中心:
...
// start off by default current position
AppManager *appManager = [AppManager sharedManager];
MKCoordinateRegion newRegion;
newRegion.center.latitude = [appManager.currentlatitude floatValue];
newRegion.center.longitude = [appManager.currentlongitude floatValue];
newRegion.span.latitudeDelta = 0.06;
newRegion.span.longitudeDelta = 0.06;
[self.mapView setRegion:newRegion animated:YES];
[self.view insertSubview:mapView atIndex:0];
...
Run Code Online (Sandbox Code Playgroud)
问题是,当使用"newRegion.span.latitudeDelta"和"newRegion.span.longitudeDelta"值时,我无法充分降低缩放级别.当我想拥有几百个时,变焦只显示一个30公里宽的区域.
对于我所看到的,longitudeDelta的值0.06应该显示180 degre(地球的一半)(对于纬度0),然后对于纬度43,我想我应该看到超过30 km.
任何的想法 ?
我没有设法让iAd在故事板中工作,在UITableViewController中.
这基本上是我到目前为止所做的:在故事板中,我在我的UITableViewController场景的底部拖了一个iAd横幅视图.(我无法在视图中设置横幅,因为故事板会阻止它.我只能将iAd对象拖到第一个响应器和UITableViewController的图标旁边.)
在UITAbleViewController的标题中,我有:
#import <UIKit/UIKit.h>
#import "ListViewController.h"
#import <iAd/iAd.h>
@interface ListViewController : UITableViewController <ADBannerViewDelegate>{
bool bannerIsVisible;
}
@property (strong, nonatomic) IBOutlet ADBannerView *iAd;
@end
Run Code Online (Sandbox Code Playgroud)
在UITableViewController的实现中,我有:
- (void)viewDidLoad
{
[super viewDidLoad];
iAd.delegate = self;
// iAd.frame = CGRectMake(0.0,200.0,iAd.frame.size.width,iAd.frame.size.height); // does not work
// self.tableView.tableFooterView = iAd; // Display the banner at the middle of the screen (depending upon the number item of the table)
// Do not know how to have the default banner to appear at the very bottom of …Run Code Online (Sandbox Code Playgroud) ios ×3
node.js ×3
google-maps ×2
iphone ×2
objective-c ×2
android ×1
iad ×1
ios4 ×1
ipad ×1
javascript ×1
jquery ×1
mkmapview ×1
mongodb ×1
mongoose ×1
nodemailer ×1
nsdate ×1
proxy ×1
sendmail ×1
storyboard ×1
xcode ×1