<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Gurchetan</title>
    <description>The latest articles on DEV Community by Gurchetan (@apalebluedev).</description>
    <link>https://dev.to/apalebluedev</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1368443%2Fd1f47bed-f720-4b69-a1f7-2a019cceb11f.jpg</url>
      <title>DEV Community: Gurchetan</title>
      <link>https://dev.to/apalebluedev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/apalebluedev"/>
    <language>en</language>
    <item>
      <title>How to stream on your LAN using VLC?</title>
      <dc:creator>Gurchetan</dc:creator>
      <pubDate>Thu, 04 Jul 2024 14:13:22 +0000</pubDate>
      <link>https://dev.to/apalebluedev/how-to-stream-on-your-lan-using-vlc-1h0j</link>
      <guid>https://dev.to/apalebluedev/how-to-stream-on-your-lan-using-vlc-1h0j</guid>
      <description>&lt;h2&gt;
  
  
  What is VLC?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;VLC&lt;/strong&gt; is an open-source video media player that has been around for quite a long time. Chances are, if you've ever downloaded a movie (via legal methods, of course), you have probably used it. But do you know why it's called VLC?&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;That is because it has very loose controls such as increasing volume more than 100%. 😂&lt;br&gt;&lt;br&gt;
&lt;em&gt;(Note: This is a joke and not true.)&lt;/em&gt; &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;VLC stands for &lt;strong&gt;VideoLAN Client&lt;/strong&gt;. Let's learn about the LAN in VLC.&lt;/p&gt;

&lt;h2&gt;
  
  
  A Bit of VLC History
&lt;/h2&gt;

&lt;p&gt;The VideoLAN software originated as a French academic project in 1996. VLC used to stand for "VideoLAN Client" when VLC was a client of the VideoLAN project. Since VLC is no longer merely a client, that initialism no longer applies. &lt;/p&gt;

&lt;p&gt;It was intended to consist of a client and server to stream videos from satellite dishes across a campus network. 📡 Originally developed by students at the École Centrale Paris, it is now developed by contributors worldwide and is coordinated by VideoLAN, a non-profit organization. 🌍 Rewritten from scratch in 1998, it was released under the GNU General Public License on February 1, 2001, with authorization from the headmaster of the École Centrale Paris. 🎓 The functionality of the server program, VideoLAN Server (VLS), has mostly been subsumed into VLC and has been deprecated. The project name has been changed to VLC media player because there is no longer a client/server infrastructure.&lt;/p&gt;

&lt;h2&gt;
  
  
  Using VLC as Its Creators Intended
&lt;/h2&gt;

&lt;p&gt;VLC was initially created to stream videos over a network, and while its usage has expanded greatly, it still retains this functionality. Here are some ways you can use VLC to take advantage of its network features:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Streaming Media Over a Network
&lt;/h3&gt;

&lt;p&gt;VLC can stream media files over a local network, allowing you to share videos and music with other devices on the same network. 🎥🎶&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;To stream a media file:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open VLC Media Player.&lt;/li&gt;
&lt;li&gt;Click on &lt;code&gt;Media&lt;/code&gt; in the menu bar.&lt;/li&gt;
&lt;li&gt;Select &lt;code&gt;Stream...&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Add the file you want to stream and click &lt;code&gt;Stream&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Choose &lt;code&gt;Next&lt;/code&gt; and select the output method as HTTP (by default the port is set to 8080).&lt;/li&gt;
&lt;li&gt;Configure the stream settings to your preferences such as &lt;code&gt;active transcoding&lt;/code&gt; and profile (optional).&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  2. Receiving a Stream
&lt;/h3&gt;

&lt;p&gt;You can use VLC to receive a stream from another device on the network. 🌐&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;To receive a stream:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open VLC Media Player.&lt;/li&gt;
&lt;li&gt;Click on &lt;code&gt;Media&lt;/code&gt; in the menu bar.&lt;/li&gt;
&lt;li&gt;Select &lt;code&gt;Open Network Stream&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Enter the network URL provided by the streaming source (IP address of the device where you set up the stream).&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;On Windows, use the &lt;code&gt;ipconfig /all&lt;/code&gt; command to get your local IPv4 address.&lt;/li&gt;
&lt;li&gt;On Linux, use &lt;code&gt;ifconfig&lt;/code&gt; for the same.&lt;/li&gt;
&lt;li&gt;Example of IP: &lt;code&gt;192.168.56.19:8080&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click &lt;code&gt;Play&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  3. Using VLC as a Server
&lt;/h3&gt;

&lt;p&gt;While the original VideoLAN Server (VLS) functionality has been integrated into VLC, you can still use VLC to set up a media server. 💻&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;To set up VLC as a server:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open VLC Media Player.&lt;/li&gt;
&lt;li&gt;Click on &lt;code&gt;Media&lt;/code&gt; in the menu bar.&lt;/li&gt;
&lt;li&gt;Select &lt;code&gt;Stream...&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Add the file you want to serve and click &lt;code&gt;Stream&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Choose &lt;code&gt;Next&lt;/code&gt; and select the output method (e.g., HTTP, RTP).&lt;/li&gt;
&lt;li&gt;Configure the stream settings and start the server.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  4. Using VLC for Remote Playback
&lt;/h3&gt;

&lt;p&gt;VLC has remote playback capabilities, allowing you to control playback on another device from your current device. 🎮&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;To use VLC for remote playback:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Enable VLC’s web interface on the device you want to control:

&lt;ul&gt;
&lt;li&gt;Go to &lt;code&gt;Tools&lt;/code&gt; -&amp;gt; &lt;code&gt;Preferences&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Select &lt;code&gt;All&lt;/code&gt; under &lt;code&gt;Show settings&lt;/code&gt; in the bottom-left corner.&lt;/li&gt;
&lt;li&gt;Navigate to &lt;code&gt;Interface&lt;/code&gt; -&amp;gt; &lt;code&gt;Main interfaces&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Check the &lt;code&gt;Web&lt;/code&gt; checkbox.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Use a web browser on your controlling device to access the web interface:

&lt;ul&gt;
&lt;li&gt;Enter the IP address of the VLC device followed by &lt;code&gt;:8080&lt;/code&gt; (e.g., &lt;code&gt;http://192.168.1.2:8080&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;By using these features, you can leverage VLC's network capabilities as its creators intended. Whether for streaming media across devices or setting up a simple media server, VLC's versatility makes it a powerful tool for both local and network-based media playback. 🚀&lt;/p&gt;

&lt;p&gt;Hope you enjoyed the article! 😊&lt;/p&gt;

</description>
      <category>vlc</category>
      <category>oldschool</category>
      <category>stream</category>
      <category>localserver</category>
    </item>
    <item>
      <title>Pointers : what are they pointing to?</title>
      <dc:creator>Gurchetan</dc:creator>
      <pubDate>Fri, 07 Jun 2024 19:23:58 +0000</pubDate>
      <link>https://dev.to/apalebluedev/pointers-what-are-they-pointing-to-chg</link>
      <guid>https://dev.to/apalebluedev/pointers-what-are-they-pointing-to-chg</guid>
      <description>&lt;h1&gt;
  
  
  Pointers in C
&lt;/h1&gt;

&lt;p&gt;Pointers are a fundamental concept in C programming that enable you to directly access and manipulate memory. Understanding pointers is crucial for effective and efficient C programming.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is a Pointer?
&lt;/h2&gt;

&lt;p&gt;A pointer is a value that represents a memory address. It points to a specific memory location, allowing you to access and modify the value stored at that location.&lt;/p&gt;

&lt;h3&gt;
  
  
  Basic Example
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;some_var&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;pointer_to_some_var&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;some_var&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;here &lt;strong&gt;&amp;amp;some_var&lt;/strong&gt; is address of some_var;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Symbol&lt;/th&gt;
&lt;th&gt;Function&lt;/th&gt;
&lt;th&gt;Example&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;some_variable&lt;/td&gt;
&lt;td&gt;Holds the value in certain memory location&lt;/td&gt;
&lt;td&gt;int x = 3;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;*&lt;/td&gt;
&lt;td&gt;Points to memory address of a certain variable&lt;/td&gt;
&lt;td&gt;int *pX;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&amp;amp;&lt;/td&gt;
&lt;td&gt;Holds the value of address of following variable&lt;/td&gt;
&lt;td&gt;&amp;amp;x;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz9qo1m9rg0ew78jqve1w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz9qo1m9rg0ew78jqve1w.png" alt=" " width="800" height="356"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  references and De-referencing
&lt;/h1&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
    &lt;tr&gt;
        &lt;th&gt;Symbols&lt;/th&gt;
        &lt;th&gt;what it holds/means&lt;/th&gt;
        &lt;th&gt;Example code&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;Declared variable&lt;/td&gt;
        &lt;td&gt;Value of the variable&lt;/td&gt;
        &lt;td&gt;`int x = 10;`&lt;/td&gt;
    &lt;/tr&gt;
&lt;tr&gt;
    &lt;td&gt;A pointer&lt;/td&gt;
    &lt;td&gt;pointer points to some address&lt;/td&gt;
    &lt;td&gt;int *p = &amp;amp;x;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
    &lt;td&gt;Address of the variable(&amp;amp;)&lt;/td&gt;
    &lt;td&gt;Memory location of variable(eg:0x7ffe2f14f97c )&lt;/td&gt;
        &lt;td&gt;printf("Address of variable x is %p",(void*)&amp;amp;x);&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
    &lt;td&gt;Pointers name itself with a preceding &amp;amp;(pointer variable)&lt;/td&gt;
    &lt;td&gt;Memory address of pointer (eg:0x7ffe2f14f97c)&lt;/td&gt;
&lt;td&gt;printf("Address of pointer p is %p",(void*)&amp;amp;p);&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;pointer preceded by * (not to be confused with initialization of a pointer type)&lt;/td&gt;
&lt;td&gt;Value pointed to by pointer(also called dereferencing)&lt;/td&gt;
&lt;td&gt;printf("Value pointed by pointer p is %d",*p);&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h1&gt;
  
  
  Why use Pointers?
&lt;/h1&gt;

&lt;p&gt;Pointers help manage scope issues, especially when using functions with structures. By using pointers, you can access out-of-scope variables in functions through their memory addresses.&lt;/p&gt;

&lt;p&gt;We use pointers to access out of scope variables in functions by providing pointer pointing to memory address of such variable (or structure).&lt;/p&gt;

&lt;h2&gt;
  
  
  Example
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;stdbool.h&amp;gt;

struct employee_type
{
    int id;
    int income;
    bool staff;
};

void initialize_employee(struct employee_type *e){
    e-&amp;gt;id = 0;
    e-&amp;gt;income=0;
    e-&amp;gt;staff=true;

    return;
}
int main(){
    struct employee_type Ralph;    
    initialize_employee(&amp;amp;Ralph);

    printf("%d", Ralph.income);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Common Pitfalls
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Uninitialized Pointers&lt;/strong&gt;: Always initialize pointers. An uninitialized pointer points to a random memory location, leading to undefined behavior.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Dangling Pointers&lt;/strong&gt;: Do not use pointers to memory that has been freed or gone out of scope.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Pointer Arithmetic&lt;/strong&gt;: Be careful with pointer arithmetic to avoid accessing memory out of bounds.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>c</category>
      <category>pointers</category>
      <category>clang</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
