The purpose of this program is to solve the following problem posed by Jon Bentley:
Given a text file and an integer k, print the k most common words in the file (and the number of their occurrences) in decreasing frequency.
// type Message = Finished | Msg of int * Message MailboxProcessor | |
// let (<--) (m:MailboxProcessor<_>) x = m.Post(x) | |
// let ping iters (outbox : Message MailboxProcessor) = | |
// MailboxProcessor.Start(fun inbox -> | |
// let rec loop n = async { | |
// match n with | |
// | 0 -> outbox.Post Finished | |
// printfn "ping finished" |
using System; | |
using System.Linq; | |
using System.Net.Sockets; | |
namespace T | |
{ | |
///<summary> | |
/// Сетевой актор подключается к серверу и пересылает сообщения. При обрыве связи самостоятельно | |
/// её восстанавливает. | |
/// </summary> |
The purpose of this program is to solve the following problem posed by Jon Bentley:
Given a text file and an integer k, print the k most common words in the file (and the number of their occurrences) in decreasing frequency.
// Put in Program Files (x86)/Steam/steamapps/common/dota 2 beta/dota/cfg/autoexec.cfg | |
alias vo/+ "voice_enable 1; vo/om-~" | |
alias vo/- "voice_enable 0" | |
alias vo/om~ "vo/om+~" | |
alias vo/om+ "voice_vox 1" | |
alias vo/om- "voice_vox 0" | |
alias vo/om+~ "vo/om+; alias vo/om~ vo/om-~" | |
alias vo/om-~ "vo/om-; alias vo/om~ vo/om+~" | |
bind kp_multiply vo/om~ | |
bind kp_minus vo/- |
Оригинал http://habrahabr.ru/company/infopulse/blog/260809
Ну и вот вам задачка, которая может попасться на собеседовании. Она не совсем тривиальна, возможно несколько подходов к решению и лучший из них не сразу очевиден — как-раз то, над чем стоит подумать. Вам предлагается следующий пазл:
con_enable 1 | |
con_filter_enable 1 | |
con_filter_text [ | |
con_notifytime 1.7 | |
developer 1 | |
alias +smpm+vr "+sixense_map_ping_mode; +voicerecord" | |
alias +smpm-vr "+sixense_map_ping_mode; -voicerecord" | |
alias -smpm-vr "-sixense_map_ping_mode; -voicerecord" | |
alias +tacticalmode +smpm+vr | |
alias -tacticalmode -smpm-vr |
(ns geolinks.snowflake | |
(:import java.util.Random)) | |
(defprotocol ICounter | |
(counter-name [this]) | |
(counter-count [this]) | |
(increase-count [this])) | |
(defrecord Counter [name count-atom] | |
ICounter |
;; -*-lisp-*- | |
(in-package :stumpwm) | |
(defun cat (&rest strings) | |
(apply 'concatenate 'string strings)) | |
(defparameter foreground-color* "white") | |
(defparameter background-color* "black") | |
(defparameter border-color* "black") |