smart

将 Hessian 集成到 Smart 中

烂漫一生 提交于 2019-12-03 21:42:56
Hessian,啥东西? 第一次见到这个单词的时候,我真不知道它是什么意思,虽然我的英语功底已经相当牛逼了。最后查了一下有道词典才知道,原来 Hessian 就是“麻布袋子”啊! 我真搞不懂,为什么一个麻布袋子就能通过 HTTP 发送二进制数据?可能麻布袋子不是一般的袋子,因为它密密麻麻,不是一般的数据可以穿透它,除了二进制数据 0 和 1。 如果您不想使用笨重的 SOAP WebService,也不想使用流行的 REST WebService,或许当您看到 Hessian 的功能后,它一定会让您惊呆! 一般我们是这样玩的,在服务端发布 Hessian 服务,让客户端调用已发布的 Hessian 服务。 请不要把 Hessian 想象得过于复杂与神秘,其实它不过是一个麻布袋子而已。 在服务端我们可以这样来发布 Hessian 服务: @WebServlet("/hessian/user_service") public class UserServiceImpl extends HessianServlet implements UserService { @Override public User login(String username, String password) { return DataSet.select(User.class, "username = ?

阿里云Spark Shuffle的优化

你说的曾经没有我的故事 提交于 2019-12-03 09:51:40
本次分享者:辰石,来自阿里巴巴计算平台事业部EMR团队技术专家,目前从事大数据存储以及Spark相关方面的工作。 Spark Shuffle介绍 Smart Shuffle设计 性能分析 Spark Shuffle流程 Spark 0.8及以前 Hash Based Shuffle Spark 0.8.1 为Hash Based Shuffle引入File Consolidation机制 Spark 0.9 引入ExternalAppendOnlyMap Spark 1.1 引入Sort Based Shuffle,但默认仍为Hash Based Shuffle Spark 1.2 默认的Shuffle方式改为Sort Based Shuffle Spark 1.4 引入Tungsten-Sort Based Shuffle Spark 1.6 Tungsten-sort并入Sort Based Shuffle Spark 2.0 Hash Based Shuffle退出历史舞台 总结一下, 就是最开始的时候使用的是 Hash Based Shuffle, 这时候每一个Mapper会根据Reducer的数量创建出相应的bucket,bucket的数量是M x R ,其中M是Map的个数,R是Reduce的个数。这样会产生大量的小文件,对文件系统压力很大,而且也不利于IO吞吐量

Smart cast to 'Type' is impossible, because 'variable' is a mutable property that could have been changed by this time

匿名 (未验证) 提交于 2019-12-03 08:30:34
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: And the Kotlin newbie asks, "why won't the following code compile?" : var left: Node? = null fun show() { if (left != null) { queue.add(left) // ERROR HERE } } Smart cast to 'Node' is impossible, because 'left' is a mutable property that could have been changed by this time I get that left is mutable variable, but I'm explicitly checking left != null and left is of type Node so why can't it be smart-casted to that type? How can I fix this elegantly? :) 回答1: Between execution of n.left != null and queue.add(n.left) another thread could have

Numpy ‘smart’ symmetric matrix

匿名 (未验证) 提交于 2019-12-03 02:50:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: Is there a smart and space-efficient symmetric matrix in numpy which automatically (and transparently) fills the position at [j][i] when [i][j] is written to? import numpy a = numpy . symmetric (( 3 , 3 )) a [ 0 ][ 1 ] = 1 a [ 1 ][ 0 ] == a [ 0 ][ 1 ] # True print ( a ) # [[0 1 0], [1 0 0], [0 0 0]] assert numpy . all ( a == a . T ) # for any symmetric matrix An automatic Hermitian would also be nice, although I won’t need that at the time of writing. 回答1: If you can afford to symmetrize the matrix just before doing calculations,

Angular 2+/4/5: Smart, dumb and deeply nested component communication

匿名 (未验证) 提交于 2019-12-03 02:49:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: NOTE: for simplicity consider the component depths as: - Smart (grand)parent level 0 - dumb child level 1 .... - dumb grandchild level 2 ....) There are various options and conditions on how smart/grand/parent/child components communicate and pass data up and down a MULTI-LEVEL (at least 3 levels) chain. We'd like to keep our 'smart' (grand)parent component as the only component that has access to our data service (or atomic/immutable store) and it will drive exchange of information with 'dumb' (grand)children. The options we see are: Anti

Creating an android smart app banner

匿名 (未验证) 提交于 2019-12-03 02:23:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Is there any solution for Android devices similar to the iOS 6 smart app banner? Here is the code for smart app banner 回答1: I needed that myself, so I created a jquery plugin to mimic a smart banner for Android and older iOS versions. http://jasny.github.com/jquery.smartbanner/#android 回答2: Since Chrome 44 Beta you can push your app in Chrome for Android with a native app install banner on your website. There are a couple of criteria that need to be met in order to enable it: You will need a web app manifest file You will have to serve your

How to test Smart App Banner Urls on in Dev environment

匿名 (未验证) 提交于 2019-12-03 02:16:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm wondering if it's possible to test iOS 6's smart app banners' app-argument URL parameter on dev builds of an iOS app. It appears the Open option in the banner only appears if the application is downloaded from the App Store. 回答1: What worked for me was to download my application from the appstore, and then overwrite it using a build from XCode. This worked and allowed me to debug the smart banner feature using my current build. This won't work from the simulator, you need to use a device. Just to be clear, you must overwrite it

Are there any valid use cases to use new and delete, raw pointers or c-style arrays with modern C++?

匿名 (未验证) 提交于 2019-12-03 01:57:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Here's a notable video ( Stop teaching C ) about that paradigm change to take in teaching the c++ language. And an also notable blog post I have a dream ... I'm dreaming of so called C++ courses/classes/curriculae will stop teaching (requiring) their students to use: ... Since C++11 as established standard we have the Dynamic memory management facilities aka smart pointers . Even from earlier standards we have the c++ standard Containers library as a good replacement for raw arrays (allocated with new T[] ) (notably usage of std::string

How to use C++ standard smart pointers with Windows HANDLEs?

匿名 (未验证) 提交于 2019-12-03 01:47:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I was wondering if there is a way to use unique_ptr with Windows HANDLEs? I was thinking to replace the std::default_delete with specific handle_trats that calls CloseHandle . The problem is that HANDLE is defined as void* unique_ptr won't compile as sizeof(void) is not defined. So far I see only two possibilities: Create a wrapper class for HANDLEs and use it like this: unique_ptr . This pretty much makes the unique_ptr itself useless. Use HANDLE specific smart pointer class that resembles unique_ptr . What do you think is better

character “|” in R

匿名 (未验证) 提交于 2019-12-03 01:31:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I would like to split a string of character at pattern "|" but unlist(strsplit("I am | very smart", " | ")) [1] "I" "am" "|" "very" "smart" or gsub(pattern="|", replacement="*", x="I am | very smart") [1] "*I* *a*m* *|* *v*e*r*y* *s*m*a*r*t*" 回答1: Use fixed argument: unlist(strsplit("I am | very smart", " | ", fixed=TRUE)) # [1] "I am" "very smart" Side effect is faster computation. stringr alternative: unlist(stringr::str_split("I am | very smart", fixed(" | "))) 回答2: | is a metacharacter. You need to escape it (using \\ before it). >