Nothing here yet.
pro bono technological, compliance-specific or security consulting
No blogs yet.
Hey, Brian; another Seattleite here! Cheers from U-District and thanks a lot for the AMA! I am going to digress here from the core topics and ask something about Microsoft's recent involvement in the Linux Foundation and the patent infringement claims made by Microsoft against TomTom for using GNU and Linux. While I am aware that this happened a while back, I want to know why did this happen in the first place. Linux is something for the community and by the community so what's the need to file for IPR violations in lieu of just supporting the development (which is happening right now, after oh-so-many lawsuits.) And do you think that the announcement of the Sphere OS means anything to the Linux community? The reason why I am asking this is because unlike other Linux-based operating systems, Sphere OS requires Visual Studio for development; this tightly-coupled architecture is one, I would say, bad in taste.
Basis of Hatred Any point or "feature" I mention here has made this list (or rather, got the Golden Raspberry Award) because of either of these things: give a false impression; readability; inaccurate usage in the community. The last point might boil the blood of a lot of people, but I have seen some features of JavaScript being used incorrectly; to an extent that sometimes I think using ES5 would've fine here. const Reason: False Impression Many new programmers, when starting with ES6 or above, think of const as being immutable. It might be true for base types ( boolean , string , and the likes) but it's not so true for objects (objects AND arrays). For example, let's say I have this piece of code: const test Value1 = 'Hello, Hashnode!' ; // Will not execute. Thank God. test Value1 = 'I love Java!' ; Perfect! It's doing what it's supposed to. However, let's look at ECMAScript 2019 Specification. In particular: § 13.3.1.4 - this section defines how let and const are actually built for lexical environment scoping (unlike var where the scope leaked). They links are actually from the 2019 spec. Let's look at the 2015 spec where they were introduced so § 13.2.14] which says: If IsConstantDeclaration of d is true , then Let status be env.CreateImmutableBinding(dn, true ). Else, Let status be env.CreateMutableBinding(dn, false ). Alright. We are getting somewhere. Let's dig in deeper: an excerpt from CreateImmutableBinding . Create an immutable binding in envRec for N and record that it is uninitialized. If S is true record that the newly created binding is a strict binding. Aahhhh! So it means that the variable reference is immutable and not the derivative thereof. As we saw in the spec (13.2.14, ECMAScript 262), only reassigning references isn't allowed; that is to say you can't point it another value. However, whatever value you have can be mutated as long as it doesn't change the lexical environment. Tagged Templates Reason: readability Almost everyone who has used styles-components knows what this is: const Button = styled.a` display: inline -block; ` It's a styled button! But for new readers , this is just probably a syntax error? Where is the parenthesis since styled.a is supposed to be a function? What is this? These are tagged templates. You seem, when ES5 introduced templates, they also thought of introducing a function which works on them in case someone wanted to do some customized interpolation. I have used this as a part of a project I worked on where we created a contenteditable wrapper around Draft.js and used a pluggable approach to the exporters, and the core logic of the adapters relied on tagged templates. For those of you who don't know what these are, let's take a quick example: const wrapInHead = ( str, ...vars ) => { // str is an array which contains strings split by where there was an interpolation. // and vars is the respective variables which were to be filled. let finalString = '' ; for ( let i in str ) { // we use short circuiting since the last value is str will always be "" and if the parts are greater than // the value, it'll just give a blank. finalString += str[ i ] + ( vars[ i ] || '' ); } return finalString; }; Very cool! But think about it. Do we seriously need it? I mean, yeah, it is certainly good and useful but if you're a new dev, will you immediately know what it is? And most of the good JS courses don't touch on this either. Because of this reason, I really don't like tagged template literals. They are good, but only when the entire team know what they are or if you are working on something personal. A big bummer for new devs! And really confusing too. () => {} Reason: gives a false impression/improper usage This is a big one! With the introduction of arrow functions, our code bases became a lot cleaner! function testFunction ( testVar, function( cbVal ) { const args = Array .from( arguments ); // Do something... } ); With arrow functions, these became: const testFunction = ( testVar, cbVal => { const args = Array .from( arguments ); // Do something! } ); After this modification, we broke an entire build. Why? Because people thought () => {} is the same a function name() {} . NO. It is NOT . We hear the term lexical scoping a lot. What that means is that the scope of the current function or block is based on its parents or ancestors (sometimes). However, arrow functions do not have their own this or arguments . And because of this, they use whatever the callee provides. Many, including me, thought that it was the same and we messed up. function testFunction ( test ) { console .log( arguments .caller ); } const newFunction = () => { testFunction( 'Hello World' ); }; This should print newFunction() right? Because that's the one calling testFunction() ? Right? NO! Arrow functions are treated as anonymous functions and hence, they don't have a function signature in call stack. (Try that code in the dev tools console.) And this also makes them really bad for any code which has logging since the function signature will never resolve in the logs. arguments Reason: JUST BECAUSE/readability/improper usage The arguments special variable contains the list of arguments passed to a specific function. This is especially useful when you don't know the number of arguments you'll receive; here, you use arguments which behaves like an array. What do you mean: behaves? Right. When you execute this: console .log ( Object .prototype .toString .call ( arguments ) ); You get [object Arguments] . It is so special that it has a separate type . Wow. But then you can access the values like arguments[ 0 ] , etc. And you can call const args = Array.from( arguments ); Weird. This object also have some (now deprecated) properties: caller - the name of the function which called the current function callee - the current function. Note: this is not a ES6 feature as such but it is something which wasn't patched in JavaScript. Disclaimer I know that these "features" are used very extensively, even by me, but I am sure TC39 could've done a better naming jobs. But well, programmers are bad at naming things anyway! xD This list isn't exclusively ES6. I have tried to include some weird parts of ES5 and 4 as well.
I seriously think that you should add some sort of description to this poll since "SEO friendly navbars" is a little vague for nearly everyone. It'd be great to see some point-wise breakdown of the topics you'll be covering as well as a line or two on their importance! Best of luck! Hassan Malik
Expectations Crusher I am diverting a little bit from the way I usually answer questions; this time, I will not write the code immediately since I want to go into the theory more as a lot of good concepts are revealed! I am so sorry Sandeep Panda for not answering the question directly! I will, in the near future! Prologue This is a really interesting problem which everyone should try as it can be implemented in a couple of ways. I will try explaining two simple methods here: Recursion With a simple if-else-if ladder, you can keep on checking if two entities collide. The logic for this can be as simple as saying that -1 means one side and 1 means the other side. You can, then, define a HashMap to match the possible collisions as the product of these two weights . Then, keep on recursing till you reach a pre-mapped disposition (where every weight is -1 or 1 ) . Binary Classification We humans are really good at making simple - yes/no - decisions. Is Hashnode the best? Yes. Does Shreyansh Pandey type way too much? Yes. Should I use ASP.NET for my next API? GOD NO! You get the picture. Now, we know which two entities have a problem with each other. Based on this, you can create a simple mapped model and then use recursion to solve it. This isn't a method as much as it is an extension or an approach . Discrete Mathematics This is where it gets super interesting . If you define each of the entities as a tree node and the edges (what connects two nodes) as a trip (or a mutation), you can build a very simple abstract (or even cyclic) tree. Now that you have the final state represented, you can solve this problem in one of two ways: Graphical Disposition You can use the shortest path algorithm ( Dijkstra's , for example) and find the required mutations. Pretty simple stuff, so we will leave this as an exercise for the reader . Linear Algebra Extending from the above, there is another way to look at this problem. Imagine, in the standard 2D plane, we have two vectors: a and b . We can see that we can define a as a scalar product of b . Why? Because it's made by adding b three times and multiplication is nothing but fancy addition. So, more formally, we can define this as: Hmm. Notice something? a and b are related. Now, the biggest problem becomes that we are restricted to the line y = x . We can do whatever we want with a and b , but they are useless because they stay on the same line and go no where. This is called a dependent vector and it's useless for us right now. Let's find some independent ones! Awesome! Now we have two independent vectors. I can hear you asking - Okay, this is good. But for what joy?! Let me explain. With two independent vectors, we can reach any point in space. Let's take an example: suppose we want to reach the point P(2, 4) . We can do this by: Perfect. Now let me introduce what solves the question. If we know the end state as a graph, we can represent it as a point. Then, we can have 4 dimensions (one for each entity) and as long as we have the same number of independent vectors, we can reach that end-position! More specifically, we want to solve the following system: With that said, you can now find a static mutation and list the steps you need to make this happen. The initial vectors are all (0, 0, 0, 0) . Based on the system you are using, you can define the final vector according to your needs. Programming After some good Math, this part looks a little boring. However, the explanations are in no way complete and I will update them with more descriptive mathematical content in a day. I am starting a GitHub repository where I will solve the question using recursion, then with graphs and then, finally (if I have some intellect left) with linear algebra. Spoiler Don't give up! However, for everyone practicing TDD, here is the answer: take the goose and come back; take the fox and bring the goose back; take the corn and leave the goose; come back to get the goose and done.
Just a quirk about WSL: it doesn't natively support ext* family of filesystems which is a pain. A better way to get better Linux-like support is to download and install git-bash for Windows. It supports nearly 90% of what Linux does (practically).
So, I have a pretty extensive list of the tools and pieces of software I use. However, I thought it'd be best to give a list of tools which every developer - regardless of platform or language - should have. Online Services GitHub This is, by far, the best investment I have ever made. I wouldn't say it is an "investment" because I got it as a part of the GiHub Education Pack which is pretty darn sweet ! I would highly recommend every college and school going to sign up! Even if you can't get the pack, the private repositories cost around $7/month which is less than the price of a grande americano. Definitely recommend it! Trello For task management, Trello is my go-to! The only reason I probably bought it instead of using the free version was that it supported a lot more integrations which made everything pretty simple for me and quite organized. Google Suite for Business Self-explanatory! Development Tools Paw Paw , is by far, the best API testing tool ever built; a lot better than Postman. .NET Tools I used to do quite a bit of C# work back in the day; I am listing those tools here as well just in case it helps someone. ReSharper This is a must-have for anyone writing anything in the Visual Studio environment. It just augments the IDE by adding a lot of cool, much-needed features. dotCover I find dotCover to be much better than the built-in test runner with features like automatic coverage, and test-case scopes (which unit test to execute based on file changes). SciTech .NET Memory Profiler I did use dotCover and dotMemory in the past, but I fell in love with SciTech's spin on the product. The easy of use and the feature set is absolutely incredible. GhostDoc Considering some of the code I wrote was unmanaged, the documentation had to be thorough. GhostDoc, in the past, was free but they introduced a pricing model (not sure when). Even then, it isn't as crazy as some of the tools I have used in the past. Licensing and Copy-Protection Since I my field of training is applied cryptography, I wrote my own suite for adding licensing and copy-protection. (If any one is interested in this, I can provide them with the library.) I also wrote some implementations around the A/DRM1 model but never completed it since encoding got really annoying for me. Note: I was in the process of writing an online, fully-open sourced, cryptographically secure implementation for copy protection but never got around finishing it. If anyone is interested in lending me a hand and getting this off the table, I would love it! Other Tools and Services Apart from these, there are a bunch of tools I use for misc. uses. Learning Pluralsight - the library is extensive containing every possible topic under the sun. acloud.guru - keeping up with the latest changes in AWS. Springer - primarily for research. Design Adobe CC Suite - the CC suite is incredible. Especially because it comes with TypeKit! Sketch - Everyone is aware of this beauty. Electronics and Mathematics I do a fair amount of research in electronics (related to PKIF, etc.) so here are some of the tools in that realm: Saleae - my go-to logic analyzer (a tool); Mathematica - my go-to for when I am doing something in math Matlab - some AI models, sophisticated cluster and/or node processing (got it for free from my college!). This is, I guess, all! I haven't mentioned services like AWS because it isn't a "service" per-se. I had a subscription of VS back in the day and a student license for Xamarin, but the license expired, I guess.