When Does the 0% APR Credit Card Expire?



When Does the 0% APR Credit Card Expire?

For each day that I miscalculate the date by, I'll have to pay either $22.20 or $36.75 in interest per day. Even that I really can't tell because there are two APRs stated (13.74% and 22.74%). Either way it is a hefty price.

With good intentions to pay off the balance before the interest accrues, the credit card companies make it really difficult to figure out. Ultimately, I decided to call because I really couldn't tell.

I asked when the 0% expired and American Express informed me that I had 0% through billing period ending December 2007. Yeah, I already knew that. When I pressed for a calendar date, he told me December 10 (my next closing date). When I confirmed that if I paid it on December 10, I wouldn't have to pay any interest, he stated, "To avoid any interest you need to pay it on December 9 by 11:59 pm. I didn't ask which time zone!


Read full article from When Does the 0% APR Credit Card Expire?


10 frustrating Google Chrome problems and how to fix them | PCWorld



10 frustrating Google Chrome problems and how to fix them | PCWorld

Chrome may be the most-used browser in the world, but that doesn't mean it's perfect. Far from it. Despite receiving over 50 updates over the years, Google's browser still harbors several rough edges and idiosyncrasies that can make for a less than optimal online experience.


Read full article from 10 frustrating Google Chrome problems and how to fix them | PCWorld


Creating a Private Homebrew Tap with Gitlab – When I Work Engineering



Creating a Private Homebrew Tap with Gitlab – When I Work Engineering

At When I Work we love internal tooling to aid us in our day to day jobs, but as we grow it's not so easy getting everyone ramped up on our tools. While we could use something like Boxen or some fancy bash scripts, we prefer to keep it easy and just use good ol' Homebrew. I'll walk you through the steps we took to get set up.


Read full article from Creating a Private Homebrew Tap with Gitlab – When I Work Engineering


Distributing private tools through homebrew – The Protean Tester



Distributing private tools through homebrew – The Protean Tester

Homebrew (and caskroom too) use formulas to distribute applications. Formulas are written in Ruby, they describe an application, where to download it and which actions homebrew should perform to install it.

By default you only get access to the formulas included in the homebrew-core project. But there are more formulas out there, stored in taps, which essentially are separate GIT repositories that contain formulas with a specific goal, such as homebrew-science.


Read full article from Distributing private tools through homebrew – The Protean Tester


Toddler Sports | Parenting



Toddler Sports | Parenting

Most toddler sports "teams" are just kiddie classes with jerseys, and that's a good thing. In fact, until about the age of 7 or 8, competition can be stressful for kids and turn them off of sports forever. The focus should simply be on fun, with no winners or losers or right way or wrong way at this age.


Read full article from Toddler Sports | Parenting


Rollback and Recovery Troubleshooting; Challenges and Strategies - Simple Talk



Rollback and Recovery Troubleshooting; Challenges and Strategies - Simple Talk

What happens if your database deployment goes awry? Do you restore from a backup or snapshot and lose all the data changes that have happened since then? Do you prepare rollback scripts to revert the changes whilst preserving the data? Do you branch by abstraction and toggle off the changes? Have you a blue-green deployment that can be switched? Do you quickly roll forward?


Read full article from Rollback and Recovery Troubleshooting; Challenges and Strategies - Simple Talk


Close Chrome's Download Strip With A Keyboard Shortcut | Lifehacker Australia



Close Chrome's Download Strip With A Keyboard Shortcut | Lifehacker Australia

One thing I really missed when I shifted from Firefox to Chrome was a keyboard-friendly download manager. You can get rid of Firefox's download window simply by hitting the Esc key, but Chrome wastes vertical space by putting file downloads under the main window in a strip you can only close by clicking the close box with your mouse. Fortunately, there is a workaround.


The fastest ways to navigate views in Eclipse using the keyboard | Eclipse On E



The fastest ways to navigate views in Eclipse using the keyboard | Eclipse On E

Navigate views using Quick Access (Ctrl+3)

Quick Access is a way to navigate to anywhere or invoke anything in Eclipse. By pressing Ctrl+3, Eclipse pops up a searchable list of all perspectives, views, preferences, commands, etc. that it knows about. It sounds far-fetched, but try it out yourself to see what I mean.


Read full article from The fastest ways to navigate views in Eclipse using the keyboard | Eclipse On E


【笔记】17 幅思维导图:Python 核心知识体系-20180410第三次更新



【笔记】17 幅思维导图:Python 核心知识体系-20180410第三次更新

这次给大家带来的是最新版的17 幅思维导图,主要就 Python 核心基础知识进行了细致梳理。无论你是编程初学者,还是经验丰富的程序员,都可以通过这些图快速了解或回忆 Python 编程中最重要的概念。(第三版更新~有大量内容修改)


Read full article from 【笔记】17 幅思维导图:Python 核心知识体系-20180410第三次更新


How Is Credit Card Interest Calculated? - NerdWallet



How Is Credit Card Interest Calculated? - NerdWallet

If your credit card has an annual percentage rate of, say, 18%, that doesn't mean you get charged 18% interest once a year. Depending on how you manage your account, your effective interest rate could be higher, or it could be lower. It could even be 0%. That's because interest is calculated on a daily basis, not annually, and is charged only if you carry debt from month to month.

Knowing how credit card issuers calculate interest can help you understand the true cost of your debt.


Read full article from How Is Credit Card Interest Calculated? - NerdWallet


A List Of What Those F1 - F12 Computer Keys Do - Simplemost



A List Of What Those F1 - F12 Computer Keys Do - Simplemost

Chances are good you've noticed the row of numbered keys across the top of your computer keyboard that all have an "f" in front of them. But  they may not get much use. If you're using a laptop, they might even share space with other options, such as your Wi-Fi switch or your mute button.

Maybe you know the purpose of one or two of them, or perhaps you simply try to avoid them because you have no clue what they do. However, learning the uses for these function keys can help you become even more efficient. Check out this comprehensive list of functions so you can stop neglecting those little f keys.


Read full article from A List Of What Those F1 - F12 Computer Keys Do - Simplemost


高效开发运维



高效开发运维

不久前 Oracle 发布了一款通用型虚拟机—— GraalVM,能执行各类高性能与互操作性任务,并在无需额外成本的前提下允许用户构建多语言应用程序。本文将带你感受GraalVM的10大用途。


Read full article from 高效开发运维


JAVA技术zhai



JAVA技术zhai

《十面阿里》本屌现今四年开发经验;前前后后为进阿里面试十次(阿里旗下——蚂蚁金服,天猫的offer都被hr因学历而被拒,最后的菜鸟面幸运的被录用,拿到P6offer,真正的"十面"阿里!)。


Read full article from JAVA技术zhai


ConcurrentHashMap – avoid a common misuse! | Dominic Williams



ConcurrentHashMap – avoid a common misuse! | Dominic Williams

If you program systems with Java, you have probably long been using ConcurrentHashMap. This post explores a caveat.

ConcurrentHashMap is often introduced to simplify code and application logic. For example:

HashMap<String, MyClass> m = new HashMap<String, MyClass>();
...
synchronized (m) {
    for each (Entry<String, MyClass> e in m.entrySet())
        system.out.println(e.getKey()+"="+e.getValue());
}

might be replaced with the following so long as a consistent snapshot is not required:

ConcurrentHashMap<String, MyClass> m = new ConcurrentHashMap<String, MyClass>();
...
for each (Entry<String, MyClass> e in m.entrySet())
    system.out.println(e.getKey()+"="+e.getValue());

More often though, ConcurrentHashMap is introduced to improve performance: internally ConcurrentHashMap allows concurrent threads to read values without locking at all, except in a minority of cases, and for concurrent writers to add and update values while only acquiring locks over localised segments of the internal data structure. Read operations are therefore mostly synchronization free and have greatly improved performance, and if there are many concurrent writers then lock contention will be reduced improving performance even further.


Read full article from ConcurrentHashMap – avoid a common misuse! | Dominic Williams


Features - IntelliJ IDEA



Features - IntelliJ IDEA

IntelliJ IDEA analyzes your code, looking for connections between symbols across all project files and languages. Using this information it provides indepth coding assistance, quick navigation, clever error analysis, and, of course, refactorings.


Read full article from Features - IntelliJ IDEA


How to install Pygments (syntax highlighter) using Homebrew :: Andrew Havens, Ruby Developer



How to install Pygments (syntax highlighter) using Homebrew :: Andrew Havens, Ruby Developer

There is no Homebrew formula available to install it. After some searching, I found out that Pygments is one of Homebrew's formulas it won't accept. "Why can't I install Pygments using Homebrew?" I wondered. The reason is because Pygments is written in Python, and Python has its own package manager. This is sort of like how Ruby has RubyGems or PHP has, shudder, PEAR.

Your Mac already came with Python installed, so you already have everything you need in order to install Pygments.

sudo easy_install Pygments  


Read full article from How to install Pygments (syntax highlighter) using Homebrew :: Andrew Havens, Ruby Developer


JavaQ



JavaQ

AbstractQueuedSynchronizer简称AQS,它是java.util.concurrent包下CountDownLatch/FutureTask/ReentrantLock/RenntrantReadWriteLock/Semaphore实现的基础,所以深入理解AQS非常有必要。

AQS通过内部实现的FIFO同步等待队列来完成资源获取线程的等待工作,如果当前线程获取资源失败,AQS则会将当前线程以及等待状态等信息构造成一个Node结构的节点,并将其加入等待队列中,同时会阻塞当前线程;当其它获取到资源的线程释放持有的资源时,则会把等待队列节点中的线程唤醒,使其再次尝试获取对应资源。


Read full article from JavaQ


(2) How do I get all the test cases of problems posted on LeetCode? - Quora



(2) How do I get all the test cases of problems posted on LeetCode? - Quora

We did share all test cases with users at one point. That is, once you get Accepted, you are able to view all test cases.

Vipin Sharma's answer to How do I get all the test cases of problems posted on LeetCode? is right on the bat that test cases are one of the most valuable assets to LeetCode. While adding a new problem, we spent most of the time crafting great test cases. This includes small edge cases, randomized test cases and large test cases which could take up to few hours to create.

Another thing wonderful about LeetCode is it is a community centered website and test cases are constantly being added by the community. For example, see Not enough test case and Missing test case.


Read full article from (2) How do I get all the test cases of problems posted on LeetCode? - Quora


(2) How do I get all the test cases of problems posted on LeetCode? - Quora



(2) How do I get all the test cases of problems posted on LeetCode? - Quora

We did share all test cases with users at one point. That is, once you get Accepted, you are able to view all test cases.


Read full article from (2) How do I get all the test cases of problems posted on LeetCode? - Quora


How to Remove Gestures on a Mac | Chron.com



How to Remove Gestures on a Mac | Chron.com

3. Click a tab to view a list of the gestures in that category. For example, click "More Gestures" to see gestures such as "Swipe Between Pages" and "Show Desktop."

4. Click the check box next to the name of a gesture to deselect it. The gesture is now disabled. When you are finished removing gestures, click the red circle at the top of the Trackpad settings window to close it.


Read full article from How to Remove Gestures on a Mac | Chron.com


(2) Why don't touch screens and touchpads work with gloves on? - Quora



(2) Why don't touch screens and touchpads work with gloves on? - Quora

Nowadays the touchscreens of most of the phones or the ipad are Capacitive touch type, which also gives the possibility for multi touch gestures like pinch zoom etc.  Capacitive touchscreens work by the electrical capacitance between your hand and the screen/pad at the point of contact. So If you use an insulated stylus or are using a glove then there is no capacitance, and no interaction.

You can figure out this difference by comparing with the touch feel for some lower end phones or the usual older ATM machines with touchscreen, where you usually press more hard or with your nails or a stylus (earlier touchphones came with a stylus) , and it is not so smooth . They use resistive touch, which has two resisitive layers and it locates the coordinates where the contact is made on pressing, their gloves or stylus or nails worked but bare hands struggled.

Read full article from (2) Why don't touch screens and touchpads work with gloves on? - Quora


When to Rewrite from Scratch - Autopsy of a Failed Software · CodeAhoy



When to Rewrite from Scratch - Autopsy of a Failed Software · CodeAhoy

We had written the original system with a gun to our heads. We had to race to the finish line. We weren't having long design discussions or review meetings - we didn't have time for such things. We would finish up a feature get it tested quickly and move on to the next. We had a shared office and I remember software developers at other companies getting into lengthy design and architecture debates and arguing for weeks over design patterns.

Despite agile-on-steroids design, the original system wasn't badly written and generally was well structured. There was some spaghetti code that carried over from company's previous proof of concept attempts that we left untouched because it was working and we had no time. But instead of thinking about incremental improvements, we convinced ourselves that we need to rewrite from scratch because:


Read full article from When to Rewrite from Scratch - Autopsy of a Failed Software · CodeAhoy


FoundationDB 学习 - 事务流程



FoundationDB 学习 - 事务流程

不久之前,FoundationDB (后面用 fdb 简化) 重新开源,对于大家来说,这真的是一个非常好的消息。我也在第一时间下载了 fdb 的源码,开始研究,一方面是看我们能在什么方面能够借鉴,另一方面也是需要给一些朋友回答,TiKV 到底跟 fdb 有什么不一样这样的问题。

关于 fdb 的研究,自己预计会有几篇,这次是第一篇,来聊聊我最关注的一个问题 - fdb 是如何实现分布式事务的。


关键组件

在开始介绍之前,要先说说 fdb 的关键组件。


1. Coordinators

所有的 clients 和 servers 都是通过 cluster file 来连接到 fdb cluster,而这个 cluster file 就包含的是 coordinators 的 IP:PORT 列表。所有的 clients 和 servers 都会使用 coordinators 连接到 cluster controller。


2. Cluster controller

Cluster controller 是通过选举产生的(fdb 貌似使用的是 Paxos,这个后面会详细研究一下)。Cluster Controller 就是控制整个集群的,它是所有进程的入口,会监控进程是否挂掉,告诉某个进程相关的 role,以及在所有进程之间传递系统的信息。Clients 也通过 cluster controller 来实时的同步最新的 proxies。


3. Master

Master 主要是用来协调写子系统的,一个写子系统包括 master,proxies,resolvers 和 transaction logs。Proxy,resolver 和 transaction log 是一个整体单元,如果任意一个失败了,那么我们就会重新找一个来将他们全部替换。Master 会给 proxies 分配 commit versions,对数据进行分布,以及全局的流速控制。


4. Proxies

Proxies 会提供 read versions,提交事务以及跟踪 storage servers 的 key ranges。如果要提供一个 read version,一个 proxy 会问其他所有的 proxies 当前最大的 committed version,并且同步的检查 transaction logs 并没有被停止。Master 流速控制可能会减缓提供 read versions 的频率。

对于一次事务提交,当只有下面操作全部完成,才能认为成功:

  • 从 master 得到一个 commit version
  • 使用 resolvers 来确定当前事务并没有跟之前已经提交的事务冲突
  • 让 transaction 持久化到 transaction logs

所有以 xff 开头的 key 是系统保留前缀,用来存放系统的元信息。任何对这段 key range 的修改都会 通过 resolvers 同步到所有的 proxies。元信息包括数据的 key ranges 以及哪些 storage servers 有这些 range,其实也就是数据的路由表了。Proxies 也给 clients 提供相关的信息,让 clients 进行缓存,如果缓存缺失,就从 proxies 重新更新。


5. Transaction Logs

Transaction logs 会按照 version 的顺序接受 proxy 发过来的提交,并会使用 append only 的方式将修改的提交持久化到硬盘。在数据被写入到磁盘的时候,也会通知 storage servers 有相关的修改操作,让 storage servers 去获取并且 apply 到 storage servers 里面。


6. Resolvers

Resolvers 用来确定不同事务的冲突。当一个事务的 read version,读取了一个 key,在 commit 之前,另一个事务写入了新的值,这时候就会有冲突。 Resovler 会在内存里面保存 5s 的所有写入提交,用来判断冲突,这也就是意味着,fdb 的事务执行时间不能超过 5s。


7. Storage Servers

Storage servers 就是存放数据的地方,fdb 会将数据按照 range 切分,存储到不同的 storage servers 上面。Storage servers 会在内存里面保存最近 5s 的修改(Versioned data),如果一个 client 的 read version 超过了 5s,那就会过期出错了。Storage server 有 ssd 和 memory 两种,ssd 其实用的是 sqlite3。


流程

上面大概介绍了 fdb 的关键组件,这里就先来说说事务。Clients 会先用一个 read version 读取所有的数据,然后在本地修改,最后再将所有的修改一起提交到 proxies,这其实也就是一个乐观事务模型。具体流程如下:

  • 开始事务
    • Clients 从 proxy 获取一个 read version
    • Proxy 会批量接受 clients 的请求,如果超过了限流控制,额外的请求会排队
    • Proxy 问其它的 proxies 当前最大的 commit version
    • Proxy 返回最大的 commit version 作为 read version
  • 读流程
    • Client 根据 read version 以及需要访问的数据的 key 或者 key range 找到对应的 storage servers。Storage server 接受到之后,如果发现 version 太老,结果返回错误。如果发现数据还不存在,就等或者超时
    • Storage server 会根据 read version 找对应的数据,并返回给 client
  • 提交事务
    • Client 将修改,read version 以及 read ranges 和 write ranges 提交给 proxy
    • Proxy 仍然是批量的接受请求
    • Proxy 将 range 切分并且发到不同的 resolvers,如果 resolver 判断有冲突,结束事务
    • Proxy 通过 master 得到最近的 commit version
    • Proxy 将修改的数据按照实际的数据分布切分,加上 tag,推送到 transaction log servers
    • Transaction log servers 回复 proxy 说 log 已经落盘
    • Proxy 给 client 返回事务提交成功

可以看到,整个流程还是很简单的,这里还需要注意几个后台流程。一个是 storage server 从 transaction logs 读取数据:

  • 根据提供的 version 和 tag 从 transaction logs 拿数据
  • 将数据读入到 storage server 的 Versioned data
  • 将数据写入 storage engine

另一个就是 version 的更新,proxies 会定期的生成一个空的 commit request 来增加 commit version,这样 transaction logs 和 storage servers 的 version 都能增加,就能处理一个集群如果没有任何写入,后面新的读取也能按照 version 读到对应的版本,不会无限制的等待。如果我的 read version 比当前 storage server 的最大 version 要大,其实并不能保证读到正确的数据。为啥会做这个,主要是 fdb 用的时间戳来当的 version。


小结

上面仅仅是对 fdb 事务流程的简单介绍,几个 concern 的点:

  • Proxy 会跟其他的 proxies 交互问最大的 commit version,如果 proxy 多了会不会有性能问题
  • Resolver 如果 range 太多会不会也有性能问题

可以看到,fdb 在 resolver 那边其实就是将事务排队了,所以虽然外面看起来是乐观事务,但对于冲突严重的情况,性能也比较不错。之前我一直以为 resovler 会是个单点,但后面知道 resolver 也是可以 scale 的。而且 fdb 自己也说做了很多的优化,保证了整个的性能。

后面我会详尽的捣鼓折腾下 FoundationDB,做下 benchmark,也正在将它集成到我们的 YCSB 里面,毕竟对我来说,至少 fdb 那套 deterministic 理念是可以借鉴学习的。如果你对我们相关的 TiKV 工作感兴趣,欢迎联系我 tl@pingcap.com。


Read full article from FoundationDB 学习 - 事务流程


开发中的易读错单词小结



开发中的易读错单词小结

在很多的交流,或者演讲中,虽是小小的单词发音错误也可能导致交流不畅,乃至于整段垮掉。勿以词小而不改,本篇收录了笔者日常工作交流中感受的读音易错的单词,同时也参考了 50 most commonly mispronounced words 以及中国程序员容易发音错误的单词等文章。本文从属于 Awesome CheatSheet英语备忘清单,鉴于很多单词的美音与英音发音不一致,只要日常读音较为符合任一发音规则,笔者也未收录。

本文内容不多,希望能抛砖引玉,得到更多指导;欢迎提交新的易错单词,举一反三,相互印证;也欢迎关注阿里南京技术专刊了解更多技术讯息。


Read full article from 开发中的易读错单词小结


Labels

Algorithm (219) Lucene (130) LeetCode (97) Database (36) Data Structure (33) text mining (28) Solr (27) java (27) Mathematical Algorithm (26) Difficult Algorithm (25) Logic Thinking (23) Puzzles (23) Bit Algorithms (22) Math (21) List (20) Dynamic Programming (19) Linux (19) Tree (18) Machine Learning (15) EPI (11) Queue (11) Smart Algorithm (11) Operating System (9) Java Basic (8) Recursive Algorithm (8) Stack (8) Eclipse (7) Scala (7) Tika (7) J2EE (6) Monitoring (6) Trie (6) Concurrency (5) Geometry Algorithm (5) Greedy Algorithm (5) Mahout (5) MySQL (5) xpost (5) C (4) Interview (4) Vi (4) regular expression (4) to-do (4) C++ (3) Chrome (3) Divide and Conquer (3) Graph Algorithm (3) Permutation (3) Powershell (3) Random (3) Segment Tree (3) UIMA (3) Union-Find (3) Video (3) Virtualization (3) Windows (3) XML (3) Advanced Data Structure (2) Android (2) Bash (2) Classic Algorithm (2) Debugging (2) Design Pattern (2) Google (2) Hadoop (2) Java Collections (2) Markov Chains (2) Probabilities (2) Shell (2) Site (2) Web Development (2) Workplace (2) angularjs (2) .Net (1) Amazon Interview (1) Android Studio (1) Array (1) Boilerpipe (1) Book Notes (1) ChromeOS (1) Chromebook (1) Codility (1) Desgin (1) Design (1) Divide and Conqure (1) GAE (1) Google Interview (1) Great Stuff (1) Hash (1) High Tech Companies (1) Improving (1) LifeTips (1) Maven (1) Network (1) Performance (1) Programming (1) Resources (1) Sampling (1) Sed (1) Smart Thinking (1) Sort (1) Spark (1) Stanford NLP (1) System Design (1) Trove (1) VIP (1) tools (1)

Popular Posts