我想开发一个近乎实时的基于Web的聊天系统.关于如何通过jQuery实现这一点的任何建议,任何需要注意的问题,以及我一直在阅读的这个Comet的东西是什么?
理想情况下,我想支持最多约5,000个并发聊天.
我想收集用户的地址,以便我可以在Google地图上绘制它们.我知道我需要存储他们的地址的纬度/经度值,我可以从谷歌地图API获得.
我正在寻找有关如何划分各种地址部分并将其保存到数据库的建议.我经常看到这样的事情:
不过,Google对这些地址组件进行了不同的分解.例如,请参阅:http://maps.googleapis.com/maps/api/geocode/json?address = 1600+Amphitheatre + Parkway,+ Mountain + View,+ CA&_sensor = false
我不确定Google地址组件的哪些部分等同于Web表单中常见的部分(例如,administrative_area_level_1始终是州/地区/省?).我想尽可能以原子方式存储各种地址组件,以便在以后显示地址信息时能够获得最大的控制权.
注意:我也打算存储formatted_address我认为在某些情况下可能有用的内容.
那么,我应该在我的数据库中存储什么?
有哪些策略可用于为PHP类的私有成员创建访问器和更改器?这个建议是否合适:http://cormacscode.wordpress.com/2009/01/22/read-only-object-variables-in-php-using-magic-methods/
<?php
class classWithReadOnlyVar
{
private $readOnlyVar;
public function __get($varName)
{
return $this->$varName;
}
public function __set($varName,$varValue)
{
}
}
Run Code Online (Sandbox Code Playgroud)
如果某些成员需要私有,公共或受保护的财产方法怎么办?
我曾经读到以下编码技术被认为是错误的:
<a HREF="page.htm" onClick="alert('Hello World')">text link</a>
Run Code Online (Sandbox Code Playgroud)
基本上,在HTML标记中使用这些事件处理程序(如onClick)是错误的使用方法.这是什么原因?什么是这种"坏"技术?这样做的"正确"方法是什么?
查看:http : //maps.googleapis.com/maps/api/geocode/json? address= 1600+Amphitheatre+Parkway,+Mountain+View,+CA& sensor= false
我正在使用MySQL。
给定部分或完整的地址,Google Map API将返回以下内容:
"address_components" : [
{
"long_name" : "1600",
"short_name" : "1600",
"types" : [ "street_number" ]
},
{
"long_name" : "Amphitheatre Pkwy",
"short_name" : "Amphitheatre Pkwy",
"types" : [ "route" ]
},
{
"long_name" : "Mountain View",
"short_name" : "Mountain View",
"types" : [ "locality", "political" ]
},
{
"long_name" : "Santa Clara",
"short_name" : "Santa Clara",
"types" : [ "administrative_area_level_2", "political" ]
},
{
"long_name" : "California",
"short_name" …Run Code Online (Sandbox Code Playgroud) 我需要开发一个支持"时间表"的应用程序.时间表示例:
如果您已经看过Outlook的调度程序,那基本上就是我需要的.以下是他们用户界面的屏幕截图:http://www.question-defense.com/wp-content/uploads/2009/04/outlook-meeting-recurrance-settings.gif
我如何在数据库中建模这些信息?请记住,我还需要查询这个,例如:
我正在使用PHP/MySQL,但我对其他解决方案持开放态度.建议?
说我卖了一些product。有时, theproduct实际上是 other 的组合product。例如,假设我正在销售:
我应该如何建模这样的东西?我是否应该有一个product表格来列出单个产品,然后是一个product_combo描述组合的表格,以及另一个与组合中的产品相关联product并product_combo逐项列出产品的表格?这对我来说似乎很简单。
但是,如果我想将所有销售额记录在一张表中怎么办?意思是,我不想要product_sales桌子和product_combo_sales桌子。我希望所有销售都集中在一张桌子上。我有点不确定如何以这样的方式对产品和产品组合进行建模,我以后可以将所有销售额记录在一张表中。
建议?
注意:我想知道是否可以使用父子关系将产品和产品组合放在一张表中。有了一张桌子,记录销售额就不会很难了。我只需要实施一项业务规则,即在已经针对该组合记录销售时编辑产品组合,该编辑实际上会产生一个新条目。不过,可能会变得凌乱。
下面的代码使用查询字符串生成分页.但是,没有领先优势?.所以,我得到这样的东西:http://localhost/index.php/search/&limit=10.有什么想法吗?
this->load->library('pagination');
$config = array();
$config['base_url'] = 'http://localhost/index.php/search/';
$config['total_rows'] = 200;
$config['per_page'] = 10;
$config['num_links'] = 4;
$config['full_tag_open'] = '<ol>';
$config['full_tag_close'] = '</ol>';
$config['first_link'] = 'First';
$config['first_tag_open'] = '<li>';
$config['first_tag_close'] = '</li>';
$config['last_link'] = 'Last';
$config['last_tag_open'] = '<li>';
$config['last_tag_close'] = '</li>';
$config['next_link'] = 'Next';
$config['next_tag_open'] = '<li>';
$config['next_tag_close'] = '</li>';
$config['prev_link'] = 'Previous';
$config['prev_tag_open'] = '<li>';
$config['prev_tag_close'] = '</li>';
$config['cur_tag_open'] = '<li class="active">';
$config['cur_tag_close'] = '</li>';
$config['num_tag_open'] = '<li>';
$config['num_tag_close'] = '</li>';
$this->pagination->initialize($config);
echo ($this->pagination->create_links()); …Run Code Online (Sandbox Code Playgroud) 如何标记地址(例如企业及其地址列表)?问题是我并不总是有足够的地址信息来完成 vCard 微格式。这address标签应该是页面作者的联系信息,因此可能不是正确使用的标签。
建议?
我有一系列需要验证的配置文件数据:
$user_group_profiles = $this->input->post('user_group_profiles', TRUE);
foreach ($user_group_profiles as $key => $user_group_profile)
{
$this->form_validation->set_rules("user_group_profiles[$key][profile_name]", 'Profile Name', 'trim|required');
$this->form_validation->set_rules("user_group_profiles[$key][birthdate]", 'Birthdate', 'trim|required');
// TODO: heigth/weight not required, but the validation somehow makes it required
$this->form_validation->set_rules("user_group_profiles[$key][height]", 'Height', 'trim|greater_than[0]');
$this->form_validation->set_rules("user_group_profiles[$key][weight]", 'Weight', 'trim|greater_than[0]');
}
Run Code Online (Sandbox Code Playgroud)
高度和重量是选项,但是当没有为这些字段设置值时,CI验证会抱怨.A var_dump($user_group_profiles);显示了这个:
array
'ugp_b33333338' =>
array
'profile_name' => string '' (length=0)
'birthdate' => string '' (length=0)
'height' => string '' (length=0)
'weight' => string '' (length=0)
Run Code Online (Sandbox Code Playgroud)
什么想法可能是错的?
编辑1:
我进入了CI的Form_validation库并成为了$_field_data公共成员.当我在var_export之后,我得到了这个:
'user_group_profiles[ugp_833333338][height]' =>
array
'field' => string 'user_group_profiles[ugp_833333338][height]' (length=42)
'label' => …Run Code Online (Sandbox Code Playgroud) mysql ×4
php ×3
codeigniter ×2
database ×2
google-maps ×1
html ×1
javascript ×1
jquery ×1
oop ×1
scheduler ×1
scheduling ×1