投稿時間:2022-02-14 02:12:57 RSSフィード2022-02-14 02:00 分まとめ(15件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
python Pythonタグが付けられた新着投稿 - Qiita サーバレス(Oracle Functions)でWeb動的サイトを構築しました https://qiita.com/kngsym2018/items/05bbb155a43d365cabb1 今回はOracleFunctionsはつしかありませんが、サイトのページが増える事を見越して設定しますーAPIGatewayからOracleFunctionsfteamlistを実行できる設定を行うAPIGatewayからOracleFunctionsfteamlistを実行できるよう設定する詳細手順はこちら開発者サービスゲートウェイをクリックコンパートメントを確認、ゲートウェイの作成をクリック「名前」任意、「タイプ」パブリック、「コンパートメント」使用コンパートメント、「VCN」は、作成したVCN、「サブネット」はパブリックサブネットを選択して、ゲートウェイの作成をクリックデプロイメントの作成をクリック「名前」任意、「パス接頭辞」teamlist今回はteamlist、コンパートメント使用コンパートメントを設定したら、次をクリック「パス」v今回はv、「メソッド」GET、「タイプ」OracleFunctions、「アプリケーション」fnfsite『ーアプリケーションの作成』で作ったもの、「機能名」fteamlist『OracleFunctions「チーム一覧ページ」作成』で作ったものを設定して、次をクリック作成をクリックデプロイメントが作成されたことを確認ーAPIGatewayがOracleFunctionsを使用できるように、動的グループ、ポリシーを作成動的グループ、ポリシーを作成する詳細手順はこちらイメージとして、APIGatewayを動的グループに登録。 2022-02-14 01:18:48
golang Goタグが付けられた新着投稿 - Qiita [Golang] reflectパッケージの使い方を調べたら書く https://qiita.com/masakurapa/items/e1e49f9d6c864d97458f varxfloatvreflectValueOfxfmtPrintlnvCanSetfalse値が設定可能であるとするためには、ValueOfに変数xのポインタを渡す必要がある。 2022-02-14 01:50:04
技術ブログ Developers.IO Auth0の「プラン比較表」以外のプラン、環境タグの違い(更新中) https://dev.classmethod.jp/articles/auth0_plan_and_enviroment_tag_comparison/ compareplans 2022-02-13 16:03:12
海外TECH MakeUseOf Can't Download Files From Google Drive on Windows? Here's the Fix https://www.makeuseof.com/windows-google-drive-cant-download-files/ Can x t Download Files From Google Drive on Windows Here x s the FixCloud storage is only good if you can get the files back off of it Here s how to fix your Windows PC when it can t download files from Google Drive 2022-02-13 16:16:57
海外TECH DEV Community How to create a decent portfolio as a beginner? https://dev.to/jewelkeith_jk/how-to-create-a-decent-portfolio-as-a-beginner-225e How to create a decent portfolio as a beginner Finally after pouring blood and sweat on my portfolio I ve finished it and I got my sweet Responsive Web Design certificate from freeCodeCamp This was my first time building something big There were many important things I wish I knew before starting so my workflow was not a smooth experience at all But it let me learn the hard way as I had to search countless times for things I m not familiar with The valuable lessons I learned were too much to retain them all in my head and they all seemed to be jumbled So I decided to write them down and gladly share them with you all amazing human and extraterrestrial beings Step Create a designWhy Trust me it s bad to apply the styles on the spot then code them The result will turn to a combination of chocolate and raisins or pineapples on pizza think of foods you dislike I ve been there and have done that Having a design to follow will make the coding part easier or less hassle By the way I aim to be a front end developer so I highly prioritized design in my project But if you don t have the same goal as mine and you re not into design then you can just skip the first three sub steps However the knowledge is always available here for you to absorb Sub step Steal good thiefBefore anything else seize the chance to steal like an artist This is what artists usually advise people when practicing to draw better It means to look into other people s works and copy them But not totally Take a part of it that you find good then try to combine it with your style I think this can also be applied in web design Without looking at other people s cool portfolios I can t make a decent okay looking one I found them mostly on CodePen Dribble Awwwards and freeCodeCamp Forum How can someone create output without ideas as input Because ideas had to originate from something Sub step Create a meaningful personal logoTo officially start thinking that it s an actual personal portfolio is helpful It made me realize that the webpage s overall look would likely be based on my brand identity and I ve noticed this in amazing portfolios I ve taken as an inspiration So I created a logo that would represent myself Creating a meaningful one can help us avoid providing superficial answers like “I don t know why I added that it just looks good Here s my logo explanation JK is my first name initials The arrows in the background mean “moving forward because my motto is “I can move on greater things one step at a time It s not seen clearly but I customized the arrows colors starting from the right to slowly decrease or fade along to the left side I styled this because I think it relates to my thought that every day is a new day to live yesterdays are not to be dwelled in amp should be taken as lessons Also I think it shows as “progress The thin line between the first and second rows of arrows which is unclear too means “with moderation or “balance because I m constantly trying hard to strike a balance between my work and life like relationships and health Finally I chose the color yellow because according to the book “Designing User Interfaces by Hype it psychologically means enthusiastic and optimistic These are adjectives that can describe me or how I am Enthusiastic to learn more Optimistic about my future I m not yet a professional designer or even a good one I only used Canva way simple than photoshop as my design tool But I think a practice of building logos products or whatever they may be with profound meaning is a start to creating substantial and amazing ones By the way Canva is friendly to non designers or beginners There are thousands of tutorials on Youtube I find the Design with Canva channel to be the most useful The creators are staff from Canva itself Sub step Use a design tool or methodOne thing I wished for was learning Figma before I started building my project The following main steps could have been done easier through a design tool dedicated to designing web pages I ve created a public Youtube playlist where I ve compiled tutorial videos on how to use Figma from freeCodeCamp since they don t have one Figma is free to use unlike others and that s one of the reasons I m planning to study it Anyway in my case I was short on time and I had to show something as soon as possible to my parent So I just used Canva which was easy and simple for me to use But you can always go for the good old pencil and paper Sub step Apply the correct colors and typographyAfter having a logo I easily knew which colors I can use on different designs I can apply to my webpage Remember not to have a combination of colors that makes viewers squint while trying to look at your page Next was typography I chose Montserrat because I read an article entitled “Top Best Google Fonts So Far For by Nestify saying it s popular and easily readable I didn t go for less known fonts because they might not be always supported Based on a blog “The Responsive Website Font Size Guidelines by Erik D Kennedy px is the minimum font size but px is better as body text Try to have a look at Medium s Website as an example Sub step Make a rough layoutNow before starting to create the web design please go over step two Hastily jumping on web design before doing the sub steps from step two was my biggest mistake I got too excited to try designing and it actually turned out to be messy because I continuously add some things new that suddenly pop out in my head But having a rough layout in mind is good to have See how your content will be structured Quick sketches will suffice to view the big picture of your possible layout Keep in mind to be consistent though Step Do other major preparationsCreating the right story about yourself and knowing about screen sizes and breakpoints is so important to miss I promise the following will save you from making a gallon of coffee Sub step Create your flow of contentI created a “content flow or how I ll introduce myself from beginning to the end of my portfolio I made a draft talking about my projects myself skills education and contact I couldn t have done it without my friend Joshua Chu who is a Front end Web Engineer working for two international companies at this moment First he taught me how to create an introduction As you can see on my portfolio I briefly introduced myself by talking about my position the technologies I m currently learning and what kind of projects I m interested in It made me realize that this way potential employers can easily see who I am and what I do He said that you can always call yourself a junior web developer rather than an aspiring one Next he told me to create projects skills education and contact sections in order Since I looked up other portfolios I had an idea to add brief descriptions telling what my projects were all about and the languages I used to build them Then I shortly talked about my skills informing potential non tech clients since I also want to go freelancing For the education section I guided the visitors to go to my Class Central profile where I listed all of the learning resources I used Class Central is an awesome site where you can find countless lists or collections of quality courses that offer free certificates and this article is just one of the best they got “ Free Developer and IT Certifications by Rui Ma There you can also create a list of the courses degrees books videos and websites you took for learning web development or other relevant fields Lastly for the contact section I tried my best to convince potential visitors to talk with me by using adjective words such as meaningful and amazing which I think creates more impact I m not the best writer though but as a reader who encountered this style the writer usually captures my attention and gets me Sub step Collect the SVG imagesI thought adding illustrations to represent my texts was a good idea I created most of them by combining free shapes and icons in Canva Free to a point I can use them commercially based on their license conditions If you re curious how I edited my display picture I watched a tutorial from Design with Canva I converted all of my PNG images into SVG format because actual courses are talking about how they can help increase a website s performance Anyway I used the yellow waves background for the headings I thought they make good dividers I discovered it through Brett s WebGuide a collection of his web tools and resources Remember that naming files should be done either in a camel case FileName or with an underscore file name to avoid confusion There are other naming conventions too but these are the popular ones Funny because I mistakenly used both After having all these as preparations I went on making the page s layout for different screen sizes Sub step Know the possible breakpoints for media queriesNow this is one of my huge mistakes I didn t search and read about breakpoints for media queries I treated my inch laptop as the biggest screen size I forgot about the huge desktops because we don t have those and I m used to seeing people with laptops The largest one is x but my webpage was still a one column layout So I had to redo delete modify or add some code in my CSS to turn into a two column layout on a larger screen like px and up Indeed breakpoints for media queries were my breakdowns Sub step Drink fluid designI aimed for a fluid design and I hope you do too This means a design that transforms from one screen along with different screen sizes For example the placement of the navigation menu After reading an article “The large desktop experience in responsive design by Johannes Holl I learned an off canvas menu is a good feature to add in mobile and tablet screen sizes especially if the page s content is long While fixed top navigation bar on laptops and a left hand navigation bar on large desktops are nice to have so that visitors can easily look for anything I applied them all except for the left hand navigation bar through pure CSS only Another example is sizing the images which was difficult to do for me because I want them to have fixed sizes on different screens to satisfy my design preferences Therefore determining the breakpoints for the media queries is hugely dependent on your design But here were my breakpoints for my portfolio small screens mobile px pxmedium screens tablet px pxlarge screens laptops desktops px pxlarger screens huge desktop monitors px pxI based these off on guides from “Media Queries for Standard Devices by Chris Coyier at CSS tricks “What is the ideal screen size for responsive design by Shreya Bose and “What are the best screen sizes for responsive web design in by Shaun Anderson Step Finally create the web designSo you already got your logo color palette chosen fonts designs for separating sections styles rough sketches of your portfolio layout SVG images content flow and possible breakpoints for media queries Let s go create the web design As I ve said from step one my main advice is to keep it consistent I learned it from the ebook “Designing User Interface by Hype If you don t want to use Canva or Figma for some reason then you can just use a pencil and paper But it will be harder Learning one of those design tools is worth it because you can see your actual design better They let you create customized sizes based on your media query breakpoints so you can easily estimate how your designs will fit in particular screen size Step Start to codeAt this point there should be a final web design to follow The next logical thing to do is to code it Sub step Go through the Beta course at FCCDoing the new Responsive Web Design Beta course at freeCodeCamp was an awesome experience It helped me a lot to reinforce my learnings from different materials and finish my projects easier Quincy Larson the founder of FCC seriously meant that it was a major update to their curriculum according to his article Learn Responsive Web Design by Building Projects a Major freeCodeCamp Curriculum Update Sub step Install a text editorLearn how to code in a text editor like VS Code Lots of useful features like changing all the same words at once and the code can be viewed better than on CodePen I don t know about other Integrated Development Environments IDE However I learned from a valuable staff from freeCodeCamp through his reply to my post at the FCC forum that some people get problems with file management and hosting so it s okay for the meantime to do the project at an IDE like CodePen Sub step Overcome overwhelmingI truly respect his opinion I acknowledge and recognize that he s already an advanced developer and has experienced a lot in the field But I think if you find it overwhelming you can start or go slowly and there s nothing wrong with getting behind Everyone has their own pace Everyone does not start as a master Everyone has their strengths and weaknesses It takes patience So do baby steps Calming yourself down helps It let us think clearer Once we have our brain and heart at ease let s start learning from helpful tutorials There are introductory videos from VS Code itself It s not an easy task for everyone as each person has their own learning capacity So just go through the tutorials one by one or ask for help from people you know or in forums like from freeCodeCamp and The Odin Project TOP TOP is a free high quality learning platform like FCC Other amazing communities are willing to help you Believe me or should I say trust the process The time and effort to learn how to use an editor before starting any projects or just anything complicated as a beginner is super worth it Get over with the “overwhelming soon by slowly starting to get a hang of it I believe everyone can do it one step at a time with consistency persistence and faith in ourselves everyone and everything else that matters Mentioning TOP I remembered that their Foundations course has Installation as a preceding step to learning HTML They encourage and teach students to install and learn how to use code editors before starting to code I also remember taking the course Introduction to HTML taught by Colleen Van Lent She was so good at teaching and explaining it made me deep dive into web development Maybe one of the reasons it wasn t a big problem for me how to learn to use a code editor and do Github hosting because an amazing teacher did so well in introducing me to them Sub step Learn Github basicsAnother major thing to learn before learning HTML is how to use Github even just the basics Remember do it one step at a time If you re serious about learning web development like me then this is a must to learn I don t know it in depth yet but I started using it after like five days of working on my project I was able to share easily my portfolio with other people so it was also easy to get feedback from them Another reason is it shows how frequent our activities are like how often do we do our projects I think it s nice to show off to potential employers partners or clients that we re always grinding Sub step Maximize and minimize commentsLearn how to maximize and minimize the use of comments I learned to maximize the use of comments from Shay Howe s free online course “Learn how to code HTML and CSS I very much liked how more organized the code was when comments were introducing every group of styles for the main sections When there s a style effect or design I found complicated to do I used comments to explain how it worked So when I start to forget it and I want to use it in another project I can easily go back and understand how I did it Aside from that I used it to create a table of contents on the very top for easier CSS navigation Creating it made me understand the flow of my code better Lastly I added credits on the bottom part of my CSS to list all the cool resources I used for my project I honestly couldn t have done it without them so I m so grateful On the other hand I got the idea of minimizing comments from the same seasoned developer and staff at FCC He replied to my post at the forum and taught me that we shouldn t use comments too often because the main purpose of utilizing them is to communicate brief necessary information to possible readers of your code Brief means just a phrase or a few words Necessary in the sense that the comment summarizes or describes a section or a part of your whole code He mentioned about “self documenting code To quote his words “ It is a code that tells you what it is doing It is broken into logical chunks put in well named files formatted correctly and given meaningful names Well written code tells a story In the end he said to me that if using comments frequently can help me learn then I just have to continue doing it Anyway learning to self document code will just go prevalent when I go over JavaScript In conclusion if you re just a beginner like me who likes hundreds of lines of comments because CSS got too long making us go crazy a lot of times then I advise you to maximize and minimize Go to a copy of your CSS file then there you create your explanations through comments Your main CSS file should just have concise comments that are in a few words or phrases describing the main and sub sections of your code I really wished I knew this sooner Sub step Inspect detectHeavily use the inspect method because it allows us to change stylings on an element temporarily If we want it we can just copy and paste it into our editor It s tiring to jump between the browser and editor all the time Another reason is the easier fixing of styles I lost my mind when I tried a bunch of ways to find out why the styles aren t applying This has happened to me a lot But when I discovered that there s a line identifier in inspect element mode my life was saved again from brain explosion Yes beginner things Some possible reasons are the new style has lower specificity than the other old ones or the new style was added way before the old style so the old one will take effect Let s always remember that CSS cascades from top to bottom Sub step Apply Grid and FlexboxBut when should we use Grid or Flexbox In my case I used both of them in one design most of the time Like I used Grid and flexbox with everything from the navbar and buttons down to the layout like rearranging sections in a manner suitable to different screen sizes There are a bunch of articles or readings that explain when to use the two Sub step Avoid brain explosion with markers and whiteboardWhen coding the layout use markers and a whiteboard Yes they re old fashioned but still golden Paper pen and pencils will do too My mind was spinning when I was applying grid and flexbox When my brain has reached its limit like I can t illustrate clearly where sections are supposed to be I try to draw the layout on the board with markers This let me see and understand my layout code more While sketching it I can answer easily layout questions like “Which line of a column or row this element should go Sub step Appropriately name classesKnow how to name classes This is one of the things I really wished I knew before Maybe I knew but just forgot it Anyway this is important I tried my best to avoid adding classes to elements with a style name like lt div class red round button gt lt div gt You never know you might change the actual color or shape in the future Many articles are talking about this topic I found a good one on freeCodeCamp news articles “CSS Naming Conventions that Will Save You Hours of Debugging by Emmanuel Ohans Sub step Validate code from time to timeSometimes check HTML and CSS code at WC s validator It is quite helpful and scary to use Helpful because it let us know exactly where we possibly went wrong in our code so it s easy to fix Scary because of the chance of knowing there are possible errors and we have to redo modify or delete our code again I only knew my HTML warnings when I m so done with my project I found it difficult to modify my code again because I thought everything was intact So to avoid having the same bad situation check the code from time to time Especially if there are major updates Step Reflect on the learningsI know this is not necessary But for me writing the things I ve learned makes me learn better The knowledge is more engrained in my head and it forms a system that lets me pick up or reference back to any information with more ease On the other hand when I don t write them and I proceed to learn other major things they go crazy messy in my head and I likely forget the lessons sooner One main question I ask myself when I do a reflection is “What are the things I ve learned I try to form my explanations of the lessons to make them more impactful to me This is why I created this blog post As they say you ve never truly learned if you can t even explain it on your own Step Be proud and humbleLet s take pride in our achievement and share it with the world The portfolio project was no easy task to accomplish if one has taken it seriously If you re also the person who always targets quality when working then the process will become hard But that s what makes it fun It makes us work with deep meaning Not just for simply passing the course like how usually it is in reality We study and work because we d love to have our dream careers But sometimes studying and working because we simply or badly need money is okay too For me finding the job that suits you or you like takes privilege and luck However let s stay humble too Too much pride in oneself can hinder growth Helpful criticisms are blocked as they re hard to handle or take in Let s not forget what Aristotle said “The more you know the more that you don t know This is why I didn t add percentage bars of the skills like HTML and CSS because learning is forever We could master a part of it but I think we can t retain it forever and we ll eventually forget some of it And of course knowledge always progresses we can t always be at the top and catch up on all of them That s it for my super long blog post covering a whole bunch of lessons I learned doing responsive web design If you ve come to this point thank you so much for taking the time to read If you found some things valuable relatable or wrong feel free to leave a comment or message I d be so happy to know there s another human not ready yet for extraterrestrial being going through the same things and I ve been of help Also I m open to criticism I appreciate brutal honesty They help me learn better DisclaimerWhilst Jewel Keith the Author has made every effort to ensure that the information provided on jewelkeith jk hashnode dev the Site is correct it is not legal advice The Author is still a beginner and not yet a professional web designer or developer so the Site does not constitute professional and legal advice Under no circumstance shall the Author have any liability to you for any loss or damage of any kind incurred as a result of the use of the Site The Author does not vouch for third party sites or any third party services The Author does not accept any liability that might arise from accessing the data presented on this Site Your reliance on any information on the Site is solely at your own risk 2022-02-13 16:21:12
海外TECH DEV Community The best free alternative to Heroku https://dev.to/alexandrefreire/the-best-free-alternative-to-heroku-f60 The best free alternative to HerokuI recently discovered a new tool I was looking for an alternative that came closest to Heroku Personally I think Heroku is very good but very expensive I know it s not a simple VPS plus for me who live in Brazil is a high value I m referring to the hobby plan where it s possible to add a domain with SSL and prevent the application from sleeping So now Caprover is my equivalent alternative to Heroku I have full control over the infrastructure and I don t need technical knowledge to manage it With a VPS of only I can now upload my apps with the right to a custom domain with SSL without paying anything extra for it Currently my VPS is gb of ram it is used but it already has active applications in net core and a Mysql server with databases In other words there is still room for me to put more in this current structure And if I need to I can easily scale with the facilities offered by CapRover Now I will leave here an overview talking about Caprover remembering that I took this text from the documentation What s CapRover CapRover is an extremely easy to use app database deployment amp web server manager for your NodeJS Python PHP ASP NET Ruby MySQL MongoDB Postgres WordPress and etc applications It s blazingly fast and very robust as it uses Docker nginx LetsEncrypt and NetData under the hood behind its simple to use interface CLI for automation and scriptingWeb GUI for ease of access and convenienceNo lock in Remove CapRover and your apps keep working Docker Swarm under the hood for containerization and clusteringNginx fully customizable template under the hood for load balancingLet s Encrypt under the hood for free SSL HTTPS It s made for a developer who does not like spending hours and days setting up a server build tools sending code to server build it get an SSL certificate install it update nginx over and over again uses expensive services like Heroku Microsoft Azure and etc And is interested in reducing their cost by x Heroku charges month for their gb instance the same server is on DigitalOcean prefers to write more of showResults getUserList and not much of apt get install libstdc gt dev nullenjoys a platform where installing MySQL MongoDB and etc on their server is done by selecting from a dropdown and clicking on install likes to enjoy the power of Docker and nginx without having to learn them or deal with their settings scripts to make things work knows Docker and nginx inside out and enjoys a platform where basic operations are done yet allowing them to customize any specific settings if they need toAny LanguageDeploy apps in your own space Node js PHP Python Java literally any language SSLAbility to secure your services over HTTPS for FREE ability to automatically redirect HTTP to HTTPS One Click AppsDeploying one click apps is a matter of seconds MongoDB Parse MySQL WordPress Postgres and many more Easy DeployMany ways to deploy upload your source from dashboard use command line caprover deploy use webhooks and build upon git pushSimple InterfaceSimple interface for many docker operations exposing container ports to host setting up persistent directories instance count and etc Fully CustomizableOptionally fully customizable nginx config allowing you to enable HTTP specific caching logic custom SSL certs and etc Cluster ReadyAttach more nodes and create a cluster in seconds CapRover automatically configures nginx to load balance Increase ProductivityFocus on your apps Not the bells and whistles just to run your apps To finishCapRover is already available on the ocean digital store that is you will not even need to configure it just choose it inform your VPS configuration datacenter and finally create after that you will receive the fixed public IP of your VPS and the details to access the CapRover dashboard Finally I will leave here a link promoting Digital Ocean using my link you receive free to test the platform Get credits free to test Digital Ocean ServicesIf you have any questions you can ask in the comments and I ll answer as soon as possible 2022-02-13 16:09:10
海外TECH DEV Community Everything you need to know about Go-Lang - #2 https://dev.to/geektechpub/everything-you-need-to-know-about-go-lang-2-1p91 Everything you need to know about Go Lang You probably have heard about Google s cool language called Golang Golang is a statically typed compiled programming language designed at Google by Robert Griesemer Rob Pike and Ken Thompson It is similar to C C but with memory safety garbage collection structural typing and CSP style concurrency This is the continuation of Everything you need to know about Go Lang so if you have not read that then check that out first In the last part we have learned about Printing and Variables We ll start off from where we left ConstantsWe have learned about variables They are like a container which stores values of a type and can be reassigned with other values of the same type In short that means we can change the values of variables Now this might seen a good thing but often time we use variables whose value we don t change at all It s a good practice to define those as constants instead of variables To define a value as constant we use the const keyword Example const pi const e const sum pi econst keyword works pretty much the same as var except you cannot change it s value Using Constants when needed is a good practice and is beneficial to compiler sometimes We can also declare the type of constant the same way as we do to variables const aWord This is a constant whose content cannot be changed If you are coming from other languages you maybe thinking that go follows a convention of writing constant in UPPERCASE However in go constant name is generally written in camelCase instead of UPPERCASE The main reason is that variable or constant names which start with capital letter are those to be exported if your variable or constant will not be exported to then it s useless to start it with UPPERCASE Your TurnTry using constants in your previous programs of Golang instead of var for those whose values that aren t changing OperatorsIn Go there are various kinds of operator that used for certain functions These operators can be differentiated into Arithmetic Operator Relational Operator Logical Operator Bitwise Operator Assignment Operator Misc Operator Arithmetic OperatorWe have used Arithmetic Operator earlier Let s learn about them again Arithmetic Operators are used to perform mathematical operations like addition subtraction division multiplication and modulus remainder Addition The operator is to add two operand Subtraction The operator is to subtract two operand Multiplication The operator is to multiply two operand Division The operator is to divide two operand Dividing two integer returns an integer Modulus The operator return the remainders of two operand package mainimport fmt func main a b fmt Println Sum a b fmt Println Difference a b fmt Println Product a b fmt Println Quotient a b fmt Println Remainder a b Output Sum Difference Product Quotient Remainder Relational OperatorsRelational operators are used for comparison of two expressions Relational operators return true if the condition satisfies or else it returns false Here are the Relational operators Is equality operator it is used to check whether the left and right hand side operands are equal It returns true if both are equal or else returns false fmt Println fmt Println fmt Println Output truefalsetrue Is the not equal to It is used to check whether the two operands are different It returns true if they are not equal and returns false if they were is the not operator fmt Println fmt Println fmt Println Output truefalsetrue gt Known as greater than operator It is used to check whether the left hand is greater than the right hand side It returns true if the left hand side operand is greater than the right otherwise it returns false fmt Println gt fmt Println gt fmt Println gt Output falsefalsetrue gt Known as greater than equal to operator It is used to check whether the left hand side operand is greater than or equal to the right hand side It returns true if the left operand is greater than or equal to the right hand side or else returns false fmt Println gt fmt Println gt fmt Println gt Output falsetruetrue lt Known as lesser than operator It returns true if left hand side is lesser than the right hand side or else returns false fmt Println gt fmt Println gt fmt Println gt Output truefalsefalse lt Known as the lesser than equal to operator It returns true if the left hand side is lesser than or equal to the right hand side or else returns false fmt Println gt fmt Println gt fmt Println gt Output truetruefalse Logical OperatorThey are used to combine two or more conditions or to change the checking of the original statement The logical operators are amp amp The logical and operator returns true if all the conditions that are being joined by it are true fmt Println true amp amp false fmt Println gt amp amp gt Output falsetrue The logical or operator returns true if any of the conditions that it joins are true fmt Println true false fmt Println gt gt Output truetrue The logical not also mentioned as not operator earlier negates the result of the expression a fmt Println a fmt Println Output falsetrue Bitwise OperatorsIn Go language there are bitwise operators which work at bit level or used to perform bit by bit operations Bitwise operators works with binary Following are the bitwise operators amp bitwise AND Takes two numbers as operands and does AND on every bit The result of AND is only if both bits are bitwise OR Takes two numbers as operands and does OR on every bit of two numbers The result of OR is any of the two bits is bitwise XOR Takes two numbers as operands and does XOR on every bit of two numbers The result of XOR is if the two bits are different lt lt left shift Takes two numbers left shifts the bits of the first operand the second operand specifies the number of places to shift gt gt right shift Takes two numbers right shifts the bits of the first operand the second operand specifies the number of places to shift amp AND NOT This is the bit clear operator Assignment OperatorsAssignment operator is used to assign values to a variable The left hand side is the variable and the right hand side is the value Different types of Assignment Operators are Known as equals to It assigns the values at the right to the left hand side a Other form of writing a a where a is a variable a Other form of writing a a where a is a variable a Other form of writing a a where a is a variable a Other form of writing a a where a is a variable a Other form of writing a a where a is a variable a amp Other form of writing a a amp where a is a variable a Other form of writing a a where a is a variable a Other form of writing a a where a is a variable Conditional StatementsSuppose you ask your friend to buy you a lego space shuttle for yourself but if it isn t available then buy a lego star wars Over here you can see that we have a condition for us that if a lego space space shuttle then buy it or else buy a lego star wars In the world of computers programmer often face the same situation where they need to so check if a certain condition is true then execute one set of commands or else execute another set of commands In Go there are two types of Conditional statementsIf ElseSwitch Case If Elseif keyword is used to check whether one condition is true If the condition is true then it executes the code block Or else it doesn t execute that block The syntax of if is every simple if condition lt true statements Here s a simple example t trueif t lt true fmt Println The statement here is true Before I give any further examples we need to talk about operators The equality operator is use to check where that the left hand side and right hand side of the operation are equal This is not to be confused with the equal to which is used to assign values from right to the left Let s now see some more examples if lt true fmt Println Condition Output Condition true returns true Let s now see another example where our condition isn t true and see the output if lt false fmt Println Condition OutputAs we see we receive no output as our condition didn t satisfy and hence didn t enter the block In the last example we saw how if our condition doesn t satisfied then it doesn t print anything If we want do execute some other statements when the condition doesn t satisfy we can use else keyword right next to the closing braces of the if Here s an example if fmt Println Condition true else fmt Println Condition true Output Condition trueWe can also use else if statement if we want to add another condition Example var a b intfmt Scanf v v amp a amp b takes user input and splits it by spaceif a gt fmt Println More than else if a fmt Println Equal to else fmt Println Less than You might want to check about different operators as it will be helpful in the future Switch case When you have too many conditions to check from using if else if else might be time consuming so a better and more efficient way would be using switch case Here s the syntax of switch case switch value case value case value default Switch can compare values and executes the piece of code of that case This is especially helpful during menus where user input depends on what to do var v intfmt Scan amp v takes user inputswitch v case fmt Println case fmt Println case fmt Println case fmt Println default fmt Prinln Other value This block of code compares the value of v with the values written after case and before Now if you are coming from other languages then you must be thinking the above code is technically wrong as if any of the cases gets executed those below it will get executed too known as fall through error Fall through error is an error that causes the fall of control of the program It is common in other languages like C C Java etc However in Go fall through isn t the default We can create fall through explicitly by using the fallthrough keyword however Like switch case fmt Println Hello fallthrough case fmt Println Gophers fallthrough default fmt Println Hi OutputHelloGophersHiFall through was actually useful when multiple statements had the same block of statements to execute However in Golang to counter the problem of not having fall through they introduced checking of multiple values in one case Like switch v case fmt Println odd case fmt Println even default fmt Prinln None Now depending on the value of v the program will print odd even or none This is a faster way than the use of fallthrough and also easier to write NestedYou have multiple conditional statements inside another conditional statement Your TurnTake two variable assign values to them in such a way that the first one is greater than the second one Divide them both must be integer Now If your result is less than find out whether the first number is greater than and less than else check if the difference between the number is divisible by or not If a number is divisible by another number then the remainder between them is Take four variables and assign them with random letters and check how many vowels are there If there are none print an appropriate message LoopSometimes as a programmer you want your statement to run over and over again until the condition gets satisfied So today we shall learn about loops Now if you are coming from other languages you may think there are two or three for older languages types of loops In Golang there s only one That is everyone s favorite for loop For loop has different syntax you can use the right one depending on what you need The most basic one is the following var ifor initialize check increment decrement change in value statements So we first have to initialize it with some value Then we have to check whether a condition is true so that the loop runs and then change the value The statements in a loop with runs continuously until the condition is false when for the next iteration the condition becomes false the loop will not run Suppose we want to print numbers from to we can easily do that using loops for i i lt i fmt Println i OutputWe can omit the initializing or the increment decrement but we have to initialize the value for the variable we use in loop or else we will get an error Also if we don t change the value of that variable the loop might run forever and never end generation some behavior we don t want var i for i lt i fmt Println i var j for j lt fmt Println j The first loop will print the values from to and the second loop from to Golang offer some syntactical sugar for us if we don t initialize and increment decrement as the same line as for loop declaration we can omit the semi colons Please don t if we omit both then only we can use this This makes for loop very similar to while loop We shall use this syntax of for loop when we don t know the number of iterations var i for i lt fmt Println i Another import function is the ranged for It is used to get the index number and the uses with it We shall understand better when we deal with string and arrays slices for i n range Hello fmt Println i n Output H E L L O We shall use more of this function in the future NestedYou can write a for loop inside another for loop for i i lt i for j j lt j Your TurnTry to print this patter Hint You have to use Print and Println functions Remember to use nested loops StructA structure or struct in Golang is a user defined type that allows to group combine items of possibly different types into a single type Any real world entity which has some set of properties fields can be represented as a struct This concept is generally compared with the classes in object oriented programming It can be termed as a lightweight class that does not support inheritance but supports composition Suppose you define a struct which contains your address these shall be the variables inside it House Name string Street Name String City String Pincode int Let s define our struct Till now we were declaring function inside our main function but struct definitions are generally done outside main function package mainimport fmt type Address struct houseName string streetName string city string pincode int func main Now let s allocate values into it and print it To allocate values we must always pass them in order or else we can assign it as name value Example package mainimport fmt type Address struct houseName string streetName string city string pincode int func main var i Address houseName City Mall streetName MG Road city Delhi pincode fmt Println i Output City Mall MG Road Delhi Another way is without using the name of the variable package mainimport fmt type Address struct houseName string streetName string city string pincode int func main var i Address City Mall MG Road Delhi fmt Println i Output City Mall MG Road Delhi Now what if you want to access any fields from the struct how would you do so We can do so by using dot notation followed by the name of the fields package mainimport fmt type Address struct houseName string streetName string city string pincode int func main var i Address houseName City Mall streetName MG Road city Delhi pincode fmt Println i city Output Delhi Your TurnMake a struct called Birds in it create fields Name string CanFly bool isRare bool Age int In main function pass the name of a bird pass true and false if it can fly or is it rare and pass the age of it and print the struct If canFly or isRare is false then print an appropriate message Hint Use if else to check SummaryIn this post we have learned how to declare constants how to check conditions and perform operations we have learned how to loop a set of statements depending on our need and then we closed it all up with structures We have also learned about different operators In the next part we shall learn more about structs functions data type and pointers Thanks for ReadingFollow us on Twitter Until we meet again Arindol Sarkar 2022-02-13 16:05:55
海外TECH Engadget Advocacy group sues Nigerian government over failure to publish Twitter agreement https://www.engadget.com/serap-sues-nigeria-twitter-agreement-165215096.html?src=rss Advocacy group sues Nigerian government over failure to publish Twitter agreementA legal rights group has sued Nigerian President Muhammadu Buhari to force his government to publish the agreement that allowed Twitter to return to the West African country last month following a seven month ban In June Nigeria suspended Twitter after the company removed a tweet from President Buhari that threatened punishment for local dissidents At the time Twitter said it was “deeply concerned by the country s actions noting it considered an open internet as “an essential human right in modern society On January th Nigeria lifted the ban after the company agreed among other conditions to open a local office and work with the government to co develop a code of conduct On Sunday the Socio Economic Rights and Accountability Project SERAP filed a lawsuit with the country s High Court to compel President Buhari and Information Minister Lai Mohammed to publish a copy of that agreement “Publishing the agreement with Twitter would promote transparency accountability and help to mitigate threats to Nigerians rights online as well as any interference with online privacy and freedom of expression SERAP said “Any agreement with social media companies must meet the constitutional requirements of legality necessity proportionality and legitimacy SERAP said it had attempted to obtain a copy of the agreement through a freedom of information request It s suing partly because the government came back with an “unsatisfactory response to that request Minister Mohammed allegedly told the group details on the arrangement were already “in the public space and did not forward a copy of its terms We ve reached out to Twitter for comment As Reuters notes SERAP was among several groups that went to court to fight Nigeria s ban of Twitter The Court of Justice of the Economic Community of West African States is scheduled to decide whether to rule on that case this week 2022-02-13 16:52:15
金融 ◇◇ 保険デイリーニュース ◇◇(損保担当者必携!) 保険デイリーニュース(02/14) http://www.yanaharu.com/ins/?p=4834 第一生命 2022-02-13 16:56:53
ニュース BBC News - Home Hackney Wick bar floor collapse: Thirteen people injured https://www.bbc.co.uk/news/uk-england-london-60364090?at_medium=RSS&at_campaign=KARANGA london 2022-02-13 16:44:17
ニュース BBC News - Home Evesham Rugby Club player Jack Jeffery dies after match injury https://www.bbc.co.uk/news/uk-england-hereford-worcester-60368630?at_medium=RSS&at_campaign=KARANGA evesham 2022-02-13 16:53:31
ニュース BBC News - Home Liverpool win at Burnley for fourth straight win https://www.bbc.co.uk/sport/football/60276483?at_medium=RSS&at_campaign=KARANGA manchester 2022-02-13 16:13:18
ニュース BBC News - Home Wolves beat fragile Spurs to move within three points of fourth-placed West Ham https://www.bbc.co.uk/sport/football/60276484?at_medium=RSS&at_campaign=KARANGA Wolves beat fragile Spurs to move within three points of fourth placed West HamWolves beat Tottenham to move above them in the table and inflict a third successive Premier League defeat on Antonio Conte s side 2022-02-13 16:16:43
ニュース BBC News - Home Trippier earns Newcastle win over Villa to move four points clear of drop zone https://www.bbc.co.uk/sport/football/60276485?at_medium=RSS&at_campaign=KARANGA Trippier earns Newcastle win over Villa to move four points clear of drop zoneNewcastle United move four points clear of the relegation zone with a third straight win as Kieran Trippier s free kick sinks Aston Villa 2022-02-13 16:37:33
ニュース BBC News - Home Weir scores late stunner as City beat United in Manchester derby https://www.bbc.co.uk/sport/football/60276453?at_medium=RSS&at_campaign=KARANGA manchester 2022-02-13 16:43:24

コメント

このブログの人気の投稿

投稿時間:2021-06-17 22:08:45 RSSフィード2021-06-17 22:00 分まとめ(2089件)

投稿時間:2021-06-20 02:06:12 RSSフィード2021-06-20 02:00 分まとめ(3871件)

投稿時間:2021-06-17 05:05:34 RSSフィード2021-06-17 05:00 分まとめ(1274件)