<?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: Ryan</title>
    <description>The latest articles on DEV Community by Ryan (@ryannz).</description>
    <link>https://dev.to/ryannz</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%2F252277%2F127b8038-328a-4610-b20a-2084fe798057.jpeg</url>
      <title>DEV Community: Ryan</title>
      <link>https://dev.to/ryannz</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ryannz"/>
    <language>en</language>
    <item>
      <title>Explaining pass-by-value and pass-by-reference in C for 1st year IT student</title>
      <dc:creator>Ryan</dc:creator>
      <pubDate>Sat, 01 Oct 2022 08:59:12 +0000</pubDate>
      <link>https://dev.to/ryannz/explaining-pass-by-value-and-pass-by-reference-in-c-for-1st-year-it-student-1fjc</link>
      <guid>https://dev.to/ryannz/explaining-pass-by-value-and-pass-by-reference-in-c-for-1st-year-it-student-1fjc</guid>
      <description>&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;p&gt;When you &lt;strong&gt;pass by value&lt;/strong&gt; what you’re doing is passing some data and the function then makes a &lt;strong&gt;copy&lt;/strong&gt; of that data inside that function. This variable is scoped to the function block. Modifying this variable only affects the variable inside the function because it only exists as a copy inside the function. It’s scoped.&lt;/p&gt;

&lt;p&gt;With &lt;strong&gt;pass by reference&lt;/strong&gt; you are passing the address or the actual location of where your data lives. By doing this you can update the actual value of whatever data is at the memory address. You don’t have a copy of the object, you have the location of the actual object and therefore can directly modify it from inside the function.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;(This TL;DR is contributed by &lt;strong&gt;&lt;a class="mentioned-user" href="https://dev.to/codebytesfl"&gt;@codebytesfl&lt;/a&gt;&lt;/strong&gt; - Thank you!)&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Pass-by-value
&lt;/h2&gt;

&lt;p&gt;When you declare a variable, it allocates a memory for that variable. When you call a function &lt;code&gt;foo(variable_name)&lt;/code&gt;, it means you pass the value of that variable in the memory to a function. Whatever the function does, it doesn't affect to the memory of the variable. Value of the variable remains the same.&lt;/p&gt;

&lt;p&gt;Example code:&lt;br&gt;
&lt;/p&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;

void foo(int x);

int main() {
    int a = 1;

    foo(a);

    printf("a: %d", a); //a: 1

    return 0;
}

void foo(int x) {
    x = 5;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the sample code above, when you call &lt;code&gt;foo(a)&lt;/code&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It actually call &lt;code&gt;foo(1)&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;In the &lt;code&gt;foo(int x)&lt;/code&gt; function, it allocates a new memory for &lt;code&gt;x&lt;/code&gt;, then sets &lt;code&gt;x&lt;/code&gt; to &lt;code&gt;5&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;In the &lt;code&gt;main&lt;/code&gt; function, &lt;code&gt;a&lt;/code&gt; is still &lt;code&gt;1&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Pass-by-reference
&lt;/h2&gt;

&lt;p&gt;As mentioned, when you declare a variable, it allocates a memory for that variable. Memory has &lt;em&gt;memory address&lt;/em&gt;. When you call a function &lt;code&gt;foo(variable_memory_address)&lt;/code&gt;, it means you pass the &lt;em&gt;memory address&lt;/em&gt; to a function. If you change the value of the memory in the function, you actually update the value in the memory of the variable. That's why variable value will be changed.&lt;/p&gt;

&lt;p&gt;Example code:&lt;br&gt;
&lt;/p&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;

void foo(int* px);

int main() {
    int a = 1;

    foo(&amp;amp;a);

    printf("a: %d", a); //a: 5

    return 0;
}

void foo(int* px) {
    *px = 5;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the sample code above, when you call &lt;code&gt;foo(&amp;amp;a)&lt;/code&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It actually call &lt;code&gt;foo(0xAB)&lt;/code&gt; (assumed &lt;em&gt;memory address&lt;/em&gt; of variable &lt;code&gt;a&lt;/code&gt; is &lt;em&gt;0xAB&lt;/em&gt;)&lt;/li&gt;
&lt;li&gt;In the &lt;code&gt;foo(int* px)&lt;/code&gt; function, it creates a pointer &lt;code&gt;px&lt;/code&gt;, and &lt;code&gt;px&lt;/code&gt; points to &lt;em&gt;0xAB&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;When you set &lt;code&gt;*px = 5&lt;/code&gt;, it means it sets the value at memory _0xAB _to &lt;code&gt;5&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Then in the main function, as value in the memory of variable &lt;code&gt;a&lt;/code&gt; was changed to &lt;code&gt;5&lt;/code&gt;, value of &lt;code&gt;a&lt;/code&gt; now is &lt;code&gt;5&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>computerscience</category>
      <category>c</category>
      <category>beginners</category>
      <category>interview</category>
    </item>
    <item>
      <title>Earning a free SumoLogic Fundermentals certification in 2 hours</title>
      <dc:creator>Ryan</dc:creator>
      <pubDate>Fri, 30 Sep 2022 01:33:36 +0000</pubDate>
      <link>https://dev.to/ryannz/earning-a-free-sumologic-fundermental-certification-in-2-hours-46b7</link>
      <guid>https://dev.to/ryannz/earning-a-free-sumologic-fundermental-certification-in-2-hours-46b7</guid>
      <description>&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.sumologic.com/learn/training/" rel="noopener noreferrer"&gt;Signup&lt;/a&gt; an account (3 minutes)&lt;/li&gt;
&lt;li&gt;Get a &lt;a href="https://learn.sumologic.com/page/sumo-expert" rel="noopener noreferrer"&gt;training account&lt;/a&gt; for lab (5 minutes)&lt;/li&gt;
&lt;li&gt;Download &lt;a href="https://learn.sumologic.com/fundamentals-cert-jam/1359290" rel="noopener noreferrer"&gt;slides and lab guide&lt;/a&gt; (2 minutes)&lt;/li&gt;
&lt;li&gt;Watch the training video, read slides and play around by following the lab guide (1 hour)&lt;/li&gt;
&lt;li&gt;Start the exam at &lt;a href="https://learn.sumologic.com/fundamentals-exam" rel="noopener noreferrer"&gt;Fundamentals Exam page&lt;/a&gt;. Trust me, most of the answers for questions can be found in the slides. (50 minutes)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  About SumoLogic
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Sumo Logic, Inc.&lt;/strong&gt; is a cloud-based machine data analytics company focusing on security, operations and BI usecases. It provides log management and analytics services that leverage machine-generated big data to deliver real-time IT insights.[1]&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sumo Logic&lt;/strong&gt; provides best-in-class cloud monitoring, log management, Cloud SIEM tools, and real-time insights for web and SaaS based apps.[2]&lt;br&gt;
Many big brands are using Sumo Logic:&lt;br&gt;
&lt;a href="https://media.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%2F0o7n2zftaxyer5rkl75v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F0o7n2zftaxyer5rkl75v.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  SumoLogic Certifications
&lt;/h2&gt;

&lt;p&gt;SumoLogic has various of certifications. The good thing is all of them are provided free (training materials and certifications).&lt;br&gt;
&lt;a href="https://media.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%2F1m13rtw4njbwl5tfda45.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F1m13rtw4njbwl5tfda45.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once you've passed an exam, you will get a certification to show off in your CV and LinkedIn profile 😎 (not to mention you've learnt something new):&lt;br&gt;
&lt;a href="https://media.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%2Ftwfh177p39j0li8v2s4l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Ftwfh177p39j0li8v2s4l.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Good luck! &lt;/p&gt;

&lt;p&gt;[1]: From &lt;a href="https://en.wikipedia.org/wiki/Sumo_Logic" rel="noopener noreferrer"&gt;Wikipedia&lt;/a&gt;&lt;br&gt;
[2]: From SumoLogic website&lt;/p&gt;

</description>
      <category>sumologic</category>
      <category>certification</category>
      <category>career</category>
      <category>monitoring</category>
    </item>
    <item>
      <title>Building a bank feeds system using C# .NET Core &amp; AWS - Part 1</title>
      <dc:creator>Ryan</dc:creator>
      <pubDate>Mon, 26 Sep 2022 04:52:43 +0000</pubDate>
      <link>https://dev.to/ryannz/building-a-bank-feeds-system-using-c-net-core-aws-part-1-hon</link>
      <guid>https://dev.to/ryannz/building-a-bank-feeds-system-using-c-net-core-aws-part-1-hon</guid>
      <description>&lt;h2&gt;
  
  
  Context
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gATRyrOX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wie8sp22nazr88s0yoga.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gATRyrOX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wie8sp22nazr88s0yoga.png" alt="Image description" width="721" height="173"&gt;&lt;/a&gt;&lt;br&gt;
One day, your friend comes to you and offers you a business opportunity. He recently built an analytics system that reads bank transactions and provide customized reports to his millionaire users 🤑. These millionaire users are banking with a secret bank, Alpaca Bank (1). He asks you to build a bank feeds system, that will:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Connect to the bank SFTP (2) server&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Download encrypted files on the SFTP server&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Extract bank transactions and then store them to a database.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;His system will then consume data from that database. The bank will provide SFTP connection information and a public key to decrypt their files. All you need to do is building a PoC (3) for him by showing a system that does exactly as described. This is a great opportunity. You are very excited and accept the challenge as well as his offer 😎&lt;/p&gt;

&lt;h2&gt;
  
  
  Brainstorming
&lt;/h2&gt;

&lt;p&gt;At this stage, Alpaca Bank doesn’t provide SFTP server connection yet. You will need to build an own SFTP server for this PoC purpose. Fortunately, you know AWS has AWS Transfer Family, that can help you create an SFTP server with just some clicks.&lt;/p&gt;

&lt;p&gt;As you are familiar with AWS, you decide to build everything on AWS cloud:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You will create an SFTP server using AWS Transfer Family. This will require to create an S3 bucket.&lt;/li&gt;
&lt;li&gt;You will simulate the way Alpaca Bank drop files into their SFTP server by creating a Lambda function that is scheduled to run every 30 minutes. You call this lambda function &lt;strong&gt;FileGenerator&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;FileGenerator&lt;/strong&gt; lambda function will create an encrypted transaction file and put it into the SFTP server. Then you will use AWS EventBridge to create a scheduler to trigger this lambda function.&lt;/li&gt;
&lt;li&gt;Next, you will build another Lambda function to connect to the SFTP server and get the file also decrypt it. The decrypted file will be stored to a folder on an AWS S3 bucket. You call this lambda function &lt;strong&gt;Transporter&lt;/strong&gt;. &lt;strong&gt;Transporter&lt;/strong&gt; lambda function will be triggered to call every 30 minutes. Similarly, you will use AWS EventBridge to schedule this event.&lt;/li&gt;
&lt;li&gt;AWS S3 folder is configured to generate notifications. Once the file is dropped into the S3 bucket, it triggers another lambda function. You call this lambda function &lt;strong&gt;Extractor&lt;/strong&gt;. &lt;strong&gt;Extractor&lt;/strong&gt; lambda function will extract data from the file in S3 bucket and store bank transactions into a database. It also moves the processed file into an archive folder on S3 bucket.&lt;/li&gt;
&lt;li&gt;Your friend’s system uses Microsoft SQL server, so you will create a Microsoft SQL server on AWS for this PoC purpose.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--MZuhexzw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/98fxmlq63m7xrnjlsjg4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MZuhexzw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/98fxmlq63m7xrnjlsjg4.png" alt="Image description" width="741" height="291"&gt;&lt;/a&gt;&lt;br&gt;
Long story short, these main technologies and services will be used:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;C# .NET Core&lt;/li&gt;
&lt;li&gt;Microsoft SQL Server&lt;/li&gt;
&lt;li&gt;AWS Transfer Family&lt;/li&gt;
&lt;li&gt;AWS S3 bucket&lt;/li&gt;
&lt;li&gt;AWS EventBridge&lt;/li&gt;
&lt;li&gt;AWS Lambda function&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In the next parts, you will create all components above to complete the PoC, includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;SFTP server using AWS Transfer Family. It will need to create an S3 bucket.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;FileGenerator&lt;/strong&gt;, &lt;strong&gt;Transporter&lt;/strong&gt;, and &lt;strong&gt;Extractor&lt;/strong&gt; lambda functions using C# .NET, AWS lambda function.&lt;/li&gt;
&lt;li&gt;EventBridge rules to trigger &lt;strong&gt;FileGenerator&lt;/strong&gt; and &lt;strong&gt;Transporter&lt;/strong&gt; lamda functions.&lt;/li&gt;
&lt;li&gt;Another S3 bucket to store files, and will need to configure bucket notifications to trigger &lt;strong&gt;Extractor&lt;/strong&gt; lambda function.&lt;/li&gt;
&lt;li&gt;A Microsoft SQL Server database on AWS.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;To be continued…&lt;/em&gt;&lt;br&gt;
&lt;em&gt;Originally published on &lt;a href="https://medium.com/@ryannz/building-a-bank-feeds-system-using-c-net-core-aws-part-1-e74d0a57e3bf"&gt;medium&lt;/a&gt;&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;(1): Alpaca Bank is not a real bank. It’s a random name used in this article.&lt;/p&gt;

&lt;p&gt;(2): SFTP: Secure File Transfer Protocol&lt;/p&gt;

&lt;p&gt;(3): PoC: Proof of Concept&lt;/p&gt;

</description>
      <category>aws</category>
      <category>dotnet</category>
      <category>csharp</category>
      <category>bankfeeds</category>
    </item>
  </channel>
</rss>
