由买买提看人间百态

topics

全部话题 - 话题: decode
1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)
z*********n
发帖数: 1451
1
直接上干货, leetcode已经有这题了 (* 代表1~9 而非0~9),这是我过了的一个解:
class Solution {
int base = 1000000007;
public:
int numDecodings(string s) {
//last1: decode ways of s ending at i-1, last2 decode ways of s
ending at i-2, nlast1 : next last1.
long long last1 = 1, last2 = 1, nlast1 = 0; //there is only 1 way to
decode "", so initialized with 1.
for (int i = 0; i < s.size(); ++ i)
{
//Just look at current character
if (s[i] == '*')
nla... 阅读全帖
y***n
发帖数: 2318
2
来自主题: Automobile版 - BMW CANBUS Decoder?
I replaced the halogen DRL bulbs with LED ones and the CANBUS produces the "
bulb out" error.
Tried multiple capacitor based decoders and no luck so far. The closest one
suppresses the error while the car is started and running slow; however as
soon as I step on the gas, the error comes back - make me wonder if it's due
to the variation in the alternator voltage?
Here is the Amazon link:
https://www.amazon.com/gp/product/B0...?ie=UTF8&psc=1
Anyone on this board has found a working capacitor base... 阅读全帖
y***n
发帖数: 2318
3
来自主题: Automobile版 - BMW CANBUS Decoder?
All-in-one的LED灯泡首先塞不进E63狭小封闭的灯室,而且这种灯泡4000 lumen起步,
发热量很大,在封闭的灯室里不安全。电阻decoder,要大量发热,电容类的decoder发
热很小,但试了好几家的产品都不能清除error message。
估计NCS Expert是唯一可行方案。

neither plan is simple.
p*****2
发帖数: 21240
4
LeetCode上的Decode Ways是一道Facebook的面试原题,而这道题的起源则是2012 黑客
杯第一轮的第三题。有网友问如何使用O(1)的space做DP?其实原题是不可以的,因为M
是变化的。而Decode Ways给简化为M=26了,这样才可以用O(1) space。由于想为了这
届黑客杯做做练习,用Ruby重新实现了一下。
http://blog.sina.com.cn/s/blog_b9285de20101h8l1.html
d**********1
发帖数: 569
5
我分析了一个修改器的代码,偏移量简直就是magic,不知道还有没有效果,希望对感
兴趣的同志有帮助。
.net写的
这个是读写文件的主体:
public string GetBytesToString(byte[] buffer, int offset)
{
byte[] bytes1 = new byte[256];
int index1;
for (index1 = 0; (int) buffer[offset + index1] != 0; ++index1)
bytes1[index1] = buffer[offset + index1];
bytes1[index1] = buffer[offset + index1];
int bytesLength = this.GetBytesLength(bytes1);
byte[] bytes2 = new byte[bytesLength];
for (int index2 = 0; index2 < bytesL... 阅读全帖
P********e
发帖数: 2610
6
Anyone has any advice?
Basically, I'll need to generate barcode( which is easy)
And, take pictures(images) and to decode the barcode to numbers(or letters)
So, my question is how to decode the barcode by using images?
f**h
发帖数: 1149
7
iterative detection and decoding 也就是那种利用turbo原理 让soft message在
soft detector 和 soft decoder之间做多个iteration然后再做decision。不知道这种
结构的receiver的实际应用复杂度到底有多高,我只的是用ASIC 或者FPGA等的硬件实
现。我看文献
虽然这种结构比那种non-turbo 也就是没有iterative的那种结构peformance要好很多
,但是好像工业界一般并不采用这种turbo的结构。我对硬件不是很了解。想知道这个
这种结构在实现上主要有什么问题?是复杂度高很多还是delay太多??有人来说说吗
??
s*****2
发帖数: 117
8
来自主题: EE版 - 线性卷积码的decoding算法
请问一下LTE中规定的线性卷积码的decoding算法是哪个?
viterbi的还是MAP decoding的算法?
谢谢!
k*****r
发帖数: 21039
9
【 以下文字转载自 Military 讨论区 】
发信人: kayaker (霜晨の月), 信区: Military
标 题: 联合舰队是光腚/Combined Fleet Decoded
发信站: BBS 未名空间站 (Sat Oct 22 21:44:43 2016, 美东)
这本书暴了很多料,感觉解放军的情况更糟糕.哈哈,完全是在米国面前裸体表演.
日本海军是崇洋媚外的重灾区,麻痹的一帮参谋言必称纳尔孙,张嘴就来洋泾滨.44
年6月重建的机动部队9条空母在中部太平洋决战中惨败,塞班岛上3万陆军被扔给20
多万米军,全军覆灭。 10月先是吹牛台湾冲海战大战果,接着菲律宾大海战几乎全
军覆没后,就没发挥啥作用了,除了谎造战果,干扰山下大将的作战部署.
陆军就厉害多了,通讯系统一直没有被米国破过,战后陆军情报局的关键技术,设备,
档案,全部销毁,关键人员隐姓埋名,彻底消失在民间.一直到80年代,老家伙们憋
不住了,才交待有好几个秘密组织,准备米军一旦不遵守停火协定,危及日本天皇制国
体,就拥立皇子上山打游击.
大连50年代还发现日本陆军秘密军火库,大批的38大盖子,簇新的6.5x50... 阅读全帖
h*******i
发帖数: 4386
10
【 以下文字转载自 History 讨论区 】
发信人: kayaker (霜晨の月), 信区: History
标 题: 联合舰队是光腚/Combined Fleet Decoded
发信站: BBS 未名空间站 (Mon Mar 21 23:29:56 2016, 美东)
这本书暴了很多料,感觉解放军的情况更糟糕.哈哈,完全是在米国面前裸体表演.米
国早就破了日本最新的97式暗号机,和类似的外交密码机,日本每次谈判的策略,底
线完全暴露,米国总是从容不迫的front run日本的offer. 奇袭真珠湾前,米国海军比
日本大使馆还先破译出东京来的秘电,从三.爹哥挪去夏威夷挑衅日本的太平洋舰队,
也早
就把主力的航空母舰开出港了,只留下8条一次大战的老旧战列舰,作为诱饵.日本海
军一路都是按米国的剧本在表演,还自鸣得意.
日本海军是崇洋媚外的重灾区,麻痹的一帮参谋言必称纳尔孙,张嘴就来洋泾滨.44
年6月重建的机动部队9条空母在中部太平洋决战中惨败,10月菲律宾大海战几乎全
军覆没后,就没发挥啥作用了.45年陆军500万精锐还基本完好,斗志昂扬,在硫磺
岛,冲绳,打得米军神经失常,... 阅读全帖
k*****r
发帖数: 21039
11
【 以下文字转载自 History 讨论区 】
发信人: kayaker (霜晨の月), 信区: History
标 题: 联合舰队是光腚/Combined Fleet Decoded
发信站: BBS 未名空间站 (Mon Mar 21 23:29:56 2016, 美东)
这本书暴了很多料,感觉解放军的情况更糟糕.哈哈,完全是在米国面前裸体表演.米
国早就破了日本最新的97式暗号机,和类似的外交密码机,日本每次谈判的策略,底
线完全暴露,米国总是从容不迫的front run日本的offer. 奇袭真珠湾前,米国海军比
日本大使馆还先破译出东京来的秘电,从三.爹哥挪去夏威夷挑衅日本的太平洋舰队,
也早
就把主力的航空母舰开出港了,只留下8条一次大战的老旧战列舰,作为诱饵.日本海
军一路都是按米国的剧本在表演,还自鸣得意.
日本海军是崇洋媚外的重灾区,麻痹的一帮参谋言必称纳尔孙,张嘴就来洋泾滨.44
年6月重建的机动部队9条空母在中部太平洋决战中惨败,10月菲律宾大海战几乎全
军覆没后,就没发挥啥作用了.45年陆军500万精锐还基本完好,斗志昂扬,在硫磺
岛,冲绳,打得米军神经失常,... 阅读全帖
j******0
发帖数: 1043
12
来自主题: Automobile版 - BMW CANBUS Decoder?
neither plan is simple.
谁知道你的LED是哪家山寨企业生产的。
自身阻抗多少?通用件还是BMW专用件?如果后者,就自带欺骗线路了。那么就是这个
欺骗线路做的不对,要再改更麻烦。得加个可变电容或电阻自己调。
cambus 手持decoder,谁知到是否code全?你试下才知道。
这里是菜车论坛,到bimmerfest去看看。
我是用inpa 刷的,2008版软件 找台WinXP电脑才能用。E66 七系前四年的乘客座带按
摩,按摩一启动乘客座的气囊就报警。得把气囊disable掉。搞了很久。你有能力就
inpa刷,还便宜。
L******d
发帖数: 2461
13
目前audio/video来源有三个:
1. Disc player (HDMI, Component)
2. Hard Drive player (HDMI, Component)
3. PC (Karaoke专用, 显卡只有DVI或VGA输出, 没有HDMI)
考虑把这三个源都接到receiver, 然后由receiver统一输出, 特别是video, 希望能由
receiver统一通过HDMI输出到projector, 而不是三个源的video分别各自输出到
projector .
后者需要三根比较长的线(HDMI和或component x 2, DVI或VGA x 1), 而前者只需要三
根比较短的线与一根比较长的HDMI线).
另外还需要这个receiver能decode AAC等较新的格式.
请问这个思路靠谱么? 有哪个receiver能满足这个要求? 谢谢.
L******d
发帖数: 2461
14
I see. 这样就容易了, 现在的receiver都带一堆HDMI input.
AAC decoding是不是也都普及了?
h********o
发帖数: 14
15
http://www.leetcode.com/onlinejudge 进入这个链接, 搜索 页面上“decode ways”就能找到题目。leetcode 大侠对题目的表达很清楚, 为了避免表达不清造成歧义,就不转述了
我觉得是个较为简单的DP,先列举出最后只剩一个字符,和两个字符的情况,然后往前推
代码如下:
int numDecodings(string s) {
int l = s.size();
vector r(l,0);
r[l-1] = 1;
if ((s[l-2]-'0')*10+s[l-1]-'0' <= 26) r[l-2] = 2;
else r[l-2] = 1;
for (int i = l-3; i>=0; i--) {
r[i] = r[i+1];
if ((s[i]-'0')*10+s[i+1]-'0' <= 26)
r[i] = r[i] + r[i+2];
}
return r[0];
}
但是leetcode onli... 阅读全帖
h*****g
发帖数: 944
16
昨天按careerup 150把encode 部分写了,今天要写decode 部分
c********p
发帖数: 1969
17
来自主题: JobHunting版 - 啥叫encode/decode binary tree啊?
看别人面经看到的。啥意思啊?
怎么个encode/decode法啊?
C*******n
发帖数: 193
18
来自主题: JobHunting版 - 做个题吧。decoder.
Let's say you have a binary string such as the following:
011100011
One way to encrypt this string is to add to each digit the sum of its
adjacent digits. For example, the above string would become:
123210122
In particular, if P is the original string, and Q is the encrypted string,
then Q[i] = P[i-1] + P[i] + P[i+1] for all digit positions i. Characters off
the left and right edges of the string are treated as zeroes.
An encrypted string given to you in this format can be decoded as follows (
u... 阅读全帖
f****e
发帖数: 923
19
decode ways follow up string 里面有* 怎么修改代码
x***e
发帖数: 11
20
题目是decode ways
但是input String可以包含 *
比如 1*2,可以有 102 (1),112 (3), 122(3),132(2), 142(2), 152(2),
162(2), 172(2) 182(2) 192 (2) 一共 21种解法。
返回多少解, 刚开始想还挺简单的,写起来并不简单,比如 1**1 ,两个*都要判断。。
G**O
发帖数: 147
21
还有个followup
我decode不是按照1-26
而是有MAP, 比如 A -> 50, B -> 2, C = 200
怎么办
x********3
发帖数: 377
22
来自主题: Missouri版 - Why DVD need to be decoded?
DVD player sold in U.S only play "regional 1" code DVD disk.
it can not play any other regional coded dvd disk. that is why dvd u got
from China does not play on dvd player sold in U.S
i can decode player for u so it will play no only chinese dvd, but
everything else.
i will set DVD code to "All"
come on, don't be a "glass chicken" hehehhee
c**p
发帖数: 1443
23
来自主题: Missouri版 - Why DVD need to be decoded?
Why my DVD player can play any DVD from China without decoding ne?
Mine is made in China, sold in USA though.
T******t
发帖数: 240
24
来自主题: NCAA版 - The NFL Draft, Decoded
a fun article to read
http://www.mensjournal.com/the-nfl-draft-decoded
...
...
Here’s the thing about quarterbacks: You just don’t know. Any coach who
tries to tell you that he knew this or that late-round college quarterback
was going to be an NFL star is a fucking liar. If you saw Tom Brady at the
2000 combine workout, you’d have thought he was auditioning for a role in a
musical about gay milkmen. Same with Delaware Blue Hen Rich Gannon (who
looked so unpromising as a QB, his first team wante
m***s
发帖数: 1094
25
来自主题: CouchPotato版 - Tropical Teaser: ‘Lost’ Clues Decoded (ZZ)
http://www.nytimes.com/2008/01/30/arts/television/30lost.html?ex=1359349200&en=f9f07d6a533e772f&ei=5089&partner=rssyahoo&emc=rss
Here is the problem for ABC: In “Lost” it has the show with perhaps the
most compelling continuing story line in television history, one whose
resumption this week has been hotly anticipated by its devoted fans.
TV Decoder: Why The Strike May Hurt ABC The Most
But especially because the writers’ strike has stripped ABC of most of its
other hit series, the network would
d*****0
发帖数: 68029
26
【 以下文字转载自 PDA 讨论区 】
发信人: cellneuron (cell), 信区: PDA
标 题: TP CM9 ALPHA 1来了, HARDWARE DECODING INCLUDED
发信站: BBS 未名空间站 (Tue Feb 21 09:51:12 2012, 美东)
http://rootzwiki.com/topic/18843-releasealpha1-cyanogenmod-9-to
慢慢玩。
MIC和CAMERA还不行, 没有SKYPE。
y**********o
发帖数: 7947
27
http://www.pbs.org/wgbh/nova/nature/dogs-decoded.html
今晚首播,我塞,看得我很感动。
狗是家养的狼。 人是白天群猎的,狼也是,俩就容易形成伙伴关系,亲近人的狼吃剩
饭好活,所以就越走越近。人选听话的狼,几代下来狼就更听话,越来越乖,同时外形
也随之变化,到今天的千差万别。这个理论在西伯利亚的银狐试验上得以证实。一边挑
的听话的,一边是不听话的。听话的三代开始表现出对人的友好,到了第八代,就变的
像大肥猫,可以呵护,哄着玩,同时模样变化很大,前额变宽,尾巴变卷,毛色多样。
狗确实很聪明。狗识别并且遵循人的指示。比如你指一个方向,它会去,可能是漫长进
化过程中形成的,大猩猩都不管人的这套。狼也不管。 狗能识别人的表情,所以你觉
得它听懂你的话,不是一厢情愿,狗真的知道个大概。 狗的词汇量通过训练可以达到
300多个,狗还能根据图片找实物。人和狗在一起玩耍,人和狗都的某种什么化学指标
都会提高,跟母乳喂养的妈妈释放出来的东西一样。所以两个人越来越亲。 养狗降血
压,减少心脏病突发。人那么喜欢狗,因为狗的模样,看到它们的时候人脑活跃的区域
... 阅读全帖
B*D
发帖数: 5016
28
来自主题: Hardware版 - XBMC支持BRCM的decoder了
BRCM的decoder是消费级的,和高清机里面的SoC一个范畴
大屏幕上看,要稍稍胜过显卡硬解一些
现有bluray的HD视频codec(MPEG2,H.264,VC-1)他都能解到最高的profile
但是能支持啥容器,这个要看软件
不过ffdshow这方面我觉得不要担心,肯定比高清机强多了
另外BRCM的功耗极低
c********n
发帖数: 4762
29
这个默认就是选中的, 就是HARDWARE ACCELERATION的意思, 颗粒感是SCALE的问题,
是DECODING的问题, 必须改BUILD.PROP, 下个版本肯定默认就改好了。

题。
r****t
发帖数: 10904
30
%e2%80%93 本来应该是什么?what outcome is expected? 是不是个 url decoding 问
题? 这些 string 是什么 codec?
urllib.unquote('abc%20def')
会得到
'abc def'.
不知道是不是你想要的结果,这个是 python.
g****y
发帖数: 436
31
来自主题: Programming版 - 问个文字decoding的题目
hfreanzr: znpf
cnffjbeq: puvcfrd
decode the above test。 完全没有概念啊。。。
g***l
发帖数: 2753
32
我就想要一个单独的H264的decoder。
g*****n
发帖数: 420
33
ffmpeg是可以剪裁的,可以去掉所有的其他codec,只编译H264 decoder,通过configure
来配置
h*********e
发帖数: 3
34
来自主题: Security版 - How to decode SQL Server encrypted data
Hi, friends,
I forget the password in the SQL Server 2000 database and it is encrypted.
Can any friend tell me how to decode the password from database? Thanks.
Para Vogel
a****k
发帖数: 9
35
I have some music files ended with .ape and .cue. How can I decode or
decompress them? what software do I need?
thanks
t**********g
发帖数: 152
36
I need it for my project--sourcecode for Viterbi decoder in VHDL
l***********[email protected]
thanks a lot!
g******g
发帖数: 292
37
方向是analog decoder ,因为仿真结果不够好,刚刚错过了IEEE ISCAS的年会。
请问这个领域还有什么差不多的学术会议?老板要求高,虽不明说要求会议都是IEEE的
,恐怕太差的他认为不算数。新手,请指教。谢谢!
w*******y
发帖数: 60932
38
Making Sense of People: Decoding the Mysteries of Personality free kindle
book $25.99 value.
Link:
http://www.amazon.com/Making-Sense-People-Personality-ebook/dp/
d**d
发帖数: 389
39
来自主题: Programming版 - 请教一个C++的设计问题
谢谢各位的输入,我把输入流的情况在说详细一下。
一个几个G的officeline的流或者是streaming进来的流被拿到以后,level 1的decoder
会把流分成不同大小的packet,每个
packet有header和payload。 level 1的decoder需要6个。分包的依据是magic word和
两个固定位置的tag。这个level 1的decoder跟我以前做的相似,就是读一段数据先找
magic word,再找那两个tag,然后根据相对于包的大小开验证是否可以重复magic word
和tags。然后对packet header进行解码。
对于level 1 packet来讲,level 1 decoder在分析包头以后来决定需不需要把不同包
的负载合并成一个新的 level 2 packet,然后调用 level 2 decoder,就是我讲的那20
几个新的decoder. level 2 packet下面实际上还有两个level的信息,结构是一样的,
都是分包头和负载,然后合并成新的包,然后再重复一遍就彻底结束了。我们现在不需
要全部的level 3和... 阅读全帖
c********y
发帖数: 1245
40
转一篇文章:Things you should know before purchasing an Android hub
1.) Using Android OS on a TV, some known issues
a. Apps:
Android OS is getting more and more popular because it's open source and
basically free.
Lots of apps. have been made available for easy download and installation.
Initially Android is designed for smartphones and tablets, and yes, it is
NOT designed for use in front of a TV, not . This is a fundamental issue of
all Android boxes. Nearly all apps. on the Google Play Store are de... 阅读全帖
c********y
发帖数: 1245
41
转一篇文章:Things you should know before purchasing an Android hub
1.) Using Android OS on a TV, some known issues
a. Apps:
Android OS is getting more and more popular because it's open source and
basically free.
Lots of apps. have been made available for easy download and installation.
Initially Android is designed for smartphones and tablets, and yes, it is
NOT designed for use in front of a TV, not . This is a fundamental issue of
all Android boxes. Nearly all apps. on the Google Play Store are de... 阅读全帖
p*******m
发帖数: 20761
42
来自主题: PDA版 - Amazon Fire TV 3
Even though there haven’t been any leaks, like there were around this time
last year, it’s fairly likely there will be a new Amazon Fire TV and/or
Fire TV Stick released within the next few months. If Amazon repeats last
year’s product roadmap, which they often do, new Fire TV devices will be
announced in September and released in October. My theory that new Fire TV
devices will be announced in time for the upcoming release of Prime Video in
India has caused several of you to wonder what can we ... 阅读全帖
f**d
发帖数: 768
43
来自主题: Neuroscience版 - eBook: From computer to brain
这是一本计算神经科学的优秀著作,全文拷贝这里(图和公式缺),有兴趣的同学可以
阅读
如需要,我可以分享PDF文件(--仅供个人学习,无商业用途)
From Computer to Brain
William W. Lytton
From Computer to Brain
Foundations of Computational Neuroscience
Springer
William W. Lytton, M.D.
Associate Professor, State University of New York, Downstato, Brooklyn, NY
Visiting Associate Professor, University of Wisconsin, Madison
Visiting Associate Professor, Polytechnic University, Brooklyn, NY
Staff Neurologist., Kings County Hospital, Brooklyn, NY
In From Computer to Brain: ... 阅读全帖
k**0
发帖数: 19737
44
来自主题: PDA版 - apple果然就升级了GPU啊
GPU accelerated video decoding
Most GPUs made since 1995 support the YUV color space and hardware overlays,
important for digital video playback, and many GPUs made since 2000 also
support MPEG primitives such as motion compensation and iDCT. This process
of hardware accelerated video decoding, where portions of the video decoding
process and video post-processing are offloaded to the GPU hardware, is
commonly referred to as "GPU accelerated video decoding", "GPU assisted
video decoding", "GPU h... 阅读全帖
n********a
发帖数: 68
45
来自主题: Database版 - 怎么写这个Query,谢谢
select emp_id,
max(decode(month, 'Jan', sumofworkhours, null)),
max(decode(month, 'Feb', sumofworkhours, null)),
max(decode(month, 'Mar', sumofworkhours, null)),
max(decode(month, 'Apr', sumofworkhours, null)),
max(decode(month, 'May', sumofworkhours, null)),
max(decode(month, 'Jun', sumofworkhours, null)),
max(decode(month, 'Jul', sumofworkhours, null)),
max(decode(month, 'Aug', sumofworkhours, null)),
max(decode(month, 'Sep', sumofworkhours, null)),
max(decode(month, 'Oct', sumofworkhours, nul
j******u
发帖数: 41683
46
来自主题: PennySaver版 - [合集] 新二维码如何编码的
☆─────────────────────────────────────☆
firstsnow (解放了~) 于 (Tue Oct 9 15:27:37 2012, 美东) 提到:
有人指教下吗
特别是这种free胖子,打过一个mrs paul的bogo胖子,扫普通条码就会提示小二输入价
格,扫旁边的二维码就直接减5.99的价格。
在想这个lindt是不是也一样,扫二维码会直接减3.99吗,anyone try
————————啰啰嗦嗦的分割线——————————
research后的补充:
二维码现有包含的重要信息
详细offer:比如多少size,什么品种,不符合的刷不过。
过期日:过一天都扫不了。
是否double:可以肯定如果写了do not double,那么99%胖子是不会double了。
free offer:更新过的register直接扫二维码可以直接调取系统价格后减掉,老码仍然
会beep提醒小二手动输入价格或者像有些tx说的显示扫不过。
limit:如果胖子写了limit per transaction,或者per purchase,有可能多了就扫不... 阅读全帖
t**********a
发帖数: 2869
47
版上问的太多了,写一下我的安装过程:
1.从这里下载安装MX Player 1.7.34 (NEON)
https://sites.google.com/site/mxvpen/download
2. 从这里下载解码包Arm v7-Neon (下载地址和安装指示在二楼)
http://forum.xda-developers.com/apps/mx-player/mx-player-custom
3. 把解码包存到火柴上(ADB或者网盘局域盘共享),zip文件不用解开。我是存在了
dowload目录里,后面截屏可以看到。
4.启动MX Player,我第一次启动时它就自动找到已经下载的解码包,并问我要不要安
装。如果这一步没有找到,你可以进入settings-decoder-custom codec,把路径指向你
保存解码包的目录。解码包安装后MX自动重启。
5.然后再次进入settings,选择你用什么解码器,并按XDA下面的说明做相应设置
In H/W decoder:
If you want to play DTS while using HW decoder, goto Set... 阅读全帖
g*****y
发帖数: 7271
48
来自主题: Programming版 - 请教一个C++的设计问题
照我理解,以dll办法为例:
1. 所有找到的某个目录下的decoder dlls,加入链表;
2. 把header依次传给decoder的回调函数来分析header并返回是否接受;
3. 如果某一个decoder回调函数返回接受,就把数据传给该decoder的
decode回调函数;
分析header的回调函数是decoder来implement的。新decoder
的code当然需要编译成dll。除了这个,还有什么要重新编译的么?
哪个语言里新的decoder都要重新编译吧?
c***s
发帖数: 15
49
来自主题: Programming版 - 请教一个C++的设计问题
//样本代码如下,把具体decoder方法在不同type上实现就行
#include
enum decoder_type
{
type_A = 0,
type_B = 1,
type_C = 2,
no_decoder_available = 3
};
template
class decoder_algorithm
{
};
template<>
struct decoder_algorithm
{
static bool is_compatible () { return false; }
static void decode() { std::cout << "decoder A" << std::endl; }
};
template<>
struct decoder_algorithm
{
static bool is_compatible () { return false; }
static void decode() { std::cout << "decoder B" ... 阅读全帖
u*****n
发帖数: 126
50
来自主题: JobHunting版 - 求airbnb电面面经
//1' Edit Distance
// cats //
// carts add 26*4 = 104
// cat deletion 3
// bats modification 78
// dict = [ "cat", "bat", "batt", "beetle" ]
// similar(string q) => words from dic that are <= 1 edit distance from q
// similar("bat") => ["cat", "bat", "batt"]
/*
Often, we want to encode raw IDs in our database by hiding them behind some
2-way decodeable hash. So, a URL which would have at one time been:
https://www.airbnb.com/rooms/848662
becomes
https://www.airbnb.com/rooms/kljJJ324hjkS_
We dec... 阅读全帖
1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)