| |
https://ziglang.org/documentation/master/#Pointers | |
*T - single-item pointer to exactly one item. | |
Supports deref syntax: ptr.* | |
[*]T - pointer to unknown number of items. (eq. of *T in C) | |
Supports index syntax: ptr[i] | |
Supports slice syntax: ptr[start..end] | |
Supports pointer arithmetic: ptr + x, ptr - x |
getCityCountry(results) { | |
const location: any = {}; | |
for (const component of results[0].address_components) { | |
if (component.types.includes('sublocality') || component.types.includes('locality')) { | |
location.city = component.long_name; | |
} else if (component.types.includes('administrative_area_level_1')) { | |
location.state = component.short_name; | |
} else if (component.types.includes('country')) { | |
location.country = component.long_name; |
import { | |
ImageBackground, | |
SafeAreaView, | |
StyleSheet, | |
Text, | |
TouchableOpacity, | |
View, | |
useWindowDimensions, | |
} from "react-native"; | |
import React, { forwardRef, useRef, useState } from "react"; |
I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.
I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real
import 'dart:math'; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter/rendering.dart'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override |
Learning Rust
The following is a list of resources for learning Rust as well as tips and tricks for learning the language faster.
Warning
Rust is not C or C++ so the way your accustomed to do things in those languages might not work in Rust. The best way to learn Rust is to embrace its best practices and see where that takes you.
The generally recommended path is to start by reading the books, and doing small coding exercises until the rules around borrow checking become intuitive. Once this happens, then you can expand to more real world projects. If you find yourself struggling hard with the borrow checker, seek help. It very well could be that you're trying to solve your problem in a way that goes against how Rust wants you to work.
const interests = [ | |
'3D printing', | |
'Amateur radio', | |
'Scrapbook', | |
'Amateur radio', | |
'Acting', | |
'Baton twirling', | |
'Board games', | |
'Book restoration', | |
'Cabaret', |
import 'package:flutter/material.dart'; | |
import 'package:flutter/rendering.dart'; | |
class Home extends StatefulWidget { | |
Home({Key key}) : super(key: key); | |
@override | |
_HomeState createState() => _HomeState(); | |
} |