Use of ‘const’ for function parameters

The reason is that const for the parameter only applies locally within the function, since it is working on a copy of the data. This means the function signature is really the same anyways. It’s probably bad style to do this a lot though. I personally tend to not use const except for reference and … Read more

How to exit an if clause

(This method works for ifs, multiple nested loops and other constructs that you can’t break from easily.) Wrap the code in its own function. Instead of break, use return. Example:

using media queries with LESS

CSS supports multiple identical media queries, if you like, but CSS doesnt support nesting. LESS, on the other hand, does support a few methods for nesting media queries. You can read about it here: http://lesscss.org/features/#extend-feature-scoping-extend-inside-media Example: Compiles to: LESS also supports nesting media queries below selectors like this: Compiles to: If this doesnt answer your … Read more

Server unable to read htaccess file, denying access to be safe

I have created a simple app using AngularJS. When I tried to host that project in my website http://demo.gaurabdahal.com/recipefinder it shows the following error: Forbidden You don’t have permission to access /recipefinder on this server. Server unable to read htaccess file, denying access to be safe But if I go to http://demo.gaurabdahal.com/ it displays “access … Read more

Type Checking: typeof, GetType, or is?

All are different. typeof takes a type name (which you specify at compile time). GetType gets the runtime type of an instance. is returns true if an instance is in the inheritance tree. Example What about typeof(T)? Is it also resolved at compile time? Yes. T is always what the type of the expression is. … Read more

What is stdole2.tlb

You can use Windows SDK COM/OLE Object Viewer to open the type library and see what is there inside: It defines certain interfaces and type you can use in your type library, since you make them available through referencing stdole2.tlb.