git checkout all the files

If you are at the root of your working directory, you can do git checkout — . to check-out all files in the current HEAD and replace your local files. You can also do git reset –hard to reset your working directory and replace all changes (including the index).

How to iterate (keys, values) in JavaScript?

tl;dr In ECMAScript 2017, just call Object.entries(yourObj). In ECMAScript 2015, it is possible with Maps. In ECMAScript 5, it is not possible. ECMAScript 2017 ECMAScript 2017 introduced a new Object.entries function. You can use this to iterate the object as you wanted. Output ECMAScript 2015 In ECMAScript 2015, there is not Object.entries but you can use Map objects instead and iterate over them … Read more

if else statement in AngularJS templates

Angularjs (versions below 1.1.5) does not provide the if/else functionality . Following are a few options to consider for what you want to achieve: (Jump to the update below (#5) if you are using version 1.1.5 or greater) 1. Ternary operator: As suggested by @Kirk in the comments, the cleanest way of doing this would be to … Read more

How to print a int64_t type in C

For int64_t type: for uint64_t type: you can also use PRIx64 to print in hexadecimal. cppreference.com has a full listing of available macros for all types including intptr_t (PRIxPTR). There are separate macros for scanf, like SCNd64. A typical definition of PRIu16 would be “hu”, so implicit string-constant concatenation happens at compile time. For your code to be fully portable, you must use PRId32 and so on for … Read more

Visual studio Express Edition vs Community

Community edition is the full fledged software, but you can’t use it on enterprise (>5 users) On the other hand, Express editions can be used in enterprise environments, but does not let you use plugins. So in the end, as far as I can tell the choice is between plugins and enterprise. If it’s just … Read more

How to change spinner text size and text color?

Make a custom XML file for your spinner item. spinner_item.xml: Give your customized color and size to text in this file. Now use this file to show your spinner items like: You don’t need to set the drop down resource. It will take spinner_item.xml only to show your items in spinner.

Storing Images in DB – Yea or Nay?

I’m in charge of some applications that manage many TB of images. We’ve found that storing file paths in the database to be best. There are a couple of issues: database storage is usually more expensive than file system storage you can super-accelerate file system access with standard off the shelf products for example, many web servers … Read more