Javadoc @see or {@link}?

The official guidelines on this are pretty clear. The functional differences are: {@link} is an inline link and can be placed wherever you like @see creates its own section In my opinion, {@link} is best used when you literally use a class, field, constructor or method name in your description. The user will be able to click through to the javadoc … Read more

How can I count all the lines of code in a directory recursively?

Try: or (when file names include special characters such as spaces) The SLOCCount tool may help as well. It will give an accurate source lines of code count for whatever hierarchy you point it at, as well as some additional stats. Sorted output: find . -name ‘*.php’ | xargs wc -l | sort -nr

What is .$on() in AngularJS

$on is related to $broadcast and $emit – which is a way to trigger code from other places. The first thing about $on you should know is that it’s a method of $scope The second thing you should know is $ prefix refers to an Angular Method, $$ prefixes refers to angular methods that you should avoid using. Now lets get into detail … Read more

First Heroku deploy failed `error code=H10`

Found solution for me here: Heroku + node.js error (Web process failed to bind to $PORT within 60 seconds of launch) In my case my app crashed because I was hard setting the PORT, instead of using the port that heroku dinamicaly sets, which can be accessed with process.env.PORT

Sorting a set of values

From a comment: I want to sort each set. That’s easy. For any set s (or anything else iterable), sorted(s) returns a list of the elements of s in sorted order: Note that sorted is giving you a list, not a set. That’s because the whole point of a set, both in mathematics and in almost every programming language,* is that it’s not ordered: the sets {1, 2} and {2, 1} are … Read more

Flask ImportError: No Module Named Flask

Try deleting the virtualenv you created. Then create a new virtualenv with: Then: Now let’s activate the virtualenv Now you should see (flask) on the left of the command line. Edit: In windows there is no “source” that’s a linux thing, instead execute the activate.bat file, here I do it using Powershell: PS C:\DEV\aProject> & .\Flask\Scripts\activate) Let’s install … Read more

How to change dataframe column names in pyspark?

Option 1. Using selectExpr. data = sqlContext.createDataFrame([(“Alberto”, 2), (“Dakota”, 2)], [“Name”, “askdaosdka”]) data.show() data.printSchema() # Output #+——-+———-+ #| Name|askdaosdka| #+——-+———-+ #|Alberto| 2| #| Dakota| 2| #+——-+———-+ #root # |– Name: string (nullable = true) # |– askdaosdka: long (nullable = true) df = data.selectExpr(“Name as name”, “askdaosdka as age”) df.show() df.printSchema() # Output #+——-+—+ #| name|age| … Read more

Extracting substrings in Go

It looks like you’re confused by the working of slices and the string storage format, which is different from what you have in C. any slice in Go stores the length (in bytes), so you don’t have to care about the cost of the len operation : there is no need to count Go strings aren’t null … Read more

Categories go