{"@attributes":{"version":"2.0"},"channel":{"title":"DEV Community: Sergiu Mure\u015fan","description":"The latest articles on DEV Community by Sergiu Mure\u015fan (@codevault).","link":"https:\/\/dev.to\/codevault","image":{"url":"https:\/\/media2.dev.to\/dynamic\/image\/width=90,height=90,fit=cover,gravity=auto,format=auto\/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F93006%2F22a019f6-e065-42ed-a963-94f379add928.jpg","title":"DEV Community: Sergiu Mure\u015fan","link":"https:\/\/dev.to\/codevault"},"language":"en","item":[{"title":"Compile and run C\/C++ code using Notepad++","pubDate":"Sun, 27 Oct 2019 14:44:01 +0000","link":"https:\/\/dev.to\/codevault\/compile-and-run-c-code-using-notepad-1m3a","guid":"https:\/\/dev.to\/codevault\/compile-and-run-c-code-using-notepad-1m3a","description":"<p>For compiling and running using MinGW:<br>\n<\/p>\n\n<div class=\"highlight\"><pre class=\"highlight plaintext\"><code>npp_save\ncd \"$(CURRENT_DIRECTORY)\"\ngcc -o \"$(NAME_PART).exe\" \"$(FULL_CURRENT_PATH)\"\n\"$(NAME_PART).exe\"\n<\/code><\/pre><\/div>\n\n\n\n<p>For compiling and running using Visual C:<br>\n<\/p>\n\n<div class=\"highlight\"><pre class=\"highlight plaintext\"><code>npp_save\ncd \"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Auxiliary\\Build\"\nvcvarsall.bat x64 &amp;&amp; cl \"$(FULL_CURRENT_PATH)\" \/Fo$(CURRENT_DIRECTORY)\\ \/link \/out:\"$(CURRENT_DIRECTORY)\\$(NAME_PART).exe\"\ncd $(CURRENT_DIRECTORY)\n\"$(NAME_PART).exe\"\n<\/code><\/pre><\/div>\n\n\n\n<p>More info on Visual C vcvars scripts:<br>\n<a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/build\/building-on-the-command-line?view=vs-2019\">https:\/\/docs.microsoft.com\/en-us\/cpp\/build\/building-on-the-command-line?view=vs-2019<\/a><\/p>\n\n","category":["notepad","compile","c","cpp"]},{"title":"Faster code editing in Visual Studio Code","pubDate":"Mon, 19 Nov 2018 18:01:40 +0000","link":"https:\/\/dev.to\/codevault\/faster-code-editing-in-visual-studio-code-lge","guid":"https:\/\/dev.to\/codevault\/faster-code-editing-in-visual-studio-code-lge","description":"<p>Here are some features that you often forget when you are trying to make a quick change and taking longer to do so. Code editing features are the ones that will help you the most because, well, most of the time you are writing code. Let's get started:<\/p>\n\n<h2>\n  \n  \n  1) Copy\/cut whole line\n<\/h2>\n\n<h2>\n  \n  \n  <code>CTRL<\/code> + <code>C<\/code> and <code>CTRL<\/code> + <code>X<\/code>\n<\/h2>\n\n<p>Okay okay, I know you probably know about these shortcuts since you were 5 but there is a spin to it in VSCode (and some other IDEs). Without selecting anything, if you use <code>CTRL<\/code> + <code>C<\/code> or <code>CTRL<\/code> + <code>X<\/code> it will copy and cut, respectively the whole current line.<\/p>\n\n<p>This saves you a total of 3 keystrokes (<code>HOME<\/code>, <code>SHIFT<\/code> + <code>END<\/code> and lastly <code>CTRL<\/code> + <code>C<\/code> or <code>CTRL<\/code> + <code>X<\/code>). This blends in well with code editing since you usually work at the level of lines in a source file.<\/p>\n\n<p>Example video:<br>\n<\/p>\n<div class=\"instagram-position\">\n  <iframe id=\"instagram-liquid-tag\" src=\"https:\/\/www.instagram.com\/p\/BqPtRdrlOO4\/embed\/captioned\/\">\n  <\/iframe>\n  \n<\/div>\n\n\n<h2>\n  \n  \n  2) Move\/duplicate line above\/below\n<\/h2>\n\n<h2>\n  \n  \n  <code>ALT<\/code> + <code>\u2191<\/code>\/<code>\u2193<\/code> and <code>SHIFT<\/code> + <code>ALT<\/code> + <code>\u2191<\/code>\/<code>\u2193<\/code>\n<\/h2>\n\n<p>This is self explanatory. Moving\/duplicating a line will be faster than copy\/cut <br>\nand pasting the whole line.<\/p>\n\n<p>Example video:<br>\n<\/p>\n<div class=\"instagram-position\">\n  <iframe id=\"instagram-liquid-tag\" src=\"https:\/\/www.instagram.com\/p\/BqSapiJFHno\/embed\/captioned\/\">\n  <\/iframe>\n  \n<\/div>\n\n\n<h2>\n  \n  \n  3) Toggle comment on line (<code>CTRL<\/code> + <code>\/<\/code>)\n<\/h2>\n\n<p>This really is much faster than commenting lines manually, especially when you have many lines to comment since it automatically comments all lines that are in a selection (whether or not you have the whole line selected).<\/p>\n\n<p>There are shortcuts for commenting\/uncommenting lines (<code>CTRL<\/code> + <code>K<\/code> with <code>CTRL<\/code> + <code>C<\/code> and <code>CTRL<\/code> + <code>K<\/code> with <code>CTRL<\/code> + <code>U<\/code>) but, aside from their cumbersome default shortcuts that can be changed I rarely find myself using them. Have you found a use case for this?<\/p>\n\n<p>Example video:<br>\n<\/p>\n<div class=\"instagram-position\">\n  <iframe id=\"instagram-liquid-tag\" src=\"https:\/\/www.instagram.com\/p\/BqXHLu2llTK\/embed\/captioned\/\">\n  <\/iframe>\n  \n<\/div>\n\n\n<h2>\n  \n  \n  4) Indenting lines (<code>CTRL<\/code> + <code>[<\/code>\/<code>]<\/code>)\n<\/h2>\n\n<p>I have the bad habit of hitting <code>HOME<\/code> and then <code>TAB<\/code> or <code>SHIFT<\/code> + <code>TAB<\/code> to indent\/un-indent a line. This feature saves you the hassle of going to the start of the line and has a very intuitive default shortcut.<\/p>\n\n<p><em>Note here: <code>TAB<\/code> and <code>SHIFT<\/code> + <code>TAB<\/code> works the same way if you have more than one line selected<\/em><\/p>\n\n<p>Example video:<br>\n<\/p>\n<div class=\"instagram-position\">\n  <iframe id=\"instagram-liquid-tag\" src=\"https:\/\/www.instagram.com\/p\/BqUxXZrFXMi\/embed\/captioned\/\">\n  <\/iframe>\n  \n<\/div>\n\n\n<h2>\n  \n  \n  End\n<\/h2>\n\n\n<div class=\"ltag__user ltag__user__id__\">\n    <div class=\"ltag__user__pic\">\n      <img src=\"https:\/\/media2.dev.to\/dynamic\/image\/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto\/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F99mvlsfu5tfj9m7ku25d.png\" alt=\"[deleted user] image\">\n    <\/div>\n  <div class=\"ltag__user__content\">\n    <h2>[Deleted User]<\/h2>\n    <div class=\"ltag__user__summary\">\n      \n    <\/div>\n  <\/div>\n<\/div>\n\n\n<p>Thanks to giancarlopro for suggesting a post about these features!<\/p>\n\n<ul>\n<li>Did you know about the copy\/cut whole line shortcut?<\/li>\n<li>What other features would you like to see next?<\/li>\n<\/ul>\n\n","category":["productivity","devhelp","webdev","vscode"]},{"title":"Code navigation in Visual Studio Code","pubDate":"Fri, 16 Nov 2018 06:49:43 +0000","link":"https:\/\/dev.to\/codevault\/code-navigation-in-visual-studio-code-2dg","guid":"https:\/\/dev.to\/codevault\/code-navigation-in-visual-studio-code-2dg","description":"<p>The navigation features look straightforward, but, at first glance, they don't seem very useful. So, for this part of the tutorial I suggest you one thing:<\/p>\n\n<p><strong>Take the mouse from the side it's currently on and move it to the other side of the keyboard<\/strong><\/p>\n\n<p>This will force you to start using the shortcuts I am about to tell you, believe me, after using them for a few hours you will regret not knowing about them before. This is how much more efficient it makes you!<\/p>\n\n<h2>\n  \n  \n  1) Back \/ Forward (<code>ALT<\/code> + <code>\u2190<\/code> \/ <code>\u2192<\/code>)\n<\/h2>\n\n<p>By far, the best way to jump from a part of a file to another is through this shortcut. Some may argue that <code>CTRL<\/code> + <code>TAB<\/code> does the same thing although this is a more complete feature since it retains history in places on the same file and the history is retained even after using this shortcut (you can go back and forth without changing the actual history)<\/p>\n\n\n<div class=\"instagram-position\">\n  <iframe id=\"instagram-liquid-tag\" src=\"https:\/\/www.instagram.com\/p\/BqFDG8MFjMg\/embed\/captioned\/\">\n  <\/iframe>\n  \n<\/div>\n\n\n<h2>\n  \n  \n  2) Open previous file (<code>CTRL<\/code> + <code>TAB<\/code>)\n<\/h2>\n\n<p>I am sure many know about this feature so I won't get into detail here. All you need to know is, similarly to the Back \/ Forward feature, this let's you navigate to\/from previously viewed files.<\/p>\n\n<p>One important note here, you can also navigate forward with (<code>CTRL<\/code> + <code>SHIFT<\/code> + <code>TAB<\/code>).<\/p>\n\n\n<div class=\"instagram-position\">\n  <iframe id=\"instagram-liquid-tag\" src=\"https:\/\/www.instagram.com\/p\/BqKDm5ggP5b\/embed\/captioned\/\">\n  <\/iframe>\n  \n<\/div>\n\n\n<h2>\n  \n  \n  3) Navigate to next error (<code>F8<\/code>)\n<\/h2>\n\n<p>When refactoring, this feature is one of the best. You can hit <code>F8<\/code> and fix every single error until you run out and have finished refactoring. It's simply a breeze to fix errors using this.<\/p>\n\n<p>Similar to the previous one you can navigate backwards (to the previous error) using <code>SHIFT<\/code> + <code>F8<\/code>.<\/p>\n\n<p>One issue with this feature is that there is no way to navigate on only the errors or only the warnings. Do you guys know of any way to customize this?<\/p>\n\n\n<div class=\"instagram-position\">\n  <iframe id=\"instagram-liquid-tag\" src=\"https:\/\/www.instagram.com\/p\/BqMnsyClb3t\/embed\/captioned\/\">\n  <\/iframe>\n  \n<\/div>\n\n\n<h2>\n  \n  \n  End\n<\/h2>\n\n<p>And that is it for code navigation, I will later on, create a post about navigating through the editor for completeness sake.<\/p>\n\n<ul>\n<li>Have you ever tried unplugging your mouse and work only from your keyboard?<\/li>\n<li>Which of the shortcuts have you learned about in this post?<\/li>\n<\/ul>\n\n","category":["devhelp","webdev","productivity"]},{"title":"Search features in Visual Studio Code","pubDate":"Sun, 11 Nov 2018 11:18:50 +0000","link":"https:\/\/dev.to\/codevault\/search-features-in-visual-studio-code-2a0c","guid":"https:\/\/dev.to\/codevault\/search-features-in-visual-studio-code-2a0c","description":"<p>Did you know that, aside from searching for strings (in the current document or in all documents) there are a total of <strong>four<\/strong> other search features inside Visual Studio Code? Let's take a look!<\/p>\n\n<h2>\n  \n  \n  1) Search file (<code>CTRL<\/code> + <code>P<\/code>)\n<\/h2>\n\n<p>This is simple, if you know the name of the file, there is no longer a need to go into the file explorer and select. Simply type in the full or partial name and VSCode will automatically look into your current workspace and display the ones that contain the name you just wrote (at the top of the list would be the files already open).<\/p>\n\n<p>Example video:<br>\n<\/p>\n<div class=\"instagram-position\">\n  <iframe id=\"instagram-liquid-tag\" src=\"https:\/\/www.instagram.com\/p\/Bo32dReBYum\/embed\/captioned\/\">\n  <\/iframe>\n  \n<\/div>\n\n\n<h2>\n  \n  \n  2) Search for symbol (<code>CTRL<\/code> + <code>T<\/code>)\n<\/h2>\n\n<p>If you know, for example, the name of a private function but you don't exactly know its location, this can come in handy. Simply hit the shortcut (or open the command pallete and prefix it with <code>#<\/code>) and type in the function's name, you will get a list of symbols preceded by their file location.<\/p>\n\n<p>Example video:<br>\n<\/p>\n<div class=\"instagram-position\">\n  <iframe id=\"instagram-liquid-tag\" src=\"https:\/\/www.instagram.com\/p\/Bo_dbVbhTyz\/embed\/captioned\/\">\n  <\/iframe>\n  \n<\/div>\n\n\n<h2>\n  \n  \n  3) Search local symbol (<code>CTRL<\/code> + <code>SHIFT<\/code> + <code>O<\/code>)\n<\/h2>\n\n<p>Same as above, just in the current source file. You can also open the command pallete and type <code>@<\/code>.<\/p>\n\n<p>A bonus feature from the one above is, if you prefix the search with <code>:<\/code> you will group them by symbol type so it's easier to find if you don't know its full name.<\/p>\n\n<p>Example video:<br>\n<\/p>\n<div class=\"instagram-position\">\n  <iframe id=\"instagram-liquid-tag\" src=\"https:\/\/www.instagram.com\/p\/BqCYkGyh_Fk\/embed\/captioned\/\">\n  <\/iframe>\n  \n<\/div>\n\n\n<h2>\n  \n  \n  4) Search by reference (<code>SHIFT<\/code> + <code>F12<\/code>)\n<\/h2>\n\n<p>People should know about this feature since in VSCode it is implemented in such a way that it makes searching for references very fast. If you hit the shortcut on a symbol you will get a \"popup\" that, not only displays all the places the symbol is used, but also shows you a ~15 line snippet of <strong>how<\/strong> it is used so you don't have to actually go to the file and check if that is the reference you want. <\/p>\n\n<p>We are using Visual Studio 2013 and not having this feature on the backend slows us down quite a lot. This is one feature that makes VSCode feel like an ease to work with.<\/p>\n\n<p>Example video:<br>\n<\/p>\n<div class=\"instagram-position\">\n  <iframe id=\"instagram-liquid-tag\" src=\"https:\/\/www.instagram.com\/p\/Bp_sb5RliEp\/embed\/captioned\/\">\n  <\/iframe>\n  \n<\/div>\n\n\n<h2>\n  \n  \n  End\n<\/h2>\n\n<ul>\n<li>Have you found these useful? Try using at least one of the ones you didn't know about, it is going to improve your productivity a bunch!<\/li>\n<li>Are there some features I missed related to searching?<\/li>\n<li>Is there a feature that VSCode missed implementing related to searching?<\/li>\n<\/ul>\n\n","category":["productivity","devtips","webdev","vscode"]},{"title":"Multi-cursor in Visual Studio Code","pubDate":"Fri, 09 Nov 2018 19:42:13 +0000","link":"https:\/\/dev.to\/codevault\/multi-cursor---visual-studio-code-productivity-features---part-1-1gha","guid":"https:\/\/dev.to\/codevault\/multi-cursor---visual-studio-code-productivity-features---part-1-1gha","description":"<p>Multi-cursor is one of those features that impresses many non-programmers but, in our world, this is quite an old one. Many people know about this but I think they are not using it to its full potential. So here is what you can do with multi-cursor:<\/p>\n\n<h3>\n  \n  \n  1) Add multi-cursor below\/above (<code>CTRL<\/code>+<code>ALT<\/code>+<code>\u2191<\/code>\/<code>\u2193<\/code>)\n<\/h3>\n\n<p>This is a simple functionality but it's hidden by its strange shortcut that also turns your screen upside-down. I always re-bind this functionality to <code>CTRL<\/code>+<code>SHIFT<\/code>+<code>\u2191<\/code>\/<code>\u2193<\/code> so it's the same with Visual Studio.<\/p>\n\n<p>Example video:<br>\n<\/p>\n<div class=\"instagram-position\">\n  <iframe id=\"instagram-liquid-tag\" src=\"https:\/\/www.instagram.com\/p\/Bp61pn7lfe6\/embed\/captioned\/\">\n  <\/iframe>\n  \n<\/div>\n\n\n<h3>\n  \n  \n  2) Add multi-cursor to next occurrence (<code>CTRL<\/code>+<code>D<\/code>)\n<\/h3>\n\n<p>Simply select a piece of text, and when you use this shortcut it will add another cursor to the next occurrence of the selected text, after that, you can edit both at once. This will help you edit code real fast.<\/p>\n\n<p>Example video:<br>\n<\/p>\n<div class=\"instagram-position\">\n  <iframe id=\"instagram-liquid-tag\" src=\"https:\/\/www.instagram.com\/p\/Boj19i6BUXt\/embed\/captioned\/\">\n  <\/iframe>\n  \n<\/div>\n\n\n<h3>\n  \n  \n  3) Add multi-cursor to all occurrences (<code>CTRL<\/code>+<code>SHIFT<\/code>+<code>L<\/code>)\n<\/h3>\n\n<p>Same mechanism as above but instead of just adding a cursor to the next occurrence it adds it to all the occurrences in the current file. This can be a really quick and flexible find and replace.<\/p>\n\n<p>Example video:<br>\n<\/p>\n<div class=\"instagram-position\">\n  <iframe id=\"instagram-liquid-tag\" src=\"https:\/\/www.instagram.com\/p\/Bo1RAMdB-l1\/embed\/captioned\/\">\n  <\/iframe>\n  \n<\/div>\n\n\n<h3>\n  \n  \n  4) Undo last cursor operation (<code>CTRL<\/code>+<code>U<\/code>)\n<\/h3>\n\n<p>This one I didn't know about for a long time. It's simple and straightforward. If you accidentally add too many cursors you can undo that operation using this shortcut. It will help you from the hassle of going aaaallll the way back and re-selecting only the occurrences you need.<\/p>\n\n<p>Example video:<br>\n<\/p>\n<div class=\"instagram-position\">\n  <iframe id=\"instagram-liquid-tag\" src=\"https:\/\/www.instagram.com\/p\/Bp9SNryFkQ_\/embed\/captioned\/\">\n  <\/iframe>\n  \n<\/div>\n\n\n<p>And that's it! They are fairly simple and straightforward features that you can 100% customize their key binding.<\/p>\n\n<p>I hope this helped you, I know it helped me!<\/p>\n\n<ul>\n<li>What features do you think are worth checking out next?<\/li>\n<li>Do you know anything I missed relating this feature?<\/li>\n<\/ul>\n\n","category":["productivity","devhelp","webdev"]},{"title":"Visual Studio Code productivity features - Intro","pubDate":"Fri, 09 Nov 2018 19:41:57 +0000","link":"https:\/\/dev.to\/codevault\/visual-studio-code-productivity-series---intro-27hp","guid":"https:\/\/dev.to\/codevault\/visual-studio-code-productivity-series---intro-27hp","description":"<p>First off, what is the goal of this series?<\/p>\n\n<p>Ever since I laid eyes on the first featureful IDE I wanted to use it at its full potential. I would take the list of all shortcuts in the editor and start reading and trying to memorize them. It is safe to say that this did not work out.<\/p>\n\n<p>Nowadays, editors have such a large amount of features that it is very difficult to learn them all in one go. This series is just for that. Helping <strong>you<\/strong> understand and hopefully start using these features so you can do your <strong>job faster<\/strong> without impacting code quality. <\/p>\n\n<p><em>For each feature there will be small videos that demonstrate what it does. Also, this is the first time using the series feature on this site, hope it will all work out<\/em><\/p>\n\n<p>See you on the other side! Let's get started!<\/p>\n\n","category":["productivity","webdev","devhelp"]},{"title":"What are your snippets?","pubDate":"Mon, 05 Nov 2018 04:20:28 +0000","link":"https:\/\/dev.to\/codevault\/what-are-your-snippets-35kp","guid":"https:\/\/dev.to\/codevault\/what-are-your-snippets-35kp","description":"<p>Ever since the advent of minimalistic IDEs such as Atom, Sublime and Visual Studio Code, user snippets have gotten more and more popular due to their helpful productivity boost which makes some boilerplate code feel like simply filling in the blanks of an online form.<\/p>\n\n<p><strong>So then, what are your most useful snippets and why (for any language)? Let's help each other find some helpful snippets or ideas for new ones! Comment yours down below!<\/strong><\/p>\n\n<p>I'll start:<\/p>\n\n<p><em>$0 is where the cursor will land once the snippet has been placed<\/em><\/p>\n\n<ul>\n<li>\n<code>then<\/code> and <code>fail<\/code> (or <code>catch<\/code>) snippets for working with promises:\n<\/li>\n<\/ul>\n\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight javascript\"><code><span class=\"c1\">\/\/ prefix: '.th'<\/span>\n<span class=\"p\">.<\/span><span class=\"nf\">then<\/span><span class=\"p\">(<\/span><span class=\"kd\">function<\/span><span class=\"p\">(<\/span><span class=\"nx\">res<\/span><span class=\"p\">)<\/span> <span class=\"p\">{<\/span>\n    <span class=\"nx\">$0<\/span>\n<span class=\"p\">})<\/span>\n<\/code><\/pre>\n\n<\/div>\n\n\n\n\n\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight javascript\"><code><span class=\"c1\">\/\/ prefix: '.fa'<\/span>\n<span class=\"p\">.<\/span><span class=\"nf\">fail<\/span><span class=\"p\">(<\/span><span class=\"kd\">function<\/span><span class=\"p\">(<\/span><span class=\"nx\">err<\/span><span class=\"p\">)<\/span> <span class=\"p\">{<\/span>\n    <span class=\"nx\">$0<\/span>\n<span class=\"p\">})<\/span>\n<\/code><\/pre>\n\n<\/div>\n\n\n\n\n\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight javascript\"><code><span class=\"c1\">\/\/ prefix: '.ca'<\/span>\n<span class=\"p\">.<\/span><span class=\"k\">catch<\/span><span class=\"p\">(<\/span><span class=\"kd\">function<\/span><span class=\"p\">(<\/span><span class=\"nx\">err<\/span><span class=\"p\">)<\/span> <span class=\"p\">{<\/span>\n    <span class=\"nx\">$0<\/span>\n<span class=\"p\">})<\/span>\n<\/code><\/pre>\n\n<\/div>\n\n\n\n<ul>\n<li>Often used HTML inputs. Here is the one with the most boilerplate on it:\n<\/li>\n<\/ul>\n\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight html\"><code><span class=\"c\">&lt;!-- prefix: 'idate' --&gt;<\/span>\n<span class=\"nt\">&lt;div<\/span> <span class=\"na\">class=<\/span><span class=\"s\">\"input-group\"<\/span><span class=\"nt\">&gt;<\/span>\n    <span class=\"nt\">&lt;span<\/span> <span class=\"na\">class=<\/span><span class=\"s\">\"input-group-addon\"<\/span><span class=\"nt\">&gt;<\/span>$1<span class=\"nt\">&lt;\/span&gt;<\/span>\n    <span class=\"nt\">&lt;input<\/span> <span class=\"na\">class=<\/span><span class=\"s\">\"form-control\"<\/span> <span class=\"na\">datetimepicker<\/span> <span class=\"na\">options=<\/span><span class=\"s\">\"dateOptions\"<\/span> <span class=\"na\">ng-model=<\/span><span class=\"s\">\"$2\"<\/span><span class=\"nt\">&gt;<\/span>\n    <span class=\"nt\">&lt;span<\/span> <span class=\"na\">class=<\/span><span class=\"s\">\"input-group-addon\"<\/span><span class=\"nt\">&gt;<\/span>\n        <span class=\"nt\">&lt;span<\/span> <span class=\"na\">class=<\/span><span class=\"s\">\"glyphicon glyphicon-calendar\"<\/span><span class=\"nt\">&gt;&lt;\/span&gt;<\/span>\n    <span class=\"nt\">&lt;\/span&gt;<\/span>\n<span class=\"nt\">&lt;\/div&gt;<\/span>\n<\/code><\/pre>\n\n<\/div>\n\n\n\n","category":["discuss","productivity"]},{"title":"Nobody can ever teach you something","pubDate":"Sun, 28 Oct 2018 16:58:52 +0000","link":"https:\/\/dev.to\/codevault\/nobody-can-ever-teach-you-something-3pe6","guid":"https:\/\/dev.to\/codevault\/nobody-can-ever-teach-you-something-3pe6","description":"<p>Most people go to university with an attitude that \"It will teach me how to program\", they get there and, what do you know? Almost everything is taught in such a boring manner that it all feels utterly useless and you just remain (yes, passively) 3 years or more so you can pass all the classes.<\/p>\n\n<h2>\n  \n  \n  Nobody can ever <strong>teach<\/strong> you something\n<\/h2>\n\n<p>Read this a few more times and drill it into your head. If the teacher is entertaining and the subject looks useful you start learning but when the teacher is as monotone as Microsoft Sam or the subject looks completely useless what do you do?<\/p>\n\n<p>Should you blame the teacher, faculty, university and everything in between that you are not being taught properly OR take matters into your own hands and start learning because <strong>nobody can ever teach you something<\/strong>?<\/p>\n\n<p>You are the one making the <strong>effort<\/strong> of paying attention and processing the information you are being given. Yes, you are the one <strong>learning<\/strong> it's just that, sometimes it doesn't feel like effort on our part. <\/p>\n\n<p>Be it from a teacher, from a book or from a YouTube video understand that you are always the one responsible for paying close attention and it mostly depends on <strong>you<\/strong> for learning something.<\/p>\n\n<p>Of course, if the teacher spouts nonsense related to the subject get another source of information or if the subject <em>looks<\/em> useless analyze it closely, it might not be as useless as it sounds. It all depends on you!<\/p>\n\n","category":["devhelp","career","mindset","university"]},{"title":"3 GIT productivity features explained","pubDate":"Thu, 25 Oct 2018 04:42:08 +0000","link":"https:\/\/dev.to\/codevault\/3-git-productivity-features-explained-4jbk","guid":"https:\/\/dev.to\/codevault\/3-git-productivity-features-explained-4jbk","description":"<p>I know there are some people in the community that use GIT on a day-to-day basis but only commit\/pull\/push while omitting some of the more useful features of it. I present to you 3 useful features, all related to committing, that will help your productivity and ease of change.<\/p>\n\n<h2>\n  \n  \n  1) <code>git stash<\/code>\n<\/h2>\n\n<p>This is the simplest way to put what you have been working on away for a second in favor of an urgent bug fix. All you have to do is:<br>\n<\/p>\n\n<div class=\"highlight\"><pre class=\"highlight plaintext\"><code>git stash\n... do whatever it is needed to fix an urgent bug fix or whatever else\ngit stash pop\n<\/code><\/pre><\/div>\n\n\n\n<p>After you <code>git stash<\/code> all your uncommitted changes go away in a temporary place which you can re-apply using <code>git stash pop<\/code>.<\/p>\n\n<h2>\n  \n  \n  2) Using multiple local branches\n<\/h2>\n\n<p>I know it has been said time and time again that anyone with a serious enough project should be using multiple branches for their project. That is not always true for all projects, but even so, if you only have one branch on the upstream it doesn't mean you can't use multiple branches on you own local repository. Here's how you do it:<br>\n<\/p>\n\n<div class=\"highlight\"><pre class=\"highlight plaintext\"><code>git branch new-branch-name\ngit checkout new-branch-name\n... commit whatever you want on this branch while keeping the main branch intact for more urgent modifications\ngit checkout master (or your main branch)\ngit merge new-branch-name\n<\/code><\/pre><\/div>\n\n\n\n<p>And voila! You have another way to quickly switch to another task if needed. Isn't that great?<\/p>\n\n<h2>\n  \n  \n  3) Selective commits\n<\/h2>\n\n<p>Instead of committing all changes you can selectively choose which files go where using the <code>git add<\/code> command to add them and <code>git commit -m ...<\/code> to commit whatever you have added.<\/p>\n\n<blockquote>\n<p>Really mate? This is the \"productivity tip\" you're teaching? I have been using that since I was 5!<\/p>\n\n<p>I know I know, but bare with, I have made this mistake where I didn't know what the stage area was for and was always committing all my changes using <code>git commit -am ...<\/code>. I never knew there was an alternative for quite some time<\/p>\n<\/blockquote>\n\n<p>With that said, here are the steps:<br>\n<\/p>\n\n<div class=\"highlight\"><pre class=\"highlight plaintext\"><code>git add file_you_want_to_commit\ngit commit -m \"Message properly explaining your changes\"\ngit add another_file_you_want_to_commit\ngit commit -m \"Another message properly explaining your changes\"\n<\/code><\/pre><\/div>\n\n\n\n<p>That has been it for this tutorial. Hope you got something out of it. I have published a video explaining these features a bit more in-depth. You can check it out here:<\/p>\n\n<p><iframe width=\"710\" height=\"399\" src=\"https:\/\/www.youtube.com\/embed\/0SqmKR_jA0A\">\n<\/iframe>\n<\/p>\n\n<p>What other features have you wished you knew when starting to use git?<\/p>\n\n","category":["devtips","productivity","git"]},{"title":"5 helpful features in Chrome's DevTools","pubDate":"Sat, 20 Oct 2018 11:21:08 +0000","link":"https:\/\/dev.to\/codevault\/5-helpful-features-in-chromes-devtools-1onk","guid":"https:\/\/dev.to\/codevault\/5-helpful-features-in-chromes-devtools-1onk","description":"<p>Chrome's DevTools (and its Firefox counterpart) is undoubtedly one of the most used debugging platforms and since most developers are using it I figured to make a list of a few time saving features that I wish I knew about when I started.<\/p>\n\n<h2>\n  \n  \n  1) <code>$0<\/code> through <code>$4<\/code>\n<\/h2>\n\n<p>This very simple feature acts like a history of the selected elements inside the <strong>Elements<\/strong> tab. Where, if you use it inside the integrated console you can have fast and direct access to the current element you have selected up to the 5th last element you have selected.<\/p>\n\n<p>As an example, I have used this to get the Scope of the selected DOM element in AngularJS like so:<br>\n<\/p>\n\n<div class=\"highlight\"><pre class=\"highlight javascript\"><code><span class=\"nx\">$<\/span><span class=\"p\">(<\/span><span class=\"nx\">$0<\/span><span class=\"p\">).<\/span><span class=\"nx\">scope<\/span><span class=\"p\">();<\/span>\n<\/code><\/pre><\/div>\n\n\n\n<h2>\n  \n  \n  2) <code>$_<\/code>\n<\/h2>\n\n<p>Ever felt like it is a drag to save the last executed statement's result inside a variable to use it in the next one? Fear not! With <code>$_<\/code> you can get the <strong>result<\/strong> of the last executed statement without needing any copy and paste.<\/p>\n\n<p>Let's see an example:<br>\n<\/p>\n\n<div class=\"highlight\"><pre class=\"highlight javascript\"><code><span class=\"nx\">getDiamonds<\/span><span class=\"p\">(<\/span><span class=\"dl\">'<\/span><span class=\"s1\">some function<\/span><span class=\"dl\">'<\/span><span class=\"p\">,<\/span> <span class=\"dl\">'<\/span><span class=\"s1\">with many long arguments<\/span><span class=\"dl\">'<\/span><span class=\"p\">);<\/span>\n\n<span class=\"k\">for<\/span> <span class=\"p\">(<\/span><span class=\"kd\">let<\/span> <span class=\"nx\">diam<\/span> <span class=\"k\">of<\/span> <span class=\"nx\">$_<\/span><span class=\"p\">)<\/span> <span class=\"p\">{<\/span> <span class=\"nx\">console<\/span><span class=\"p\">.<\/span><span class=\"nx\">log<\/span><span class=\"p\">(<\/span><span class=\"nx\">diam<\/span><span class=\"p\">.<\/span><span class=\"nx\">name<\/span><span class=\"p\">);<\/span> <span class=\"p\">}<\/span>\n<\/code><\/pre><\/div>\n\n\n\n<h2>\n  \n  \n  3) <code>clear()<\/code>\n<\/h2>\n\n<p>Ever wanted to clear the console programatically, not just from the <em>clear console<\/em> button? With this function you can do just that and have the console return to its clear state once you have refresh parts of your application.<\/p>\n\n<h2>\n  \n  \n  4) <code>monitor()<\/code>\n<\/h2>\n\n<p>If you have a function that gets called many times (an event handler for example) and you are not 100% if the arguments it gets passed are correct. Adding a monitor to it would help identify that fairly quickly.<br>\n<\/p>\n\n<div class=\"highlight\"><pre class=\"highlight javascript\"><code><span class=\"nx\">monitor<\/span><span class=\"p\">(<\/span><span class=\"nx\">getDialogue<\/span><span class=\"p\">);<\/span>\n<span class=\"nx\">getDialogue<\/span><span class=\"p\">(<\/span><span class=\"dl\">'<\/span><span class=\"s1\">main<\/span><span class=\"dl\">'<\/span><span class=\"p\">);<\/span>\n<span class=\"nx\">console<\/span> <span class=\"nx\">out<\/span><span class=\"p\">:<\/span> <span class=\"dl\">\"<\/span><span class=\"s2\">function getDialogue called with arguments: main<\/span><span class=\"dl\">\"<\/span>\n<\/code><\/pre><\/div>\n\n\n\n<h2>\n  \n  \n  5) <code>$()<\/code> and <code>$$()<\/code>\n<\/h2>\n\n<p>CSS selector implemented natively in the console. Simple and straightforward. Want to select a button inside the main div?<br>\n<\/p>\n\n<div class=\"highlight\"><pre class=\"highlight javascript\"><code><span class=\"nx\">$<\/span><span class=\"p\">(<\/span><span class=\"dl\">'<\/span><span class=\"s1\">.main .btn-submit<\/span><span class=\"dl\">'<\/span><span class=\"p\">);<\/span>\n<\/code><\/pre><\/div>\n\n\n\n<p>Or would you like to get all links inside a list? No problem, the selectors got you covered!<br>\n<\/p>\n\n<div class=\"highlight\"><pre class=\"highlight javascript\"><code><span class=\"nx\">$$<\/span><span class=\"p\">(<\/span><span class=\"dl\">'<\/span><span class=\"s1\">ul.links a<\/span><span class=\"dl\">'<\/span><span class=\"p\">);<\/span>\n<\/code><\/pre><\/div>\n\n\n\n<p>Aside from the <code>monitor<\/code> function every other feature we talked about here is also available in the Firefox Debugger.<\/p>\n\n<p>For more details check out this video I made that covers them a bit more in-depth:<br>\n<iframe width=\"710\" height=\"399\" src=\"https:\/\/www.youtube.com\/embed\/DkIYsjYdz60\">\n<\/iframe>\n<\/p>\n\n<p>Thank you for reading and I hope this was helpful to some of you!<\/p>\n\n","category":["devtips","webdev","javascript","productivity"]},{"title":"Data validation mistakes made by beginners","pubDate":"Fri, 28 Sep 2018 08:29:07 +0000","link":"https:\/\/dev.to\/codevault\/data-validation-mistakes-made-by-beginners-35lk","guid":"https:\/\/dev.to\/codevault\/data-validation-mistakes-made-by-beginners-35lk","description":"<p>Let's start simple. You have a method that, sometimes, when called with certain arguments or at certain times it might fail. How do we tell that to the user? What about to the programmer using that method?<\/p>\n\n<p>Here are 4 guidelines that will help your team validate data in a consistent manner without running into some trivial issues:<\/p>\n\n<ul>\n<li>Treat validation errors first<\/li>\n<\/ul>\n\n<p>This ties in with the other article I posted:<br>\n<\/p>\n<div class=\"ltag__link\">\n  <a href=\"\/codevault\" class=\"ltag__link__link\">\n    <div class=\"ltag__link__pic\">\n      <img src=\"https:\/\/media.dev.to\/dynamic\/image\/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto\/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F93006%2F22a019f6-e065-42ed-a963-94f379add928.jpg\" alt=\"codevault\">\n    <\/div>\n  <\/a>\n  <a href=\"\/codevault\/invert-your-ifs-2m0g\" class=\"ltag__link__link\">\n    <div class=\"ltag__link__content\">\n      <h2>Invert your ifs!<\/h2>\n      <h3>Sergiu Mure\u015fan \u30fb Aug 31 '18<\/h3>\n      <div class=\"ltag__link__taglist\">\n        <span class=\"ltag__link__tag\">#refactoring<\/span>\n        <span class=\"ltag__link__tag\">#devtips<\/span>\n      <\/div>\n    <\/div>\n  <\/a>\n<\/div>\n\n\n<ul>\n<li>Do not let your methods fail silently<\/li>\n<\/ul>\n\n<p>This is when you don't let the caller of your method know if the method failed and did absolutely nothing.<\/p>\n\n<ul>\n<li>Return a proper error<\/li>\n<\/ul>\n\n<p>Return 0 when your method fails and it is called <code>getIndexOf...<\/code> is a really bad idea.<\/p>\n\n<ul>\n<li>Do not validate for developer errors<\/li>\n<\/ul>\n\n<p>Validating if your constants are actually defined (in an interpreted environment) using if statements is simply a waste of time and these problems should be <strong>solved<\/strong> and not <strong>validated<\/strong>.<\/p>\n\n<p>The caller nor the user can help you solve this issue.<\/p>\n\n<p>These are simple rules, but they can affect your project in the long run if you don't apply them from the start. Check out this video I created explaining more in-depth about this subject:<\/p>\n\n<p><iframe width=\"710\" height=\"399\" src=\"https:\/\/www.youtube.com\/embed\/gKS3yEjEbJI\">\n<\/iframe>\n<\/p>\n\n<p>What do you think? Was this better presented than the post before, or was it worse? Did you get something out of this?<\/p>\n\n<p>Also, for the guys (or gals) that previously suggested to add more content on the article itself, is this good enough? I have also posted on my blog but the content is quite large and wouldn't really fit in here that well.<\/p>\n\n","category":["devtips","discuss"]},{"title":"The comment-pocalypse | Part 1","pubDate":"Wed, 19 Sep 2018 05:32:28 +0000","link":"https:\/\/dev.to\/codevault\/the-comment-pocalypse--part-1-4p79","guid":"https:\/\/dev.to\/codevault\/the-comment-pocalypse--part-1-4p79","description":"<p><em>Originally posted on <a href=\"https:\/\/code-vault.net\/articles\/comments-part1.php\">CodeVault<\/a><\/em><\/p>\n\n<p>There are quite a few conventions when it comes to commenting your code. Let's break them down and see how good\/bad they are.<\/p>\n\n<p>First is the <strong>comment all your methods<\/strong> convention. Why would you do that? So everyone knows what your code does and how to use it. The upsides are that:<\/p>\n\n<ul>\n<li>badly naming methods becomes less problematic<\/li>\n<li>hard to understand methods are usually easier to understand<\/li>\n<li>in case of examples, it is really easy to learn how to use<\/li>\n<\/ul>\n\n<p>This all sounds fine and dandy but commenting all your methods is a double-edged sword. Let's look at an example:<br>\n<\/p>\n\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight java\"><code><span class=\"cm\">\/**\n * Gets all the hardware of the type and brand given.\n * Searches for substring *brand* inside each hardware's brand name.\n * @param type the type of hardware\n * @param brand the brand to search for\n * @returns a list of hardware\n * Example: getHardwareOfTypeAndBrand(HardwareType.Keyboard, \"Das\") \n *          returns List with dasKeyboard1 and dasMechKeyboard2\n *\/<\/span>\n<span class=\"kd\">public<\/span> <span class=\"nc\">List<\/span><span class=\"o\">&lt;<\/span><span class=\"nc\">Hardware<\/span><span class=\"o\">&gt;<\/span> <span class=\"nf\">getHardwareOfTypeAndBrand<\/span><span class=\"o\">(<\/span><span class=\"nc\">HardwareType<\/span> <span class=\"n\">type<\/span><span class=\"o\">,<\/span> <span class=\"nc\">String<\/span> <span class=\"n\">brand<\/span><span class=\"o\">)<\/span> <span class=\"o\">{<\/span> <span class=\"o\">...<\/span> <span class=\"o\">}<\/span>\n<\/code><\/pre>\n\n<\/div>\n\n\n\n<p>I think we can all agree that having comments and examples at least <strong>looks<\/strong> nice. But what about their usability? Does the comment:<br>\n<\/p>\n\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight plaintext\"><code> * Gets all the hardware of the type and brand given.\n\n * @param type the type of hardware\n * @param brand the brand to search for\n * @returns a list of hardware\n<\/code><\/pre>\n\n<\/div>\n\n\n\n<p>tell us more about the method than:<br>\n<\/p>\n\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight java\"><code><span class=\"kd\">public<\/span> <span class=\"nc\">List<\/span><span class=\"o\">&lt;<\/span><span class=\"nc\">Hardware<\/span><span class=\"o\">&gt;<\/span> <span class=\"nf\">getHardwareOfTypeAndBrand<\/span><span class=\"o\">(<\/span><span class=\"nc\">HardwareType<\/span> <span class=\"n\">type<\/span><span class=\"o\">,<\/span> <span class=\"nc\">String<\/span> <span class=\"n\">brand<\/span><span class=\"o\">)<\/span>\n<\/code><\/pre>\n\n<\/div>\n\n\n\n<p>The answer: No. And here we get to the first issue: <strong>REDUNDANCY<\/strong>. And you know what happens when you have redundancy in your code? When one change occurs in one place you will have to change it in another. <\/p>\n\n<p>Same goes for comments. If we were to update our method and add another parameter we would also have to change our comment, otherwise our comment becomes <strong>MISLEADING<\/strong>. <\/p>\n\n<p>Misleading comments are our second issue. Especially when we also have examples. <br>\nBut don't we have tools and plugins that help us updating our comments when the signature of the method changes? Yes we do, but that means more time investment in something that, at the end of the day, will be redundant. <\/p>\n\n<p>Imagine changing our method from, instead of searching for brands that contain the given string we would check if the brands name corresponds exactly. <\/p>\n\n<p>You should also change the comment. But would you, when it's 8 PM and in 10 minutes you have a deploy to make? Couple that with there being no way of checking if the example is valid and you have got a recipe for disaster. This is where this comment:<br>\n<\/p>\n\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight plaintext\"><code>Searches for substring *brand* inside each hardware's brand name.\n<\/code><\/pre>\n\n<\/div>\n\n\n\n<p>can also become misleading.<\/p>\n\n<p>Next part we will discuss about the other conventions and their pros and cons.<\/p>\n\n","category":["comments","devhelp"]}]}}