<?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 Kota J Ueshima on Medium]]></title>
        <description><![CDATA[Stories by Kota J Ueshima on Medium]]></description>
        <link>https://medium.com/@kota.j.ueshima?source=rss-3347889c9c6d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*UhSt58KM7NdiHYNclBbCJQ.jpeg</url>
            <title>Stories by Kota J Ueshima on Medium</title>
            <link>https://medium.com/@kota.j.ueshima?source=rss-3347889c9c6d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 16:54:43 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kota.j.ueshima/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[Layout in Material UI]]></title>
            <link>https://medium.com/@kota.j.ueshima/layout-in-material-ui-1d3ee5ed9fb5?source=rss-3347889c9c6d------2</link>
            <guid isPermaLink="false">https://medium.com/p/1d3ee5ed9fb5</guid>
            <dc:creator><![CDATA[Kota J Ueshima]]></dc:creator>
            <pubDate>Mon, 22 Aug 2022 18:01:01 GMT</pubDate>
            <atom:updated>2022-08-22T18:01:01.532Z</atom:updated>
            <content:encoded><![CDATA[<p>As a developer in the 21st century, one of the most important aspects of a webpage is figuring out the layout. Whether that be having an app bar or a side bar or even both, whether to have a grid like structure or perhaps stack items vertically, the appearance of a webpage is ultimately and at its highest level determined by its layout.</p><p>We will be using Material UI to look at various layout components offered in the library, so that you can start your personal journey on creating a webpage.</p><p><strong>AppBar and Footer</strong></p><p>The primary way to deal with layout structure is to create a layout component, ‘Layout.js’. That will wrap around whatever components that you want to wrap it around, mainly the body of each page. How this works is that the layout will wrap the other components, while taking in a prop called {children}, that will represent all the child components that it is wrapped around.</p><p>This component is essential to hold both an appbar and footer.</p><p><strong>Box</strong></p><p>The box is a wrapper component, often used to wrap an element on certain pages. By default, the box will show as ‘div’ in html, but as you can see below, the style can be changed using the component attribute.</p><pre>&lt;Box component=&#39;span&#39; sx={boxStyles}&gt;</pre><pre>&lt;/Box</pre><p>The benefit of the box component is that it is easily stylable using the sx attribute. Here in the example, sx is placed with a constant ‘boxStyles’ that is declared within the same component class, which has attributes on the class, the last creating a hover feature that will change the background color to ‘primary.light’.</p><pre>const boxStyles = {backgroundColor: &#39;primary.main&#39;, color: &#39;white&#39;, width:&#39;100px&#39;, &#39;&amp;:hover&#39;: {backgroundColor: &#39;primary.light&#39;}}</pre><p><strong>Grid</strong></p><p>A grid in material UI is composed of both a grid container and a grid item. A grid item in a horizontal approach is split up into 12 columns and that grid item can take up any amount out of those 12 columns</p><pre>&lt;Grid container spacing={3}&gt;<br>  &lt;Grid item xs={12}&gt;<br>  &lt;/Grid&gt;<br>&lt;/Grid&gt;</pre><p>The code above demonstrates a grid item taking all 12 columns of the available space. The xs is actually an attribute relying on screen size. Here is a list of attributes with their associated screen size.</p><p>xs: 0-600 pixels</p><p>sm: 600-960 pixels</p><p>md: 960-1280 pixels</p><p>lg: 1280-1920 pixels</p><p>xl: 1920 pixels +</p><p>Thus, these attributes can be layered so that it can fit based on different screen sizes. For example, the code below will fill up 12 columns on a xs screen size, but will only take up 6 columns, if the screen is made to be bigger to fit the dimensions of a small screen. However, if you want the item to take up 12 columns on all screen sizes there is nothing you have to do except declare on one of the attributes.</p><pre>&lt;Grid item xs={12} sm={6}&gt;</pre><p>Another attribute of the grid is spacing, which is declared on the container. The default is 0, and it can range from 1–10.</p><p>Another useful attribute on the grid container is a change of direction:</p><pre>&lt;Grid container spacing={3} direction=&quot;column&quot;&gt;</pre><p>This will switch a grid from filling up based on row (which is the default) to stacking up vertically, if that is the format you desire. The cool thing besides being able to stack items vertically, is that in this format, a grid item can actually become a grid container itself. Thus within a column based grid container, can be grid container’s that will by default align themselves by row.</p><pre>&lt;Grid container spacing={3} direction=&quot;column&quot;&gt;<br>    &lt;Grid item xs={12} container&gt; <br>        &lt;Grid item = xs={2}<br>        &lt;/Grid&gt;<br>        &lt;Grid item = xs={8}<br>        &lt;/Grid&gt;<br>        &lt;Grid item = xs={2}<br>        &lt;/Grid&gt;<br>    &lt;/Grid&gt;<br>&lt;/Grid</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1d3ee5ed9fb5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How To Display and Post Image Using React and Ruby]]></title>
            <link>https://medium.com/@kota.j.ueshima/how-to-display-and-post-image-using-react-and-ruby-15652283fcd6?source=rss-3347889c9c6d------2</link>
            <guid isPermaLink="false">https://medium.com/p/15652283fcd6</guid>
            <category><![CDATA[ruby]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[display-image]]></category>
            <dc:creator><![CDATA[Kota J Ueshima]]></dc:creator>
            <pubDate>Mon, 01 Aug 2022 06:39:57 GMT</pubDate>
            <atom:updated>2022-08-01T06:39:57.197Z</atom:updated>
            <content:encoded><![CDATA[<p>Uploading images is a common and almost necessary functionality of many web applications.</p><p>This is my first attempt to figure out how to undergo this process. My current background in software engineering relies mainly on React JS and Ruby, using the ActiveRecord framework.</p><p>First on the react side, we can create an input field with type=”file”, which will allow the user to select a file.</p><pre>&lt;input <em>type</em>=&quot;file&quot; <em>accept</em>=&quot;image/*&quot; <em>onChange</em>={fileSelectedHandler}/&gt;</pre><p>The code above, also has an attribute of <em>accept</em>, which gives the coder authority on what types of file types the user can choose from.</p><p>For example, the code below will only allow the user to select from .png files, whereas “image/*” allows the user to choose from any image file.</p><pre>accept=&quot;image/png&quot; or accept=&quot;.png&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/223/1*2C3Qhoh2V2uJ-G4-AUl6Dg.png" /></figure><p>The input will appear as a button, which upon being clicked will display the user’s desktop, from where the user can select an image based on the given limitations of the <em>accept</em> attribute.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DVvC8WJ2GUd5EwkpZWqMHw.png" /></figure><p>As you might have noticed, the initial input field included an event listener, <em>onChange</em>={fileSelectedHandler}. This is a tied to a function which will set the chosen file into a react state (selectedFile)</p><pre>const [selectedFile, setSelectedFile] = useState()</pre><pre>function fileSelectedHandler(e){<br>    setSelectedFile(e.target.files[0])<br>}</pre><p><em>e.target</em> here returns a FileList object, which acts basically as an array of File objects. The code above, goes through the array and selects the first file, which means later on that multiple files can be selected, but I have not gotten into looking at that feature quite yet. Here is the current state of <em>selectedFile</em>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/482/1*Svj_PeCslUo_6ekE4hTPYg.png" /></figure><p>First, we can temporarily display the chosen image.</p><pre>let imageSrc = &quot;&quot;</pre><pre>if (selectedFile){<br>    imageSrc = URL.createObjectURL(selectedFile)<br>}</pre><pre>&lt;img <em>width</em>=&quot;auto&quot; <em>height</em>=&quot;200&quot; <em>src</em>={imageSrc}&gt;&lt;/img&gt;</pre><p>The <em>if </em>statement ensures that the method <em>createObjectURL</em><strong><em> </em></strong>is not displayed on a null object, and the method itself converts an object such as a File, into a URL, however the lifetime of that URL is tied to the document in the window, so it will not persist. I recommend setting width=”auto” so that different sized images can automatically readjust based on a specified height.</p><p>Finally, now that a file has been selected and can be temporary displayed on the page, we can attempt to post this to a backend. The functionality of this will be controlled by a button (this button was made using Material UI, explaining its capitalization)</p><pre>&lt;Button <em>onClick</em>={uploadFile}&gt;Upload File&lt;/Button&gt;</pre><p>The function <em>uploadFile </em>will create a FormData that will send a key/value pair of “MyFile” and the <em>selectedFile </em>to our local server create in Ruby.</p><pre>function uploadFile(){<br>    const formData = new FormData()</pre><pre>    formData.append(&quot;MyFile&quot;, selectedFile)</pre><pre>    fetch(&quot;http://localhost:9292/post&quot;, {<br>        method: &quot;POST&quot;,<br>        body: formData <br>    })<br>    .then(res =&gt; res.json())<br>    .then(file =&gt; setUploadedFile(file))<br>}</pre><p>Currently, our backend works simply to return what is sent, simply to prove that it has gone to our backend and can be returned as such. I am sure it is fairly simple to be able to save the object in our database and retrieve it later based on as separate fetch request from the frontend.</p><pre><em>post &quot;/post&quot; do<br>    params.to_json<br>end</em></pre><p>The backend simply retrieves what is send as <em>params</em>, and returns our FormData in the form of a JSON object, which currently we have it placed inside its own state called <em>uploadedFile</em>, through the method <em>setUploadedFile</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/474/1*Mu3pzfJtH-8AsnEUfrexvw.png" /></figure><p>This is what the returned object looks like. Currently, as you can tell, this is an unfinished project, that hopefully I will like to have sorted by the end of next week.</p><p>Some issues that need resolving is that the image currently has no means of persisting on the page, which is essential. Furthermore, I have not clearly figured out a method in which the file itself can be stored using Ruby. In terms of this, I think one thing that has to be sorted is to be able to display an image based on the returned response, which is currently set in <em>uploadedFile.</em></p><ul><li><a href="https://www.geeksforgeeks.org/file-uploading-in-react-js/">File uploading in React.js - GeeksforGeeks</a></li><li><a href="https://www.pluralsight.com/guides/uploading-files-with-reactjs">Uploading Files with React.js</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=15652283fcd6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HTML Tags and When to Use Them]]></title>
            <link>https://medium.com/@kota.j.ueshima/html-tags-and-when-to-use-them-c57f63e0df62?source=rss-3347889c9c6d------2</link>
            <guid isPermaLink="false">https://medium.com/p/c57f63e0df62</guid>
            <dc:creator><![CDATA[Kota J Ueshima]]></dc:creator>
            <pubDate>Mon, 11 Jul 2022 20:55:16 GMT</pubDate>
            <atom:updated>2022-07-11T21:12:04.392Z</atom:updated>
            <content:encoded><![CDATA[<p>Html tags can always be confusing. Why do we need so many of them? What is up with H1, H2, H3? From the beginning, tags would always confuse me in the simplicity and variation of them. Many are intuitive such as &lt;body&gt; &lt;/body&gt; or &lt;header&gt; &lt;/header&gt; but others require research and some basic understanding.</p><p>Tags are essential for any front-end developer to tell certain lines of code to act in certain behaviors. It represents how code should be displayed or formatted based on specific instructions (the tags). How else can we differentiate how each text look, create links, have images etc. , basic functionalities for our websites</p><p>At its core they are very basic, but they can vary and ultimate have stylistic implications as well. For example, as of the latest versions of HTML, the body and header tags are no longer mandatory as in versions of the past, but are still represented in basically every website you will find based on stylistic implications. In some ways it is not just for the computer itself, but also for the developer to understand their own code, as well as anyone else’s.</p><p>Especially, having recently have started in react, it is even more important to realize that these html tags become the essence to distinguish functionality and styles of our created webpage, as React JSX uses what is essentially HTML. Perhaps it is important to note that the essence of this blog comes from the fact that having not dealt with HTML very much this phase, I realized that HTML tags are key even when utilizing React components and the declarative nature of React.</p><p><strong>Did You Know?</strong></p><p>The &lt;a&gt; &lt;/a&gt; to represent links accounts for 25% of all tags found on the internet. Imagine how many links you can find on the internet, to get from one page, one link to another. It is both surprising and unsurprising to me, as there are ultimately so many links, but then again what about the &lt;p&gt; tag?</p><p><strong>Tags to Know You Might Not Have Known</strong></p><p><strong>&lt;br&gt;</strong></p><ul><li>the break tag will create a break in the line of text, allowing some breathing room between your texts</li><li>doubling up on them will create an empty line between your text (&lt;br&gt;&lt;br&gt;), and this can extrapolated into creating multiple line gaps</li></ul><p><strong>&lt;b&gt; &lt;/b&gt;</strong></p><ul><li>to bold text</li></ul><p><strong>&lt;i&gt; &lt;/i&gt;</strong></p><ul><li>to italicize text</li></ul><p><strong>&lt;span&gt; &lt;/span&gt;</strong></p><ul><li>for stylistic purposes</li><li>for example, if you would like to change the color of one word in a sentence, the span tag can have a style or class that would allow that word to have a unique style different from the rest of the sentence.</li></ul><p><strong>&lt;figure&gt; &lt;/figure&gt;</strong></p><ul><li>figure tags can be used to enclose an image or other reference on a webpage</li><li>usually attached to a &lt;figcaption&gt; tag which holds the description for the specified content</li></ul><p><strong>&lt;code&gt; &lt;/code&gt;</strong></p><ul><li>in order to display code within a website itself, helps browser display for a front end with technical writing</li></ul><p><strong>&lt;del&gt; &lt;/del&gt;</strong></p><ul><li>will format the words between the tags with a line across it, in a way of representing that the word should not be there but still showing it</li><li>H̶e̶l̶l̶l̶o̶</li></ul><p><strong>&lt;progress&gt; &lt;/progress&gt;</strong></p><ul><li>displays progress bar, attributes of max = 100 and value = 70, percentage between the tag demonstrate appropriate value of the progress bar</li><li>usually attached with a &lt;label&gt; tag to describe what the progress is measuring</li></ul><p><strong>&lt;mark&gt; &lt;/mark&gt;</strong></p><ul><li>the mark tags allows you to highlight what is between the tags, the color choice can be indicated by css</li></ul><p><strong>&lt;audio controls&gt; &lt;/audio&gt;</strong></p><ul><li>the audio tag allows a developer to place audio within a webpage</li><li>it supports MP3, OGG, WAV formats, and the usual use will include as many of the sources as you can (with a &lt;source /&gt; tag) and whichever source a browser supports will function</li><li>whatever between the actual &lt;audio&gt; tags will get displayed in case none of the source types are supported by the browser</li></ul><p><strong>Sources:</strong></p><ul><li><a href="https://www.codebrainer.com/blog/top-10-html-tags">Basic HTML tags - Top 10 tags</a></li><li><a href="https://www.creativebloq.com/advice/html-tags">8 HTML tags you need to be using (and 5 to avoid)</a></li><li><a href="https://www.w3schools.com/tags/tag_audio.asp">HTML audio tag</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c57f63e0df62" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>