Categories
Development Google

Creating Google’s CRC32C on Visual Studio

As the title says. I’m trying to compile the code found on Google’s Github. I don’t know much about CMake. First I ran the following command as per instructions: git submodule update –init –recursive I got the following error message: fatal: not a git repository (or any of the parent directories): .git. After that I […]

Categories
Development Laravel

Why BelongsTo() isn’t working in Laravel 6?

I’ve got two Models User and AccountType class User extends Authenticatable { (…) public function accountType() { return $this->belongsTo(‘App\AccountType’, ‘account_type_id’, ‘id’); } } class AccountType extends Model { protected $table = ‘account_types’; // protected $primaryKey = ‘id’; public function users() { return $this->hasMany(‘App\User’); } } My database: Schema::create(‘users’, function (Blueprint $table) { $table->bigIncrements(‘id’); $table->bigInteger(‘account_type_id’)->unsigned(); $table->foreign(‘account_type_id’)->references(‘id’)->on(‘account_types’); […]

Categories
Development

dispatch action inside saga watcher after Meteor.call

I want to dispatch action inside Meteor.call callback. I’v tried to pass generator function as callback, but does not work. function* createRegistrationField(action: CreateRegistrationFieldRequest) { yield call(function* () { yield put(CreateRegistrationFieldRequestRunningAction()); }); const { type } = action.payload; const callBack = function*(error, _id) { console.log(“callback called”); yield put(RegistrationFieldCreatedAction(type, _id)); }; Meteor.call(“registerFormFields.insert”, { type }, callBack); }; […]

Categories
Development

How to convert a tree into an array?

I have a tree object which is an irregular tree which children’s names and key values can change everytime I run my code. For example: { addressRouter: 192.168.0.1, addresses: { address1: ‘A’, }, { address2: ‘B’, }, { ports: [ { portA: ‘C’, portB: null }, } route: ‘D’, } so the names: ‘addressRouter’, ‘addresses’, […]

Categories
Development

firestore get field from all documents in collection

I’m trying to setup a chat app in which you can search for random users to talk to. Right now, my database structure in firestore is the following: collection “users” – document “userID” – collection “conversations” – document “conversationID” – fields “partner”, “lastmessage” Next to that I have a collection “conversations” which contains all the […]

Categories
Development

How should I write the constructor for my class

I have a container class to which i can send a Geometry object as constructor argument. Geometry is a polymorphic class as interface for other geometric types like Sphere and Rectangle. My question is that in Container class the constructor with arguments “Container(std::string str, Geometry* geometry)” can i code this in more flexible manner. Whenever […]

Categories
Development Swift

Getting and setting the position of content in a SwiftUI ScrollView

I have a horizontal scroll view where I’d like to set a position programmatically. Here is the body of the view: let radius = CGFloat(25) let scrollWidth = CGFloat(700) let scrollHeight = CGFloat(100) let spacing = CGFloat(20) let circleDiameter = CGFloat(50) … var body: some View { GeometryReader { viewGeometry in ScrollView () { VStack(spacing: […]

Categories
Angular Development

change dynamic description meta tag be detectable with search engines in angular 8

I created a website with angular 8. description’s meta’s tag have default value. I get description from backend with api rest and update description’s meta’s tag with Meta service in home page(main page). import { Meta } from ‘@angular/platform-browser’; search engines and analysis tools only detect default value.

Categories
Development Google

How to replace text in message with regex with variable get in sheet in google apps script

Firstly, I’m using google apps script I get an text body and I want to replace placeholder with variables in a sheet, I get a variable in my sheet and i want to replace it with regex but it’s not working it’s working with a variable that i just set but not with an value […]

Categories
Development

Unable to swipe to delete with tableview using diffable data source in iOS 13

I’m updating a UITableViewController to use the new UITableViewDiffableDataSource, I have everything working except Swipe to delete. This is an example of how I use swipe to delete func tableView(_ tableView: UITableView, trailingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? { let lockedAction = UIContextualAction(style: .normal, title: “TEST”) { (_, _, completion) in print(“tapped….”) completion(true) } return UISwipeActionsConfiguration(actions: […]