<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Nodir Turakulov on Medium]]></title>
        <description><![CDATA[Stories by Nodir Turakulov on Medium]]></description>
        <link>https://medium.com/@nodir?source=rss-4a3184b6a1a9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*179jnDCW025Iw6y5eW9_lw.png</url>
            <title>Stories by Nodir Turakulov on Medium</title>
            <link>https://medium.com/@nodir?source=rss-4a3184b6a1a9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 00:23:32 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nodir/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Rust:Go comparison]]></title>
            <link>https://nodir.medium.com/rust-go-comparison-eef7118c611a?source=rss-4a3184b6a1a9------2</link>
            <guid isPermaLink="false">https://medium.com/p/eef7118c611a</guid>
            <category><![CDATA[rust]]></category>
            <category><![CDATA[go]]></category>
            <dc:creator><![CDATA[Nodir Turakulov]]></dc:creator>
            <pubDate>Wed, 30 Aug 2023 22:50:52 GMT</pubDate>
            <atom:updated>2023-08-30T22:50:52.077Z</atom:updated>
            <content:encoded><![CDATA[<p>This blogpost used to be a Twitter thread in 2021 when I had a Twitter account. I am posting this only to share what used to be there.</p><p>Things that caught my attention as a Go programmer while reading the <a href="https://doc.rust-lang.org/book/">Rust book</a>. This post is focusing on differences. Definitely not an exhaustive description of the lang.</p><p>No nil in Rust lang per-se, so by default you don’t have to check for nil in your code. You can’t trick the compiler into passing a nil either. Instead, “nullability” is opt-in, using explicit Option&lt;T&gt; container type.</p><pre>fn foo(u: Option&lt;&amp;User&gt;) {<br>  // If u has some user, then shadow u variable<br>  // with a new variable u of type &amp;User.<br>  if let Some(u) = u {<br>    printin! (&quot;Hello {}&quot;, u. name)<br>  }<br>  // ..<br>}<br><br>fn bar(u: &amp;User) {<br>  // don&#39;t have to check u for nil<br>  // ...<br>}<br><br>fn main() {<br>  let u = User{ /*..*/ };<br>  foo(Some(&amp;u)) ;<br>  foo(None); // like nil<br><br>  let u2: &amp;User;<br>  bar (u2); // &lt;- COMPILATION ERROR: u2 is uninitialized<br>}<br></pre><p>Rust lang design decisions are heavily influenced by “Zero cost abstraction” principle from C++, which is defined as 1. What you don’t use, you don’t pay for 2. What you do use, you couldn’t hand-code any better. This precludes GC, and coroutines at lang level.</p><p>An object is dropped/destructed when its (last) owner goes out of scope. Ownership can be transferred from var to var, from func to func, etc. Objects can also be borrowed temporarily. At the lang level, ownership is exclusive. Multi-ownership is opt-in, and provided via stdlib.</p><pre>fn main() {<br>  let bob = User{name: String::from(&quot;bob&quot;)};<br><br>  // Transfer ownership to bob2.<br>  let bob2 = bob;<br>  // Variable bob is no longer valid.<br><br>  // Transfer ownership to foo().<br>  foo (bob2);<br>  // Var bob2 is no longer valid.<br>}<br><br>fn foo(u: User) {<br>  printin!(&quot;Hello {}&quot;, u.name);<br>  // u&#39;s memory is released here.<br>}<br><br>struct User {<br>  name: String,<br>}</pre><p>Ownership/borrowing rules prevent mutating a vector while iterating over it. This is an error at compile-time!</p><pre>fn main( ) {<br>  let mut ints = vec![1, 2, 3];<br>  for x in &amp;ints {<br>    // COMPILTION ERROR:<br>    // An immutable borrow begins at the loop declaration and ends at loop end.<br>    // A mutable borrow happens in push() call.<br>    // Rule: a mutable borrow is mutually exclusive with any other borrows<br>    ints.push(1) ;<br>}</pre><p>There are also less trivial cases where compiler cannot figure out lifetime of a value. Then you have to annotate func input/output params or struct fields with “lifetimes”. It is hard to summarize this other than “it can get complicated”. Read more: <a href="https://doc.rust-lang.org/stable/book/ch10-03-lifetime-syntax.html">https://doc.rust-lang.org/stable/book/ch10-03-lifetime-syntax.html</a></p><p>No defer() in Rust, but it is not a huge deal because Rust drops objects automatically. A type can implement custom drop() func which releases system resources. The following code does NOT explicitly close the file anywhere, and yet the file isn’t leaked.</p><pre>fn main() {<br>  let mut file = File::open(&quot;foo. txt&quot;).unwrap() ;<br>  let mut contents = String::new();<br>  file.readToString(&amp;mut contents).unwrap();<br>  println!(&quot;Contents: {}&quot;, contents);<br>}</pre><p>Unlike Go, Rust forces you to think heap-vs-stack, and encourages storing data on the stack. If an object is stored in the heap, it stands out in the code, by being wrapped in Box&lt;T&gt; or another smart pointer.</p><p>Can be verbose though. Here is LinkedList in Rust and Go:</p><pre>// Rust<br>struct LinkedList {<br>  value: String,<br>  next: Box&lt;Option&lt;LinkedList&gt;&gt;,<br>}<br><br>fn main() {<br>  let head = LinkedList {<br>    value: String::from(&quot;a&quot;),<br>    next: Box::new(Some(LinkedList {<br>      value: String::from(&quot;b&quot;),<br>      next: Box::new(Some(LinkedList {<br>        value: String::from(&quot;c&quot;),<br>        next: Box::new(None),<br>      })),<br>    })),<br>  };<br><br>  let a = Shead;<br>  let b = a.next.as_ref().as_ref().unwrap();<br>  let c = b.next.as_ref().as_ref().unwrap();<br>  println!(&quot;() -&gt; {} -&gt; {})&quot;, a.value, b.value, c.value);<br>}</pre><pre>// Go<br>type LinkedList struct {<br>  value string<br>  next *LinkedList<br>}<br><br>func main() {<br>  var head = &amp;LinkedList{<br>    value: &quot;a&quot;,<br>    next: &amp;LinkedList{<br>      value: &quot;b&quot;,<br>      next: &amp;LinkedList{ value: &quot;c&quot; },<br>    },<br>  }<br><br>  fmt.Printf(<br>    &quot;%s -&gt; %s -&gt; %s&quot;,<br>    head.value,<br>    head.next.value,<br>    head.next.next.value,<br>  )<br>}</pre><p>There are a few pointer types. You use the cheapest one sufficient for the job. Need multiple owners? Use Rc&lt;T&gt;. Wait, need access from different threads? Then Arc&lt;T&gt;. Need to bend ownership/borrow rules? Use RefCell&lt;T&gt;, or maybe Rc&lt;RefCell&lt;T&gt;&gt;, or Arc&lt;Mutex&lt;T&gt;&gt;.</p><p>Immutability is a part of the lang, and the lang encourages it. Vars/params are immutable by default: mutable ones stand out in code because they must be annotated with `mut`. Can convert to immutable without copying. Not only var/params are immutable, but the referenced object <strong>itself</strong> too (deep immutability).</p><pre>let immutable = String::from(&quot;immutable&quot;);<br>let mut mutable = String::from(&quot;mutable&quot;);<br><br>mutable.push_str(&quot; foo&quot;);   // WORKS<br>immutable.push_str(&quot; foo&quot;); // COMPILATION ERROR</pre><p>Rust supports macros, which are basically Rust code that generates Rust code. Rust doesn’t support reflection, but macros have access to the AST. Rust funcs don’t support varags, but macros effectively do:<br>println!(“Hello {}”, user.name)</p><p>Rust trait is like Go interface. Unlike Go, a type must declare that it implements a trait; but it isn’t a problem because you can implement your trait for third-party types! A trait method can have a default impl. Effectively, you can add new methods to third-party types.</p><pre>trait MyLen {<br>  fn len(&amp;self) -&gt; usize;<br><br>  // double_len has a default impl.<br>  // A type implementing MyLen my override it.<br>  fn double_len(&amp;self) -&gt; usize {<br>    self.len() * 2<br>  }<br>}<br><br>// Implement MyLen in String type from stdlib.<br>impl MyLen for std::string::String {<br>  fn len(&amp;self) -&gt; usize {<br>    return self.len()<br>  }<br>}<br><br>fn main() {<br>  let s = String::from(&quot;&quot;);<br><br>  // Calling double_len on a String!<br>  println!(&quot;{}&quot;, s.double_len());<br>}</pre><p>You can even implement a trait for ANY type that satisfies a constraint, AKA blanket implementations. Also, a generic type can have methods defined *conditionally* on the type arguments, e.g. only if a type arg implements a trait. This kinda blows my mind.</p><pre>trait MyLen {<br>  fn len(&amp;self) -&gt; usize;<br>}<br><br>trait Dimensions {<br>  fn print_dims(&amp;self);<br>}<br><br>// Implement Dimensions for <br>// anything that implements MyLen.<br>impl&lt;T: MyLen&gt; Dimensions for T {<br>  fn print_dims(&amp;self) {<br>    println!(&quot;length: {}&quot;, self.len())<br>  }<br>}</pre><pre>struct Proxy&lt;T&gt; {<br>  real: T,<br>}<br><br>trait Closer {<br>  fn close(&amp;mut self);<br>}<br><br>impl&lt;T&gt; Proxy&lt;T&gt; {<br>  // These methods are available for any Proxy&lt;T&gt;<br>}<br><br>// Implement Closer for any Proxy&lt;T&gt; where T implements Closer.<br>impl&lt;T: Closer&gt; Proxy&lt;T&gt; {<br>  fn close(&amp;mut self) {<br>    self.real.close();<br>  }<br>}</pre><p>Both langs follow “errors are values” philosophy. Rust wraps values in Result&lt;T, E&gt; where E is the error type.</p><p>Rust’s “?” operator is syntax sugar for Go’s checking err != nil and returning err as-is.</p><pre>use srd::error::Error;<br><br>fn foo() -&gt; Result&lt;i32, Box&lt;dyn Error&gt;&gt; {<br>  // If bar returns an error, return it.<br>  // Otherwise, if baz returns an error, return it.<br>  // Otherwise, return their product.<br>  Ok(bar()? * baz()?)<br>}<br><br>fn bar() -&gt; Result&lt;i32, &amp;&#39;static std&gt; {<br>  Ok(1)<br>}<br><br>fn baz() -&gt; Result&lt;i32, std::io::Error&gt; {<br>  Ok(2)<br>}</pre><p>The “?” operator does NOT add contextual info to the returned error, AND an error in Rust doesn’t necessarily capture the stacktrace (support exists, but it has been experimental for 2y). I wonder if this combination makes it challenging to tell where an error came from.</p><p>Rust encourages all types to be known at compile time. Otherwise a type stands out in the code, annotated with `dyn`. For traits used in a func signature, Rust has syntax sugar to use generics instead, or replace returned trait with concrete type behind the scenes if it can.</p><pre>trait IntReader {<br>  fn read(&amp;mut self) -&gt; i32;<br>}<br><br>trait Printer {<br>  fn print(&amp;mut self);<br>}<br><br>// Accepts a trait and returns a trait,<br>// but both are annotated with &quot;impl&quot; syntax sugar.<br>fn int_printer(r : impl IntReader) -&gt; impl Printer {<br>  IntPrinter{ints: r}<br>}<br><br>// The equivalent<br>fn print_int_2&lt;T: IntReader&gt;(r: T) -&gt; IntPrinter&lt;T&gt; {<br>  IntPrinter{ints: r}<br>}<br><br>//-----------<br>struct IntPrinter&lt;R: IntReader&gt; {<br>  ints: R,<br>}<br><br>impl&lt;T: IntReader&gt; Printer for IntPrinter&lt;T&gt; {<br>  fn print(&amp;mut self) {<br>    println!(&quot;value: {}&quot;, self.ints.read());<br>  }<br>}</pre><p>Rust has enums, which are actually discriminated unions. Each member can store different types of data. The byte size of the enum type is the byte size of its largest member. Rust has pattern matching and it works particularly nicely for enums.</p><pre>enum Message {<br>  Quit,<br>  Move {x: i32, y: i32 },<br>  Write(String),<br>  ChangeColor(i32, i32, i32),<br>}<br><br>fn act(m: Message) {<br>  use Message::*;<br>  match m {<br>    Quit =&gt; println!(&quot;I am quitting&quot;),<br>    Move{x, y} =&gt; println!(&quot;Moving to ({}, {})&quot;, x, y),<br>    Write(s) =&gt; println!(&quot;Writing {:?}&quot;, s),<br>    ChangeColor(r, g, b) =&gt; println!(&quot;Changing color to ({}, {}, {}), r, g, b), <br>  }<br>}</pre><p>panic crashes the current thread, not necessarily entire process… unless it was the main thread. In Go, panic in any goroutine can crash the process. There is no recover() in Rust.</p><p>Rust’s type inference is more advanced. The following code creates a hashtable without explicitly specifying its key/value type params anywhere. They are inferred from return types of foo() and bar().</p><pre>fn main() {<br>    let mut ht = HashMap::new();<br>    ht.insert(foo(), bar());<br>}</pre><p>Rust has a short syntax for anonymous funcs: if Rust can infer types of in/out params, then they can be omitted</p><pre>foo(|x| x * 2);</pre><p>Only anonymous functions can be closures. You can define fn inside an fn, but it is not allowed to capture the environment, so a function call never allocates memory.</p><p>Rust implements iterators (with map, filter, etc) that adhere to “zero cost abstraction” principle. For the following non-trivial code, Rust compiler is smart enough <strong>not to generate any loops (anywhere)</strong> for calculation of one prediction. read more: <a href="https://doc.rust-lang.org/stable/book/ch13-04-performance.html">https://doc.rust-lang.org/stable/book/ch13-04-performance.html</a></p><pre>let buffer: &amp;mut [i32];<br>let coefficients: [i64, 12];<br>let qlp_shift: i16;<br><br>for i in 12..buffer.len() {<br>  let prediction = coefficients.iter()<br>    .zip(&amp;buffer[i - 12..i])<br>    .map(|(&amp;c, &amp;s)| c * s as i64)<br>    .sum::&lt;i64&gt;() &gt;&gt; qlp_shift;<br>  <br>  let delta = buffer[i];<br>  buffer[i] = prediction as i32 + delta;<br>}<br><br>// Rust compiler is smart enough not to generate any loops (anywhere)<br>// corresponding to the iterator code.<br><br>// Source: https://doc.rust-lang.org/book/ch13-04-performance.html</pre><p>Rust seems to like exhaustiveness. Struct literals must specify ALL fields. In particular, this prevents un-initialized reference fields (so.. no nil). When pattern matching, the set of patterns must be exhaustive.</p><p>Unit tests can be in the same file as the code-under-test.</p><pre>fn factorial(x: i32) -&gt; i32 {<br>  if x == 1 {<br>    1<br>  } else {<br>    x * factorial(x-1<br>  }<br>}<br><br>#[cfg(test)]<br>mod tests {<br>  use super::*;<br><br>  #[test]<br>  fn factorial_5() {<br>    assert_eq!(factorial(5), 120)<br>  }<br>}</pre><p>At last, concurrency. Today, Rust has full support for OS-thread-based concurrency, whereas async/await model is very much pre-1.0. The Rust async book is WIP, and my brain melted while I was reading it due to the amount of complexity imposed on me as a user of Rust. Gotta wait.</p><p>Mutexes are brilliant in Rust. Impossible to forget to lock/unlock.</p><ul><li>The value is wrapped in a mutex, and can be retrieved only by locking</li><li>The lock is released automatically when it leaves the scope</li></ul><pre>fn main() {<br>  // Wrap an int in a mutex.<br>  // Wrap the mutex in Arc so that we can share across threads.<br>  let counter = Arc::new(Mutex::new(0));<br><br>  let mut handles = vec![];<br>  for _ in 0..10 {<br>    let counter = Arc::clone(&amp;counter);<br>    let handle = thread::spawn(move || {<br>      // Retrieve by calling lock();<br>      let mut num = counter.lock().unwrap();<br>      *num += 1;<br>      //  The lock is released here automatically.<br>    });<br>    handles.push(handle);<br>  }<br>  <br>  for handle in handles {<br>    handle.join().unwrap();<br>  }<br><br>  println!(&quot;Result: {}&quot;, *counter.lock().unwrap());<br>}</pre><p>Go-like channels are available in stdlib and third-party libs. Stdlib defines common types, like Future, while third-party libs implement runtimes. <a href="https://tokio.rs/">tokio.rs</a> is a popular third-party async framework. It comes with a plug-in async runtime and purpose-built channels.</p><pre>// tx: t for transmission<br>// rx: r for receiving<br>// Note: they ARE generic.<br>let (tx, rx) = mpsc::channel();<br>for i in 0..10 {<br>  let tx = tx.clone();<br>  thread::spawn(move|| {<br>    tx.send(i).unwrap();<br>  });<br>}<br><br>for _ in 0..10 {<br>  let x = rx.recv().unwrap();<br>  println!(&quot;{}&quot;, x)<br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eef7118c611a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Distributed systems]]></title>
            <link>https://nodir.medium.com/distributed-systems-6ea0dc981840?source=rss-4a3184b6a1a9------2</link>
            <guid isPermaLink="false">https://medium.com/p/6ea0dc981840</guid>
            <dc:creator><![CDATA[Nodir Turakulov]]></dc:creator>
            <pubDate>Wed, 18 Jan 2023 20:36:44 GMT</pubDate>
            <atom:updated>2023-01-24T03:04:35.937Z</atom:updated>
            <content:encoded><![CDATA[<h3>Distributed systems, the hard parts</h3><p>Originally this was a twitter thread with 2k likes in my now-deleted account. It was pretty condense, and so are paragraphs in this article.</p><p>Distributed systems are interesting because you don’t have some of the guarantees that you normally have, and are used to, in a single process. An anti-pattern is to assume you have them. Here are a few assumptions I’ve observed in my experience.</p><h3>RPCs</h3><p>RPCs have higher overhead than function calls. Put multiple items in a single request if you expect many items, but don’t put all of them into a single batch because RPCs define limits, and because you want consistent latency. Make RPCs in parallel, but don’t forget to limit number of concurrent outgoing requests, e.g. to avoid running out of file descriptors.</p><p>Unlike a function call, when you make an RPC, the handler may receive your request multiple times. Implement idempotency. And when you respond to the client, it doesn’t necessarily receive your response. They might retry, so idempotency helps again. Same with queues. A message may be delivered multiple times. The message handler gotta be idempotent. It is generally difficult/rare to implement exactly-once semantics. Usually it is at-least-once.</p><p>When calling a stateful dependency, such as a distributed database, different items in a batch might be processed by different nodes. Minimize the number of nodes involved per batch by sorting items by the sharding key before forming batches.</p><h3>Races conditions</h3><p>The order of requests sent isn’t the same as the order of requests received. Assuming the otherwise might lead to races. Enqueued messages may be delivered out of order. Consider putting data-that-might-change into a db, and put only an immutable ref to that data into an SQS message. Then when processing the however-stale message, the handler fetches the latest state.</p><p>A piece of state you read from another machine/service/database isn’t necessarily the same when writing it back a subsecond later. This also leads to race conditions. When writing it back, <strong>atomically</strong> verify that state is still the same, via ConditionChecks / transactions.</p><p>Clocks on different machines may show different times. Don’t rely on timestamp comparison if must get it 100% correct. This is another source of race conditions.</p><p>Most race conditions can be addressed by a synchronization mechanism, and in most distributed systems it is your database that supports atomic condition checks / transactions. It is the arbiter of who wins.</p><h3>Atomic mutations</h3><p>Unlike state in a single process, in distributed systems you rarely can make mutations in two systems atomically, e.g. marking a purchase order as placed in the database and sending a confirmation email is not atomic. You might successfully mutate first system, but fail on the second one.</p><p>If your storage system supports Change Data Capture, like DynamoDB, only place the purchase order, and in the background listen to committed changes and send the email there. This assumes that sending the email is idempotent.</p><p>Without CDC, update the order row and atomically insert another row representing an <strong>intention</strong> to send the email. In the background poll “intention rows” and send the email. Usually this is done in conjunction with a queuing system, so typically the intention is to enqueue a msg.</p><h3>Availability</h3><p>A single process can rarely overwhelm itself. In a distributed system, one service can take another down by sending too many requests. A service must protect itself by throttling incoming requests, and you sometimes should protect others by throttling outgoing requests, see <a href="https://brooker.co.za/blog/2022/02/28/retries.html">adaptive client-side throttling</a> by <a href="https://twitter.com/MarcJBrooker">@MarcJBrooker</a>.</p><p>Unlike functions in the same process, different services have different availability SLOs. In the code path of your API, don’t call another API that didn’t promise availability as high as you promised in your API. Same with latency. Try to move such calls out, to background jobs.</p><p>With a single process, if it crashes there isn’t much you can do, so why bother. In a distributed system your service should survive when a single process/machine fails, and try to fail gracefully if your dependency service is hard-down.</p><p>When one process fails, the system should somehow notice that (failed health checks, expired leases, explicit acknowledgements of completed work) and redistribute the work among survivors. In particular, you don’t have to maintain multiple exact copies of a state in a single process. In a stateful service, high availability can be achieved by maintaining multiple replicas of the same state.</p><p>State replicas should live in different availability zones which fail independently. Some keep copies even in geographically distant locations to survive natural disasters, for business continuity. State replication, especially synchronous / strongly consistent, is hard to get right. The good news is you rarely have to implement this yourself because your distributed database takes care of that.</p><p>Unlike a single process, deployments in a distributed system aren’t atomic. Backward incompatible changes require a multiple deployments, e.g. 1) update service1 to accept both old &amp; new protocols 2) update service2 to use the new protocol 3) remove old code from service1.</p><h3>Security</h3><p>Different parts of the same process trust each other. A distributed system should minimize the impact when one node is compromised: each node may have to verify each incoming call/connection via authentication, authorization, transport encryption and/or input validation.</p><p>You might want to extract security sensitive parts of your application, e.g. payments, into a separate highly secure environment, e.g. Nitro Enclaves. When a monolith is compromised, ALL of its parts are compromised at once.</p><h3>Testing</h3><p>Testing a distributed system is harder. It may require multiple machines and/or more time. If your dependency service in a cloud doesn’t provide local emulators, you may have to create resources in your cloud provider, and forget to cleanup.</p><p>It might be infeasible to run integration tests locally or before merging a change. This increases the feedback loop interval, which makes engineers less happy.</p><h3>Conclusion</h3><p>While distribute systems have higher scale, availability, latency/throughput, and security, there are MUCH more complex. Making a system more distributed is a large investment and you must have a crisp understanding of what you are trying to achieve, i.e. the ROI.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6ea0dc981840" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[3 years with autism self-diagnosis]]></title>
            <link>https://nodir.medium.com/3y-autism-46323ede30af?source=rss-4a3184b6a1a9------2</link>
            <guid isPermaLink="false">https://medium.com/p/46323ede30af</guid>
            <category><![CDATA[personal]]></category>
            <category><![CDATA[autism]]></category>
            <dc:creator><![CDATA[Nodir Turakulov]]></dc:creator>
            <pubDate>Tue, 06 Jul 2021 07:00:06 GMT</pubDate>
            <atom:updated>2021-08-29T08:22:35.193Z</atom:updated>
            <content:encoded><![CDATA[<p>Autism doesn’t get diagnosed in Uzbekistan often; only severe cases. There is little awareness about autism, no support in schools, etc. It is a sort of thing that “happens to others”, and people generally don’t talk about it.</p><p>My son was officially diagnosed with autism here in US around 3 years ago. After reading the <a href="https://www.webmd.com/brain/autism/symptoms-of-autism">symptoms</a> I’ve realized that I, my father and my grandfather must have it too. It was a personal epiphany for me and my wife: it answered many questions about my childhood/youth; explained severe obsession with coding with little interest in friendships/people. This realization helped our marriage because it brought clarity.</p><p>Since then it was a slow process of crawling out of the little world I built in my head over 30 years into the real world, where people matter more than code. My wife spent countless hours explaining things that are natural to neuro-typical people, breaking elements of interpersonal relationships down into atoms and articulating all of this in a <strong>logical</strong> manner so that I can understand it.</p><p>I am “more normal” now, but I am currently ambivalent about the results. On the upside, people around me have easier time with me now. I learned to do the small-talk, have conversations that don’t involve coding/work. I am more willing to spend my time helping others even if I personally don’t benefit from it. I can spend a weekend without waiting for Monday, and now I understand people who don’t like Mondays. I was able to talk to my relatives despite none of them being close to computers. I was finally able to organize my wife’s birthday after 7 years of failures caused by anxiety of dealing with real world with so many degrees of freedom.</p><p>All of this sounds great, but the irony is that with normalization came the problems of “normal people”. Questions like “<em>what’s the point of all of this?</em>” didn’t really bother me before — I didn’t have time for them because I was so preoccupied with my blissful obsession. Now it turns out that what I cared about the most for 20 years does matter <strong>that</strong> much; and at this scale, it takes time to process that. It is like leaving a religion. Now I find myself pondering about stuff like in this post for long evenings, instead of… coding.</p><p>So people around me seem happier with me now, but I feel less happy currently. This might be temporary, as I learn how to live; or it might be that in the real world everyone is struggling a bit and that’s actually OK. Overall, it seems like a net win.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=46323ede30af" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Job at Google in 6 months recipe]]></title>
            <link>https://nodir.medium.com/job-at-google-in-6-months-recipe-20c5bf3104d9?source=rss-4a3184b6a1a9------2</link>
            <guid isPermaLink="false">https://medium.com/p/20c5bf3104d9</guid>
            <category><![CDATA[google]]></category>
            <dc:creator><![CDATA[Nodir Turakulov]]></dc:creator>
            <pubDate>Sun, 23 Mar 2014 10:25:32 GMT</pubDate>
            <atom:updated>2023-01-18T17:09:01.455Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Originally published at </em><a href="https://nodirt.tumblr.com/post/79121611709/google"><em>https://www.tumblr.com</em></a><em> on March 23, 2014.</em></p><p><strong>TL;DR</strong> Read three books, watch two classes, solve problems at topcoder/codeforces/projecteuler. Links are below.</p><p>If you are interested in getting a job at Google, you’ve probably already read Steve Yegge’s <a href="https://href.li/?http://steve-yegge.blogspot.ch/2008/03/get-that-job-at-google.html">famous post</a> (if you didn’t, read it first). It assumes you have only a couple of weeks for preparation and focuses on topics. I used it as a checklist. This recipe focuses on resources; depending on your background, requires 3–6 months, and gives you pretty good chances to pass the interview even if you never knew the difference between a graph and a hash table.</p><p>After following the recipe you will</p><ul><li>have basic math, algorithm and data structure knowledge required for the interview</li><li>change the way you think about problems, expressing them using mathematical models (it is not scary, rather fun)</li><li>possibly love learning. Here at Google it is a continuous process and not less intensive.</li><li>learn nothing about system design (see below)</li></ul><p>I spent 2/3 of time on education and 1/3 on solving problems, but that’s because I had almost zero CS knowledge. If you just need a refresher, you should probably spend more time on problems.</p><h3>Learn math</h3><ul><li>Watch MIT’s <a href="https://href.li/?http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-042j-mathematics-for-computer-science-fall-2010/index.htm">Mathematics for CS</a> video course</li><li>Read <a href="https://href.li/?http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-042j-mathematics-for-computer-science-fall-2010/readings/MIT6_042JF10_notes.pdf">course notes</a></li><li>Do homework</li></ul><p>The lecturer, Prof. Tom Leighton, is just great. He gives simple real-life examples that help understanding material easily. The course is designed for undergraduate students.</p><h3>Learn algorithms and data structures</h3><ul><li>Watch MIT’s <a href="https://href.li/?http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-006-introduction-to-algorithms-fall-2011/">Introduction to Algorithms</a> video course.</li><li>Read <a href="https://t.umblr.com/redirect?z=http%3A%2F%2Fwww.amazon.com%2FIntroduction-Algorithms-Thomas-H-Cormen%2Fdp%2F0262033844&amp;t=Njk0YWI1NzIwNjRjNDQ3YTUwMDZmYjQ1ZDhlMWI2NDc5ZjE0ZWEyMCxkVHRuamVVOA%3D%3D&amp;b=t%3AouUW2EVqXtgMGiSXbVOb-A&amp;p=https%3A%2F%2Fnodirt.tumblr.com%2Fpost%2F79121611709%2Fgoogle&amp;m=1&amp;ts=1624941913">Introduction to Algoritms</a> book by Cormen et al.</li><li>Do homework</li><li>Write algorithm and data structure implementations yourself. Write unit tests</li><li>Skim through the second part of <a href="https://t.umblr.com/redirect?z=http%3A%2F%2Fwww.amazon.com%2FAlgorithm-Design-Manual-Steve-Skiena%2Fdp%2F0387948600&amp;t=OGVkYThmMWZiNmFiYjkxNTA3MTIyMzU2OTRkZTBjMGU3MThlZTY2NixkVHRuamVVOA%3D%3D&amp;b=t%3AouUW2EVqXtgMGiSXbVOb-A&amp;p=https%3A%2F%2Fnodirt.tumblr.com%2Fpost%2F79121611709%2Fgoogle&amp;m=1&amp;ts=1624941913">Algorithm design manual</a> book by Skiena. It is a catalog of well-known algorithmic problems. The first part is not required since Introduction to Algorithms covers theory pretty well</li><li>Optionally, skim through <a href="https://t.umblr.com/redirect?z=http%3A%2F%2Fwww.amazon.com%2FAlgorithms-4th-Edition-Robert-Sedgewick%2Fdp%2F032157351X&amp;t=NjBkZGUzY2EwZTQzY2YwMGQ2MWFlY2M2NGM0MmFlMmM0Nzg0MzkyZixkVHRuamVVOA%3D%3D&amp;b=t%3AouUW2EVqXtgMGiSXbVOb-A&amp;p=https%3A%2F%2Fnodirt.tumblr.com%2Fpost%2F79121611709%2Fgoogle&amp;m=1&amp;ts=1624941913">Algorithms</a> book by Sedgewick. He covers 3-way-quicksort and has great illustrations</li></ul><p>The <em>Introduction to Algorithms</em> book is the primary source of knowledge in the whole recipe. The video lectures mainly explain the material in the book, bring some fun, but also present something not covered by the book.</p><p>The book is big, but according to Steve and reports available on the Internet, not all knowledge presented in the book is required for the interview. At least you should read the material covered by the lectures. I enjoyed reading more because it turned out to be soo interesting.</p><p>I believe writing code after reading theoretical material is the only way to memorize it and find real-life obstacles, not obvious from pseudocode. For instance, Dijkstra’s algorithm pseudocode initializes distance for all nodes in the beginning. In practice it will cause unnecessary memory waste and it is much more efficient to assign distance to a node on discovery. I wouldn’t figure this out without implementing it myself.</p><h3>Learn multi-threading</h3><p>I didn’t have time to read it all, but Part I Fundamentals is worth reading even if Java is not your language. You must be able to tell why a given piece of code won’t work multi-threaded and how to fix it.</p><h3>Solve problems</h3><p>The second part of the recipe is simply solving algorithmic problems available at contest sites, such as <a href="https://href.li/?http://topcoder.com">TopCoder</a> and <a href="https://href.li/?http://codeforces.com">Codeforces</a>. Solve as many problems as time permits. It is OK to feel “I am stupid” when looking at a problem. I still have it, yet I’ve got a job.</p><p>Two main languages for an interview are Java and Python. Choose one and use it to solve all problems.</p><p>There is a plenty of interview problems posted on the Internet. Here are some of them:</p><p>Problems at topcoder/codeforces are generally more difficult than published interview problems, so make sure you know how to solve all interview problems that you find.</p><h3>Learn system design</h3><p>You will be asked system design questions for sure. This recipe does not cover it. I didn’t prepare for system design and regretted. If you have a book/course recommendation, please post in comments.</p><p>Good luck, but more importantly prepare for intensive self-development. After getting the job you will find this material was just a tip of an iceberg.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=20c5bf3104d9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Code Project Members Choice 2012 award]]></title>
            <link>https://nodir.medium.com/code-project-members-choice-2012-award-a043895f09ad?source=rss-4a3184b6a1a9------2</link>
            <guid isPermaLink="false">https://medium.com/p/a043895f09ad</guid>
            <category><![CDATA[linq]]></category>
            <dc:creator><![CDATA[Nodir Turakulov]]></dc:creator>
            <pubDate>Tue, 26 Jun 2012 10:25:32 GMT</pubDate>
            <atom:updated>2021-06-29T04:51:21.515Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/250/0*DoAagnfTN8zr1R8S.jpg" /></figure><p>Today I’ve discovered, thanks to a customer, that two weeks ago <a href="https://href.li/?http://componentone.com/SuperProducts/StudioEF/">ComponentOne Studio® for Entity Framework</a>, the main product I worked on, <a href="https://href.li/?http://www.componentone.com/SuperPages/Awards/">won <strong>Code Project Members Choice 2012 award</strong></a> in the Big Data Solutions category at Microsoft’s TechEd 2012 conference in Orlando.</p><p>This award is the best thing I ever achieved and thus I am super excited. Such awards are a great source of motivation.</p><p><em>Originally published at </em><a href="https://nodirt.tumblr.com/post/26060301089/award"><em>https://www.tumblr.com</em></a><em> on June 26, 2012.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a043895f09ad" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>