<?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 Alex chen on Medium]]></title>
        <description><![CDATA[Stories by Alex chen on Medium]]></description>
        <link>https://medium.com/@mengke.chen?source=rss-6380aba4af2e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*HtZSfHTQ7ldARwOXGqUgTQ.jpeg</url>
            <title>Stories by Alex chen on Medium</title>
            <link>https://medium.com/@mengke.chen?source=rss-6380aba4af2e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 19:57:59 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mengke.chen/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[Are REM in Bootstrap 4 responsive?]]></title>
            <link>https://medium.com/@mengke.chen/are-rem-in-bootstrap-4-responsive-ec6bc03214ea?source=rss-6380aba4af2e------2</link>
            <guid isPermaLink="false">https://medium.com/p/ec6bc03214ea</guid>
            <category><![CDATA[css]]></category>
            <category><![CDATA[bootstrap-4]]></category>
            <dc:creator><![CDATA[Alex chen]]></dc:creator>
            <pubDate>Tue, 25 Jun 2019 14:43:54 GMT</pubDate>
            <atom:updated>2019-06-25T15:19:22.997Z</atom:updated>
            <content:encoded><![CDATA[<p>This is a very good question, and with the recent switch to REM for Bootstrap 4, I had to figure it out ‘the hard way’, but try and error with some projects.</p><p>I used REM for the &lt;p&gt;, and I found that it was not responsive to shrinking size. Hence I decided to look it up and found this:</p><p><strong>bootstrap makes images and divs responsive, but not texts.</strong></p><p>and</p><p><strong>1REM is 16px.</strong></p><p>The relatives are :</p><p>h1{<br>font-size: 2rem;<br>}<br>h2{<br>font-size: 1.5rem;<br>}<br>p{<br>font-size: 1rem;<br>}</p><p>This creates a problem where the text wraps around the div in some shapes which you might not like… and look bad… for example here in my portfolio page…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J5WVgCP5lcae4gWYl8bzYg.png" /></figure><p>How do you fix this:</p><p>Well, one way to do this would be to set media queries: that is to define text sizes for each device size.</p><p>For example I did this for one text inside divs: what it did was that it made the h6 texts smaller than <strong>what it used to be, which is 1rem, when at smaller screens (for example: i made it 0.5rem so that the text are not too big when on smaller devices).</strong></p><p>@media (min-width: 576px) {</p><p>h6 { font-size: 0.5rem; }</p><p>}</p><p>@media (min-width: 768px) {</p><p>h6 { font-size: 0.75rem; }</p><p>}</p><p>@media (min-width: 992px) {</p><p>h6 { font-size: 0.75rem; }</p><p>}</p><p>@media (min-width: 1200px) {</p><p>h6 { font-size: 1rem; }</p><p>}</p><p>Or you could, add REM sized margins and padding so that they reduce instead of text. Although I am not sure if this would work.</p><p>Which one is better? It’s better to test out how it looks with both, I have tested with the former approach and found its ok, although abit complicated, having to define all the media queries with just some text adjustment. Maybe one could do that for all of the &lt;p&gt;s or headings on the page…</p><p><strong>Overall insight</strong></p><p>This REM thing is a weakness in Bootstrap and I have no idea why they haven’t made text responsive? where the images are already. Perhaps there is some further technical reason why they don’t do it. For now, adjust the text sizes with media queries.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ec6bc03214ea" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Reflections on Bootstrap 4- Good and Bad]]></title>
            <link>https://medium.com/@mengke.chen/reflections-on-bootstrap-4-good-and-bad-67f90ae1cafd?source=rss-6380aba4af2e------2</link>
            <guid isPermaLink="false">https://medium.com/p/67f90ae1cafd</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[bootstrap-4]]></category>
            <category><![CDATA[bootstrap]]></category>
            <dc:creator><![CDATA[Alex chen]]></dc:creator>
            <pubDate>Tue, 25 Jun 2019 13:40:45 GMT</pubDate>
            <atom:updated>2019-06-25T13:40:45.060Z</atom:updated>
            <content:encoded><![CDATA[<p>These past 2 weeks, I have been learning about this new Bootstrap 4 framework which came up recently, and having done some projects on it, including implementing some designs and creating web pages with them, I have came to some conclusions:</p><p>Lets start with some weaknesses, since everyone has only been talking about what it can do (haha)</p><p>Weaknesses:</p><ul><li>Bootstrap4 is a framework which is quite standardised in many aspects. This includes for example nav bars, etc. The one weakness I have discovered is : when you only want to toggle certain items in the bootstrap nav bar it doesn’t allow you to do it, I think this is because that the target id for the toggle is on the &lt;UL&gt; and not on the individual &lt;li&gt;s. I have researched and tried to target on individual &lt;li&gt;s but couldn’t. This is just one discovery I had about Bootstrap 4, there might be others which is a result of standardisation.</li></ul><p>Good:</p><p>Now the good parts of Bootstrap 4 is mainly that it allows you to build up a structure very quickly, especially if you want a quite standardised website, for example with some cards, or picture divs aligned, and boxes.</p><p>Using the ‘row’ and column classes, you can divide up the page according to requirements you like, for example, on mobile you want one column, on desktop 3 columns, ipad 2 columns.</p><p>It allows full stack and backend developers to quickly meet client requirements, if time is important in development, then I would definitely recommend bootstrap</p><p>The bootstrap buttons and forms look quite good. (compared to normal html that is), of course you can change on top of it using custom css.</p><p>Overall:</p><p>Bootstrap 4 is a decent product, just bear in mind that if you need abit more customisation, check where you need the customisation. If its only abit, I would still recommend Bootstrap4 as you could always edit it on top it. Also bear in mind where the design and implementation of css and html are in the development cycle.</p><p>Example of what bootstrap can do relatively quickly:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_BM8_Y4CHnQz63AV-kyyRQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=67f90ae1cafd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why I dislike Markdown (A LOT)]]></title>
            <link>https://medium.com/@mengke.chen/why-i-dislike-markdown-a-lot-2f3682954402?source=rss-6380aba4af2e------2</link>
            <guid isPermaLink="false">https://medium.com/p/2f3682954402</guid>
            <category><![CDATA[markdown]]></category>
            <dc:creator><![CDATA[Alex chen]]></dc:creator>
            <pubDate>Fri, 31 May 2019 15:06:58 GMT</pubDate>
            <atom:updated>2019-05-31T15:12:18.050Z</atom:updated>
            <content:encoded><![CDATA[<p>Of all the word processing technologies out there, MARKDOWN or md is probably one of the worst out there. Why?</p><ul><li>This and by far the most important- there isn’t much ‘easily digestable information out there to help with you’, every single time I use markdown, and say, try to center a text, or a bunch of images, I spend HOURS and HOURS on the web searching for information, and there are info, no doubt, there are info: for example, if you want to put a link onto an image in md readme, there is ALOT of info on that , most of which would say do something like [![]()](link), HOWEVER, there are almost NO info on resizing that image after the link has been added. and almost all the resizing sources state something like &lt;img src… which is very different to the original syntax. THE LACK OF COMPREHENSIVE information is whats taking people hours and hours of productive time.</li><li>It is extremely difficult to use and unnecessary. There are weird syntaxes like ## and ** which just makes it look stupid and not user friendly.</li></ul><p>Who ever invented this md thing needs to be prosecuted for wasting people millions and billions of man hours in productivity time. And no wonder Microsoft word is so successful you wonder.</p><p>If you are a markdown geek who spent thousands of hours learning this stuff, maybe you will find it easy and say ‘learn it or google it’, but for the average guy who is using it just to write down something (and the basic function is really just to write something like MS word), spending hours and hours is not productive.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2f3682954402" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Overview of whole Makers course]]></title>
            <link>https://medium.com/@mengke.chen/overview-of-whole-makers-course-23c9c22df5c2?source=rss-6380aba4af2e------2</link>
            <guid isPermaLink="false">https://medium.com/p/23c9c22df5c2</guid>
            <category><![CDATA[makers]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Alex chen]]></dc:creator>
            <pubDate>Wed, 29 May 2019 16:46:51 GMT</pubDate>
            <atom:updated>2019-05-29T18:34:22.087Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>General summary</strong></p><p>Overall its been a good experience and I really like many aspects of the course. I think there were many areas covered and maybe one point that is important is to maybe focus down a few topics, rather than using a scatter gun approach. I learnt about (list below):</p><ul><li>Ruby, dependency injection, creating and app http server, using database (postgres, ORM) to connect with app, javascript testing(jasmine), creating frontend app with javascript, group airbnb CRUD app, group rails app with AWS deployment, tech tests, python and machine learning.</li></ul><p>This list is very big and quite scattered, so one needs to keep practicing the learnt language all the time, in order to memorise the techniques. I had forgotten a bit about the syntax of tests for first 2 weeks of ruby and had to go back and review them.</p><p><strong>The things I really enjoyed were:</strong></p><ul><li>Pair programming: this really was very good because it suited my personality and that I liked solving problems with another person who may have different approaches and discuss which one to use. I find inspiration when in a discussion mode, (not that I can’t search for solutions online), but I find another pair of eyes with a different mindset helps me to create more ideas. It also helps with finding errors where I gain some more experience where the errors are coming from.</li><li>Working in agile groups: This was interesting because I enjoyed group work and for something a bit more foreign (e.g. machine learning), it was interesting to hear different ideas. I think it was a good idea to work in a ‘mob’ fashion where a foreign concept, (such as CNN) is discussed and explored.</li></ul><p><strong>What were the achievements / what I gained from the course</strong></p><ul><li>A better assessment of my strengths and weaknesses</li></ul><p><strong>Strengths:</strong></p><ul><li>Good design and approach for problem solving, clear, easy to understand, — communicates well my decisions to stakeholders, the reason why I chose a particular approach or technology, and progress along the way. I am a natural strategic thinker.</li></ul><p><strong>Weaknesses:</strong></p><ul><li><strong>Debugging </strong>some times can take longer than I would have hoped. This is sometimes due to the fact that sometimes I do not know why the error is occurring (which step is wrong), even if I read the line number and reading the error out aloud. sometimes the errors were due to incorrect syntax or the incorrect usage of s language, which resulted in error message not “telling me anything”. For example when using ruby let statement in rspec testing, I put let(:shopping) { described_class}.new instead of let(:shopping) { described_class.new }, and this produced an error.</li></ul><p>How to improve: At first I thought this required just time try and error as every bug is different, and with time, I would have seen most bugs, the different types of bugs, and have can provide a quick response. However, this may be a slow approach and take too long time. To more efficiently improve in this aspect, I will need to DEVELOP A MODEL for identify why the error is happening. The steps and process will be outlined in another blog post.</p><p><strong>Achievements (to follow in next blog)</strong></p><p><strong>What now?</strong></p><p>First, I plan to consolidate my knowledge with TDD practices in the process workshops.</p><p>My plan for the future is to keep on learning new technologies (REACT and vue JS), and job hunting. I will also redo/ complete the previous weekend challenges where I did not complete (e.g. bowling, guildedroses, newsapp, and chitter front end).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=23c9c22df5c2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Week 7- Rails group project -acebook]]></title>
            <link>https://medium.com/@mengke.chen/week-7-rails-group-project-acebook-6986b4d6febd?source=rss-6380aba4af2e------2</link>
            <guid isPermaLink="false">https://medium.com/p/6986b4d6febd</guid>
            <dc:creator><![CDATA[Alex chen]]></dc:creator>
            <pubDate>Tue, 28 May 2019 23:42:47 GMT</pubDate>
            <atom:updated>2019-05-28T23:42:47.923Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Learning:</strong></p><p>First sprint:</p><ul><li>Today is first day of creating our group which is to create a facebook clone. This is fairly straightforward, but what we needed to do was to deploy in the first 2 days. We went about setting up aws beanstalk, which was abit more complex than heroku, because in our app we couldn’t deploy via the aws cli and health was red.</li></ul><p><strong>Second sprint:</strong></p><p>Today is first day of second sprint and we are doing code quality and integration checks. We used simplecov (to check test coverage), and rubycritic.</p><p>To add the checks such as rubocop to travis, we added bundle exec to script of travis.yml.</p><p>We made these things badges so that once checks are passed, badge displays on readme. For example, adding the following line to readme:</p><p>[![Build Status](<a href="https://travis-ci.com/m-budryte/acebook-zuckerbros.svg?branch=master)](https://travis-ci.com/m-budryte/acebook-zuckerbros)">https://travis-ci.com/m-budryte/acebook-zuckerbros.svg?branch=master)](https://travis-ci.com/m-budryte/acebook-zuckerbros)</a></p><p>Adding simple cov badge meant we used shields.</p><p><strong>Aws Beanstalk Deployment:</strong></p><p>In order to deploy the app:</p><ul><li>Sign up for aws account and open an elastic beanstalk account (select region, etc), create an app and environment</li><li>Download AWS Cli console. Log in, select environment which you created on aws</li><li>On aws console on webpage, modify database to postgres (if deploying in postgres). On database.yml, specify production database to aws, with environment variables</li><li>For manual deployment : enter ‘eb deploy’ in command line</li></ul><p>Automatic deployment:</p><ul><li>configure travis.yml to include deploy:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/721/1*VAHLZ3e-Gb26zbYjOWq7QQ.png" /></figure><p>Aws Deployment (learning path):</p><p>In this challenge to deploy , we chose the difficult path of deploying to aws instead of Heroku. This was partly because some previous apps deployed by some team members to Heroku were slow. AWS beanstalk required some configuration in the environment, and it required some research to find out what they were. We were trying to deploy an existing app, so chose not to upload a zip file, which isn’t very git friendly. We configured the database.yml file to be aws, and then changed configuration in aws console from mysql(default) to postgres. And then the manual deployment was quite simple, with just ‘eb deploy’ command.</p><p>Overall the process isn’t as simple and user friendly as Heroku (not a lot of images), but we managed to get through the complexity by research, try and error with methodology. The speed of loading seems good too. Lesson here is that it is important to cover configurations when deploying something to production environment.</p><p>For automatic deployment, we had to spend quite a while because each time we changed some code and made pull request or merged with master, it required a lot of waiting time for Heroku to build. There isn’t an easier way right now, but we will try to make pull requests in larger block in the future.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6986b4d6febd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Review day -1st try- failed]]></title>
            <link>https://medium.com/@mengke.chen/review-day-1st-try-failed-864ea834176d?source=rss-6380aba4af2e------2</link>
            <guid isPermaLink="false">https://medium.com/p/864ea834176d</guid>
            <dc:creator><![CDATA[Alex chen]]></dc:creator>
            <pubDate>Tue, 28 May 2019 23:40:14 GMT</pubDate>
            <atom:updated>2019-05-29T11:46:29.660Z</atom:updated>
            <content:encoded><![CDATA[<p>Today I did a ‘review’ at Makers, which is a mock ‘tech test/interview’ which is done ‘on the spot’ with a head coach at Makers.</p><p>Why review is important:</p><ul><li>Without passing review, one cannot apply to jobs to makers hiring partners. And since this is really important, many people take this very seriously and the opportunity to work for hiring partners is the reason a lot of people chose makers in the first place.</li></ul><p>What happened:</p><p>- The main problem was that I made a strategic mistake in that I did the review in ruby, which i needed to refresh because in the past 8 weeks I have been doing projects in javascript and python. As a result my dexterity in ruby declined. This was the reason where I kept going back to previous ruby projects for syntax on implementation. Basic ally I knew what should be done but I didn’t know how to write it from scratch without looking at syntax at other projects. This delayed the implementation at one time up to 5 minutes.</p><ul><li>I knew exactly the outline of project , what needs to be done each step, the approach was clear and simple. If I could just peudo code it, it would have been done quickly. My strength is in the big design and structure of things.</li></ul><p>Why did I do it in ruby</p><ul><li>During the weekend I had tried to do a process workshop where it asked for user input, I found this to be difficult to test and I got stuck for many hours trying to solve this problem and still no one I asked knew how to do it. Someone posted a question involving jest and node js but it was not met with any answers. Hence I tried to do it in ruby and some people in the cohort did manage to test it, as a result I chose to do it in ruby because the program involved some elements of user selection. However this made everything else more difficult.</li></ul><p>What to do now? :</p><p>Sometimes one needs to improve dexterity in something and get more solid rather than going off tangent if that distracts from overall effectiveness and efficiency.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=864ea834176d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Week 11–12 (final project)]]></title>
            <link>https://medium.com/@mengke.chen/week-11-12-final-project-a48b8af2d033?source=rss-6380aba4af2e------2</link>
            <guid isPermaLink="false">https://medium.com/p/a48b8af2d033</guid>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Alex chen]]></dc:creator>
            <pubDate>Fri, 24 May 2019 13:07:49 GMT</pubDate>
            <atom:updated>2019-05-24T13:07:49.838Z</atom:updated>
            <content:encoded><![CDATA[<p>Today concludes the final project which I did within a group, the project link is as follow: <a href="https://github.com/alexanderchen6/ajak-final-project">https://github.com/alexanderchen6/ajak-final-project</a>.</p><p>The project is a a machine learning app where the AI recognises the drawing user has drawn in a canvas. The canvas is on a webpage.</p><ul><li>The user can then access if the AI guessed it correctly</li><li>A % is shown on how many correct guesses the AI did</li><li>There is a clock countdown where user has to draw within 20 seconds.</li></ul><p>Reflections:</p><ul><li>Machine learning involves a lot of data processing. I tried to convert the data which were downloaded from google quickdraw (in bitmap npy format) to data which derive the x_train and y_train. This was a process which included things like reshape, normalize, set limit, etc. After this, we fitted the model (model.fit(np.array(x_train), np.array(Y_train)).</li><li>Subjects like machine learning can involve a lot of research, and there is a lot of information online. However, it is very easy to get deep in this and loose track of the project. In this aspect, we did quite well and this was due to that we had peer check once a while. The research we did was as follows:</li><li>- Check other repos on github which performed similar projects</li><li>- Understand the big picture of machine learning and tensorflow</li><li>- watch tutorial videos on CNN and tensorflow to understand the process.</li><li>Problems we had were as follow:</li><li>- Other examples of image recognition was overly complex. We overcame this by first doing a tutorial of a easy example (e.g. hello world). And then we proceeded step by step so that 1) we are able to train the model (including the loading of data from google quickdraw 2) we can load an image and predict 3) we can connect with front end so that the canvas sends the image to the backend. 4) we convert the image received so that it saves an image ‘output.png’ 5) we initiate a drawing object and prediction object based on this.</li><li>We had issue where the prediction was not accurate. This may be because that the image from canvas is different to image from the google dataset. We opened one of the images from google quickdraw dataset and found that the background was white, and made our drawing to have white background by formatting it at server-end, before initiating drawing. To make the prediction more accurate we also brightened the image in reshape method in the drawing class.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a48b8af2d033" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Week 5 Blog]]></title>
            <link>https://medium.com/@mengke.chen/week-5-blog-6a0be4e1996c?source=rss-6380aba4af2e------2</link>
            <guid isPermaLink="false">https://medium.com/p/6a0be4e1996c</guid>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Alex chen]]></dc:creator>
            <pubDate>Sat, 06 Apr 2019 09:57:18 GMT</pubDate>
            <atom:updated>2019-04-06T09:57:18.630Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>02/04</strong></p><p>Peer programming:</p><p>Today was an interesting session as we started on pair programming in JavaScript. This is new to many people and it proved a small challenge but one that we overcame.</p><p>The project we started was doing a fizz buzz exercise in JavaScript, driven by tests. This was interesting and new because I haven’t done testing in JavaScript. I used Jasmine, which had similar syntax to rspec, for example the “describe” block.</p><p>We finished the fizzbuzz and also first part of thermostat.</p><p>In terms of writting tests, the test, the start is very similar:</p><p>describe, and it, adding in function()</p><p>Thermostat:</p><p>In order to test the max and min temperatures, we first put in an error message, but then changed it to ‘return’ so that it does nothing when turned up higher, and the test expect it to be at max temp when added more degrees than the max allows.</p><p>Another point i learnt was the ‘prototype’, which in my understanding allows javascript to call a function.</p><p>What was good:</p><ul><li>I learnt how to TDD in jasmine (the basics)</li><li>I learnt how to write a simple app using functions (thermostat)</li><li>I learnt to set powrsavermode off when needing to test values above the max temperature in a test, as powersavermode has maximum temperature.</li></ul><p>Improvement</p><ul><li>close distractions. ( I had a email message pop up on my screen during the session, and my partner felt a bit distracted by it) I will close the messaging programs and email while doing work with a colleague next time.</li><li>To use a defined constant eg MinTemperature instead of number</li></ul><p><strong>03/04</strong></p><p>Today I paired with a colleague to do the airport challenge in JavaScript. As we had already done it in ruby, I thought it would be easy, but it was not so.</p><p>Our style was ping pong.</p><p>The main change that we made was that the “actions” happen on the plane, instead of just the airport. For example, there is a function of land for the plane, and that function calls another function in airport class to land the plane.</p><p>With them switch to javascript me and my colleague was abit uncomfortable at first and we were abit lost with trying to write test. We mainly overcame this by trail and error with JavaScript syntax and looking it up in mdn. So far not much had been a main issue apart from one where thr airport was not able to pop() plane.</p><p>More javascript journey continues.</p><p>Skills developed</p><p>TDD</p><ul><li>by doing the airport challenge again, I have encountered some issues in the syntax of jasmine where i needed to make it throw an error.</li></ul><p>Debugging</p><ul><li>For the error where it didn’t raise an error. I used console log in the code to see if anything was printed to screen, but it didn’t print anything.</li></ul><p>Approach:</p><p>Our approach is very similar to Ruby’s one.</p><p>Problem encountered</p><ul><li>the airport was not able to pop() the plane.</li></ul><p>Error says cannot call pop() on undefined.</p><p>S- we changed the methods before the line to be called on the plane, instead of the airport.</p><p>Using double — we wanted to make the plane double in the airport, airport double in the plane, and stub the airport so that it is not stormy.</p><p>We found out how to use double with JavaScript docs.</p><p>Improvement/ Kaizen :</p><ul><li>be more familiar with Jasmine writing</li><li>Manage change more effectively, in this case we wanted to create methods on plane, so could not straight translate ruby code</li></ul><p><strong>04/04</strong></p><p>Added in double for original airport challenge (ruby).</p><p><strong>Airport in JavaScript:</strong></p><p>I paired with a colleague to do the airport challenge from beginning in JavaScript.</p><p>Very effective pair-</p><ul><li>finished airport ( from beginning) with good speed (ping pong style)</li><li>able to find problem quickly and break it down</li><li>Clear on approach — but not syntax ( for example wrote ruby code)</li></ul><p>I wrote tests which would then let her pass. Helped her when she struggled in writing code, direct her to correct in the right places ( for example, writing or changing the function )</p><p>I mentored colleague-</p><ul><li>Airport is full, writing the throw error on the land function, not in the isFull method.</li></ul><p>Colleague feedback:</p><ul><li>Good- Asks questions</li><li>Quite positive</li><li>Able to follow through</li><li>Abit distraction</li></ul><p>Problems:</p><p>Default capacity-</p><p>Testing : we did not know how to test it and write it</p><p>-solution: If default capacity is passed in, uses that, if not, it uses default capacity that is a constant in program</p><p>Capacity is put into Airport object and also you are able to pass it in as option.</p><p>Passed the test.</p><p>Colleague’s issue early on (before started)- which I helped to resolve:</p><ul><li>Should not put () after the hanger as it’s just</li><li>Gave opinion that she shouldn’t have used same name “hanger” for method and attribute.</li><li>Asked to confirm if she understood it. Explained that it’s not calling function here.</li></ul><p><strong>05/04</strong></p><p>thermostat</p><p>Today i worked mostly alone as colleague wasn’t here, I continued the JavaScript project on thermostat, and went through few steps which were quite interesting:</p><ul><li>made a js file that stores jquery functions which dynamically change the index page, some functions included update, where it updated the temperature on page, Color of the temperature. I did the color change by adding css class to the span, according to current energy usage.</li><li>Also, I could adjust the temperatures</li><li>Made Ajax request to a weather api, and according to the selected city, displays the temperature of the city</li><li>I started a Sinatra app and tried to get the data to the post route but couldn’t do it on the day.</li></ul><p>Problem that remain to be solved :</p><ul><li>how to get the “front end” stuff to save in the Sinatra api</li></ul><p>Overall was an ok day, but I need to do some more research on how to interact with backend, which is not in the references.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6a0be4e1996c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Week 2 blog]]></title>
            <link>https://medium.com/@mengke.chen/week-2-blog-22d456c9e057?source=rss-6380aba4af2e------2</link>
            <guid isPermaLink="false">https://medium.com/p/22d456c9e057</guid>
            <category><![CDATA[testing]]></category>
            <dc:creator><![CDATA[Alex chen]]></dc:creator>
            <pubDate>Sat, 06 Apr 2019 09:56:13 GMT</pubDate>
            <atom:updated>2019-04-06T09:56:13.664Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>**11/03**</strong></p><p>Oystercard challenge 1–12</p><p>TDD</p><p>Our TDD process was quite simple. we use context where card has been topped up (normal situation), not topped up, balance over limit, card below balance, and expect response to these situations. This made the test groupings abit more clear.</p><p>We extracted Oystercard class, which would then have many methods, such as top_up, touch_in, Touch_out, in_journey?. This is because at this stage the model is relatively simple.</p><p>We did use a double for station class, and at this stage it doesn’t have much for behaviour.</p><p>Hard part:</p><p>We encountered issue when trying to input entry and exit station into the hash and accessing/changing it to let it equal to a ‘station’ when touch out. This was due to relatively little knowledge over hashes.</p><p>To do this, we <strong>**googled and extrapolated important information relating to hashes**</strong>, and then used that to make the entry_station and exit_station return the hash information (e.g. something is passed into hash(entry_station) when touch in, and something else (exit_station) is passed into hash when touch out)</p><p>Once we figured out the syntax, we were able to access and make the touch_in and touch_out methods (which require changing the journey hash) work.</p><p><strong>**12/03**</strong></p><p>Feedback:</p><p>I paired with a colleague who is very nice and collaborative. However, she was a bit behind on the challenge so at first I made her to do the last challenge which i did. I think I was too fast in going over the material, so that she wasn’t progressing and understanding it. So next time I will go abit slower at beginning.</p><p>Challenge 14 TDD process:</p><p>Our TDD process was that we wanted to test journey class that starts with first initiating with empty hash. And then as journey goes on, it changes value inside the hash according to the relevant touch in and touch out.</p><p>What was hard(1st try extracting classes):</p><p>We were a bit confused about moving methods to the Journey class. First we moved the touch in and touch out methods over, but it didn’t work very well, because a lot of variables depended on the original oystercard. So we revereted back to our original commit where we had everything in the Oystercard card.</p><p><strong>### APPROACH to extracting classes(2nd try):</strong></p><p>So we just moved the necessary behaviours: calculating fare if no touch out, deducting minimum fare if touched in and out. first we moved the tests, and then we wrote the codes.</p><p>We removed the original ‘in journey’ method, as our hash in journey class would tell us if its in journey or not by returning a value or nil.</p><p>What to do next time:</p><p>Although we did finish the requirements, and got it done, we lacked a bit direction in the extraction of journey class, as there were a lot of code in the original oystercard. We could draw up a plan and decide which responsibilities to move over, and then start implementing.</p><p><strong>*13/03**</strong></p><p>Today partnered with a slightly experienced coder, and I felt the session went well. I found his methodology very clear and there was little confusion in what he is doing or trying to do.</p><p>I enjoyed very much partnering with people like this.</p><p>So we redoed challenge 14 which required extracting out Journey class, but this time it was much clearer. The approach we did was this:</p><p>first- we comment out the tests for the old class(Oystercard, whose some methods we should move to new class)</p><p>-we write the tests for the new class(Journey), and then we extracted a new class, and wrote the corresponding code (e.g. methods ‘fare’, etc.), and then we comment in the test for Oystercard_spec, and which gave few errors. And then we made those tests pass by modifying some of the corresponding methods in Oystercard class.</p><p>-This approach proved much more clear and I didn’t get my head all over the places. I had clear objectives, where I knew what I am trying to achieve with the new Journey class (which was to calculate fare (if touched out and not touched out), end a journey, etc), so I was more <strong>**objective oriented in writing tests and corresponding code**</strong>. This helped with test coverage (i knew exactly what the test would do) and speed as well, as we finished relatively quickly, to move on to the Oystercard class.</p><p>When we modified the oystercard tests and methods, we kept in mind what we wrote about Journey and removed the duplicate methods (which did same thing). <strong>**The code was more clearer at the end for Oystercard class**</strong></p><p><strong>*14/03**</strong> (12)</p><p>-Today have had a relatively new to coding pair colleague. He was abit new to the challlenge and didnt know where the errors were coming from, and didn’t know much what to do.</p><p>-As he was far behind my progress in the challenge, I adopted approach to let him work through the challenge and help him when he is stuck nad guiding through the main concepts. I found this to be better than guiding him throughout the process. So every time he is met with an error which he didn’t know what to do, or if he is struggling with big concepts I would step in. I explain why the error was there, most often when variables weren’t defined. I tried to explain the nature of the error, rather than just telling him what to do.</p><p>In order to do this, I had to first understand his code (which i dndn’t know previously), and then understand what the error is telling me. Sometimes I would question back and ask him ‘ why do you think that happened? how did you define this method? or instance variable, and then that would make him thinking towards why the code didn’t work.</p><p><strong>-**So, in the end it was a great success**</strong>, in that he passed the challenges faily quickly, and also learnt lot about fundementals of programming, rather than just copying my code line by line. I feel good that I was abble to help someone who might not be as solid, but just needed some guidance towards thinking about the right direction. I felt this was also more efficient for both because I didnt have to spend alot of time dictating line by line. I am confident he is a better programmer and know thinks in a better way.</p><p><strong>## 11/03</strong></p><p>Today’s pairing session is quite interesting.</p><p>We started new a new project called “Oyster card”, the idea and task is similar to the previous airport and Boris bike, you store a balance, it deducts money when touch out, you can top up, etc. you use Oystercard class and crest instant variables and attributes.</p><p>We were very quick to progress and finished 12 of total 16. The reason I found was that my colleague was very quick to start writing tests and code and didn’t need to have time to think about it. I think most of our code was correct, and the tests passed quickly. The only difficulty was setting the layout for tests as there were many scenarios, we segregated this with “context”.</p><p>Feedback:</p><p>A bit more enthusiasm — maybe I’m feeling a bit too overworked/didn’t have a rest day in weekend and feel the challenge to be too similar to the last one, it would be better to show that I’m excited to do the challenge, instead of just no/ little emotion. I think meditation will help with this . Overall I think it was good balance that she talked more and I talked less because if I had also talked a lot it it might be distracting to talk a lot and not do much.</p><p>Better communication in explaining code- I was explaining some code to colleague and she was not understanding it. I am going to adapt a more clearer and shorter approach when I start to explain and explain later, instead of trying to explain the more complex things first.</p><p><strong>## 11/03</strong></p><p>It has been an interesting week and seemed to go very quick. There has been a lot of things I learnt.</p><p>- try to seek alternatives when stuck</p><p>The main issue which took quite a while was doing the birthday challenge. And due to interpreting the user stories abit differently, I made 2 classes instead of one, which made it abit more difficult. I got stuck when trying to put one class object into another.</p><p>The tutor was not available during those 2 mornings and I had to think of another strategy. After researching a while I found that this is a big subject, and I paired with another colleague. This was great because she saw somethings which I didn’t and I was able to overcome the “bottlenecks”. I managed to finish the birthday challenge mostly by my driving.</p><p>- think like an engineer</p><p>I haven’t been trained as engineer at university, although there are many problem solving and analytical work in Economics. And when I started coding, my approach sometimes just consisted “try everything out to see if it works”. This approach can sometimes be very confusing and you need to find patterns as to why some things work and some don’t. Doing this approach can confuse you because you are constantly trying different things with out a focus or methodology.</p><p>What I learnt was to : to still try out stuff, and it’s ok to learn by trail and error, but first take a step back and look at the overall picture. I am a big thinking person, but I do get carried away into details too much due to some error for example. And as I am a very determined person, I want to solve the problem and get too carried away with that determination.</p><p>Now I have learnt to take a step back and look at the big picture, try figure out what exactly the code is telling me, and have 1–2 minutes “thinking” time. This step is important. If I decide to go for a certain approach, then go all a head, but have some pauses between major changes in approach.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=22d456c9e057" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[06/03/19]]></title>
            <link>https://medium.com/@mengke.chen/06-03-19-8ca5c530ced4?source=rss-6380aba4af2e------2</link>
            <guid isPermaLink="false">https://medium.com/p/8ca5c530ced4</guid>
            <category><![CDATA[tdd]]></category>
            <dc:creator><![CDATA[Alex chen]]></dc:creator>
            <pubDate>Thu, 07 Mar 2019 10:09:25 GMT</pubDate>
            <atom:updated>2019-05-28T23:41:24.211Z</atom:updated>
            <content:encoded><![CDATA[<h3>Week 1 blog</h3><p>Bikes</p><p>Day 1 of the Borris bike pair programming, we completed up to task 10. and it was quite interesting. We initialised 2 classes, DockingStation, and bikes. The way we did it was that we first wrote the tests, then we wrote the code. Thinking about the relationships between classes was interesting, because that might be useful later on. I can now explain my TDD process to my peers, that is, having test first, then writing code to pass the test according to the error given.</p><p>WE as a group felt we did quite well and my peer partner felt good about what we have achieved today. There was a lot of discussion on what to do, and we both were wrong sometimes but it was quick to correct our mistakes, and I learnt a lot from working in pair.</p><p>Goals for this week recap:</p><p>TDD- simple app, Debugging, Explain some OOP principles, pairing</p><p>The birthday exercise I found to be very hard. This is due to that I found the instructions not very clear: it asked that to first store names of people and their birthdays in irb and then also return a list of birthday names and dates, and if their birthday is today, puts a message to say that their birthday is today. All this written by TDD.</p><p>The first part involved irb, which I wasn’t sure how to store the data. But I proceeded anyway because I know I can initiate a unit test to test if there is a birthday class, and also their attributes, which are name and date. So I wrote these 2 failing tests, and then wrote the corresponding code to them.</p><p>I asked my colleague what she did about it and she broke it down to user stories ( eg the user stores birthday and retrieve them , this is a good way to think, and I think it’s in the manual we were given, so I might incorporate this thinking next time ).</p><p>After these tests passed, the second phase is to have a birthday list test. I don’t know what to do about this yet. I was unsure whether that the storage to the empty array, which I I’ll initiate occurs at the initialized method stage or another stage, and asked my colleague, they suggested to put it in another method as one method has to do one thing . ( good clear thinking), but in order to do that you can’t just input (initiate) it into irb, you have to put it into a variable, and then put that variable into the array. So each time you will need to define a new birthday, say birthday1, birthday2 etc…</p><p>I will confirm this method with teacher.</p><p>I wonder if there is an automated method to do this rather than inputting birthday1, birthday2 manually.</p><p><strong>Afternoon (Boris Bikes)-</strong></p><p>The afternoon pairing session was quite interesting. I was paired with a very friendly partner, who covered a lot of my weaknesses, which I later found.</p><p>We were both quite inquisitive, always asking why this is happening etc, rather than rushing through the exercise, and this was good for our learning experience.</p><p>The first problem we encountered was that we were suppose to define a programming ‘action’ or ‘process’ which describes the ‘docking’ action of bikes. She was wondering if it was an ‘action’ or method on the bike, hence the bike class, and I agreed too, but we were stuck as the requirement wanted to have instance variable on the DockingStation class. This could be only achieved through creating ‘docking’ method on the DockingStation class, which we later found out through the walkthrough, after few moments thinking and discussing. This is good, now we kind of know what to do.</p><p>The next step is writing the test to expect something when ‘docking’ the bike, namely returning the bike docked. THIS is interesting, because i didn’t know that it should return the bike. After getting this instruction, it was much easier to write the test, which is that it should expect to return the bike(which is passed through an argument) when its docked. After, I wrote the corresponding code for it, @bike = bike.</p><p>After this we did few exercises on raising an error when station empty, or when station full, which are fairly ok. And then we changed the @bikes attribute to an array. As i knew a bit more about OOP, I helped by explaining to her about Bike objects, about that we have to define and dock them separately. This was helpful to her she said.</p><p><strong>Behaviours/processes</strong></p><p>One thing that she was good at and helped us a lot to progress was reading a bit better on the instructions/ readme. By doing this, she helped us to get more idea when we were stuck, and provided some direction to try, some were incorrect but the ones which moved us a lot were very helpful. I will learn more from this.</p><p><strong>07/03/09</strong></p><p>pair programming- Bikes</p><p>Very clear approaches — I can see what he wants to say and do. Articulate his thinking quite well.</p><p>CONCRET THINGS:</p><p>Both misunderstood requirement for capacity. We both thought that the dockingstation initiates with 20 bikes, instead of having the CAPACITY of 20 bikes. I learnt that</p><p>when passing default should be</p><p>def initialize(attribute = x)</p><p>where x is default value.</p><p>Passing default value into initialize method.( capacity= Defaultcapacity)</p><p>BEHAVIOR:</p><p>Good discussion on approaches and both were interested in problem solving. Spent a lot of time on experimenting but in a controlled way- eg we had something in our mind when we changed the code or test.</p><p>CONCRET THINGS:</p><p>I explained that @bikes is an array.</p><p>And that in order to test it so that it wont accept anymore bikes, we put 20 bikes in first, and then put another bike in, which raises an error. Then we write the code raise an error when @bikes.count is larger than 20.</p><p>IMPROVEMENT:</p><p>CONCRET THINGS/ APPROACH- SINGLE RESPONSIBILITY:</p><p>I had initially tried to use def dock to do everything, from checking if full, and raising error message, or returning bike. Instead, I should have done private method for full? and empty? where the assessment is done in another method. This would make things much more clearer if you break it down.</p><p><strong>**09/03**</strong> Bikes</p><p>This afternoon’s Borris bike exercise was quite interesting and we progressed a lot. We had 3 people on the team. Me being mostly the driver and my team members giving me inputs for ideas. we progressed from start of 18 to start of 20.</p><p>With 18: we were given 3 user stories, user should report bike being broken, docking station should not release broken bikes, and docking stations can accept both broken and working bikes.</p><p>APPROACH: with these user stories, we decided to go one at a time. So each user story corresponds to one unit test.</p><p>The first user story caused some disagreement, me and one member wanted to have a report function/method on the Bike class, whereas the other member wanted to have report on docking class. But we though both might work, and first we wrote the test to say, the bike is broken , and that it should ‘raise’ an error message, and then we wrote the corresponding code.</p><p>CONCRETE THINGS: when doing the second user story, this is where we encountered an error, because we copied the same code as before to ‘raise an error’ when bike is docked (user story 1), when we run release bike test(which first docks the bike), there was an error: the test for release bike didn’t run to expect{ release bike } line because during the dock bike stage, it raised an error. This error was pointed out by my colleague, which was very good.</p><p>BEHAVIOR: Definitely having a colleauge sometimes can point out your weaknesses, which in this case, for me was error debugging and understanding the error. He understood that the ‘raise error caused the problem’. I learnt that it is often quite beneficial to have a colleague in pair programming as they can point out mistakes/ blind spots which i didn’t see. I have learnt to listen abit more to colleauge and get ‘out of my head’ sometimes in my thinking and listen to a different approach/idea.</p><p>Once the first 2 user stories have finished. The 3rd one automatically works, because the dockingstation would accept broken or working bike in the first instance, so no changes required.</p><p>Testing for doubles, was quite hard to understand. The best way i found was discussing what is required. So me and collegue had similar ideas, and we came to conclusion that it was to mock the behavior of Bike class, so that you use a double, instead of using say , Bike.new. And then you use let to define moke object, and use :bike instead of Bike.new.</p><p>Improvement- I could find out other ways to understand Doubles better, because this was in the birthday exercise too. And I could understood with the team a bit faster the concept. We took a while to understand the subject by navigating the material. This probably takes practice.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8ca5c530ced4" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>