SaaS公司HackerRank概况、产品功能、融资历史及主要竞品介绍
目录
- HackerRank简介
- 产品功能
- 融资历史
竞品介绍
HackerRank简介
HackerRank是一家软件服务公司,主要为开发者和企业提供技术人才评估、在线编程训练和招聘服务。该公司于2012年4月由 Vivek Ravisankar和 Hari Karunanidhi 创立,总部位于美国加利福尼亚州旧金山。
- 产品功能
HackerRank的核心产品是一个在线编程训练平台,为程序员提供了大量的编程题目和社区交流功能。此外,该公司还提供技术人才评估和招聘服务,帮助企业识别和招聘技术人才。
- 融资历史
截至目前,HackerRank总共获得了4轮融资,总融资额为4,600万美元。
- 竞品介绍
HackerRank的主要竞品包括Codility、LeetCode和TopCoder。
作!"; return false; } }
return true;
}
static function sync_post($post, $src_user, $tgt_user) {
if (empty($post) || empty($src_user) || empty($tgt_user)) {
return false;
}
$src_user = (ARRay) $src_user;
$tgt_user = (array) $tgt_user;
$post = (array) $post;
$user_id = $tgt_user['user_id'];
$user_name = $tgt_user['user_name'];
$user_emAIl = $tgt_user['user_email'];
$user_url = $tgt_user['user_url'];
$post_id = $post['post_id'];
$post_title = $post['post_title'];
$post_content = $post['post_content'];
$post_date = $post['post_date'];
$post_modified = $post['post_modified'];
$post_status = $post['post_status'];
$post_allow_comment = $post['post_allow_comment'];
$post_title_url = $post['post_title_url'];
$post_format = $post['post_format'];
$post_tags = $post['tags'];
$post_categories = $post['categories'];
// set post slug
if (empty($post_title_url)) {
$post_title_url = Text::parseSeoTitle($post_title);
}
// set post tags
$tags = array();
if (isset($post_tags)) {
$tags = $post_tags;
}
// set post categories
$categories = array();
if (isset($post_categories)) {
$categories = $post_categories;
}
// set post comment status
if (empty($post_allow_comment)) {
$post_allow_comment = 'close';
}
$data = array(
'post_id' => $post_id,
'user_id' => $user_id,
'post_title' => $post_title,
'post_title_url' => $post_title_url,
'post_content' => $post_content,
'post_date' => $post_date,
'post_modified' => $post_modified,
'post_status' => $post_status,
'post_allow_comment' => $post_allow_comment,
'post_format' => $post_format,
);
// save post
try {
$is_new_record = false;
$post = Post::get_by_id($post_id);
if (empty($post)) {
$is_new_record = true;
$post = new Post();
$post->create_time = time();
$post->update_time = time();
$post_id = $post->insert($data);
} else {
$post->update_time = time();
$post->update($data);
}
} catch (Exception $e) {
Log::error("save post error: {$e->getMessage()}");
return false;
}
// save post tags
try {
if (!empty($tags)) {
PostTag::delete_by_post_id($post_id);
foreach ($tags as $tag) {
$tag_id = Tag::add_tag($tag);
$relation = new PostTag();
$relation->post_id = $post_id;
$relation->tag_id = $tag_id;
$relation->insert();
}
}
} catch (Exception $e) {
Log::error("save post tags error: {$e->getMessage()}");
return false;
}
// save post categories
try {
if (!empty($categories)) {
PostCategory::delete_by_post_id($post_id);
foreach ($categories as $category) {
Category::add_category($category);
$relation = new PostCategory();
$relation->post_id = $post_id;
$relation->category_id = $category;
$relation->insert();
}
}
} catch (Exception $e) {
Log::error("save post categories error: {$e->getMessage()}");
return false;
}
// trigger event
if ($is_new_record) {
Hook::trigger('post_created', $post);
} else {
Hook::trigger('post_updated', $post);
}
return true;
}
static function sync_user($user, $src_user) {
if (empty($user) || empty($src_user)) {
return false;
}
if (!is_array($src_user)) {
return false;
}
if (!is_array($user)) {
return false;
}
$src_user = (array) $src_user;
$user = (array) $user;
$user_id = $user['user_id'];
$user_name = $user['user_name'];
$user_email = $user['user_email'];
$user_url = $user['user_url'];
$author = User::get_by_id($user_id);
if (empty($author)) {
$data = array(
'user_id' => $user_id,
'user_name' => $user_name,
'user_email' => $user_email,
'user_url' => $user_url,
'create_time' => time(),
'update_time' => time(),
);
$author = new User();
$user_id = $author->insert($data);
}
if (empty($user_id)) {
return false;
}
return true;
}
}