Supplement to this video. Watch first 35 min (the language bits), then 1:14:30 - 1:18:15 (the new map features).
You can find a fairly comprehensive list of new features on cppreference or here if you really want to see it all.
// You can use maven-publish-helper.gradle script without changes and even share it between multiple | |
// modules. Just place the maven-publish-helper.gradle file in the root directory of your project, | |
// then apply it at the bottom of your module's build.gradle file like this: | |
// ...content of module's build.gradle file... | |
apply from: '../maven-publish-helper.gradle' | |
publishing { | |
publications { |
public void readTwice() | |
{ | |
Observable.fromCallable(() -> { | |
RedditData inflatedModel = null; | |
Response response = makeRequest(); | |
String diskValue = null; | |
try { | |
File file = new File(getContext().getCacheDir(), "file"); | |
BufferedSink cacheBody = Okio.buffer(Okio.sink(file)); |
suspend fun downloadFile(url: String, | |
downloadFile: File, | |
downloadProgressFun: (bytesRead: Long, contentLength: Long, isDone: Boolean) -> Unit) { | |
async(CommonPool) { | |
val request = with(Request.Builder()) { | |
url(url) | |
}.build() | |
val client = with(OkHttpClient.Builder()) { | |
addNetworkInterceptor { chain -> |
#include <fstream> | |
#include <iostream> | |
#include <string> | |
#include <vector> | |
using namespace std; | |
void learnTypesAndSize() { | |
/** TYPES */ | |
cout << "\n:::: TYPES ::::" << endl; |
Supplement to this video. Watch first 35 min (the language bits), then 1:14:30 - 1:18:15 (the new map features).
You can find a fairly comprehensive list of new features on cppreference or here if you really want to see it all.
Automated analysis is the main advantage to working with a modern statically typed compiled language like C++. Code analysis tools can inform us when we have implemented an operator overload with a non-canonical form, when we should have made a method const, or when the scope of a variable can be reduced.
In short, these tools catch the most commonly agreed best practice mistakes we are making and help educate us to write better code. We will be fully utilizing these tools.
All reasonable warning levels should be enabled. Some warning levels, such as GCC's -Weffc++
warning mode can be too noisy and will not be recommended for normal compilation.
import kotlinx.coroutines.experimental.GlobalScope | |
import kotlinx.coroutines.experimental.channels.Channel | |
import kotlinx.coroutines.experimental.channels.Channel.Factory.CONFLATED | |
import kotlinx.coroutines.experimental.channels.Channel.Factory.UNLIMITED | |
import kotlinx.coroutines.experimental.channels.sendBlocking | |
import kotlinx.coroutines.experimental.launch | |
fun main(args: Array<String>) { | |
val channels = listOf<Channel<Int>>( | |
Channel(capacity = UNLIMITED), |
class ChatRoomsFragment : Fragment() { | |
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | |
super.onViewCreated(view, savedInstanceState) | |
viewModel = ViewModelProviders.of(this, factory).get(ChatRoomsViewModel::class.java) | |
subscribeUi() | |
} | |
private fun subscribeUi() { |
Because pointers can be ugh
To understand a pointer, let's review "regular" variables first. If you're familiar with a programming language without pointers like JavaScript, this is what you think when you hear "variable".
When declaring a variable by identifier (or name), the variable is synonymous with its value.
// ... | |
Request request = new Request.Builder() | |
.url(url) | |
.tag(TAG) | |
.build(); | |
// Cancel previous call(s) if they are running or queued | |
OkHttpUtils.cancelCallWithTag(client, TAG); | |
// New call |