计算机专业太难不适合女生学?来看 N 多小姐姐的回应 - 文章 - 伯乐在线



计算机专业太难不适合女生学?来看 N 多小姐姐的回应 - 文章 - 伯乐在线

@刘不刘二小姐:没想到"计算机太难不适合女生学"的观点五年前我上大学的时候有,现在都火成这样了还有[二哈]

很多关注我们的小姐姐都冒泡留言,鼓励那位求助的女生。汇总如下:

@澈海情深:计算机女生出来说一句,现在干啥都挺难的。学计算机也没有想象中那么恐怖。感兴趣就学呗。

@眠眠阿卷:选吧,学计算机又不是以后当码农,计算机是个工具,你学了计算机,以后去哪里再读其他专业都受欢迎

@J家蠢萌痴汉夏:怎么会,我就毕业了呀,毕业还是简单的,只要好好听课,也不会挂科的[二哈] 当年高考结束填志愿,五个全是计算机第一顺位,🙊回过头想想也是有勇气啊


Read full article from 计算机专业太难不适合女生学?来看 N 多小姐姐的回应 - 文章 - 伯乐在线


A brief dive into 2 times I clearly had no clue what I was doing as a developer



A brief dive into 2 times I clearly had no clue what I was doing as a developer

Last week I had a short conversation with coworkers about how we had messed up in our careers. Being so far removed from those mistakes, it was easy to laugh. More than laughs, though, these screw-ups served as powerful lessons for us.

It's important that we share our mistakes so that others can learn from them and maybe feel more comfortable with their own. So here are a couple of my more recent ones.


Read full article from A brief dive into 2 times I clearly had no clue what I was doing as a developer


Java堆外内存排查小结 - 小姐姐味道



Java堆外内存排查小结 - 小姐姐味道

这几天遇到一个比较奇怪的问题,觉得有必要和大家分享一下。我们的一个服务,运行在docker上,在某个版本之后,占用的内存开始增长,直到docker分配的内存上限,但是并不会OOM。版本的更改如下:

  • 升级了基础软件的版本
  • 将docker的内存上限由4GB扩展到8GB
  • 上上个版本的一项变动是使用了EhCache的Heap缓存
  • 没有读文件,也没有mmap操作

使用jps 查看启动参数,发现分配了大约3GB的堆内存


Read full article from Java堆外内存排查小结 - 小姐姐味道


How to attach a PDF to your Blogger blog post | Projects by Jane



How to attach a PDF to your Blogger blog post | Projects by Jane

Have you ever clicked on a link in a blog post and it opens to a PDF? Have you ever wondered how on earth the linking and magical retrieval of the file are done?

Well, I have. Because I have 3 online free tutorials which link to PDFs.

First of all, you need a internet space to store your file. Then you need to make it public and the linking is the easy part. The hard part is finding a internet space to store your file. Because you don't want to have to pay for the space. You want it FREE.

Back in the days, I used scribd. It was free. Then one day it started asking for money. So I moved my files to Acrobat workspace which was free as well.

Read full article from How to attach a PDF to your Blogger blog post | Projects by Jane


We’re Opening X-Pack | Elastic



We're Opening X-Pack | Elastic

Historically, we developed X-Pack as a set of closed-source features that extend the Elastic Stack — that's Elasticsearch, Kibana, Beats, and Logstash. Some features like monitoring were free, and others like security and machine learning were paid.


Read full article from We're Opening X-Pack | Elastic


One line browser notepad (Example)



One line browser notepad (Example)

Sometimes I just need to type garbage. Just to clear out my mind. Using editors to type such gibberish annoys me because it clutters my project workspace (I'm picky, I know).

So I do this. Since I live in the browser, I just open a new tab and type in the url tab.

data:text/html, <html contenteditable>

Voila, browser notepad.


Read full article from One line browser notepad (Example)


Your Git Log Should Tell A Story



Your Git Log Should Tell A Story

Have you ever been debugging an annoying new bug and realised that the simplest way to track it down would be to look at what changed in the code since the previous release, where the bug wasn't there?

There are different ways to do this, a quick one is to run git log and to skim through the commit messages looking for something suspicious. That is, if the commit messages tell something useful.

We software developers take a lot of care in crafting readable and efficient code, but too often not enough in writing informative commits. It is not uncommon to see logs like this (fictitious) one:


Read full article from Your Git Log Should Tell A Story


美国信用卡回国使用指南 - 美国信用卡指南



美国信用卡回国使用指南 - 美国信用卡指南

如果要在不常使用的地方用你的信用卡,最好提前设置一个Travel Notification,让银行知道你的出行计划,避免被风控程序直接给decline掉。设置Travel Notification不难:一般都在网银的Customer Center或者Account Management页面,然后找到Credit Card Service那一栏,就能看到设置Travel Notification的选项了。

  • Amex:他家的卡很屌,号称是方便用户,不用设置直接拿去刷就是了。
  • Chase:第一次去某地之前设置一下就好了,之后再去相应的地区就不用设置了(至少Secure Message的客服是这么告诉我的)。
  • Discover:直接在手机App里就可以设置,而且还会告诉你目的地的带哪些标志的POS机支持Discover卡。
  • 其他银行的就请正常去网页里的对应位置设置好Travel Notification吧


Read full article from 美国信用卡回国使用指南 - 美国信用卡指南


Charles技术站



Charles技术站

F1是Google自主研发的分布式数据库,采用计算与存储分离的架构,存储层采用Spanner作为分布式KV存储引擎,计算层则是F1团队研发的分布式SQL引擎,其整体架构如下图


Read full article from Charles技术站


Learning Git Internals by Example - teohm



Learning Git Internals by Example - teohm

After switching to Git from Subversion and Mercurial for a few months, somehow I feel that Git is fundamentally different from Subversion or Mercurial, but couldn't really tell the differences. I often see terms like tree, parent etc. in GitHub, which I have no idea what they actually mean.

So I decided to spent some time to learn Git.

I will try to summarize and publish important stuffs I learned about Git along the way.. but here is the first entry, about Git internals, which helped me to answer how Git is different other source control tools.

Objects, References, The Index

To understand the core of Git internals, there are 3 things to we should know: objects, references, the index.


Read full article from Learning Git Internals by Example - teohm


Mac Tips: Turn on remote login (SSH server) - teohm



Mac Tips: Turn on remote login (SSH server) - teohm

Enable SSH server on Mac OSX is surprisingly easy. Open System Preferences > Sharing, and turn on Remote Login. You can futher restrict which user can login via SSH on the same screen.


Read full article from Mac Tips: Turn on remote login (SSH server) - teohm


Mac Tips: Change default application for a file type - teohm



Mac Tips: Change default application for a file type - teohm

To switch the default application for file type, right-click the file, select Get Info and change the application in Open With section.

Remember, remember.. click Change All… button to apply the changes to all files. It seems obvious, but took me a while to figure this out. :)


Read full article from Mac Tips: Change default application for a file type - teohm


Python



Python
  • Link without text
<http://example.com/>
<address@example.com>

Table without header

| | |
|-|-|
Normal Key|Value1

Nested list

- Item 1
    - Item 1a

Line breaks in markdown

<br/>
\
  (<-- two spaces)

Named anchor

  • we can use html in markdown
<a name="mac-mail"></a>
  • Reference the anchor
[Mail's Shortcuts](http://lifelongprogrammer.blogspot.com/2018/05/keyboard-shortcuts.html#mac-mail)

Supported Languages

  • markdown, java, json,html, javascript, shell, yaml, xml etc

Write email with markdown

Share markdown with socrates

stackedit

  • Functions: export as html, save to google drive, blogger, github, dropbox etc
  • alternatives: https://dillinger.io/

Blogger with markdown

  • Why: Focus on the content, easy to store/edit the content locally
1: Use “Copy Html” function from markdown-preview-plus
  • Then paste output
<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="font-size: large;">
     _copy_html_output_from_markdown-preview-plus_
</div></div>
2: Use pandoc
pandoc -f markdown -t html5 -c style.css -s --highlight-style espresso -o the_output.html the.md
pandoc -f markdown -t html5 -c style.css -s --highlight-style espresso -o the.md | pbcopy
  • then remove no needed head, body tags

Atom

pandoc

  • brew install pandoc
  • Add eval “$(pandoc --bash-completion)” to ${HOME}/.bash_profile
  • generate pdf: -o output.df
    • install this first: brew cask install mactex
  • generate ppt: -o output.pptx
  • pandoc --list-extensions
  • pandoc --list-output-formats

remark

  • in-browser, markdown-driven slideshow tool

Gotcha

  • Space matters:
    • for link, no space between [] and (), for header, need space between ### and the words
    • check the colors in atom
  • Empty line matters
    • when not sure, add empty line

Basic Syntax

~~crossed out~~
_italic_
__bold__
_You **can** combine them_

> This is a blockquote
// horizontal rule tag (<hr />) 
---
// Code span - use `and`
Type `echo 'Hello World'`

lujun9972.github.com/Emacs帮你进行英文写作.org at source · lujun9972/lujun9972.github.com



lujun9972.github.com/Emacs帮你进行英文写作.org at source · lujun9972/lujun9972.github.com

ispell是Unix下的一个拼写(不仅仅是英文)检查工具,同时它也是Emacs用来调用ispell类工具进行拼写检查的插件名称。

之所以说是ispell类工具是因为Emacs的ispell插件不仅仅支持调用ispell来进行拼写检查,也支持调用aspell/hunspell来进行拼写检查。

而且事实上,aspell已经逐渐取代ispell成为主流。


Read full article from lujun9972.github.com/Emacs帮你进行英文写作.org at source · lujun9972/lujun9972.github.com


fahd.blog: Writing your own Bash Completion Function



fahd.blog: Writing your own Bash Completion Function

Bash programmable completion is a powerful feature which allows you to specify how arguments to commands should be completed. You do this using the complete command. For example, you can set completion up so that when you type the unzip command and hit the TAB key, it only shows completions for files ending with the .zip extension. Similarly, the completion for the ssh command would display hosts taken from your known_hosts file.

In this post, I will describe how you can write a custom completion function for a command foo. Bash will execute this function when foo [TAB][TAB] is typed at the prompt and will display possible completions.

Bash uses the following variables for completion:

  • COMPREPLY: an array containing possible completions as a result of your function
  • COMP_WORDS: an array containing individual command arguments typed so far
  • COMP_CWORD: the index of the command argument containing the current cursor position
  • COMP_LINE: the current command line
Therefore, if you want the current argument that you are trying to complete, you would index into the words array using: ${COMP_WORDS[COMP_CWORD]}.

So, how do you build the result array COMPREPLY? The easiest way is to use the compgen command. You can supply a list of words to compgen and a partial word, and it will show you all words that match it. Let's try it out:


Read full article from fahd.blog: Writing your own Bash Completion Function


fahd.blog: Increase Console Output in Eclipse [Howto]



fahd.blog: Increase Console Output in Eclipse [Howto]

By default, Eclipse limits the amount of text in the console output window. So if you are running a program which produces a lot of output, the Console will only display the last n lines and you lose the rest.

Here is a tip which will allow you to have unlimited output in the console:
  • Go to Window > Preferences > Run/Debug > Console
  • Uncheck "Limit Console Output" (Alternatively you can increase the Console buffer size.)

Read full article from fahd.blog: Increase Console Output in Eclipse [Howto]


String concatenation with Java 8



String concatenation with Java 8

In summary, Java 8 seems not to introduce new optimizations for String concatenation with the + operator. It means that using StringBuilder manually is still required for specific cases where the compiler or the JIT is not applying magic tricks. For instance, when lot of substrings are concatenated to a String variable defined outside the scope of a loop.

The reason for not optimizing automatically all String concatenations is still a bit obscure to me. Probably, too much information and efforts are required to handle all possible cases safely. After all, that's also a good point to make programmers think about what they write.


Read full article from String concatenation with Java 8


jcabi-aspects – Useful Java AOP Aspects



jcabi-aspects – Useful Java AOP Aspects

Useful Java AOP Aspects is a collection of useful AOP aspects and Java annotations which allow you to modify the behavior of your Java application without writing lots of duplicate code.

For example, you may want to retry HTTP resource downloading in case of a failure. You can implement a full do/while cycle yourself or you can annotate the method with @RetryOnFailure and let one of our AOP aspects do the work for you:


Read full article from jcabi-aspects – Useful Java AOP Aspects


Writing clean logging code using Java 8 lambdas | Gary Gregory



Writing clean logging code using Java 8 lambdas | Gary Gregory

In this article, I will show you how to clean up your logging code using Apache Log4j 2.4 and Java 8 lambdas.

Log4j is a great logging framework, and the upcoming version — 2.4 — includes support for Java 8 lambdas. Lambda expressions are new to Java 8 and provide a simple and compact way to represent a method interface using an expression.


Read full article from Writing clean logging code using Java 8 lambdas | Gary Gregory


I’m trying to become less dumb — by listening to smart people



I'm trying to become less dumb — by listening to smart people

I'm getting more and more excited about a very simple fact. Listening to smart people, thinking hard about what they had to say, and then regurgitating their ideas in conversations, makes you smarter. It might be seen as untrue, but I think that's the nature of good ideas, they tend to flow from person to person, from a book passage to a reader, from a podcast episode to the listener.


Read full article from I'm trying to become less dumb — by listening to smart people


How to Fix Mixed Content Errors in BlogSpot Blogger ~ My Blogger Lab



How to Fix Mixed Content Errors in BlogSpot Blogger ~ My Blogger Lab

Fix Mixed Content Errors on your Blogger Template:

It means that mixed content errors is appearing on multiple pages and is most probably caused by either your template or gadgets, follow below instructions to remove them.
  1. Go to Blogger >> Template >> Edit HTML >> and search for http:// 

  2. If you are able to find any http:// link replace it with https://

  3. Before saving, verify if each like is available over HTTPS by opening that linking into a new window or tab of your browser. If both HTTP and HTTPS links are giving you the same results, then you are good to click Save Template.

  4. Now go to Blogger >> Layout >> Edit each HTML/Javascript type gadget and replace all https:// links with http://. Verify if the https:// links are working correctly and then press Save.

Read full article from How to Fix Mixed Content Errors in BlogSpot Blogger ~ My Blogger Lab


情情说



情情说

我也这一块也比较菜,所以,后面的一段时间会梳理和总结Spring相关的技术原理,以「Spring技术内幕:深入解析Spring架构与设计原理」书籍为核心,结合自己的使用经验和疑问,以及网络上大牛的文章,来补足自己这方面的缺失。


Read full article from 情情说


高效开发运维



高效开发运维

从不同的目录执行脚本可能会发生错误,这样的脚本没有人会喜欢。要解决这个问题,请使用绝对路径(/path/to/something)和脚本的相对路径(如下所示)。


Read full article from 高效开发运维


Very low quality job ads from recruiters - Meta Stack Overflow



Very low quality job ads from recruiters - Meta Stack Overflow

I'm seeing a lot of very low quality job ads from recruiters, and I'm getting sick of reporting them. Does SO have a review process for ads? I'm not really feeling the love from SO on this TBH, feels like they're prioritising short-term recruiter $$ rather than respecting the mission and community (not saying this is true but it's what it seems like).


Read full article from Very low quality job ads from recruiters - Meta Stack Overflow


Is that possible calling content script method by context menu item in Chrome extension? - Stack Overflow



Is that possible calling content script method by context menu item in Chrome extension? - Stack Overflow

I'm trying to use context menu item to invoke my method written in content script.
Is that possible?

As i have tried, context menu could only doing stuff in backend.


Read full article from Is that possible calling content script method by context menu item in Chrome extension? - Stack Overflow


Tutorial: Debugging - Google Chrome



Tutorial: Debugging - Google Chrome

To follow this tutorial, you need the Hello World extension that was featured in Getting Started. In this section, you'll load the extension and take a look at its information in the Extensions page.


Read full article from Tutorial: Debugging - Google Chrome


Pivotal Paris Événement



Pivotal Paris Événement

Gartner estime que d'ici 2020, 75 % des applications qui sous-tendent l'entreprise digitale seront non pas achetées, mais développées en interne*. Sous l'impulsion d'une nouvelle génération de culture, de codage, et de cloud, on voit émerger des entreprises « software-driven » capables d'anticiper les tendances et de libérer des opportunités de croissance. *Rapport Gartner sur les logiciels d'application d'entreprise.


Read full article from Pivotal Paris Événement


This Week in Spring: Spring Fu and MongoDB - DZone Java



This Week in Spring: Spring Fu and MongoDB - DZone Java

Hi Spring fans and welcome to another installment of This Week in Spring! This week, I'm in NYC for the SpringOne Tour NYC event. Then, it's off to Amsterdam for some customer visits. It's been a wild week in Spring, so let's get to it!


Read full article from This Week in Spring: Spring Fu and MongoDB - DZone Java


How to Use Infinite Sets in Java 9 - DZone Java



How to Use Infinite Sets in Java 9 - DZone Java

A Set is a collection of elements whereby any given element in the Set appears only once. More formally, a set contains no pair of elements e1 and e2 such that e1.equals(e2). We can easily create a Set in Java 9 like this:


Read full article from How to Use Infinite Sets in Java 9 - DZone Java


How to Use Infinite Sets in Java 9 - DZone Java



How to Use Infinite Sets in Java 9 - DZone Java

A Set is a collection of elements whereby any given element in the Set appears only once. More formally, a set contains no pair of elements e1 and e2 such that e1.equals(e2). We can easily create a Set in Java 9 like this:


Read full article from How to Use Infinite Sets in Java 9 - DZone Java


How to Use Infinite Sets in Java 9 - DZone Java



How to Use Infinite Sets in Java 9 - DZone Java

A Set is a collection of elements whereby any given element in the Set appears only once. More formally, a set contains no pair of elements e1 and e2 such that e1.equals(e2). We can easily create a Set in Java 9 like this:


Read full article from How to Use Infinite Sets in Java 9 - DZone Java


Add Custom Keyboard Shortcuts to Chrome Extensions for Quick Launching



Add Custom Keyboard Shortcuts to Chrome Extensions for Quick Launching

Just head to chrome://extensions/ in your browser's address bar to open up the extensions page. Scroll down to the bottom and you'll see a Keyboard Shortcuts option. Click it, and you can set up custom shortcuts for some of you extensions.


Read full article from Add Custom Keyboard Shortcuts to Chrome Extensions for Quick Launching


garbage collection - Java CMS GC, GC threads taking CPU when system is idle - Stack Overflow



garbage collection - Java CMS GC, GC threads taking CPU when system is idle - Stack Overflow

And we see that the following GC threads take up CPU (around 15% overall) even though:

  • there is no activity in the system,
  • no other threads are active except these and this continues for 48 hours and the system at this time was under 0 load.
  • the system was under 0 load also for the previous 24 hours and then these threads became active
  • when these threads were active and taking up CPU, the preceding lines were printed in the gc.log
  • this continued for 2 days and when we finally put load by invoking the web application in this JVM for 5 minutes and then it all stopped. We noticed that these threads are no longer taking CPU (they are taking <1 %) now. The problem seems to have resolved itself once a FULL GC happens. The FULL GC happened after the system was put under load.
  • In short, the GC threads continued taking 15% CPU when the system was under 0 load for 48 hours.


Read full article from garbage collection - Java CMS GC, GC threads taking CPU when system is idle - Stack Overflow


vimium doesn't work with file protocol · Issue #1976 · philc/vimium



vimium doesn't work with file protocol · Issue #1976 · philc/vimium

However be noted that PDF pages will still not work since PDF viewer itself is sort of an extension, and Chrome doesn't allow extensions running on extensions.


Read full article from vimium doesn't work with file protocol · Issue #1976 · philc/vimium


TensorFlow入门教程 | Fundebug博客



TensorFlow入门教程 | Fundebug博客

谷歌的AI技术独步天下,从即将商业化运营的无人驾驶汽车Waymo,到天下无敌的围棋大师AlphaGo,再到以假乱真的电话助理Duplex

如果你想学习AI技术的话,神经网络是个不错的学习方向,因为它是最神奇也是现在最有效的机器学习算法;如果你想学习神经网络的话,最好的起点是实现一个简单的神经网络,因为你可以在实现的过程中发现问题,思考问题以及解决问题;如果你想实现一个简单的神经网络的话,本文将教你使用TensorFlow来实现;至少,你可以直接运行本文给出的例子,感受一下神经网络的神奇。


Read full article from TensorFlow入门教程 | Fundebug博客


aalansehaiyang/technology-talk: 汇总java生态圈常用技术框架、开源中间件,系统架构、项目管理、经典架构案例、数据库、常用三方库、线上运维等知识



aalansehaiyang/technology-talk: 汇总java生态圈常用技术框架、开源中间件,系统架构、项目管理、经典架构案例、数据库、常用三方库、线上运维等知识

有人认为编程是一门技术活,要有一定的天赋,非天资聪慧者不能及也。其实不然,笔者虽是计算机专业出身,但工作年限并不长,对于技术这碗饭有一些心得体会,大多数人成为某领域顶级专家可能会有些难度,但应对日常工作,成长为资深研发工程师、技术专家、甚至成为小团队的Team Leader,其实并不难。

多读书、多看报,多研究常用开源框架的源码,比如:github.com,这里汇集了全球工程师的智慧!

言归正传,下文会列举工作中常用的一些技术,以及如何锻炼提升自己的架构能力。

由于每块技术市场上基本都有对应的网络资料或书籍,所以本文只是少篇幅列举工作中用到的核心知识点,抛砖引玉,属于进阶型,不适用初学者。


Read full article from aalansehaiyang/technology-talk: 汇总java生态圈常用技术框架、开源中间件,系统架构、项目管理、经典架构案例、数据库、常用三方库、线上运维等知识


从构建分布式秒杀系统聊聊限流特技 - 柒's Blog



从构建分布式秒杀系统聊聊限流特技 - 柒's Blog

俗话说的好,冰冻三尺非一日之寒,滴水穿石非一日之功,罗马也不是一天就建成的。两周前秒杀案例初步成型,分享到了中国最大的同性交友网站-码云。同时也收到了不少小伙伴的建议和投诉。我从不认为分布式、集群、秒杀这些就应该是大厂的专利,在互联网的今天无论什么时候都要时刻武装自己,只有这样,也许你的春天就在明天。


Read full article from 从构建分布式秒杀系统聊聊限流特技 - 柒's Blog


Top 7 Credit Cards For Those With Excellent Credit



Top 7 Credit Cards For Those With Excellent Credit

If you're in the market for a great cash back rewards cards that also has a long 0% APR, the Discover it Cash Back card is a smart pick. To start, Discover will match the cash back you earn at the end of your first year as a card member. So if you earn $300 in cash back, Discover will match that $300 for a total of $600 cash back! You can really rack up the cash back by earning an ongoing 5% cash back (an effective 10% back your first year after the Cashback Match Bonus) in categories that rotate each quarter you activate (on up to $1,500 in combined purchases, then 1% back) and 1% back on all other purchases. The categories for 2018 include gas stations and wholesale clubs from January to March, grocery stores from April to June, restaurants from July to September and Amazon.com and wholesale clubs from October to December. In addition to all this, cardholders will get a 14-month 0% intro APR on purchases and balance transfers (then it's 13.49% to 24.49% variable), with a 3% balance transfer fee. The Discover it Cash Back card really does have it all – cash back, an extra cash back bonus (2X cashback your first year!), a lengthy 0% intro APR on purchases and balance transfers AND no annual fee.


Read full article from Top 7 Credit Cards For Those With Excellent Credit


Closest product pair in an array - GeeksforGeeks



Closest product pair in an array - GeeksforGeeks

Given an array of non negative integers and a number x, find a pair in array whose product is closest to x.

Examples:

Input : arr[] = [2, 3, 5, 9]          x = 47  Output : {5, 9}    Input : arr[] = [2, 3, 5, 9]          x = 8  Output : {2, 5}  


Read full article from Closest product pair in an array - GeeksforGeeks


分布式工具的一次小升级⏫ | crossoverJie's Blog



分布式工具的一次小升级⏫ | crossoverJie's Blog

之前在做 秒杀架构实践 时有提到对 distributed-redis-tool 的一次小升级,但是没有细说。

其实主要原因是:

秒杀时我做压测:由于集成了这个限流组件,并发又比较大,所以导致连接、断开 Redis 非常频繁。
最终导致获取不了 Redis connection 的异常。


Read full article from 分布式工具的一次小升级⏫ | crossoverJie's Blog


Stop Yelling - Turn Off The Caps Lock Key On Your Mac [OS X Tips] | Cult of Mac



Stop Yelling - Turn Off The Caps Lock Key On Your Mac [OS X Tips] | Cult of Mac

Launch System Preferences, either from the Dock, or the Apple Menu, or even the Applications menu. Once launched, click on the Keyboard icon to launch the preference pane, and then click on Modifier Keys button at the bottom right of the window.


Read full article from Stop Yelling - Turn Off The Caps Lock Key On Your Mac [OS X Tips] | Cult of Mac


Log processing, 1. part – architecture overview | YSofters



Log processing, 1. part – architecture overview | YSofters

This article is a first one of planned series focused on log processing, therefore YSoft SafeQ monitoring. It explains goals of log monitoring and intended use cases, as well as requirements for designed architecture. A brief description of high-level view of designed architecture follows, architecture itself will be properly described in one of following articles.

Goals of YSoft SafeQ log processing

Logs contain information about behaviour of SafeQ deployment, but each log carries only limited local info (such as single Exception). This can directly lead to understanding, what has happened, but sometimes more logs, even from different components, are needed.

The main goal of log processing is to collect all logs to a central location, unify them to single format to simplify their structure, compute additional information, such as duration of a print process, and finally index this info into a database to allow searches and visualizations into graphs.


Read full article from Log processing, 1. part – architecture overview | YSofters


Exercises in Programming Style | Henrik Warne's blog



Exercises in Programming Style | Henrik Warne's blog

In the book club at work, we recently finished reading Exercises in Programming Style by Cristina Videira Lopes. The book consists of a simple program implemented in 33 different programming styles. It is a great way of showing the different styles, and the book was quite popular in the book club. The book is relatively new (it was published in 2014), and I don't think it is as well-known as it deserves to be. So here is a summary and review of it.

Read full article from Exercises in Programming Style | Henrik Warne's blog


关于RESTful不足的思考 | 四火的唠叨



关于RESTful不足的思考 | 四火的唠叨

在Amazon的时候,公司内有大量的组来维护不计其数的service,而service之间的通用通讯方式是公司内部的一个框架,协议是自定的,客户端也是内部的;现在到了Oracle,我看到这个变成了RESTful,也就是说,协议本身变成了最常见和适用的一种。我看到有太多论述RESTful优点的文章了,而实际工作中也确实有所体会,比如接口和报文的可读性好,不需要特制的客户端,上手和调试都比较容易等等。但是,如果看到某个东西被冠以过多正面的评价,就要当心了。我也慢慢地体会到了一些问题。不过,在谈谈我的思考之前,我想先明确一下我对REST的认识,而这点,鉴于历史原因,也是我不太愿意花时间争辩的内容。我认为REST是一种设计和架构的方式,体现了系统响应请求交互的风格,而非接口规约,更不是什么报文协议。

对于RESTful的四种HTTP/HTTPS的方法,我看到不同的工程师有着不同的理解,而这点,是缺少足够明确的约束的。

  • 第一个例子,GET、POST、PUT、DELETE分别表示对资源的获取、创建、修改和删除。但是实际操作中,我看到一些不一致的东西。比如修改,我见过有使用PUT的,使用POST的,也有使用PATCH的,很难讲孰对孰错,欠缺的是规约。
  • 第二个例子,使用GET来做查询,清晰简便,但是也有着自己的局限性,其中一个就是参数的携带。明文参数的方法并不适合传递吧比较多的参数,而且如果参数值不是普通字符串或者数值,而是数组等集合,它缺少清晰而友好的传递方式。于是我看到有一些工程师会使用POST来解决这样的问题,这无疑从某种程度上破坏了RESTful的一些规约。
  • 第三个例子——版本的指定:我以前所了解到的,版本是可以再请求头部的Accept头中指定的,但是我看到了一些把版本号放到URL中的解决方案。考虑到REST本来也只是一种方式和风格,不能说这样的做法就是错误的,但我觉得还是缺少一个在REST之上更为细致的协议或者规约。
  • 第四个例子,参数的指定方式,放到问号前面的URI里面去还是放到问号后面的参数键值对里面去,我看到了不一致的处理方式。
  • ……

对于资源名称的定义,也就是RESTful的核心,也不适用于许多问题的解决。我用过SOAP,也用过一些其他的XML协议,REST是更加简洁的一个。如果是针对简单实体的增删改查,RESTful无疑是有效的。换言之,它擅长通用性问题的解决,但是孱弱于特应性问题的处理。但是如果是一个复杂业务的封装,RESTful显得力不从心。这样的封装,之所以不任其发展为通用接口,就是考虑到某些业务的特殊性,而通用接口对于特定场景的优化是不足的。就像一个简单的二维表,一个简单的select-from语句可能就可以解决,但是当业务复杂到多数请求都需要join、filter、map,这就似乎很难用擅长通用性的REST来解决问题了,否则就要创造一大堆不易理解的、不易重用的名词在作为resource了。

前面提到过缺少REST之上更为细致的协议或者规约,这个可以进一步展开说。对于某些基于请求和响应的通用操作,和内部框架+协议的方式比较起来,不太容易统一。比如说鉴权,比如说流控,比如说性能监控,这些东西都是很常用的,但是我看到使用一个专有的内部框架会更方便地嵌入和推广这样的组件,而RESTful的结果就是各个项目组五花八门,对于具体字段的理解也是分歧不少。

最后一个,我想到的是客户端的生成,以前用到的内部框架,可以方便地生成客户端,而客户端的功能也比较强大。但是RESTful了以后,以往的一些客户端丰富的特性都要重头自己实现过,比如说复杂的参数校验,比如一些自动装包解包到业务对象的代码生成等等。事实上,这些工作是不可能省略掉的,没法借助框架完成,就要自己想办法做。我记得以往获知一个service,为了使用客户端,想了解一下schema,很容易就可以得到自动生成的文档,但是现在则完全不能。

基于这些种种的原因,如果从头来过,依然使用RESTful风格的service,为了保持各个service之间的一致性,兴许一个统一的API框架是值得的。我理解速度在如今软件企业中的地位,但是我们总得在和可维护性的博弈中取得一个平衡。

确实软件开发没有银弹,而我自认为对于RESTful不足的思考还是不够深刻,如果你有很好的认识,不妨告诉我。:)


Read full article from 关于RESTful不足的思考 | 四火的唠叨


【开发原则】软件开发中的原则 - pdai - 博客园



【开发原则】软件开发中的原则 - pdai - 博客园

面向对象的基本原则(solid)是五个,但是在经常被提到的除了这五个之外还有 迪米特法则合成复用原则等, 所以在常见的文章中有表示写六大或七大原则的; 除此之外我还将给出一些其它相关书籍和互联网上出现的原则;

S单一职责SRP

Single-Responsibility Principle, 一个类,最好只做一件事,只有一个引起它的变化。单一职责原则可以看做是低耦合,高内聚在面向对象原则的引申,将职责定义为引起变化的原因,以提高内聚性减少引起变化的原因。

定义

一个对象应该只包含单一的职责,并且该职责被完整地封装在一个类中。(Every object should have a single responsibility, and that responsibility should be entirely encapsulated by the class.),即又定义有且仅有一个原因使类变更。

原则分析
  • 一个类(或者大到模块,小到方法)承担的职责越多,它被复用的可能性越小,而且如果一个类承担的职责过多,就相当于将这些职责耦合在一起,当其中一个职责变化时,可能会影响其他职责的运作。
  • 类的职责主要包括两个方面:数据职责和行为职责,数据职责通过其属性来体现,而行为职责通过其方法来体现。
  • 单一职责原则是实现高内聚、低耦合的指导方针,在很多代码重构手法中都能找到它的存在,它是最简单但又最难运用的原则,需要设计人员发现类的不同职责并将其分离,而发现类的多重职责需要设计人员具有较强的分析设计能力和相关重构经验。

Read full article from 【开发原则】软件开发中的原则 - pdai - 博客园


10 Quick Google Search Tips to Find What You Need Faster



10 Quick Google Search Tips to Find What You Need Faster

How did we ever get along without Google? With its mix of simplicity and breadth of information, there's little doubt that it's king of the mountain when it comes to search engines.

While most of us use Google for basic search, just under the surface there's a wealth of information to help make your searches more effective. Instead of searching for an airline's website and hunting down flight information there, have Google give it straight to you. Instead of finding a site that tells you when sunrise is, just let Google tell you. From searching within a specific website to finding books by a specific author, Google has it all.


Read full article from 10 Quick Google Search Tips to Find What You Need Faster


Two algorithms you must know for a software engineering interview | Tech Tutorials



Two algorithms you must know for a software engineering interview | Tech Tutorials

Depth-First Search (DFS) and Breadth-First Search (BFS) are very well know algorithms if you studied computer science, but for some self-taught people this algorithms are not so well known.

Graph theory helps you to solve several problems and having this two algorithms in mind could save your interview. Actually some big companies will ask you to solve problems that use this DFS or BFS.

We are going to show you how to remember DFS and BFS algorithms very easily. All examples will be made with Python.


Read full article from Two algorithms you must know for a software engineering interview | Tech Tutorials


How to convert mkv to mp4 on macOS | Tech Tutorials



How to convert mkv to mp4 on macOS | Tech Tutorials

Matroska (mkv) is a file format that contains audio, video, picture, subtitles, etc. This mkv format is not so friendly to the Apple environment. In this simple tutorial for beginners we will explain how to convert multiple files from mkv to mp4 using the command line.


Read full article from How to convert mkv to mp4 on macOS | Tech Tutorials


How to Force Your Mac to Stay Awake Indefinitely via the Command Line



How to Force Your Mac to Stay Awake Indefinitely via the Command Line

User Ricket on StackExchange shares this neat little command line tip. To keep your Mac awake, all you have to do is open Terminal on your Mac (Macintosh HD -> Applications -> Utilities -> Terminal) and enter the following command:

pmset noidle

When you're ready to allow your machine to sleep again, you just need to press Control + C.

Advertisement


Read full article from How to Force Your Mac to Stay Awake Indefinitely via the Command Line


My Technical Works: Analyzing a JVM Crash



My Technical Works: Analyzing a JVM Crash

A crash can cause the JVM to terminate. A Crash or even a fatal error can cause a Crash. A bug in the API, a bug in third party library that we use or bug in a native api can cause these JVM crashes. JVM can crash due to the external factors like resource exhaustion etc.

In this article we will see how we can analyze a JVM crash. Whenever a JVM is crashed a fatal error log file is generated. The file is named as hs_err_pid<pid>.log (where <pid> is the process id of the process). Most cases this file is created in the same working directory and in some other cases the file may be created in the temporary location. The file is created in the /tmp location in Linux and in directory specified by TEMP environment variable in windows.

Read full article from My Technical Works: Analyzing a JVM Crash


GitHub's 7 top productivity tools for programmers | InfoWorld



GitHub's 7 top productivity tools for programmers | InfoWorld

GitHub abounds with open source tools aimed at helping you build software faster. Devs find these seven among the best


Read full article from GitHub's 7 top productivity tools for programmers | InfoWorld


Eliminating Large JVM GC Pauses Caused by Background IO Traffic | LinkedIn Engineering



Eliminating Large JVM GC Pauses Caused by Background IO Traffic | LinkedIn Engineering

When Java heap space that the JVM manages is garbage collected, the JVM could be stopped, which introduces STW pauses to the applications. Depending on JVM options supplied when starting the Java instance, various types of GC and JVM activities are logged into GC log files.


Read full article from Eliminating Large JVM GC Pauses Caused by Background IO Traffic | LinkedIn Engineering


技术人生 | 陶辉笔记



技术人生 | 陶辉笔记

许多程序员自称码农,因为每天事情总也做不完,而这些工作也没有给自己带来职业上的提升,总在原地打转,自己的工作似乎随时可被新人替换,可有可无。于是,年轻些的考虑着转管理或者转行,年纪大些的则被所谓的40岁危机困扰焦虑着。另一方面,有些程序员工作高效,能力出众,每当机会来临时总能获得职位上升,收入迅速的[……]


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