<?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: Debojyoti Chakraborty</title>
    <description>The latest articles on DEV Community by Debojyoti Chakraborty (@darkdebo).</description>
    <link>https://dev.to/darkdebo</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%2F364554%2Fe83afd8a-1741-4041-b9ec-8345c8895cfc.png</url>
      <title>DEV Community: Debojyoti Chakraborty</title>
      <link>https://dev.to/darkdebo</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/darkdebo"/>
    <language>en</language>
    <item>
      <title>How to Deploy a flask app using Docker</title>
      <dc:creator>Debojyoti Chakraborty</dc:creator>
      <pubDate>Sun, 22 Jan 2023 06:10:11 +0000</pubDate>
      <link>https://dev.to/darkdebo/how-to-deploy-a-flask-app-using-docker-eif</link>
      <guid>https://dev.to/darkdebo/how-to-deploy-a-flask-app-using-docker-eif</guid>
      <description>&lt;p&gt;Docker is a powerful tool that makes it easy to deploy and run web applications in a containerized environment. In this blog post, we'll show you how to use Docker to deploy a Flask application.&lt;/p&gt;

&lt;p&gt;Before you begin, make sure that you have Docker installed on your machine. You can download it from the official Docker website.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1:&lt;/strong&gt; Create a Flask Application First, you'll need to have a Flask application that you want to deploy. If you don't already have one, you can create a new one by following the Flask documentation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2:&lt;/strong&gt; Create a Dockerfile A Dockerfile is a script that contains instructions for building a Docker image. Create a file called "Dockerfile" in the root of your application directory and add the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;FROM python:3.8
COPY . /app
WORKDIR /app
RUN pip install --upgrade pip
RUN pip install -r requirements.txt
CMD ["python", "app.py"]

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This Dockerfile tells Docker to use the official Python 3.8 image as the base, copy all the files from the current directory to the /app directory in the container, set the working directory to /app, install the application dependencies, and run the command "python app.py" to start the application.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3:&lt;/strong&gt; Build the Docker Image Once you have your Dockerfile ready, you can build the Docker image by running the following command in the terminal:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;docker build -t myapp .&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This command will build the image and tag it as "myapp".&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4:&lt;/strong&gt; Run the Docker Container Once the image is built, you can run the container by executing the following command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;docker run -p 5000:5000 myapp&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This command will start the container and map port 5000 on the host to port 5000 in the container. This means that your application will be accessible on &lt;a href="http://localhost:5000"&gt;http://localhost:5000&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 5:&lt;/strong&gt; Deploy to a Remote Server To deploy your application to a remote server, you can use the Docker push command to push the image to a registry such as Docker Hub or a private registry, and then use the Docker pull command on the remote server to pull the image and run the container.&lt;/p&gt;

&lt;p&gt;In conclusion, Docker is a powerful tool that makes it easy to deploy and run web applications in a containerized environment. By using a Dockerfile and building a Docker image, you can easily package your application and its dependencies and deploy it to any environment.&lt;/p&gt;

</description>
      <category>docker</category>
    </item>
    <item>
      <title>Redis : Your db for in memory</title>
      <dc:creator>Debojyoti Chakraborty</dc:creator>
      <pubDate>Sun, 29 May 2022 15:28:42 +0000</pubDate>
      <link>https://dev.to/darkdebo/redis-your-db-for-in-memory-3b0l</link>
      <guid>https://dev.to/darkdebo/redis-your-db-for-in-memory-3b0l</guid>
      <description>&lt;p&gt;Hello everyone knows what is redis, it’s the most popular in-memory data structure store used as a database, cache, message broker, and streaming engine. It offers great data structures out of the boxes such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs, geospatial indexes, and streams.&lt;/p&gt;

&lt;p&gt;And out of all things it is a open source software so everyone can take a look at the source code, if you want countribute check out the link&lt;/p&gt;

&lt;p&gt;GitHub - redis/redis: Redis is an in-memory database that persists on disk. The data model is…&lt;br&gt;
Redis is an in-memory database that persists on disk. The data model is key-value, but many different kind of values…&lt;br&gt;
github.com&lt;/p&gt;

&lt;p&gt;Today I will show you how to use redis with python to create your database in memory using redis. So let’s jump into it.&lt;/p&gt;

&lt;p&gt;Requirements&lt;br&gt;
First you need python and redis installed in your machine, best option is to use docker and redis for this tutorial.so deploy your redis docker instance with one command in your terminal:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;docker run --name redis -p 6379:6379 -d redis&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;It will create a redis instance at port 6379. Now it’s created let’s create our python code to store the sata into redis database. For this we need redis library from pip. If you don’ have it on your machiner install it with this command.&lt;/p&gt;

&lt;p&gt;pip install redis&lt;br&gt;
Now let’s code…&lt;/p&gt;

&lt;p&gt;First create a file with anyname , let’s say test.py and add this code,&lt;/p&gt;

&lt;p&gt;Connect to Redis&lt;br&gt;
The following code creates a connection to Redis using redis-py:&lt;/p&gt;

&lt;p&gt;import redis&lt;br&gt;
r = redis.Redis(&lt;br&gt;
    host='hostname',&lt;br&gt;
    port=port, &lt;br&gt;
    password='password')&lt;br&gt;
To adapt this example to your code, replace the following values with your database’s values:&lt;/p&gt;

&lt;p&gt;In line 4, set host to your database’s hostname or IP address&lt;br&gt;
In line 5, set port to your database’s port&lt;br&gt;
In line 6, set password to your database’s password&lt;br&gt;
Example code for Redis commands&lt;br&gt;
Once connected to Redis, you can read and write data with Redis command functions.&lt;/p&gt;

&lt;p&gt;The following code snippet assigns the value bar to the Redis key foo, reads it back, and prints it:&lt;/p&gt;

&lt;h1&gt;
  
  
  open a connection to Redis
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
r.set('foo', 'bar')
value = r.get('foo')
print(value)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example output:&lt;/p&gt;

&lt;p&gt;$ python test.py&lt;br&gt;
bar&lt;br&gt;
Conclusion&lt;br&gt;
So this is how you can use redis and python to create your database in redis, also you can use for caching for applications. Below is some more resources for you to follow.&lt;/p&gt;

&lt;p&gt;Redis with Python&lt;br&gt;
To use Redis with Python, you need a Python Redis client. The following sections demonstrate the use of redis-py, a…&lt;br&gt;
docs.redis.com&lt;/p&gt;

&lt;p&gt;Redis | The Real-time Data Platform&lt;br&gt;
Build and run faster apps with the world's leading real-time data platform.&lt;br&gt;
redis.com&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How is the acer nitro 5 for full stack web development?</title>
      <dc:creator>Debojyoti Chakraborty</dc:creator>
      <pubDate>Sun, 30 Jan 2022 17:08:03 +0000</pubDate>
      <link>https://dev.to/darkdebo/how-is-the-acer-nitro-5-for-full-stack-web-development-226h</link>
      <guid>https://dev.to/darkdebo/how-is-the-acer-nitro-5-for-full-stack-web-development-226h</guid>
      <description>&lt;p&gt;Hello, i just recently bought a acer nitro 5 with a hexa core ryzen 5 4600h processor,now there was also 5600h option available but as I already ordered the model so i can't able to buy that one.&lt;/p&gt;

&lt;p&gt;Now my question is how good is this laptop for web development I run multiple docker containers, python apps,vscode and some browser tab.&lt;/p&gt;

&lt;p&gt;It has 8gb ram and if any of you are using that for programming please share your experience and if anyone bought latest 5600h one let me know what is better than the 4600h one.&lt;/p&gt;

&lt;p&gt;Have a great day,&lt;br&gt;
Waiting for cool experiences.&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>webdev</category>
    </item>
    <item>
      <title>My life ,I don't know what to do next?</title>
      <dc:creator>Debojyoti Chakraborty</dc:creator>
      <pubDate>Wed, 10 Feb 2021 02:46:21 +0000</pubDate>
      <link>https://dev.to/darkdebo/my-life-i-don-t-know-what-to-do-next-4kf8</link>
      <guid>https://dev.to/darkdebo/my-life-i-don-t-know-what-to-do-next-4kf8</guid>
      <description>&lt;p&gt;Hey everyone,&lt;/p&gt;

&lt;p&gt;I need a immediate job or internship, my family situation is not so good,I am undergoing in a super depressed condition and in a condition where our economical situation is not so good I applied many jobs in the LinkedIn but no response or cold reply.&lt;/p&gt;

&lt;p&gt;So please help me to get a job or internship as I am currently in 3rd year of my computer science I can do work remotely.&lt;/p&gt;

&lt;p&gt;Everytime from day to night quarreling happens in my house,I don't find a way to get rid off it,due to this I got depression for which I am undergone medication and I think that I don't know what to do?&lt;/p&gt;

&lt;p&gt;Eating a sleep pill every day to sleep.i need some money to survive so if you can help me in some way with a job or whatever I please.&lt;/p&gt;

&lt;p&gt;Currently I am in a assignment task with a company but it almost 1 month and I don't get paid so please at least someone I want to move from here my house.&lt;/p&gt;

&lt;p&gt;I have experience in deep learning, machineearning and web development to deploying models.&lt;/p&gt;

&lt;p&gt;Hopefully you can help me to get a #internship #jobs #webdevelopment #deeplearning #computerscience #connections #connections #jobsearch #linkedin #work #hiring #help #career #careers.&lt;/p&gt;

&lt;p&gt;my resume &lt;a href="https://drive.google.com/file/d/17IiF9h5ghNefRVy6KbHLckPCoq5saXSd/view?usp=drivesdk"&gt;https://drive.google.com/file/d/17IiF9h5ghNefRVy6KbHLckPCoq5saXSd/view?usp=drivesdk&lt;/a&gt;&lt;/p&gt;

</description>
      <category>help</category>
      <category>developer</category>
    </item>
    <item>
      <title>How to learn anything in 20 hours: My thought::</title>
      <dc:creator>Debojyoti Chakraborty</dc:creator>
      <pubDate>Tue, 09 Feb 2021 14:36:28 +0000</pubDate>
      <link>https://dev.to/darkdebo/how-to-learn-anything-in-20-hours-my-thought-10i0</link>
      <guid>https://dev.to/darkdebo/how-to-learn-anything-in-20-hours-my-thought-10i0</guid>
      <description>&lt;p&gt;&lt;strong&gt;This is a personal understanding which I got from this video at &lt;a href="https://youtu.be/5MgBikgcWnY"&gt;Tedx talk by Josh Kaufman&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You have free time just it feels that you have no free time.&lt;/p&gt;

&lt;p&gt;I am very much enthusistic to learn new things.&lt;/p&gt;

&lt;p&gt;go to the book store,library how to learn new things?&lt;/p&gt;

&lt;p&gt;How many time takes to learn something new : 10000 hours&lt;/p&gt;

&lt;p&gt;What we say?&lt;/p&gt;

&lt;p&gt;I have no time: excuse :p&lt;/p&gt;

&lt;p&gt;expert level performance: 10000&lt;/p&gt;

&lt;p&gt;most time practicing,most learning,improvising&lt;/p&gt;

&lt;p&gt;experts are built&lt;/p&gt;

&lt;p&gt;Outliers&lt;/p&gt;

&lt;p&gt;10000 rule everything but need to be a expert&lt;/p&gt;

&lt;p&gt;It's not true,&lt;/p&gt;

&lt;p&gt;performance = 1/practice&lt;/p&gt;

&lt;p&gt;how good you are = saturated curve practice_time&lt;/p&gt;

&lt;h1&gt;
  
  
  to be a reasonably good 20 hours
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Rapid skill acquisition
&lt;/h2&gt;

&lt;p&gt;What you want to do with this skill?&lt;/p&gt;

&lt;p&gt;1.Deconstruct the skill: Required component&lt;br&gt;
2.Learn enough to self correct coose 3 to 5 books/courses don't use to it procastinate. do learn enough self edit.&lt;/p&gt;

&lt;p&gt;3.Remove practice barriers :: &lt;strong&gt;mobile,tvs,everything&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;4.Practice at least 20 hours.&lt;/p&gt;

&lt;p&gt;Feeling stupid is a barrier overcome it stick with the practice.&lt;/p&gt;

&lt;h1&gt;
  
  
  The major barrier to learn anything is not intellectual, it's emotional.
&lt;/h1&gt;



&lt;blockquote&gt;
&lt;p&gt;credit&lt;br&gt;
&lt;span&gt;&lt;b&gt;cover Photo by&lt;/b&gt; &lt;a href="https://unsplash.com/@stephanieharvey?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Stephanie Harvey&lt;/a&gt; on &lt;a href="https://unsplash.com/s/photos/productivity?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Unsplash&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>productivity</category>
      <category>tutorial</category>
      <category>programming</category>
    </item>
    <item>
      <title>Resolution of the 2021🎉🎉</title>
      <dc:creator>Debojyoti Chakraborty</dc:creator>
      <pubDate>Fri, 01 Jan 2021 02:40:21 +0000</pubDate>
      <link>https://dev.to/darkdebo/resolution-of-the-2021-48b</link>
      <guid>https://dev.to/darkdebo/resolution-of-the-2021-48b</guid>
      <description>&lt;p&gt;What will your resolution in this new year 2021?&lt;/p&gt;

&lt;p&gt;Corona virus is getting security patch update.....&lt;/p&gt;

&lt;p&gt;Mine is reinforcement learning and gsoc 2021,with bit of startup opening idea in mind.&lt;/p&gt;

&lt;p&gt;Let's see your....&lt;/p&gt;

&lt;p&gt;Btw I am looking for members to build a good team.&lt;/p&gt;

</description>
      <category>discuss</category>
    </item>
    <item>
      <title>Understanding of Reinforcement Learning first lecture stanford cs243 course</title>
      <dc:creator>Debojyoti Chakraborty</dc:creator>
      <pubDate>Thu, 31 Dec 2020 16:30:01 +0000</pubDate>
      <link>https://dev.to/darkdebo/understanding-of-reinforcement-learning-first-lecture-stanford-cs243-course-2edf</link>
      <guid>https://dev.to/darkdebo/understanding-of-reinforcement-learning-first-lecture-stanford-cs243-course-2edf</guid>
      <description>&lt;p&gt;1.intelligent agent-&amp;gt;&lt;br&gt;
  2.learn to make &lt;strong&gt;good sequential decisions&lt;/strong&gt;&lt;br&gt;
    3.optimality&lt;br&gt;
    4.utility&lt;/p&gt;
&lt;h2&gt;
  
  
      5.a agent need to intelligent to make good decisions
&lt;/h2&gt;

&lt;p&gt;Atari learn the game from pixel to pixel&lt;/p&gt;



&lt;p&gt;video game playing&lt;/p&gt;

&lt;p&gt;robotics grasping clothes&lt;/p&gt;

&lt;p&gt;educational games to amplify human intelligence&lt;/p&gt;



&lt;p&gt;NLP,vision kind of optimization process&lt;/p&gt;



&lt;p&gt;key aspects:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;optimization&lt;/strong&gt;:
    good decision or at least good strategy

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;delayed consequences&lt;/strong&gt;:
no idea about decision is good for now or immediate but
helpful past&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;exploaration&lt;/strong&gt;: agent explore everything try to leearn everything....
           data is censored only a reward for decision made.&lt;/li&gt;
&lt;li&gt;policy is mapping pst experiences to the action
not better if preprogram due to large high search space &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;good question why not pre-program a policy?&lt;/p&gt;

&lt;p&gt;big search space &lt;/p&gt;

&lt;p&gt;enourmous code base&lt;/p&gt;

&lt;p&gt;atari learning from space of images what to do next&lt;br&gt;
need some sort of generalisation.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AI planning : ogd why go game don't need exploration?&lt;/li&gt;
&lt;li&gt;supervised: og
          already have experience as form of dataset&lt;/li&gt;
&lt;li&gt;unsupervised: og no label but have data&lt;/li&gt;
&lt;li&gt;RL:oged&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;imitation learning:ogd learning from others experience.&lt;/p&gt;

&lt;p&gt;assumes that input coming from good policy demos.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;reduces rl to supervised learning&lt;/p&gt;

&lt;p&gt;explore the world use experience to guide decisions&lt;/p&gt;



&lt;p&gt;end of class goal&lt;/p&gt;



&lt;p&gt;sequential decision making under uncertainity&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;interactive close loop prcess agent take action max reward
observation,reward  -- &amp;gt; max future reward&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;expected stochastic process need strategic behaviour to get high reward&lt;/p&gt;

&lt;p&gt;balancing immediate and long term reward&lt;/p&gt;

&lt;p&gt;it may have to make long decision in which it get no rewards&lt;br&gt;
for long times&lt;/p&gt;

&lt;p&gt;if agent get easy option to choose for maximising the reward it can do that&lt;/p&gt;

&lt;p&gt;reward function() is a important one.&lt;/p&gt;

&lt;p&gt;sub desicipline of machine teaching&lt;/p&gt;

&lt;p&gt;---------------------|------------&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;     +        (0)+   -         -
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;need constant two points&lt;/p&gt;

&lt;p&gt;|||important things for sequential decision:&lt;br&gt;
    History,state space,world state descrete timer &lt;/p&gt;

&lt;p&gt;small subset of the real world state &lt;/p&gt;

&lt;p&gt;(&lt;strong&gt;&lt;em&gt;Markov Assumption&lt;/em&gt;&lt;/strong&gt;):&lt;/p&gt;

&lt;p&gt;state current observation : s(t)&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   t=inf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;his(t)=sum(s(i))&lt;br&gt;
       i=0&lt;br&gt;
       ^&lt;br&gt;
history|&lt;/p&gt;

&lt;p&gt;markov whole history can be markov&lt;/p&gt;

&lt;p&gt;POMD&lt;/p&gt;



&lt;p&gt;Bandits: actions have no influence on next observations&lt;/p&gt;



&lt;p&gt;MDP and POMDPs actions influence future onservations&lt;/p&gt;

&lt;p&gt;types of SDP:&lt;/p&gt;

&lt;p&gt;Deterministic: &lt;/p&gt;

&lt;p&gt;Stochastic: &lt;/p&gt;

&lt;p&gt;RL algorithm :&lt;/p&gt;

&lt;p&gt;model&lt;/p&gt;

&lt;p&gt;policy : mapping function States-&amp;gt;actionsstochas&lt;/p&gt;

&lt;p&gt;stochastic policy Determinsitic policy&lt;/p&gt;

&lt;p&gt;value fucntion gamma: expected discounted sum on future rewards&lt;br&gt;
Reward: Mars Rover Stochastic Markov Model&lt;/p&gt;

&lt;p&gt;RL agents:&lt;/p&gt;

&lt;p&gt;Model based: have model&lt;/p&gt;

&lt;p&gt;Model free: have policy and value function&lt;/p&gt;

&lt;p&gt;Key challenges:&lt;/p&gt;

&lt;p&gt;Planning,&lt;/p&gt;

&lt;p&gt;finite horizon setting is to the time span of the system operation during which you are concerned about such defined performance measures. If you want to control the system, meeting the performance measures for a finite time say T, then the problem is finite horizon and if you are concerned about the optimality during the whole time span i.e till &lt;code&gt;t=∞&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;, then it is an infinite horizon problem.&lt;/p&gt;

&lt;p&gt;The problem of deriving control u(t)&lt;br&gt;
, &lt;code&gt;t=[0,T]&lt;/code&gt; for the system&lt;/p&gt;

&lt;p&gt;&lt;code&gt;x˙(t)=Ax(t)+Bu(t)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;such that the performance index&lt;/p&gt;

&lt;p&gt;&lt;code&gt;PM=∫T0x(t)′Qx(t)+u′(t)Ru(t)dt&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;is minimised is a finite horizon problem&lt;/p&gt;

&lt;p&gt;The problem of deriving control&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;, 
t=[0,∞] for the system
x˙(t)=Ax(t)+Bu(t)
such that the performance index
PM=∫∞0x(t)′Qx(t)+u′(t)Ru(t)dt

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;is minimised is an infinite horizon problem&lt;/p&gt;

&lt;p&gt;Evaluation and control&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>ai</category>
      <category>computerscience</category>
    </item>
    <item>
      <title>A new Way to assign variable in Cpp 10</title>
      <dc:creator>Debojyoti Chakraborty</dc:creator>
      <pubDate>Sat, 07 Nov 2020 17:03:46 +0000</pubDate>
      <link>https://dev.to/darkdebo/a-new-way-to-assign-variable-in-cpp-10-1kep</link>
      <guid>https://dev.to/darkdebo/a-new-way-to-assign-variable-in-cpp-10-1kep</guid>
      <description>&lt;p&gt;A new way to assign variable in cpp is:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;datatype variable name(any data)&lt;/code&gt;&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;bits/stdc++.h&amp;gt;

using namespace std;

int main(){

int b = 11;
int a(10);

cout&amp;lt;&amp;lt;"new way to print "&amp;lt;&amp;lt;a&amp;lt;&amp;lt;endl;

cout&amp;lt;&amp;lt;"old way to print "&amp;lt;&amp;lt;b&amp;lt;&amp;lt;endl;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output shown here:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;➜  ~ g++ test.cpp 
➜  ~ ./a.out      
new way to print 10
old way to print 11
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>cpp</category>
      <category>tutorial</category>
      <category>computerscience</category>
    </item>
    <item>
      <title>Voila Hack the Problem-ProHack</title>
      <dc:creator>Debojyoti Chakraborty</dc:creator>
      <pubDate>Thu, 08 Oct 2020 17:30:46 +0000</pubDate>
      <link>https://dev.to/darkdebo/voila-hack-the-problem-prohack-2hhl</link>
      <guid>https://dev.to/darkdebo/voila-hack-the-problem-prohack-2hhl</guid>
      <description>&lt;p&gt;Hola A todos!&lt;br&gt;
My short blog to approaching a problem in programming,Just follow these rules just  I learned...&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I bought a little pocket notebook with just 20 rupees and start to think how to utilise it?&lt;/li&gt;
&lt;li&gt;Open your laptop&lt;/li&gt;
&lt;li&gt;GEt your problem in the :awesome: place 😄&lt;/li&gt;
&lt;li&gt;Your laptop again&lt;/li&gt;
&lt;li&gt;Read It thoroughly :do It several: &lt;strong&gt;times&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Now point out the variables or anything like an object in the problem 🙂&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Great relate problem with it's condition you can get from it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;More likely it's viability&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Time to code&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Test&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;refractor it.&lt;br&gt;
And - Finished&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>cpp</category>
      <category>computerscience</category>
      <category>cp</category>
      <category>learning</category>
    </item>
    <item>
      <title>Trick to read all the content of a file in java</title>
      <dc:creator>Debojyoti Chakraborty</dc:creator>
      <pubDate>Tue, 06 Oct 2020 05:06:15 +0000</pubDate>
      <link>https://dev.to/darkdebo/trick-to-read-all-the-content-of-a-file-in-java-1led</link>
      <guid>https://dev.to/darkdebo/trick-to-read-all-the-content-of-a-file-in-java-1led</guid>
      <description>&lt;p&gt;Hello I recently need to write a program where I need to find the duplicates book title from a given text file and store it in a output file.&lt;/p&gt;

&lt;p&gt;But it's quite difficult to read file in java as there are many options available but after searching the internet I found the awesome process where you can read the file just with few lines of code.&lt;/p&gt;

&lt;p&gt;Let's see the code&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="c1"&gt;//required imports&lt;/span&gt;
&lt;span class="c1"&gt;//such as file handling java.io //and java.files&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.io.*&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.util.Iterator&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.io.IOException&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.nio.charset.StandardCharsets&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.nio.file.Files&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.nio.file.Paths&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.util.Collections&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.util.List&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;


&lt;span class="c1"&gt;//utility class for read the file in line and store it in&lt;/span&gt;
&lt;span class="c1"&gt;//an array and return it.&lt;/span&gt;
&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;OpenFileExample6&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;//functions static to call from outside to the class&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;readFileInList&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;fileName&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;

        &lt;span class="c1"&gt;//craeted a list of strings to store all the title from the file&lt;/span&gt;

        &lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;lines&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Collections&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;emptyList&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;

        &lt;span class="c1"&gt;//required try catch block to avoid any Input Output Exception and program can run&lt;/span&gt;
        &lt;span class="c1"&gt;//without any error&lt;/span&gt;
        &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;lines&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Files&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;readAllLines&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Paths&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;get&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fileName&lt;/span&gt;&lt;span class="o"&gt;),&lt;/span&gt; &lt;span class="nc"&gt;StandardCharsets&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;UTF_8&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;IOException&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;printStackTrace&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;
        &lt;span class="c1"&gt;//return the string of array&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;lines&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Above code I used to read all the content from the file the magic is happened by these lines&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;lines&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Files&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;readAllLines&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Paths&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;get&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fileName&lt;/span&gt;&lt;span class="o"&gt;),&lt;/span&gt; &lt;span class="nc"&gt;StandardCharsets&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;UTF_8&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;IOException&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;printStackTrace&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Great now it's your turn to use it in java to read the file and don't forget to import java.nio library.&lt;/p&gt;

</description>
      <category>java</category>
      <category>computerscience</category>
      <category>file</category>
    </item>
    <item>
      <title>SHort learning Godot engine</title>
      <dc:creator>Debojyoti Chakraborty</dc:creator>
      <pubDate>Sat, 26 Sep 2020 07:14:30 +0000</pubDate>
      <link>https://dev.to/darkdebo/short-learning-godot-engine-gei</link>
      <guid>https://dev.to/darkdebo/short-learning-godot-engine-gei</guid>
      <description>&lt;p&gt;I take a small bite in game development using the godot engine which is pretty good.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Learn how to create a project.&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Kinematic 2D body for object creation and the tree data structure used for game.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Project structure below:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;|
|
|
--Res|
     |
     |
     -scenes
     |
     |
     -scripts
     |
     |
     -assets

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is the basic structure of a godot project.&lt;/p&gt;

</description>
      <category>game</category>
      <category>learning</category>
      <category>csharp</category>
    </item>
    <item>
      <title>Week 2:Artificial Intelligence class experience in cs50(Knowledge)- Part 1</title>
      <dc:creator>Debojyoti Chakraborty</dc:creator>
      <pubDate>Tue, 22 Sep 2020 08:15:54 +0000</pubDate>
      <link>https://dev.to/darkdebo/week-2-artificial-intelligence-class-experience-in-cs50-knowledge-2a86</link>
      <guid>https://dev.to/darkdebo/week-2-artificial-intelligence-class-experience-in-cs50-knowledge-2a86</guid>
      <description>&lt;p&gt;In this class learned about the knowledge,knowledge based reasoning,Propositional logic,inference,inference rule,first order logic,knowledge engineering.&lt;/p&gt;

&lt;p&gt;We humans can make conclusions from the our existing knowledge like we know that computer can compute something and it's need some input.From that we can conclude that it can give some output.&lt;/p&gt;

&lt;p&gt;The concept of representing knowledge and drawing conclusions from it is also used in AI, and in this lecture we will explore how we can achieve this behaviour.&lt;/p&gt;

&lt;p&gt;Now there are the agents which we know from previous class that agents are the things which can interact with the enviourment.&lt;/p&gt;

&lt;h3&gt;
  
  
  Knowledge based Agents
&lt;/h3&gt;

&lt;p&gt;The agents which are give reasons by operating on internal representation of knowledge.&lt;/p&gt;

&lt;p&gt;Took the example used in class:&lt;/p&gt;

&lt;p&gt;What does “reasoning based on knowledge to draw a conclusion” mean?&lt;/p&gt;

&lt;p&gt;Let’s start answering this with a Harry Potter example. Consider the following sentences:&lt;/p&gt;

&lt;p&gt;If it didn’t rain, Harry visited Hagrid today.&lt;br&gt;
Harry visited Hagrid or Dumbledore today, but not both.&lt;br&gt;
Harry visited Dumbledore today.&lt;/p&gt;

&lt;p&gt;Based on these three sentences, we can answer the question “did it rain today?”, even though none of the individual sentences tells us anything about whether it is raining today. Here is how we can go about it: looking at sentence 3, we know that Harry visited Dumbledore. Looking at sentence 2, we know that Harry visited either Dumbledore or Hagrid, and thus we can conclude&lt;/p&gt;

&lt;p&gt;Harry did not visit Hagrid.&lt;/p&gt;

&lt;p&gt;Now, looking at sentence 1, we understand that if it didn’t rain, Harry would have visited Hagrid. However, knowing sentence 4, we know that this is not the case. Therefore, we can conclude&lt;/p&gt;

&lt;p&gt;It rained today.&lt;br&gt;
To come to this conclusion, we used logic, and today’s lecture explores how AI can use logic to reach to new conclusions based on existing information.&lt;/p&gt;

&lt;p&gt;Sentence&lt;/p&gt;

&lt;p&gt;A sentence is an assertion about the world in a knowledge representation language. A sentence is how AI stores knowledge and uses it to infer new information.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;


                      ___________ PROPOSITIONAL lOGIC
                    /
                  /
                /
Logic --------/
              \
               \ 
                \
                 \________________ fIRST oRDER lOGIC


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now Propositional logic have the following components&lt;br&gt;
I try to give a diagram representation instead of a text version:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Propostional Logic
propositional logic is based on the statements told by us about the world that can be either true or false.
|
|
-----LOGICAL CONNECTIVES
     |These are the logical symbols that connect 
     |propositional  symbols in order to reason in a 
     |more complex way about the world.
     ----------------------------------
     - Not (¬) inverses the truth value of the 
       proposition.So the example if P:"it is raining" 
       then ¬P means not raining.
       --------
       P | false
      ¬P | true
       --------
       P | true
      ¬P | false
       ---------
    - And(^)  connects two different propositions. When 
      these two proposition, P and Q, are connected by 
      ∧, the resulting proposition P ∧ Q is true only in 
      the case that both P and Q are true.
      ------------------------------------
      P    |     false
      Q    |     false
      p^Q  |     false
      ------------------------------------
      P    |     true
      Q    |     false
      p^Q  |     false
      ------------------------------------
      P    |     false
      Q    |     true
      p^Q  |     false
      ------------------------------------
      P    |     true
      Q    |     true
      p^Q  |     true
     ------------------------------------
    - Or (∨) is true as as long as either of its 
      arguments is true. This means that for P ∨ Q to be 
      true, at least one of P or Q has to be true.
      ------------------------------------
      P    |     false
      Q    |     false
      pvQ  |     false
      ------------------------------------
      P    |     true
      Q    |     false
      pvQ  |     true
      ------------------------------------
      P    |     false
      Q    |     true
      pvQ  |     true
      ------------------------------------
      P    |     true
      Q    |     true
      p^Q  |     true
     ------------------------------------
     It is worthwhile to mention that there are two 
     types of Or: an inclusive Or and an exclusive Or. 
     In an exclusive Or, P ∨ Q is false if P ∧ Q is 
     true. That is, an exclusive Or requires only one of 
     its arguments to be true and not both. An inclusive 
     Or is true if any of P, Q, or P ∧ Q is true. In the 
     case of Or (∨), the intention is an inclusive Or.
     -------------------------------------------------
     -------------------------------------------------
     - Implication (→) represents a structure of “if P 
       then Q.” For example, if P: “It is raining” and 
       Q: “I’m indoors”, then P → Q means “If it is 
       raining, then I’m indoors.” In the case of P 
       implies Q (P → Q), P is called the antecedent and 
       Q is called the consequent.
        ___________________________
        P      |      false
        Q      |      false
        P → Q  |      true
        -------------------
        P      |      false
        Q      |      true
        P → Q  |      true
        -------------------
        P      |      true
        Q      |      false
        P → Q  |      false
        -------------------
        P      |      true
        Q      |      true
        P → Q  |      true
        -------------------
    - Biconditional (↔) is an implication that goes both 
      directions. You can read it as “if and only if.” P 
      ↔ Q is the same as P → Q and Q → P taken together. 
      For example, if P: “It is raining.” and Q: “I’m 
      indoors,” then P ↔ Q means that “If it is raining, 
      then I’m indoors,” and “if I’m indoors, then it is 
      raining.” This means that we can infer more than 
      we could with a simple implication. If P is false, 
      then Q is also false; if it is not raining, we 
      know that I’m also not indoors.
        ___________________________
        P      |      false
        Q      |      false
        P → Q  |      true
        -------------------
        P      |      false
        Q      |      true
        P → Q  |      false
        -------------------
        P      |      true
        Q      |      false
        P → Q  |      false
        -------------------
        P      |      true
        Q      |      true
        P → Q  |      true
        -------------------
    |Model(The model is an assignment of a truth value 
    |to every proposition.)
    |
    |
    ------Knowledge Base(KB):The knowledge base is a set 
    |of sentences known by a knowledge-based agent. This 
    |is knowledge that the AI is provided about the 
    |world in the form of propositional logic sentences 
    |that can be used to make additional inferences 
    |about the world.

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In next part we will look through the inference and model checking algorithm.&lt;/p&gt;

&lt;p&gt;Reference:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://cs50.harvard.edu/ai/2020/notes/1/"&gt;https://cs50.harvard.edu/ai/2020/notes/1/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>machinelearning</category>
      <category>python</category>
      <category>computerscience</category>
      <category>ai</category>
    </item>
  </channel>
</rss>
