<?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 Erim Tuzcuoğlu on Medium]]></title>
        <description><![CDATA[Stories by Erim Tuzcuoğlu on Medium]]></description>
        <link>https://medium.com/@erimtuzcuoglu?source=rss-71ea1d222471------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*GI2rUqhVg2QpWtqxk-U9_g.png</url>
            <title>Stories by Erim Tuzcuoğlu on Medium</title>
            <link>https://medium.com/@erimtuzcuoglu?source=rss-71ea1d222471------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 09:40:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@erimtuzcuoglu/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[Redis: A High-Performance, Scalable, and Versatile Database]]></title>
            <link>https://medium.com/@erimtuzcuoglu/redis-a-high-performance-scalable-and-versatile-database-c4043f864e92?source=rss-71ea1d222471------2</link>
            <guid isPermaLink="false">https://medium.com/p/c4043f864e92</guid>
            <category><![CDATA[redis]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[typescript]]></category>
            <dc:creator><![CDATA[Erim Tuzcuoğlu]]></dc:creator>
            <pubDate>Wed, 29 Jan 2025 13:53:07 GMT</pubDate>
            <atom:updated>2025-01-29T13:53:07.368Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/704/1*_gmOXb4NWkfNcfV1of4v0Q.png" /></figure><p>In modern high-traffic applications, efficient data management is crucial for performance and reliability. Redis, renowned for its speed, scalability, and versatility, has become an essential tool for developers seeking an optimized data storage and retrieval solution. This article explores the key features that make Redis an industry-leading choice, along with additional features such as Pub/Sub, transactions, Lua support, ease of use, and community backing.</p><h3>1. Remote Dictionary Server (Redis)</h3><p>Redis, which stands for <strong>Re</strong>mote <strong>Di</strong>ctionary <strong>S</strong>erver, is an open-source, in-memory data structure store used as a database, cache, and message broker. It provides lightning-fast data access by storing key-value pairs in memory, making it an excellent choice for high-performance applications.</p><h4>Key Features:</h4><ul><li>In-memory storage for ultra-fast data retrieval.</li><li>Supports multiple data structures such as strings, lists, sets, and hashes.</li><li>Lightweight and efficient, ideal for distributed systems.</li><li>Provides high availability through clustering and replication.</li></ul><h4>Key Use Cases for Redis</h4><p>Redis’s performance, scalability, and flexibility make it an optimal choice for a wide range of applications, including:</p><ul><li>Caching — Accelerate application response times by storing frequently accessed data in memory.</li><li>Session Management — Maintain user sessions efficiently in web applications.</li><li>Real-Time Analytics — Power dashboards with high-speed data aggregation and retrieval.</li><li>Leaderboards and Rankings — Use sorted sets for gaming and social media applications.</li><li>Job Queues — Implement background task processing using Redis lists.</li><li>Machine Learning Feature Stores — Store and serve ML model features with minimal latency.</li></ul><h3>2. High Performance</h3><p>Redis operates as an in-memory key-value store, enabling ultra-fast data access compared to traditional disk-based databases. With response times in the millisecond range, Redis is ideal for applications requiring real-time data processing, such as financial services, gaming, and content delivery networks.</p><h4>Example:</h4><pre>// Storing a user object as a JSON string in Redis<br>redis.set(&quot;user:123&quot;, JSON.stringify({ name: &quot;John Doe&quot;, age: 30 }));<br>// Retrieving the stored user data<br>redis.get(&quot;user:123&quot;, (err, result) =&gt; {<br>  console.log(JSON.parse(result)); // Output: { name: &quot;John Doe&quot;, age: 30 }<br>});</pre><h3>3. Time-to-Live (TTL) for Expiring Data</h3><p>Redis provides a Time-to-Live (TTL) mechanism that allows keys to expire after a specified duration. This is particularly useful for caching, session management, and temporary storage of data.</p><h4>Example (Setting TTL on a Key):</h4><pre>// Setting a key with an expiration time of 60 seconds<br>redis.setex(&quot;session:user123&quot;, 60, &quot;active&quot;);<br>// Checking the remaining time to live<br>redis.ttl(&quot;session:user123&quot;, (err, time) =&gt; {<br>  console.log(`Time left: ${time} seconds`);<br>});</pre><h3>4. Comprehensive Data Structure Support</h3><p>Unlike simple key-value stores, Redis supports various complex data structures, including:</p><ul><li><strong>Strings</strong> — Ideal for caching and session management.</li><li><strong>Lists</strong> — Useful for implementing queues and logs.</li><li><strong>Sets</strong> — Suitable for tracking unique elements in recommendation systems.</li><li><strong>Sorted Sets</strong> — Enables ranking mechanisms in leaderboards.</li><li><strong>Hashes</strong> — Efficient for storing user profiles and metadata.</li><li><strong>Bitmaps, HyperLogLogs, and Streams</strong> — Advanced structures for statistical computations and real-time event processing.</li></ul><h4>Example (Sorted Sets for Leaderboards):</h4><pre>// Adding players and their scores to a sorted set (leaderboard)<br>redis.zadd(&quot;game:leaderboard&quot;, 1500, &quot;player1&quot;);<br>redis.zadd(&quot;game:leaderboard&quot;, 2000, &quot;player2&quot;);<br>// Retrieving players sorted by score in descending order<br>redis.zrevrange(&quot;game:leaderboard&quot;, 0, -1, &quot;WITHSCORES&quot;, (err, result) =&gt; {<br>  console.log(result); // Output: [ &#39;player2&#39;, &#39;2000&#39;, &#39;player1&#39;, &#39;1500&#39; ]<br>});</pre><h3>5. Job Queue with Redis Lists</h3><p>Redis lists can be used to implement job queues, where tasks are enqueued and processed asynchronously by workers. Example (Job Queue Using Redis Lists):</p><pre>// Adding jobs to the queue<br>redis.lpush(&quot;task_queue&quot;, &quot;task1&quot;);<br>redis.lpush(&quot;task_queue&quot;, &quot;task2&quot;);<br>// Worker fetching jobs from the queue<br>function processJobs() {<br>  redis.brpop(&quot;task_queue&quot;, 0, (err, result) =&gt; {<br>    console.log(`Processing ${result[1]}`); // Process the job<br>    processJobs(); // Recursively fetch the next job<br>  });<br>}<br>processJobs();</pre><h3>6. Redis Streams for Real-Time Data Processing</h3><p>Redis Streams allow efficient handling of real-time data flows, making it an excellent choice for event-driven applications, messaging systems, and real-time analytics.</p><h4>Example (Using Redis Streams):</h4><pre>// Adding an event to a stream<br>redis.xadd(&quot;mystream&quot;, &quot;*&quot;, &quot;user&quot;, &quot;Alice&quot;, &quot;action&quot;, &quot;login&quot;);<br>// Reading the latest event from the stream<br>redis.xread(&quot;STREAMS&quot;, &quot;mystream&quot;, &quot;0&quot;, (err, result) =&gt; {<br>  console.log(result);<br>  // Output: [[&#39;mystream&#39;, [[&#39;message_id&#39;, [&#39;user&#39;, &#39;Alice&#39;, &#39;action&#39;, &#39;login&#39;]]]]]<br>});</pre><h3>7. Persistent Data Storage</h3><p>Although Redis is primarily an in-memory database, it offers two mechanisms for data durability:</p><ul><li><strong>RDB (Redis Database Backup)</strong> — Periodic snapshots ensure efficient backup and disaster recovery.</li><li><strong>AOF (Append-Only File)</strong> — Logs every write operation to disk to minimize data loss.</li></ul><h4>Example (AOF Configuration in Redis):</h4><pre># Enabling append-only mode to ensure data persistence<br>appendonly yes<br>appendfsync everysec</pre><h3>8. Horizontal Scalability for Large-Scale Deployments</h3><p>Redis supports sharding (data partitioning across multiple nodes), enabling seamless horizontal scaling. Large-scale distributed applications benefit from this approach by balancing loads across multiple Redis instances, ensuring consistent performance even under heavy traffic.</p><h4>Example (Redis Cluster Setup):</h4><pre>const cluster = new Redis.Cluster([<br>  { host: &quot;127.0.0.1&quot;, port: 7000 },<br>  { host: &quot;127.0.0.1&quot;, port: 7001 },<br>  { host: &quot;127.0.0.1&quot;, port: 7002 }<br>]);</pre><h3>9. Pub/Sub (Publish-Subscribe) Support</h3><p>Redis supports the Pub/Sub (Publish-Subscribe) messaging pattern, making it an excellent choice for real-time messaging applications. In this model, a “publisher” sends messages to a channel, and “subscribers” listen for messages on that channel. This feature is particularly useful for real-time applications and event-driven architectures.</p><h4>Example (Pub/Sub Usage):</h4><pre>// Redis Subscriber<br>const subscriber = redis.duplicate();<br>subscriber.subscribe(&quot;news&quot;, (message) =&gt; {<br>  console.log(&quot;New Message:&quot;, message);<br>});<br>// Redis Publisher<br>redis.publish(&quot;news&quot;, &quot;Breaking News!&quot;);</pre><h3>10. Transaction Support</h3><p>Redis provides simple transaction support via commands like <strong>MULTI</strong>, <strong>EXEC</strong>, <strong>DISCARD</strong>, and <strong>WATCH</strong>. However, Redis transactions do not fully support ACID (Atomicity, Consistency, Isolation, Durability) properties. Still, they are useful for ensuring atomicity for certain operations.</p><h4>Example (Transaction Usage):</h4><pre>redis.multi()<br>  .set(&quot;user:123&quot;, JSON.stringify({ name: &quot;Alice&quot; }))<br>  .incr(&quot;counter&quot;)<br>  .exec((err, results) =&gt; {<br>    console.log(results); // Atomic operations<br>  });</pre><h3>11. Lua Support</h3><p>Redis supports Lua scripting, allowing you to run Lua scripts on the server. This reduces the network round trips and allows for atomic operations on the data. Lua scripts are especially useful for complex data processing directly within Redis.</p><h4>Example (Lua Script Usage):</h4><pre>const script = `<br>  return redis.call(&#39;SET&#39;, KEYS[1], ARGV[1])<br>`;<br>redis.eval(script, 1, &#39;key1&#39;, &#39;value1&#39;, (err, result) =&gt; {<br>  console.log(result); // &#39;OK&#39;<br>});</pre><h3>12. Ease of Use</h3><p>Redis is widely known for its ease of use. Its simple API, straightforward commands, and various client libraries across languages make Redis easy to integrate into your application. Redis also has a Command Line Interface (CLI) tool, making it simple to interact with the database.</p><h4>Example (Redis CLI Usage):</h4><pre>$ redis-cli<br>127.0.0.1:6379&gt; SET mykey &quot;Hello, Redis!&quot;<br>127.0.0.1:6379&gt; GET mykey<br>&quot;Hello, Redis!&quot;</pre><h3>13. Community Support</h3><p>Redis enjoys strong community support. With extensive documentation, active discussions on GitHub, Stack Overflow, and other forums, Redis developers have access to solutions, tips, and best practices. Redis has been continuously improved by the open-source community for years, and its ecosystem is growing.</p><ul><li><strong>Official Redis GitHub Repository</strong>: <a href="https://github.com/redis/redis">https://github.com/redis/redis</a></li><li><strong>Redis Community</strong>: <a href="https://redis.io/community/">https://redis.io/community/</a></li></ul><h3>14. Drawbacks of Redis</h3><p>While Redis offers many advantages, it also has some drawbacks that developers should consider before adopting it.</p><h4>14.1 Memory Consumption</h4><ul><li>Since Redis stores data in memory, it can be expensive for applications requiring large datasets.</li><li>Proper memory management techniques, such as eviction policies and compression, are necessary to optimize performance.</li></ul><h4>14.2 Lack of Strong ACID Compliance</h4><ul><li>Unlike traditional relational databases, Redis does not fully support ACID (Atomicity, Consistency, Isolation, Durability) transactions.</li><li>This makes Redis less suitable for applications requiring strict data consistency, such as financial transactions.</li></ul><h4>14.3 Persistence Trade-offs</h4><ul><li>While Redis provides persistence through RDB and AOF, neither guarantees zero data loss in all failure scenarios.</li><li>AOF can introduce latency due to frequent disk writes, and RDB snapshots may lead to data loss between snapshots.</li></ul><h4>14.4 Limited Querying Capabilities</h4><ul><li>Redis lacks complex querying features found in relational databases, such as SQL-like querying and joins.</li><li>Developers often need to structure data retrieval logic in the application layer.</li></ul><h4>14.5 Single-Threaded Processing</h4><ul><li>Redis processes commands in a single-threaded manner, limiting CPU-bound performance.</li><li>Though it achieves high throughput via I/O multiplexing, workloads requiring multi-threaded computation may not be optimal.</li></ul><h3>Conclusion</h3><p>Redis is a high-performance, scalable, and versatile database solution well-suited for modern applications. Whether used for caching, real-time analytics, messaging, or background task processing, Redis delivers unparalleled speed and reliability. Organizations leveraging Redis gain a competitive edge through faster data access, reduced latency, and enhanced system resilience. However, developers should be mindful of Redis’s drawbacks, such as memory consumption, persistence trade-offs, and limited query capabilities, to ensure it aligns with their specific use case.</p><p>If you have any questions or want to share your thoughts, feel free to reach out. Happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c4043f864e92" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is Hoisting and Scope in JavaScript]]></title>
            <link>https://medium.com/@erimtuzcuoglu/what-is-hoisting-and-scope-in-javascript-aabeabca4968?source=rss-71ea1d222471------2</link>
            <guid isPermaLink="false">https://medium.com/p/aabeabca4968</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[hoisting]]></category>
            <dc:creator><![CDATA[Erim Tuzcuoğlu]]></dc:creator>
            <pubDate>Fri, 17 Jan 2025 15:09:58 GMT</pubDate>
            <atom:updated>2025-01-17T15:09:58.897Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/704/1*y6IM_z5avqP8DAzDfGG9QA.png" /></figure><p>JavaScript is a powerful language with many unique features. Two of the most important concepts to understand are <strong>hoisting</strong> and <strong>scope</strong>. These are fundamental to writing clean, predictable, and bug-free code. In this blog, we will dive deep into these concepts and explain them with examples.</p><h3>What Is Hoisting?</h3><p>Hoisting in JavaScript refers to the process where variable, function, and class declarations are moved to the top of their containing scope during the compilation phase, before the code is executed. This means you can use a variable or function before it’s declared in your code.</p><p>Let’s break down how hoisting works for different types of declarations:</p><h3>Function Declarations</h3><p>Functions declared with the function keyword are fully hoisted. This means you can call a function before it is defined in your code:</p><pre>sayHello(); // Output: &quot;Hello, World!&quot;<br><br>function sayHello() {<br>  console.log(&quot;Hello, World!&quot;);<br>}</pre><p>In this example, the function sayHello is hoisted to the top of its scope, making it accessible before its declaration.</p><h3>Variable Declarations</h3><h4>Using var</h4><p>Variables declared with var are hoisted to the top of their scope but <strong>are not initialized</strong>. The value of the variable remains undefined until the code assigns a value to it:</p><pre>console.log(a); // Output: undefined<br>var a = 10;<br>console.log(a); // Output: 10</pre><p>In this case, the declaration of a is hoisted, but its assignment (a = 10) remains in place.</p><h4>Using let and const</h4><p>Variables declared with let and const are also hoisted but placed in a &quot;temporal dead zone&quot; (TDZ). This means they cannot be accessed before their declaration:</p><pre>console.log(b); // ReferenceError: Cannot access &#39;b&#39; before initialization<br>let b = 20;<br><br>console.log(c); // ReferenceError: Cannot access &#39;c&#39; before initialization<br>const c = 30;</pre><p>The TDZ ensures safer and more predictable behavior, reducing potential bugs in your code.</p><h3>Class Declarations</h3><p>Classes are hoisted but like let and const, they are also in the TDZ until their declaration. Accessing a class before its declaration results in an error:</p><pre>const obj = new MyClass(); // ReferenceError: Cannot access &#39;MyClass&#39; before initialization<br><br>class MyClass {<br>  constructor() {<br>    this.name = &quot;JavaScript&quot;;<br>  }<br>}</pre><h3>What Is Scope?</h3><p><strong>Scope</strong> determines where variables, functions, and objects are accessible in your code. JavaScript has two main types of scope:</p><h3>1. Global Scope</h3><p>Variables declared outside any function or block belong to the global scope. They are accessible anywhere in the program:</p><pre>var globalVar = &quot;I am global!&quot;;<br><br>function checkScope() {<br>  console.log(globalVar); // Output: &quot;I am global!&quot;<br>}<br><br>checkScope();</pre><h3>2. Local Scope</h3><p>Variables declared inside a function or block are in local scope. They can only be accessed within that function or block.</p><h4>Function Scope</h4><p>var is function-scoped, meaning it is only accessible within the function it’s declared in:</p><pre>function localScope() {<br>  var localVar = &quot;I am local!&quot;;<br>  console.log(localVar); // Output: &quot;I am local!&quot;<br>}<br><br>localScope();<br>console.log(localVar); // ReferenceError: localVar is not defined</pre><h4>Block Scope</h4><p>let and const are block-scoped, meaning they are only accessible within the block (enclosed by {}) they are declared in:</p><pre>{<br>  let blockVar = &quot;I am block-scoped!&quot;;<br>  console.log(blockVar); // Output: &quot;I am block-scoped!&quot;<br>}<br><br>console.log(blockVar); // ReferenceError: blockVar is not defined</pre><h3>Combining Hoisting and Scope</h3><p>Understanding how hoisting interacts with scope is crucial for avoiding bugs. Here’s an example that demonstrates both concepts:</p><pre>function example() {<br>  console.log(x); // Output: undefined (hoisted declaration, but not initialization)<br><br>  if (true) {<br>    var x = 10; // Function-scoped, hoisted to the top of the function<br>    let y = 20; // Block-scoped, not hoisted to the top of the block<br>    console.log(y); // Output: 20<br>  }<br><br>  console.log(x); // Output: 10<br>  console.log(y); // ReferenceError: y is not defined<br>}<br><br>example();</pre><h3>Key Takeaways</h3><ol><li><strong>Hoisting</strong> lifts declarations (not initializations) to the top of their scope.</li><li>Function declarations are fully hoisted, but var, let, const, and class behave differently.</li><li><strong>Scope</strong> determines the accessibility of variables:</li></ol><ul><li>var is function-scoped.</li><li>let and const are block-scoped.</li></ul><p>4. Understanding the <strong>temporal dead zone</strong> is critical for using let, const, and class safely.</p><p>By mastering these concepts, you’ll write more predictable and error-free JavaScript code.</p><h3>Conclusion</h3><p>Hoisting and scope are at the core of JavaScript’s execution model. While these behaviors can be confusing at first, understanding them will make you a more confident and capable JavaScript developer. Experiment with different examples to solidify your understanding.<br>If you have any questions or want to share your thoughts, feel free to reach out. Happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aabeabca4968" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exploring Node.js Event Loop: A Complete Guide]]></title>
            <link>https://medium.com/@erimtuzcuoglu/exploring-node-js-event-loop-a-complete-guide-79d8e735818e?source=rss-71ea1d222471------2</link>
            <guid isPermaLink="false">https://medium.com/p/79d8e735818e</guid>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[event-loop]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[asynchronous]]></category>
            <dc:creator><![CDATA[Erim Tuzcuoğlu]]></dc:creator>
            <pubDate>Sun, 22 Dec 2024 07:02:06 GMT</pubDate>
            <atom:updated>2025-01-17T15:10:45.733Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/704/1*SMMranWIWZ3Wgf03HTkJSA.jpeg" /></figure><p>JavaScript is a single-threaded language that allows non-blocking I/O operations, making it ideal both for browser and server based applications. With the advent of Google’s V8 JavaScript engine, Node.js brought JavaScript to the server-side. But how does Node.js work? How does the code written on the server or browser get processed?</p><h3>How Node.js Works</h3><p>Node.js basically operates with a interactive shell which works as a REPL (Read-Evaluate-Print-Loop), enabling you to execute JavaScript code line by line and see immediate results. Being single-threaded, Node.js processes one task at a time on its main thread. While this might seem limiting, JavaScript’s design efficiently handles multiple tasks using an event loop.</p><p>Behind the scenes, Node.js uses libuv, which manages concurrency with a thread pool (default size: 4). Although Node.js executes the code on a single thread, it achieves concurrency by utilizing Worker Threads behind the scenes. Worker Threads allow parallel execution of heavy tasks, ensuring the Event Loop remains non-blocking and responsive. This architecture allows Node.js to maintain its signature non-blocking behavior. When people say &quot;Node.js runs on a single thread&quot; they typically mean that the JavaScript code, including its callbacks, executes on a single thread managed by the event loop.</p><p>Let’s delve into the event loop, a core part of Node.js to understand how it manages asynchronous operations.</p><h3>What is the Event Loop?</h3><p>The event loop in Node.js is a fundamental mechanism that allows Node.js to handle asynchronous operations efficiently. It is initialized when Node.js starts and is responsible for managing tasks like processing the input script, handling asynchronous API calls, scheduling timers, and managing events.</p><p>While JavaScript code executes sequentially (line by line), asynchronous operations such as timers, I/O tasks (like reading from a file, making HTTP requests), and callbacks are handled by the event loop. This ensures that the main thread remains non-blocking and free to handle new events, allowing Node.js to perform multiple tasks concurrently without waiting for each one to complete.</p><p>In simpler terms, the event loop lets Node.js handle multiple operations at once, efficiently managing asynchronous tasks without blocking the execution of other code.</p><h3>Event Loop Components</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/967/1*Od2k7o9UHQonTHxPCv6RNQ.png" /></figure><h4>1. Call Stack</h4><ul><li>Tracks the currently executing function with using Last In, First Out (LIFO) mechanism.</li></ul><h4>2. Node.js Bindings</h4><ul><li>Node.js bindings connects JavaScript to the libuv which is native C++ library, enabling asynchronous I/O and system-level tasks. It allow to use system resource with modules like fs, path, http and worker_threads.</li></ul><h4>3. Event/Task Queue</h4><ul><li>Stores callbacks from asynchronous operations (e.g., I/O or timers). Once the call stack is empty, tasks from this queue are executed.</li></ul><h4>4. Event Loop</h4><ul><li>Continuously checks the call stack and event queue. When the call stack is empty, event loop retrieves the first function from the callback queue and places it onto the call stack for execution.</li></ul><h4>5. Execution</h4><ul><li>The function at the top of the call stack is executed first. If this function contains asynchronous code, it may trigger additional asynchronous operations, which are handed off to worker threads. Once these operations are completed, their callbacks are added to the event queue for later execution.</li></ul><h4>6. Repeat</h4><ul><li>The event loop keeps cycling through these phases. Ensuring the call stack is clean before retrieving the next function from the callback queue.</li></ul><h3>Event Loop Phases</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/427/1*fXDT6MIDQxLqKlc1E3zufA.png" /><figcaption>Event Loop’s order of operations</figcaption></figure><p>Node.js’s event loop progresses through specific phases:</p><ol><li><strong>Timers</strong>: Executes callbacks like such as setTimeout and setInterval when their timers expire.</li><li><strong>I/O Callbacks</strong>: Handles I/O operations (e.g., file reads, network requests).</li><li><strong>Idle, Prepare</strong>: Reserved for internal operations.</li><li><strong>Poll</strong>: Processes callbacks in the event queue. If the queue is empty, it waits for new events or moves to the check phase if setImmediate() callbacks are scheduled.</li><li><strong>Check</strong>: Executes setImmediate callbacks after the poll phase.</li><li><strong>Close Callbacks</strong>: Processes callbacks related to close events for e.g. socket.on(‘close’)</li></ol><pre>console.log(&#39;Start&#39;);<br><br>// Timer phase (setTimeout)<br>setTimeout(() =&gt; {<br>  console.log(&#39;Timer: setTimeout callback&#39;);<br>}, 0);<br><br>// I/O Callbacks phase (Asynchronous file reading example)<br>const fs = require(&#39;fs&#39;);<br>fs.readFile(__filename, () =&gt; {<br>  console.log(&#39;I/O Callbacks: fs.readFile callback&#39;);<br>});<br><br>// Microtask Queue (Promise)<br>Promise.resolve().then(() =&gt; {<br>  console.log(&#39;Microtask Queue: Promise callback&#39;);<br>});<br><br>// Check phase (setImmediate)<br>setImmediate(() =&gt; {<br>  console.log(&#39;Check: setImmediate callback&#39;);<br>});<br><br>console.log(&#39;End&#39;);</pre><p><strong>Output:</strong></p><pre>Start<br>End<br>Microtask Queue: Promise callback<br>Check: setImmediate callback<br>Timer: setTimeout callback<br>I/O Callbacks: fs.readFile callback</pre><h3>Step-by-Step Execution:</h3><ol><li><strong>Synchronous Code (Start and End)</strong>:<br>console.log(&#39;Start&#39;) and console.log(&#39;End&#39;) are executed first because they are synchronous.</li><li><strong>Microtask Queue (</strong><strong>Promise)</strong>:<br>Promise.resolve() callbacks are processed before other asynchronous tasks.</li><li><strong>Check Phase (</strong><strong>setImmediate)</strong>:<br>The setImmediate() callback executes during the Check phase. This phase runs after microtasks but before timer callbacks like setTimeout.</li><li><strong>Timers Phase (</strong><strong>setTimeout)</strong>:<br>Even with a delay of 0ms, the callback runs after microtasks and setImmediate processed.</li><li><strong>I/O Callbacks Phase (</strong><strong>fs.readFile)</strong>:<br>Asynchronous file reading is handled during the I/O Callbacks phase.</li></ol><h3>Debugging the Event Loop</h3><p>Debugging the event loop is crucial for optimizing application performance and understanding asynchronous operations. By grasping how the event loop works, you can identify issues and improve your code.</p><h3>Built-in Debugging Tools</h3><h4>a) — inspect or — inspect-brk Flag</h4><p>Enable Chrome DevTools debugging with:</p><pre>node --inspect index.js</pre><p>Steps:</p><ol><li>Run the command to get a debugging URL (e.g., chrome-devtools://...).</li><li>Open this URL in Chrome to inspect the event loop and call stack.</li><li>Use breakpoints to analyze asynchronous operations.</li></ol><h4>b) — trace-events Flag</h4><p>Trace event loop phases with:</p><pre>node --trace-events-enabled index.js</pre><p>This flag logs event loop activities to a file, which you can analyze to detect bottlenecks.</p><h4>c) — trace-sync-io Flag</h4><p>Monitor synchronous I/O operations that might block the event loop:</p><pre>node --trace-sync-io index.js</pre><h3>Using Performance Hooks</h3><p>Measure execution time for specific tasks using the perf_hooks module:</p><pre>const { performance, PerformanceObserver } = require(&#39;perf_hooks&#39;);<br><br>const obs = new PerformanceObserver((items) =&gt; {<br>  console.log(items.getEntries());<br>  performance.clearMarks();<br>});<br>obs.observe({ entryTypes: [&#39;measure&#39;] });<br><br>performance.mark(&#39;start&#39;);<br><br>setTimeout(() =&gt; {<br>  performance.mark(&#39;end&#39;);<br>  performance.measure(&#39;Event loop timer&#39;, &#39;start&#39;, &#39;end&#39;);<br>}, 100);</pre><h3>Advanced Techniques: process.nextTick vs setImmediate</h3><pre>console.log(&#39;Begin&#39;);<br><br>process.nextTick(() =&gt; {<br>  console.log(&#39;Next Tick&#39;);<br>});<br><br>setImmediate(() =&gt; {<br>  console.log(&#39;Immediate&#39;);<br>});<br><br>console.log(&#39;End&#39;);</pre><p><strong>Output:</strong></p><pre>Begin<br>End<br>Next Tick<br>Immediate</pre><h3>Key Differences:</h3><ol><li><strong>process.nextTick()</strong>:<br>- Executes before any other phase of the event loop.<br>- Prioritizes callbacks immediately after the current operation.</li><li><strong>setImmediate()</strong>:<br>- After other phases are processed, the Event Loop runs the Immediate Callbacks and executes the setImmediate callback.</li></ol><p>These techniques give developers more control over callback execution, ensuring efficient task prioritization.</p><p>Mastering Node.js and its event loop equips developers with the tools to write efficient, non-blocking applications. By understanding its phases, debugging tools, and advanced techniques, you can unleash the full potential of JavaScript on the server-side. Keep experimenting and refining your understanding of the event loop, and you’ll be well on your way to becoming expert on Node.js. If you have any questions or want to share your thoughts, feel free to reach out. Happy coding! 😊</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=79d8e735818e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering Node.js EventEmitter]]></title>
            <link>https://medium.com/@erimtuzcuoglu/mastering-node-js-eventemitter-f149705eb7c6?source=rss-71ea1d222471------2</link>
            <guid isPermaLink="false">https://medium.com/p/f149705eb7c6</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[eventemitter]]></category>
            <category><![CDATA[event-driven-programming]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[pub-sub]]></category>
            <dc:creator><![CDATA[Erim Tuzcuoğlu]]></dc:creator>
            <pubDate>Thu, 19 Dec 2024 10:30:17 GMT</pubDate>
            <atom:updated>2024-12-19T10:59:43.265Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/832/1*1XEz5uYMw1ukyq5AzcPRUg.jpeg" /></figure><p>Events are a crucial concept in software development, often appearing in patterns like Publish-Subscribe (PubSub) or Observer. In this article, we’ll dive into Node.js’s EventEmitter, a powerful feature for enabling asynchronous and event-driven programming.</p><h3>EventEmitter: A Real-Life Analogy</h3><p>To understand EventEmitter, let’s consider a real-world analogy: the relationship between a satellite and a TV broadcast. Satellites transmit signals at specific frequencies, and TVs tuned to those frequencies receive the broadcast. Similarly, in Node.js:</p><ul><li><strong>EventEmitter</strong> acts as the satellite, broadcasting events.</li><li><strong>Listeners</strong> are like TVs, receiving and reacting to those events.</li></ul><h3>Key Concepts of EventEmitter</h3><ol><li><strong>Triggering Events:</strong> When an event is triggered, all listeners registered for that event are executed.</li><li><strong>Registering Listeners:</strong> You can define listeners (callback functions) for specific events. These listeners are executed whenever the corresponding event is triggered.</li><li><strong>Cleaning Up Listeners:</strong> Unused listeners can be removed to ensure optimal resource usage.</li></ol><h3>A Quick Code Example</h3><p>Here’s a simple demonstration of EventEmitter in action:</p><pre>const EventEmitter = require(&#39;node:events&#39;);<br>const eventEmitter = new EventEmitter();<br><br>// One-time listener for the &quot;successful&quot; event<br>eventEmitter.once(&#39;successful&#39;, () =&gt; {<br>    console.log(&#39;Successful&#39;);<br>});<br><br>eventEmitter.emit(&#39;successful&#39;); // Output: Successful<br>eventEmitter.emit(&#39;successful&#39;); // No output<br><br>// Defining a reusable listener<br>const helloListener = (name, age) =&gt; {<br>  console.log(`Hello, my name is ${name}, and I am ${age} years old.`);<br>};<br><br>eventEmitter.on(&#39;hello&#39;, helloListener);<br>eventEmitter.emit(&#39;hello&#39;, &#39;Erim&#39;, 28); // Output: Hello, my name is Erim, and I am 28 years old.<br><br>// Removing the listener<br>eventEmitter.removeListener(&#39;hello&#39;, helloListener);<br>eventEmitter.emit(&#39;hello&#39;, &#39;Erim&#39;, 28); // No output</pre><h3>Core Methods of EventEmitter</h3><p>Here are the main methods you’ll use with EventEmitter:</p><ul><li>once: Registers a one-time listener that gets removed after it is called.</li><li>emit: Emits an event, invoking all listeners for that event.</li><li>on: Registers a listener for an event.</li><li>removeListener: Removes a specific listener from an event.</li><li>removeAllListeners: Removes all listeners for a specific event.</li></ul><h3>Additional Methods in EventEmitter</h3><p>According to the <a href="https://nodejs.org/api/events.html">official Node.js documentation</a>, EventEmitter also includes:</p><ul><li>emitter.addListener(eventName, listener): Alias for on.</li><li>emitter.eventNames(): Returns an array of all event names currently registered.</li><li>emitter.getMaxListeners(): Retrieves the maximum number of listeners (default: 10).</li><li>emitter.listenerCount(eventName): Returns the number of listeners for a given event.</li><li>emitter.listeners(eventName): Returns a copy of the array of listeners for a specific event.</li><li>emitter.off(eventName, listener): Alias for removeListener.</li><li>emitter.prependListener(eventName, listener): Adds a listener to the beginning of the listeners array.</li><li>emitter.prependOnceListener(eventName, listener): Same as prependListener, but only fires once.</li><li>emitter.setMaxListeners(n): Sets the maximum number of listeners.</li><li>emitter.rawListeners(eventName): Returns an array of listeners, including wrappers (like those created by once).</li></ul><h3>Revisiting the Example</h3><p>In the example above, we defined a one-time listener for the successful event and emitted it twice. The first emit called the listener, but the second had no effect because once was used.</p><p>Next, we added a reusable listener for the hello event, emitted it, and then removed it with removeListener. Attempting to emit hello again confirmed the listener was successfully removed.</p><h3>Best Practices for Using EventEmitter</h3><ol><li><strong>Keep Listener Count Low:</strong> To avoid memory leaks, minimize the number of listeners. Use setMaxListeners to define a reasonable limit.</li><li><strong>Clean Up After Use:</strong> Remove listeners when they’re no longer needed to maintain optimal performance.</li><li><strong>Choose Clear Event Names:</strong> Descriptive names for events make your code easier to understand and maintain.</li></ol><h3>Conclusion</h3><p>EventEmitter is a powerful tool in Node.js that simplifies asynchronous programming and enables event-driven architecture. Whether building a web server, real-time application, or modular codebase, mastering EventEmitter is an essential skill for Node.js developers.</p><p>Hopefully, this article has demystified EventEmitter and inspired you to explore its potential. If you have any questions or want to share your thoughts, feel free to reach out. Happy coding! 😊</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f149705eb7c6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding JavaScript Prototypes: A Comprehensive Guide]]></title>
            <link>https://medium.com/@erimtuzcuoglu/understanding-javascript-prototypes-a-comprehensive-guide-a7d614269c04?source=rss-71ea1d222471------2</link>
            <guid isPermaLink="false">https://medium.com/p/a7d614269c04</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript-tips]]></category>
            <category><![CDATA[prototype-chain]]></category>
            <category><![CDATA[nodejs]]></category>
            <dc:creator><![CDATA[Erim Tuzcuoğlu]]></dc:creator>
            <pubDate>Mon, 16 Dec 2024 20:46:19 GMT</pubDate>
            <atom:updated>2024-12-19T11:10:11.988Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3oN3qsBzdDGQJW7WvKxAJg.png" /></figure><p>JavaScript is a prototype-based programming language, sometimes referred to as <strong>Object-Linked Other Objects (OLOO)</strong>. Prototypes allow JavaScript objects to inherit properties and methods from one another. Whenever an object or function is created in JavaScript, a prototype is automatically associated with it. In this article, we’ll explore what prototypes are, how they work, and how the prototype chain operates.</p><h3>Defining Our Object</h3><p>Let’s start by defining a simple object:</p><pre>const person = {<br>    age: &#39;28&#39;,<br>    name: &#39;Erim&#39;,<br>    sayHello: function() {<br>        console.log(`Hello, I&#39;m ${this.name} and I&#39;m ${this.age} years old.`);<br>    },<br>};</pre><p>When you inspect the person object, you&#39;ll see the properties we’ve defined:</p><pre>Object { age: &quot;28&quot;, name: &quot;Erim&quot;, sayHello: sayHello() }<br>  age: &quot;28&quot;<br>  name: &quot;Erim&quot;<br>  sayHello: function sayHello()<br>  &lt;prototype&gt;: Object { … }</pre><p>Now, if you check the prototype using person.__proto__ (or Object.getPrototypeOf(person)), you&#39;ll find additional properties:</p><pre>__defineGetter__: function __defineGetter__()<br>__defineSetter__: function __defineSetter__()<br>__lookupGetter__: function __lookupGetter__()<br>__lookupSetter__: function __lookupSetter__()<br>constructor: function Object()<br>hasOwnProperty: function hasOwnProperty()<br>isPrototypeOf: function isPrototypeOf()<br>propertyIsEnumerable: function propertyIsEnumerable()<br>toLocaleString: function toLocaleString()<br>toString: function toString()<br>valueOf: function valueOf()</pre><h3>What Are These Prototype Properties?</h3><p>Every object in JavaScript has a built-in property called its <strong>prototype</strong>, which itself is an object. This forms a <strong>prototype chain</strong>, as each prototype can also have its own prototype. The chain ends when a prototype is null.</p><p>For example, if you call the toString() method on person:</p><pre>person.toString();</pre><ol><li>JavaScript first searches for the method in the person object itself.</li><li>If it doesn’t find it, it looks at the object’s prototype.</li><li>If still not found, it continues to searching up the prototype chain.</li></ol><p>When inspecting the person object, you’ll notice its prototype comes from Object.prototype. However, not all objects inherit from Object.prototype.</p><pre>String.prototype;         // String { &quot;&quot; }<br>Number.prototype;         // Number { 0 }<br>Date.prototype;           // Date.prototype { … }<br>Array.prototype;          // Array []<br>Boolean.prototype;        // Boolean { false }<br>BigInt.prototype;         // BigInt.prototype { … }</pre><p>At the top of this chain is Object.prototype, which does not inherit from anything:</p><pre>String.prototype.__proto__; // Object { … }<br>Object.prototype.__proto__; // null</pre><h3>Using Constructor Functions with Prototypes</h3><p>Here’s an example of a constructor function that utilizes prototypes:</p><pre>// Our constructor function<br>function Person(name, age) {<br>    this.name = name;<br>    this.age = age;<br>}<br><br>Person.prototype.sayHello = function() {<br>    console.log(`Hello, I&#39;m ${this.name} and I&#39;m ${this.age} years old.`);<br>};<br><br>const person1 = new Person(&quot;Erim&quot;, 28);<br>const person2 = new Person(&quot;Hakan&quot;, 30);<br><br>person1.sayHello(); // &quot;Hello, I&#39;m Erim and I&#39;m 28 years old.&quot;<br>person2.sayHello(); // &quot;Hello, I&#39;m Hakan and I&#39;m 30 years old.&quot;<br><br>Person.prototype.country = &quot;Türkiye&quot;;<br><br>console.log(person1.country); // &quot;Türkiye&quot;<br>console.log(person2.country); // &quot;Türkiye&quot;<br><br>console.log(person1.__proto__ === Person.prototype); // true<br>console.log(Person.prototype.constructor === Person); // true</pre><h4>Key Points:</h4><ol><li><strong>Constructor Function:</strong> The Person function is used to define objects with individual properties like name and age.</li><li><strong>Prototype:</strong> Shared methods (e.g., sayHello) are defined on Person.prototype. This is memory-efficient since the method is stored once and shared across all instances.</li><li><strong>Prototype Chain:</strong> When you access a property or method, JavaScript first looks in the object itself and then traverses the prototype chain.</li><li><strong>prototype vs. </strong><strong>__proto__:</strong></li></ol><ul><li>The <strong>prototype</strong> property exists on constructor functions and defines the shared methods and properties for all instances created by that constructor.</li><li>The <strong>__proto__</strong> property exists on individual objects and points to the prototype of the object, linking it to its constructor&#39;s prototype object.</li><li>For example:</li></ul><pre>console.log(Person.prototype); // The prototype object for all Person instances<br>console.log(person1.__proto__); // Points to Person.prototype<br>console.log(person1.__proto__ === Person.prototype); // true</pre><ul><li>Think of __proto__ as the &quot;link&quot; to the prototype, while prototype is the actual prototype object itself.</li></ul><h3>Using Prototypes for Constructors</h3><p>Prototypes can also be used for constructors, and this approach is conceptually similar to how classes work in modern JavaScript. Classes are syntactic sugar over the prototype system, meaning that <strong>a class is essentially just a function under the hood</strong>.</p><pre>const personPrototype = {<br>    greet() {<br>        console.log(`Hello, my name is ${this.name}`);<br>    },<br>};<br><br>function Person(name) {<br>    this.name = name;<br>}<br><br>Object.assign(Person.prototype, personPrototype);<br>// Alternatively:<br>// Person.prototype.greet = personPrototype.greet;<br><br>const erim = new Person(&#39;Erim&#39;);<br>erim.greet(); // &quot;Hello, my name is Erim&quot;</pre><h4>Classes and Prototypes</h4><p>If we rewrite the above example using ES6 classes, it would look like this:</p><pre>class Person {<br>    constructor(name) {<br>        this.name = name;<br>    }<br><br>    greet() {<br>        console.log(`Hello, my name is ${this.name}`);<br>    }<br>}<br><br>const erim = new Person(&#39;Erim&#39;);<br>erim.greet(); // &quot;Hello, my name is Erim&quot;</pre><p>Under the hood, the class syntax is translated into a function-based implementation. For example, the greet method defined in the Person class is essentially attached to Person.prototype, just like in the constructor example above.</p><h3>Own Properties vs Prototype Properties</h3><p>Objects created using the Person constructor have:</p><ol><li><strong>Own Properties:</strong> Like name, defined in the constructor.</li><li><strong>Prototype Methods:</strong> Like greet(), defined on the prototype.</li></ol><p>This pattern is common because methods are usually shared across instances, while data properties are unique to each object.</p><p>You can check whether a property is an “own property” using Object.hasOwn():</p><pre>console.log(Object.hasOwn(erim, &quot;name&quot;)); // true<br>console.log(Object.hasOwn(erim, &quot;greet&quot;)); // false</pre><h3>Prototypes and Inheritance</h3><p>Prototypes allow JavaScript to reuse code and support inheritance. Inheritance is a key feature in Object Oriented Programming (OOP), enabling specialized objects to inherit from more general ones. For example:</p><ul><li>A Painter and a Engineer could both inherit common properties from a Person object.</li><li>Each can define unique properties or override inherited ones.</li></ul><p>This flexibility makes prototypes a powerful feature for building complex systems in JavaScript.</p><h3>Summary</h3><p>This article explored JavaScript’s prototype system:</p><ul><li>Prototypes enable inheritance and code reuse through the prototype chain.</li><li>The prototype property allows you to add shared methods to constructors.</li><li>Own properties differ from shared prototype properties, and this distinction is central to efficient JavaScript programming.</li><li>Classes in modern JavaScript are syntactic sugar for constructor functions and prototypes.</li></ul><p>Hopefully, you now have a clearer understanding of why prototypes are such an essential part of JavaScript’s magic! If you have any questions or want to share your thoughts, feel free to reach out. Happy coding! 😊</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a7d614269c04" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bir mühendis nasıl cv hazırlamalı?]]></title>
            <link>https://medium.com/@erimtuzcuoglu/bir-m%C3%BChendis-nas%C4%B1l-cv-haz%C4%B1rlamal%C4%B1-deec036bdbc7?source=rss-71ea1d222471------2</link>
            <guid isPermaLink="false">https://medium.com/p/deec036bdbc7</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[özgeçmiş]]></category>
            <category><![CDATA[cv-writing]]></category>
            <category><![CDATA[cv]]></category>
            <category><![CDATA[engineering]]></category>
            <dc:creator><![CDATA[Erim Tuzcuoğlu]]></dc:creator>
            <pubDate>Mon, 22 Jul 2019 21:21:59 GMT</pubDate>
            <atom:updated>2019-07-22T21:21:59.461Z</atom:updated>
            <content:encoded><![CDATA[<p>Merhaba değerli mühendis ve mühendis adayı meslektaşlarım.Bu yazıda çevremden gözlediğim kadarıyla ve zamanında benim için de bir probleme dönüşen cv hazırlama işini dilim döndüğünce anlatmaya çalışacağım.</p><p>Diyeceğim ilk şey, cv sizi işverene tanıtan bir belgedir. Yani ne kadar açık ve anlaşılır yazarsanız, işe uygun özelliklerinizi vurgularsanız o kadar şansınız artacaktır.</p><p>-Özgeçmişinizde sizi ve o işe uygunluğunuzu anlatan bütün bilgiler bulunmalı. Ülkemizde işverenler eleman seçerken tipe göre de seçim yaptığı için güler yüzlü ve iş hayatına uygun ciddiyette(mümkünse takım elbiseli) fotoğrafınızın bulunması iyi olur (aslında bir anlamda şart.).<br>-Mümkünse 2 sayfayı geçmemeye bakın. Gereksiz olabilecek hiçbir bilginizi yazmayın. (Nerede doğduğunuz, medeni durumunuz, sevdiğiniz yemekler gibi bilgiler gereksizdir.)<br>-İmla kurallarına dikkat edin.<br>-Cep telefonu, email, linkedin, eğer başvurduğunuz iş aynı şehirde ise adresiniz, yazılım/bilgisayar mühendisi iseniz github hesabınız gibi iletişim bilgilerinizi yazın.<br>-Bildiğiniz yabancı dilleri ve mümkünse o dillerde hangi seviyelerde olduğunuzu yazın, fakat abartmayın. İngilizceyi en azından anlayabilecek düzeyde olun, hatta eğer endüstri mühendisi iseniz Almanca, inşaat mühendisiyseniz Arapça gibi bildiğiniz ikinci bir yabancı dil varsa personel seçiminde sizi bir adım öne taşıyacaktır.<br>-Okurken katıldığınız sosyal aktiviteler, klüpler, geziler gibi sosyal anlamda sizi öne çıkaracak çeşitli bilgilerinizi yazın.<br>-Cv’nizde güçlü olduğunuz bölümleri ön plana çıkarmaya çalışın.Örneğin gno’nuz yüksek ise gno’nuzu, deneyimleriniz fazla ise deneyimlerinizi ön plana çıkartın. (Şirketler için iş hayatında edinilen deneyimler ve bilgi birikiminiz daha önemlidir.)<br>-Yeteneklerinizi yazın.Örneğin inşaat mühendisi iseniz Autocad, Sap2000 gibi programlardan bildiklerinizi, yazılımcı iseniz bildiğiniz programlama teknikleri (oop, design patterns vs…) ve programlama dilleri gibi bilgilerinizi yazın fakat yazarken bu programlarla, dillerle verilen işleri bitirebilecek düzeyde misiniz bunu da düşünün, zira orada yazdığınız konular üzerine çalışacaksınız.<br>-Okuduğunuz okulları yazın. İyi bir üniversitede iseniz sizi öne taşıyacaktır, fakat değilseniz de üzülmeyin herşey iyi üniversite değildir :) .Eğer okuduğunuz lise yapacağınız işle ilgiliyse, iyi bir liseyse veya okul derecenizin olması gibi durumlarda lise bilginizi de dahil edebilirsiniz, değil ise yazmanıza gerek olmadığını düşünüyorum.<br>-Yaptığınız projeleri de cvnize dahil edin. Hatta mümkünse projelerde kullandığınız teknolojilerden de bahsetmeniz daha iyi olacaktır.<br>-En önemlisi deneyimlerinizden bahsedin. İlgili alan üzerine çalıştığınız tüm iş deneyimlerinizi yazın. Başvurduğunuz pozisyon ile alakasız işler gereksiz bilgidir. İş deneyimlerinizi yazarken çalıştığınız süre boyunca neler yaptığınızı, ne üzerine çalışıp neler öğrendiğinizi yazın. Öğrenci iseniz bolca staj yapmaya veya çalışmaya çalışın, öğrenci iken edinilen çalışma deneyimi sizi az da olsa sektöre hazırlar.<br>-Çok önemli olduğunu düşünmüyorum ama, varsa sertifikalarınıza da ufak bir alan ayırabilirsiniz. Sertifikalarınız o alan ile olan ilginizi ve sosyal yönünüzü gösterecektir.<br>-Eğer varsa referanslarınızı yazın. Fakat akraba, komşu gibi kimseleri yazmayın :) Çalıştığınız iş yerindeki bir yönetici veya patronunuz gibi kişiler olabilir.<br>-Erasmus, farabi gibi öğrenci değişim programlarından faydalandıysanız onları yazabilirsiniz.</p><p>Son olarak eğer grafik tasarımcı-frontend geliştirici gibi bir pozisyona başvurmuyorsanız cvnizde sade tasarımlar kullanmanızı tavsiye ederim.<br>Yazım umuyorum aklınızda bir fikir oluşturmuş ve yardımcı olmuştur.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=deec036bdbc7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[İp Kamera Bilgisayara Doğrudan Nasıl Bağlanır?]]></title>
            <link>https://medium.com/@erimtuzcuoglu/i%CC%87p-kamera-bilgisayara-do%C4%9Frudan-nas%C4%B1l-ba%C4%9Flan%C4%B1r-609af7bd5f46?source=rss-71ea1d222471------2</link>
            <guid isPermaLink="false">https://medium.com/p/609af7bd5f46</guid>
            <dc:creator><![CDATA[Erim Tuzcuoğlu]]></dc:creator>
            <pubDate>Mon, 01 Apr 2019 21:51:51 GMT</pubDate>
            <atom:updated>2019-04-01T21:51:51.011Z</atom:updated>
            <content:encoded><![CDATA[<p>İp kameralar yakaladığı görüntüyü ağ yardımıyla aktaran, genelde güvenlik kamerası olarak bildiğimiz cihazlardır.Normalde bir ağ cihazına bağlanan bu kameraları, üzerinde görüntü işleme yapmak amacıyla bitirme ödevim için bir şekilde bilgisayarıma bağlamam gerekti.Araştırarak birçok markanın kullanıcı kitapçığı / kullanım kılavuzunda bağlantı için default bir ip adresi verildiğini gördüm (bu adres kamerada da tanımlı.).Fakat bu adres elime gelen cihazda verilmediği için tarayarak bulmak gerektiğini öğrendim.Nasıl olacağına gelirsek:<br>1- Öncelikle bilgisayarınıza “Angry IP Scanner” programını kurup açın ve kameranızı lan kablosu ve adaptör ile bağlayın (cihazınızın PoE desteği olsa dahi, bilgisayara doğrudan bağlarken adaptör gerekiyor).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/714/1*JCR0hOEc2Ec9QjzSrAxh8w.png" /></figure><p>2- IP Range bölümüne bir aralık vermeniz gerekiyor.Bu aralık bilgisayarınızın da üzerinde bulunduğu ip aralığıdır.Bunu görebilmek için windows kullanıyorsanız cmd üzerinde ipconfig, linux kullanıyorsanız terminal üzerinde ifconfig komutunu çalıştırın.Aradığımız kısım IPv4 adres veya linuxta inet yazan bölüm.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/719/1*1a0HxMYbfQ5s0PJyvamFQA.png" /></figure><p>3- Bir önceki adımda bulduğumuz adresin sonunu 1 ve 254 yaparak sınırları ip scanner programına girin (192.168.1.9 için aralık 192.168.1.1–192.168.1.254 olacak).Taramayı başlatmadan önce ayarlardan sadece açık cihazları gösterme seçeneğini (preferences/display/alive hosts only) açarsanız sonuçları daha rahat görebilirsiniz.Son olarak starta basıp taramayı başlatın.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/709/1*XEEUMrI25Z4__5IA08MfUQ.png" /></figure><p>4- Sonuçlardaki ip adreslerinde hostname bölümünde genellikle belirtici bir ibare yazar, fakat yazmıyorsa deneme yoluyla bulunur. Buradaki İp adresini kopyalayalayıp web tarayıcınıza yapıştırarak arayüze erişebilirsiniz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/719/1*2dmgmNpuog_F23Hs5w1tGg.png" /></figure><p>5- Arayüze giriş için kullanım kılavuzunda veya internet üzerinde ufak bir aramayla kamera üreticisinin default kullanıcı adı ve parolasını bulabilirsiniz.<br>6- Kameradan görüntü almak için yeni kameralarda genellikle RTSP adresi olur.Bu adresle vlc gibi video oynatıcılar üzerinde kameradan aldığınız görüntüyü görebilirsiniz.Bazı markaların RTSP adresleri şöyle:</p><p>Cenova IP Kamera rtsp://ipadres:554/MainStream<br>Cenova NVR rtsp://ipadres:554/main1<br>Tiandy IP Kamera rtsp://admin:admin@ipadres/554/1<br>Hikvision rtsp://ipadres:554<br>Oncam rtsp://ipadres/h264/video.sdp?camera=1<br>Mobotix rtsp://ipadres:554<br>Panasonic rtsp://ipadres/MediaInput/h264<br>Pelco rtsp://ipadres:554<br>Samsung rtsp://ipadres:554 rtsp://ipadres/profile2/media.smp<br>Vivotek rtsp://ipadres/live.sdp<br>Dahua rtsp://ipadres:554/cam/realmonitor<br>Neutron rtsp://ipadres:554/media/video1 rtsp://kullaniciadi:parola@ipadres:554/media/video1</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=609af7bd5f46" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Debian 9.4 Xfce - Kurulumdan Sonrası]]></title>
            <link>https://medium.com/@erimtuzcuoglu/debian-9-4-xfce-kurulumdan-sonras%C4%B1-e9a592cbacaf?source=rss-71ea1d222471------2</link>
            <guid isPermaLink="false">https://medium.com/p/e9a592cbacaf</guid>
            <dc:creator><![CDATA[Erim Tuzcuoğlu]]></dc:creator>
            <pubDate>Tue, 19 Jun 2018 14:04:00 GMT</pubDate>
            <atom:updated>2018-06-19T14:04:00.687Z</atom:updated>
            <content:encoded><![CDATA[<p>Bu yazıda uzunca bir süredir Debian tabanlı Ubuntu, Linux Mint gibi dağıtımları kullandıktan sonra merak ederek kurduğum Debian 9.4&#39;de gördüğüm bazı eksiklikler ve sorunların çözümlerini paylaşacağım.</p><p><strong>1- Başlangıçta Gelen Giriş Ekranını Kaldırmak</strong></p><p>Sistemi kurduktan sonra ilk olarak, her açılışta gelen giriş yapmak için kullanıcı adı-şifre girilen ekranı nasıl kaldırabileceğimi araştırdım ve çözüm olarak aşağıdaki adımları buldum.</p><p><em>1- Terminalden aşağıdaki komutu girerek lightdm.conf dosyasını text editör üzerinde root haklarıyla açın.</em></p><p><em>sudo mousepad /etc/lightdm/lightdm.conf</em></p><p><em>2- Açılan editörde [Seat:*] başlığının altında “# autologin-user=” ile başlayan satırı bulun ve başındaki “#” işaretini kaldırıp, “=” işaretinden hemen sonra kendi kullanıcı adınızı yazıp ctrl+s ile kaydedin.</em></p><p><strong>2- Sudoers Hatası</strong></p><p>Hemen hemen birçok linux dağıtımında sudo ile root olmaya çalışırken karşılaşılan sudo “User is not in the sudoers file. This incident will be reported” hatasını aldım ve birkaç komutla sorunu çözebileceğim bir cevap buldum.Öncelikle terminali açıp “su” yazarak terminalde yönetici hakları alalım.Daha sonra aşağıdaki komutta kullaniciadi yazan yere kendi kullanıcı adımızı yazarak terminalde çalıştıralım ve sorunu çözelim.</p><p><em>echo “kullaniciadi ALL = (ALL) ALL” &gt;&gt; /etc/sudoers</em></p><p><strong>3- Yönetici Haklarıyla Çalıştır Kısayolu</strong></p><p>Ubuntu,Mint,Elementary gibi dağıtım kullananlar bilecektir, dosya yöneticisinde bir dizinde iken sağ tıklama ile menüden seçerek o dizini yönetici haklarıyla çalıştırabilirsiniz.Debianda ilk eksikliğini hissettiğim şeylerden birisi de bu olmuştu.Çözüm olarak ise Thunar (Xfce dosya yöneticisi) Düzenle/Özelleştirilmiş Eylemleri Yapılandır menüsünü açın ve + tuşuna basarak yeni bir eylem ekleyin.Ad kısmına görünmesini istediğiniz yazıyı, komut kısmına ise aşağıdaki komutu yazın ve tamam diyerek kapatın.</p><p><em>gksudo thunar %f</em></p><p><strong>4- Başlangıçta Bir Diski Otomatik Olarak Bağlamak</strong></p><p>Başlangıçta herhangi bir diski (Windows kurulu diskiniz, Depo diskiniz vs…) otomatik olarak sisteme mount edebilmek için terminalden aşağıdaki komutu verin.</p><p><em>sudo cp /etc/fstab /etc/fstab.old</em></p><p>Bu komut herhangi bir probleme karşı olarak üzerinde değişiklik yapacağımız fstab dosyasını kopyalar.Ardından yine alttaki komutu verin.</p><p><em>sudo blkid</em></p><p>Bu komutla da otomatik olarak mount edeceğimiz diskin UUID’si ve hangi disk olduğuna (örneğin sda2, sdb3 vs…) bakın ve bu değerleri bir kenara not edin.Daha sonra /etc/ dizinini root haklarıyla açın ve fstab dosyanıza çift tıklayarak text editörde açın.En alt satıra aşağıdakine benzer şekilde kendi komutunuzu yazın.</p><pre><em>UUID=&lt;uuid&gt; &lt;nereyemountedileceği&gt; &lt;dosyasistemitürü(ntfs/fat32 vs...)&gt; defaults 0 0</em></pre><p>Komutunuz örnek olarak <em>“UUID=B812G87892D44D0E /media/kullaniciadi/ ntfs defaults 0 0” </em>gibi olacaktır.</p><p><strong>5- .Deb Uzantılı Uygulamaları Kolayca Yüklemek ve Hesap Makinesi Uygulaması</strong></p><p>Yine Debian tabanlı Ubuntu,Mint gibi dağıtımları kullanmış olanlar bilecektir ki .deb uzantılı dosyaları kurmak terminalden bir uygulama kurmaya göre daha kolaydır.Debianda da aynı şekilde uygulama kurabilmek için terminal vasıtası ile Qapt isimli uygulamayı kuracağız.Birde sistemde Gui (kullanıcı arayüzü) olan bir hesap makinesi kurulu gelmiyor.Bunun içinde gnome-calculator uygulamasını kuracağız.Aşağıdaki komutları terminale yazarak bu iki uygulamayı kurabilirsiniz.</p><p><em>sudo apt-get install qapt-deb-installer</em></p><p><em>sudo apt-get install gnome-calculator</em></p><p><strong>6- Sisteme Repository Eklemek</strong></p><p>Sisteminize sizde kayıtlı olmayan bir repository üzerinden program kuracağınız zaman, kurmak istediğiniz programın bulunduğu repository’i eklemeniz gerekebilir.Bunun için de “add-apt-repository” komutunu kullanırız.Eğer komutu yazdığınızda “command not found” mesajı alıyorsanız aşağıdaki satırı terminale yazıp gerekli paketleri kurarak bu sorundan kurtulabilirsiniz.</p><p><em>sudo apt-get install -y software-properties-common</em></p><p><strong>7- Bazı klavye kısayolları (Prtscr, Görev Yöneticisi vs…)</strong></p><p>Windowsta ve birçok linux dağıtımlarında ayarlanmış olarak gelen bazı klavye kısayolları Debianda otomatik olarak gelmeyebiliyor. Kendimiz bir klavye kısayolu atamak istersek Ayarlar/Klavye/Uygulama Kısa Yolları yolunu takip edip ekle butonuna basarak ve ardından komutu ekleyip, kısayol tuşlarımıza basarak ekleyebiliriz.Örnek olarak printscreen ve görev yöneticisi kısayol komutları:</p><p><em>xfce4-screenshooter</em></p><p><em>xfce4-taskmanager</em></p><p>Son olarak Xfce masaüstünde kullanmak isteyenler için Arc teması ve genel olarak linux dağıtımlarında kullanmak için de Paper ikon paketini tavsiye ederim.Biraz özelleştirme sonucunda sisteminize daha iyi bir görünüm verebilirsiniz.Bu da benim masaüstüm :)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t6GJZU-5h4Lg4gFsZBTsoA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e9a592cbacaf" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>