Laravel PHP Command Not Found

Ok, I did that and it works: And paste do source ~/.bash_profile and enjoy 😉 Important: If you want to know the difference between bash_profile and bashrc please check this link Note: For Ubuntu 16.04 running laravel 5.1, the path is: ~/.config/composer/vendor/bin On other platforms: To check where your Composer global directory is, run composer global about. Add /vendor/bin to the directory that gets listed after “Changed … Read more

How to check if a map contains a key in Go?

One line answer: Explanation: if statements in Go can include both a condition and an initialization statement. The example above uses both: initializes two variables – val will receive either the value of “foo” from the map or a “zero value” (in this case the empty string) and ok will receive a bool that will be set to true if “foo” was … Read more

PadLeft function in T-SQL

I believe this may be what your looking for: or I haven’t tested the syntax on the 2nd example. I’m not sure if that works 100% – it may require some tweaking – but it conveys the general idea of how to obtain your desired output. EDIT To address concerns listed in the comments… @pkr298 … Read more

TypeError: ‘dict_keys’ object does not support indexing

Clearly you’re passing in d.keys() to your shuffle function. Probably this was written with python2.x (when d.keys() returned a list). With python3.x, d.keys() returns a dict_keys object which behaves a lot more like a set than a list. As such, it can’t be indexed. The solution is to pass list(d.keys()) (or simply list(d)) to shuffle.

Git diff against a stash

See the most recent stash: See an arbitrary stash: From the git stash manpages: By default, the command shows the diffstat, but it will accept any format known to git diff (e.g., git stash show -p stash@{1} to view the second most recent stash in patch form).

Use of $parse in angular js

Angular runs $parse automatically when it runs the $digest loop, basically $parse is the way angular evaluates expressions. If you wanted to manually parse an expression, you can inject the $parse service into a controller and call the service to do the parsing for you. Here’s a code snipped from ng-book that watches then parses … Read more

Android TextView : “Do not concatenate text displayed with setText”

Resource has the get overloaded version of getString which takes a varargs of type Object: getString(int, java.lang.Object…). If you setup correctly your string in strings.xml, with the correct place holders, you can use this version to retrieve the formatted version of your final String. E.g. using getString(R.string.welcome_message, “Test”, 0); android will return a String with … Read more