1679926923
zkEVM is a virtual machine that executes smart contracts in a way that is compatible with zero-knowledge-proof computation. Our zkEVM keeps EVM semantics, but is also ZK-friendly and takes on traditional CPU architectures.
Constantly updated, zkSync Era Docs offers the most complete knowledge about the upcoming zkSync Era. zkSync Era release has built-in EVM compatibility which makes it a single key to release EVM-compatible ZK rollup. We call it zkEVM: long-awaited way to preserve the battle-tested code and knowledge gained after years of working with Solidity scaling it with Layer 2.
The Frontend team chose the yarn@berry
packager, so don't forget to install node
version LTS@14 after configuring yarn
# configure yarn version: berry or specifically 3.1.1.
$ yarn set version berry
# install dependencies
$ yarn add
# serve with hot reload at localhost:8080
$ yarn docs:dev
# static generation to dist
$ yarn docs:build
CI pipeline will check that the files are formatted according to prettier
, markdownlint
founds no issues in document and spelling is correct. Also, there should be no dead links.
You can check it locally as follows:
# check dead links
$ yarn lint:dead
# check spelling
$ yarn lint:spell
# check with markdownlint
$ yarn lint:mdl
# check with prettier
$ yarn lint:fmt
# fix with markdownlint
$ yarn fix:mdl
# fix with prettier
$ yarn fix:fmt
# run all checks
$ yarn ci
# run all fixes
$ yarn ci:fix
# build for production
$ yarn ci:build
If lint:spell
doesn't recognize a word but you're sure that it's correct, consider adding it to the cspell-zksync.txt
.
To add a new tutorial:
docs/dev/tutorials
folder.docs/.vuepress/config.js
file, add the tutorial inside this block:{
title: "Tutorials",
path: "/dev/tutorials",
collapsable: false,
children: [
"/dev/tutorials/cross-chain-tutorial.md",
"/dev/tutorials/custom-aa-tutorial.md",
"/dev/tutorials/custom-paymaster-tutorial.md"],
// ADD YOUR FILE HERE
},
docs/assets/images
folder.main
branch is automatically deployed to https://console.firebase.google.com/u/0/project/aqwzx-zksync-v2-docs
will do:
dist
folder will be deployed in form of the static websiteyarn zk-ci-prepare
yarn firebase deploy
Configuration in .cSpell.json
:
version
— version of the setting file, always 0.1language
— language - current active spelling languagewords[]
— words - list of words to be always considered correctdictionaries[]
"dictionaryDefinitions": [
{
"name": "zksync", "path": "./cspell-zksync.txt"
}
]
Author: Matter-labs
Source Code: https://github.com/matter-labs/zksync-web-era-docs
License: MIT, Apache-2.0 licenses found
1679069100
Узнайте, как интегрировать проект Blazor WebAssembly в существующее веб-приложение ASP.NET Core, используя знакомые файлы кода C# и синтаксис Razor для реализации пользовательского веб-интерфейса.
Когда вы думаете о разработке пользовательского интерфейса для интерактивной сети, ваши мысли сразу же могут обратиться к JavaScript. Следовательно, для многих разработчиков C# это означало бы изучение всех тонкостей совершенно нового языка программирования.
Тем не менее, это не должно быть так! Blazor WASM (он же Blazor WebAssembly) позволяет разработчикам реализовывать пользовательские веб-интерфейсы, используя знакомые файлы кода C# и синтаксис Razor. Затем эти исходные файлы компилируются в байт-код для загрузки для запуска поверх среды выполнения WebAssembly в клиентском браузере, что обеспечивает повышение производительности среды выполнения за счет компиляции.
Blazor WebAssembly — это распространенное решение для одностраничных веб-приложений (или SPA), которое соответствует типичному многоуровневому шаблону разработки веб-приложений. В многоуровневом дизайне пользовательский интерфейс реализуется отдельно от бизнес-логики и доступа к данным, причем последние два обычно развертываются как служба API.
Начало работы с Blazor WASM в новых проектах с нуля упрощается, поскольку Visual Studio включает шаблоны для проектов Blazor WebAssembly, но что произойдет, если вы захотите интегрировать Blazor WASM с существующим веб-приложением ASP.NET Core? Как мы постепенно переносим и модернизируем существующие веб-приложения, чтобы использовать возможности Blazor WASM?
В этой статье вы узнаете, как интегрировать проект Blazor WebAssembly в существующее веб-приложение ASP.NET Core. Кроме того, вы узнаете, как интегрировать пользовательский интерфейс Progress Telerik для Blazor , который предоставляет готовые к использованию компоненты для создания привлекательных веб-интерфейсов пользователя с помощью Blazor WebAssembly.
В этой демонстрации мы создадим два проекта. Первый проект — это основное веб-приложение ASP.NET, представляющее наше существующее веб-приложение. Второй проект — это проект Blazor WebAssembly, в котором мы создадим новые компоненты Blazor для интеграции в наше существующее веб-приложение.
Примечание . Рекомендации в этой статье также применимы к проектам .NET 6.0. .NET 5 больше не поддерживается, поэтому рекомендуется сначала обновить существующие приложения как минимум до .NET 6.0.
Примечание . Рекомендации в этой статье также применимы к проектам .NET 6.0. .NET 5 больше не поддерживается, поэтому рекомендуется сначала обновить существующие приложения как минимум до .NET 6.0.
Шаблон приложения Blazor WebAssembly создает одностраничное приложение (SPA). Таким образом, когда приложение Blazor запускается, оно ищет элемент HTML с идентификатором , appчтобы содержать и отображать работающее приложение. Эту функцию необходимо отключить, так как в этом случае мы хотим, чтобы существующее веб-приложение обеспечивало общий пользовательский интерфейс, позволяя нам включать компоненты Blazor, разработанные в проекте Blazor WASM.
В панели обозревателя решений найдите проект BlazorApp и откройте файл Program.cs .
В файле Program.cs закомментируйте следующую строку кода и сохраните файл:
builder.RootComponents.Add<App>("#app");
Чтобы существующее веб-приложение ASP.NET Core могло использовать компоненты Blazor Web Assembly, нам потребуется ссылка на проект, пакет NuGet и некоторый код инфраструктуры.
else
{
app.UseWebAssemblyDebugging();
}
app.UseBlazorFrameworkFiles();
app.MapFallbackToFile("index.html");
<script src="_framework/blazor.webassembly.js"></script>
Примечание . Добавление сценария в _Layout.cs позволит вам добавлять компоненты Blazor в любое представление. Кроме того, вы можете включить сценарий только в каждое конкретное представление, в котором необходимы компоненты Blazor.
Проект приложения Blazor WebAssembly поставляется с компонентом счетчика в виде шаблона. Теперь мы добавим этот компонент в представление в нашем существующем веб-приложении ASP.NET Core (Existing.Web).
@using BlazorApp.Pages
<component type="typeof(Counter)" render-mode="WebAssemblyPrerendered" />
Запустите существующий проект веб-приложения и обратите внимание, как вы можете взаимодействовать с компонентом Counter из проекта Blazor WebAssembly.
Примечание . В качестве альтернативы, поскольку мы установили стартовый проект, вы также можете запустить экземпляр (с отладкой или без нее) из меню панели инструментов.
Теперь, когда мы успешно использовали компонент Blazor WebAssembly в нашем существующем веб-приложении ASP.NET Core, мы можем воспользоваться преимуществами компонентов, предоставляемых пользовательским интерфейсом Progress Telerik для Blazor. Эта библиотека компонентов совместима с проектами Blazor WebAssembly и Blazor Server.
Примечание . Проект сервера в нашем случае — это проект Existing.Web , и мы уже добавили код app.UseStaticFiles() , поэтому этот шаг можно пропустить (шаг 4, пункт № 2 в статье по ссылке).
@page "/counter"
<PageTitle>Counter</PageTitle>
<h1>Counter</h1>
<p role="status">Current count: @currentCount</p>
<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>
<br/>
<hr />
<TelerikButton OnClick="@SayHelloHandler" ThemeColor="primary">Say Hello</TelerikButton>
<br />
@helloString
@code {
private int currentCount = 0;
private void IncrementCount()
{
currentCount++;
}
MarkupString helloString;
void SayHelloHandler()
{
string msg = string.Format("Hello from <strong>Telerik Blazor</strong> at {0}.<br /> Now you can use C# to write front-end!", DateTime.Now);
helloString = new MarkupString(msg);
}
}
В этой статье мы интегрировали компоненты Blazor в существующее веб-приложение ASP.NET Core. Это открывает менее разрушительный путь миграции для переноса существующих проектов в Blazor WebAssembly.
Оригинальный источник статьи: https://www.telerik.com/
1679065260
了解如何将 Blazor WebAssembly 项目集成到现有的 ASP.NET Core Web 应用程序中,使用熟悉的 C# 代码文件和 Razor 语法来实现您的 Web UI。
当您考虑为交互式 Web 开发用户界面时,您的想法可能会立即转向 JavaScript。因此,对于许多 C# 开发人员来说,这意味着学习一门全新编程语言的来龙去脉。
但是,情况并非如此!Blazor WASM(又名 Blazor WebAssembly)允许开发人员使用熟悉的 C# 代码文件和 Razor 语法实现 Web 用户界面。然后将这些源文件编译成字节码以供下载以在客户端浏览器中的 WebAssembly 运行时运行,由于编译而产生改进的运行时性能。
Blazor WebAssembly 是适用于单页 Web 应用程序(或 SPA)的流行解决方案,它遵循 Web 应用程序开发的典型 n 层模式。在 n 层设计中,用户界面与业务逻辑和数据访问分开实现,后两者通常部署为 API 服务。
由于 Visual Studio 包含 Blazor WebAssembly 项目的模板,新项目中的 Blazor WASM 入门得到了简化,但是当您想要将 Blazor WASM 与现有的 ASP.NET Core Web 应用程序集成时会发生什么?我们如何缓慢迁移和现代化现有 Web 应用程序以利用 Blazor WASM 的强大功能?
在本文中,您将了解如何将 Blazor WebAssembly 项目集成到现有的 ASP.NET Core Web 应用程序中。此外,您将学习如何为 Blazor 合并 Progress Telerik UI,它提供随时可用的组件,用于使用 Blazor WebAssembly 构建引人注目的 Web 用户界面体验。
在此演示中,我们将创建两个项目。第一个项目是一个 ASP.NET Core Web 应用程序,代表我们现有的 Web 应用程序。第二个项目是 Blazor WebAssembly 项目,我们将在其中构建新的 Blazor 组件以集成到我们现有的 Web 应用程序中。
注意:本文中的指南也适用于 .NET 6.0 项目。.NET 5 不受支持,因此建议先将现有应用程序至少升级到 .NET 6.0。
注意:本文中的指南也适用于 .NET 6.0 项目。.NET 5 不受支持,因此建议先将现有应用程序至少升级到 .NET 6.0。
Blazor WebAssembly 应用程序模板生成单页应用程序 (SPA)。因此,当 Blazor 应用程序运行时,它会查找 ID 为 的 HTML 元素app来包含和显示正在运行的应用程序。需要禁用此功能,因为在这种情况下,我们希望现有的 Web 应用程序提供整体用户体验,同时允许我们合并在 Blazor WASM 项目中开发的 Blazor 组件。
在“解决方案资源管理器”面板中,找到BlazorApp项目并打开Program.cs文件。
在Program.cs文件中,注释掉以下代码行并保存文件:
builder.RootComponents.Add<App>("#app");
为了让现有的 ASP.NET Core Web 应用程序能够使用 Blazor Web Assembly 组件,我们需要一个项目引用、NuGet 包和一些基础结构代码。
else
{
app.UseWebAssemblyDebugging();
}
app.UseBlazorFrameworkFiles();
app.MapFallbackToFile("index.html");
<script src="_framework/blazor.webassembly.js"></script>
注意:将脚本添加到_Layout.cs将允许您将 Blazor 组件添加到任何视图。或者,您可以选择仅在需要 Blazor 组件的每个特定视图中包含脚本。
Blazor WebAssembly 应用程序项目附带一个计数器组件脚手架。我们现在将此组件添加到现有 ASP.NET Core Web 应用程序 (Existing.Web) 中的视图。
@using BlazorApp.Pages
<component type="typeof(Counter)" render-mode="WebAssemblyPrerendered" />
运行现有的 Web 应用程序项目并注意如何与Blazor WebAssembly 项目中的计数器组件进行交互。
注意:或者,由于我们设置了启动项目,您也可以从工具栏菜单启动一个实例(有或没有调试)。
现在我们已经在现有的 ASP.NET Core Web 应用程序中成功使用了 Blazor WebAssembly 组件,我们可以利用 Progress Telerik UI 为 Blazor 提供的组件。此组件库与 Blazor WebAssembly 和 Blazor Server 项目兼容。
注意:我们案例中的服务器项目是Existing.Web项目,并且我们已经添加了app.UseStaticFiles()代码,因此可以跳过此步骤(链接文章中的第 4 步,第 2 项)。
@page "/counter"
<PageTitle>Counter</PageTitle>
<h1>Counter</h1>
<p role="status">Current count: @currentCount</p>
<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>
<br/>
<hr />
<TelerikButton OnClick="@SayHelloHandler" ThemeColor="primary">Say Hello</TelerikButton>
<br />
@helloString
@code {
private int currentCount = 0;
private void IncrementCount()
{
currentCount++;
}
MarkupString helloString;
void SayHelloHandler()
{
string msg = string.Format("Hello from <strong>Telerik Blazor</strong> at {0}.<br /> Now you can use C# to write front-end!", DateTime.Now);
helloString = new MarkupString(msg);
}
}
在本文中,我们将 Blazor 组件集成到现有的 ASP.NET Core Web 应用程序中。这为将现有项目移动到 Blazor WebAssembly 开辟了一条破坏性较小的迁移路径。
文章原文出处:https: //www.telerik.com/
1679061429
See how to integrate a Blazor WebAssembly project into an existing ASP.NET Core web application, using familiar C# code files and Razor syntax to implement your web UI.
When you think of developing a user interface for the interactive web, your thoughts may immediately turn to JavaScript. Consequently, for many C# developers, this would mean learning the ins and outs of an entirely new programming language.
However, this doesn’t have to be the case! Blazor WASM (aka Blazor WebAssembly) allows developers to implement web user interfaces using familiar C# code files and Razor syntax. These source files are then compiled into byte code for download to run atop the WebAssembly runtime in the client browser, yielding improved runtime performance due to the compilation.
Blazor WebAssembly is a prevalent solution for single-page web applications (or SPAs) that adheres to the typical n-layer pattern of web application development. In the n-layer design, the user interface is implemented separately from the business logic and data access, with the latter two typically deployed as an API service.
Getting started with Blazor WASM in new greenfield projects is simplified as Visual Studio includes templates for Blazor WebAssembly projects, but what happens when you want to integrate Blazor WASM with an existing ASP.NET Core web application? How do we slowly migrate and modernize existing web applications to harness the power of Blazor WASM?
In this article, you will learn how to integrate a Blazor WebAssembly project into an existing ASP.NET Core web application. Furthermore, you’ll learn how to incorporate Progress Telerik UI for Blazor, which provides ready-to-use components for building compelling web user interface experiences with Blazor WebAssembly.
In this demonstration, we’ll create two projects. The first project is an ASP.NET Core Web Application representing our existing web application. The second project is a Blazor WebAssembly project where we’ll build new Blazor components to integrate into our existing web application.
Create a new project
.ASP.NET Core Web App
. Press Next.Existing.Web
, optionally choose the file system location and press Next.Note: The guidance in this article will also work with .NET 6.0 projects. .NET 5 is out of support, so it is recommended to upgrade existing applications to at least .NET 6.0 first.
Blazor WebAssembly
and select Blazor WebAssembly App from the search results. Press Next.BlazorApp
and press Next.Note: The guidance in this article will also work with .NET 6.0 projects. .NET 5 is out of support, so it is recommended to upgrade existing applications to at least .NET 6.0 first.
The Blazor WebAssembly App template generates a single-page application (SPA). Therefore, when the Blazor application runs, it looks for an HTML element with the ID of app
to contain and display the running application. This functionality needs to be disabled as, in this case, we want the existing web application to provide the overall user experience while allowing us to incorporate Blazor components developed in the Blazor WASM project.
In the Solution Explorer panel, locate the BlazorApp project and open the Program.cs file.
In the Program.cs file, comment out the following line of code and save the file:
builder.RootComponents.Add<App>("#app");
In order for the existing ASP.NET Core web application to make use of the Blazor Web Assembly components, we will need a project reference, NuGet package and some infrastructure code.
Microsoft.AspNetCore.Components.WebAssembly.Server
into the search box. Select Microsoft.AspNetCore.Components.WebAssembly.Server from the search results and press Install. Accept any Licenses.else
{
app.UseWebAssemblyDebugging();
}
app.UseBlazorFrameworkFiles();
app.MapFallbackToFile("index.html");
<script src="_framework/blazor.webassembly.js"></script>
Note: Adding the script to _Layout.cs will allow you to add Blazor components to any view. Alternatively, you can choose to only include the script on each specific view that Blazor components are needed.
The Blazor WebAssembly App project comes with a Counter component scaffolded. We’ll now add this component to a view in our existing ASP.NET Core Web Application (Existing.Web).
@using BlazorApp.Pages
<component type="typeof(Counter)" render-mode="WebAssemblyPrerendered" />
Run the existing web application project and notice how you can interact with the Counter component from the Blazor WebAssembly project.
Note: Alternatively, since we set the startup project you can also start an instance (with or without debugging) from the toolbar menu.
Now that we’ve successfully used a Blazor WebAssembly component in our existing ASP.NET Core Web Application, we can take advantage of the components provided by Progress Telerik UI for Blazor. This component library is compatible with both Blazor WebAssembly and Blazor Server projects.
Note: The Server project in our case is the Existing.Web project, and we’ve already added the app.UseStaticFiles() code, so this step can be skipped (Step 4, item #2 in the article linked).
@page "/counter"
<PageTitle>Counter</PageTitle>
<h1>Counter</h1>
<p role="status">Current count: @currentCount</p>
<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>
<br/>
<hr />
<TelerikButton OnClick="@SayHelloHandler" ThemeColor="primary">Say Hello</TelerikButton>
<br />
@helloString
@code {
private int currentCount = 0;
private void IncrementCount()
{
currentCount++;
}
MarkupString helloString;
void SayHelloHandler()
{
string msg = string.Format("Hello from <strong>Telerik Blazor</strong> at {0}.<br /> Now you can use C# to write front-end!", DateTime.Now);
helloString = new MarkupString(msg);
}
}
In this article, we integrated Blazor components into an existing ASP.NET Core web application. This opens up a less disruptive migration path for moving existing projects to Blazor WebAssembly.
Original article source at: https://www.telerik.com/
1678305420
A swifter Core Data stack
This library aims to do the following:
pod 'JSQCoreDataKit', '~> 9.0.0'
Add JSQCoreDataKit
to the dependencies
value of your Package.swift
.
dependencies: [
.package(url: "https://github.com/jessesquires/JSQCoreDataKit.git", from: "9.0.0")
]
Alternatively, you can add the package directly via Xcode.
You can read the documentation here. Generated with jazzy. Hosted by GitHub Pages.
Interested in making contributions to this project? Please review the guides below.
Also, consider sponsoring this project or buying my apps! ✌️
Created and maintained by @jesse_squires.
Author: jessesquires
Source Code: https://github.com/jessesquires/JSQCoreDataKit
License: MIT license
1677598981
This is a native app that shows how to integrate Apple's Core ML Stable Diffusion implementation in a native Swift UI application. The Core ML port is a simplification of the Stable Diffusion implementation from the diffusers library. This application can be used for faster iteration, or as sample code for any use cases.
This is what the app looks like on macOS:
On first launch, the application downloads a zipped archive with a Core ML version of Stability AI's Stable Diffusion v2 base, from this location in the Hugging Face Hub. This process takes a while, as several GB of data have to be downloaded and unarchived.
For faster inference, we use a very fast scheduler: DPM-Solver++, that we ported to Swift from our diffusers DPMSolverMultistepScheduler implementation.
See this post and this issue for additional performance figures.
The application will try to guess the best hardware to run models on. You can override this setting using the Advanced
section in the controls sidebar.
The easiest way to test the app on macOS is by downloading it from the Mac App Store.
You need Xcode to build the app. When you clone the repo, please update common.xcconfig
with your development team identifier. Code signing is required to run on iOS, but it's currently disabled for macOS.
Performance on iPhone is somewhat erratic, sometimes it's ~20x slower and the phone heats up. This happens because the model could not be scheduled to run on the Neural Engine and everything happens in the CPU. We have not been able to determine the reasons for this problem. If you observe the same, here are some recommendations:
Author: Huggingface
Source Code: https://github.com/huggingface/swift-coreml-diffusers
License: Apache-2.0 license
1676342160
Sometimes our application frequently calls the same method and fetches the data from the database. The output of these requests is the same at all times. It doesn't get changed or updated in the database. In this case, we can use caching to reduce the database calls and retrieve the data directly from the cache memory.
There are 3 types of cache available,
In-Memory cache means storing the cache data on the server's memory.
It is easier and quicker than other caching mechanisms
It is suited for small and middle applications.
If the cache is not configured properly then, it can consume the server’s resources.
Scalability Issues. It is suitable for a single server. If we have many servers then, can't share the cache with all servers.
Original article source at: https://www.c-sharpcorner.com/
1670256741
We were developing a database project in .NET 6 using Entity Framework Core. Our back-end database engine was MySql rather than SQL server. It was a remote database. Short operations like single read and write worked fine but suddenly I stuck somewhere and got this horrible error.
The error was
“A second operation was started on this context instance before a previous operation was completed. This is usually caused by different threads concurrently using the same instance of DbContext.”
I started the operation again and surprisingly, this time the error was different regardless of the fact that all the inputs I provided were the same.
The error I got this time is:
“ The configured execution strategy 'MySqlRetryingExecutionStrategy' does not support user-initiated transactions. Use the execution strategy returned by 'DbContext.Database.CreateExecutionStrategy()' to execute all the operations in the transaction as a retriable unit.' ”
Please note that if you are using SQL Server as a database engine, You’ll receive SqlRetryingExecutionStrategy rather than MySqlRetryingExecutionStrategy.
I tested the application many times and explored the stack trace in detail and also do a lot of search online but failed to figure out the issue as my app followed all the suggested solution standards.
I started following a thread on github where one important thing was mentioned.
One has to be careful while working with sync and async method. If you are following sync method patterns in your code, better to follow it completely, mean use sync method in all of your codebase. Don’t mix sync calls with async calls in your code.
If you working with async methods in your code it is highly recommended to use the async method with await in all the places in your codebase.
This last line give me some hint to find out the issue so started exploring the code backward. From the position where error or exception was coming while going backward from line to line, there was an async function which has no await before its invocation.
As soon as I applied this await prior to this call, both errors are gone.
Original article source at: https://www.c-sharpcorner.com/
1661609700
afya_moja_core
is an open source project — it's one among many other shared libraries that make up the wider ecosystem of software made and open sourced by Savannah Informatics Limited
.
A shared library for ProHealth360
and ProHealth360 Daktari
that is responsible for rendering and exposing shared components
Use this package as a library by depending on it
Run this command:
flutter pub add afya_moja_core
This will add a line like this to your package's pubspec.yaml (and run an implicit dart pub get):
dependencies:
afya_moja_core: ^0.2.14
Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.
Lastly:
Import it like so:
import 'package:afya_moja_core/buttons.dart';
Check the example provided for how to use this package.
First off, thanks for taking the time to contribute!
Be sure to check out detailed instructions on how to contribute to this project here and go through out Code of Conduct.
GPG Signing: As a contributor, you need to sign your commits. For more details check here
Author: Savannahghi
Source Code: https://github.com/savannahghi/afya_moja_core
License: MIT license
1661428707
Simplio wallet core library for blockchain interactions, developed in Dart, can be used in Flutter framework.
Sio_core library is working hand in hand with trust_wallet_core_lib, so please check the setup of trust_wallet_core_lib.
// ignore_for_file: avoid_print
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:sio_core/sio_core.dart';
import 'package:trust_wallet_core_lib/trust_wallet_core_ffi.dart';
import 'package:trust_wallet_core_lib/trust_wallet_core_lib.dart' as trust_core;
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'sio_core example',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: const MyHomePage(title: 'sio_core example'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({Key? key, required this.title}) : super(key: key);
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
late trust_core.HDWallet wallet;
final mnemonic =
'horror select baby exile convince sunset outside vehicle write decade powder energy';
Future<String> example() async {
if (Mnemonic.isValid(mnemonic: mnemonic)) {
wallet = Mnemonic.import(mnemonic: mnemonic);
} else {
throw Exception(['Mnemonic is not valid!']);
}
// ignore: unused_local_variable
final solAddress = wallet.getAddressForCoin(TWCoinType.TWCoinTypeSolana);
print('My solana address: $solAddress');
var toAddress = '3fTR8GGL2mniGyHtd3Qy2KDVhZ9LHbW59rCc7A3RtBWk';
var amount = '2000';
try {
final latestBlockHash = await UtilsSolana.latestBlockHashRequest(
apiEndpoint: 'https://api.mainnet-beta.solana.com/');
print(latestBlockHash);
final signedSolanaTx = BuildTransaction.solana(
recipient: toAddress,
amount: amount,
wallet: wallet,
latestBlockHash: latestBlockHash,
);
print(signedSolanaTx.toJson());
try {
// Broadcasting will throw exception - it is normal unless u move funds in your solana address
final broadcastSolanaTx = await Broadcast.solana(
signedTxEncoded: signedSolanaTx.rawTx!,
apiEndpoint: 'https://api.mainnet-beta.solana.com',
);
print(broadcastSolanaTx);
} catch (exception) {
print(exception);
}
} catch (exception) {
print(exception);
}
const tokenMintAddress = 'SioTkQxHyAs98ouRiyi1YDv3gLMSrX3eNBg61GH7NrM';
try {
final latestBlockHash = await UtilsSolana.latestBlockHashRequest(
apiEndpoint: 'https://api.mainnet-beta.solana.com/');
print(latestBlockHash);
final signedSolanaTokenTx = BuildTransaction.solanaToken(
amount: amount,
decimals: 8,
tokenMintAddress: tokenMintAddress,
recipientSolanaAddress: toAddress,
wallet: wallet,
latestBlockHash: latestBlockHash,
);
print(signedSolanaTokenTx.toJson());
final broadcastSolanaTokenTx = await Broadcast.solana(
signedTxEncoded: signedSolanaTokenTx.rawTx!,
apiEndpoint: 'https://api.mainnet-beta.solana.com/',
);
// Broadcasting will throw exception - it is normal unless u move funds in your solana address
print(broadcastSolanaTokenTx);
} catch (exception) {
print(exception);
}
return 'Success';
}
@override
void initState() {
trust_core.TrustWalletCoreLib.init();
super.initState();
example();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: const <Widget>[],
),
);
}
}
Run this command:
With Flutter:
$ flutter pub add sio_core
This will add a line like this to your package's pubspec.yaml (and run an implicit flutter pub get
):
dependencies:
sio_core: ^0.1.0
Alternatively, your editor might support flutter pub get
. Check the docs for your editor to learn more.
Now in your Dart code, you can use:
import 'package:sio_core/sio_core.dart';
List of supported chains here.
Author: SimplioOfficial
Source Code: https://github.com/SimplioOfficial/sio_core
License: BSD-3-Clause license
1659918480
Official Golang implementation of the IoTeX protocol.
Welcome to the official Go implementation of IoTeX protocol! IoTeX is building the next generation of the decentralized blockchain protocol for powering real-world information marketplace in a decentralized-yet-scalable way. Refer to IoTeX whitepaper for details.
Please visit https://iotex.io official website or IoTeX onboard pack to learn more about IoTeX network.
Please visit IoTeX Delegate Manual for detailed setup process.
Components | Version | Description |
---|---|---|
Golang | ≥ 1.17.3 | Go programming language |
Protoc | ≥ 3.6.0 | Protocol buffers, required only when you rebuild protobuf messages |
Download the code to your desired local location (doesn't have to be under $GOPATH/src
)
git clone git@github.com:iotexproject/iotex-core.git
cd iotex-core
If you put the project code under your $GOPATH\src
, you will need to set up an environment variable
export GO111MODULE=on
set GO111MODULE=on (for windows)
Build the project for general purpose (server, ioctl) by
make
Build the project for broader purpose (server, ioctl, injector...) by
make all
If the dependency needs to be updated, run
go get -u
go mod tidy
If you want learn more advanced usage about go mod
, you can find out here.
Run unit tests only by
make test
Build the docker image by
make docker
Start (or resume) a standalone server to operate on an blockchain by
make run
Restart the server from a clean state by
make reboot
If "make run" fails due to corrupted or missing state database while block database is in normal condition, e.g., failing to get factory's height from underlying DB, please try to recover state database by
make recover
Then, "make run" again.
Users could interact with iotex blockchain by
ioctl [command]
Refer to CLI document for more details.
We are glad to have contributors out of the core team; contributions, including (but not limited to) style/bug fixes, implementation of features, proposals of schemes/algorithms, and thorough documentation, are welcomed. Please refer to our contribution guideline for more information. Development guide documentation is here.
For any major protocol level changes, we use IIP to track the proposal, decision and etc.
Thank you for considering contributing to the IoTeX framework!
Author: iotexproject
Source Code: https://github.com/iotexproject/iotex-core
License: Apache-2.0 license
1659717540
trust_wallet_core_lib
A Flutter plugin for trust wallet core. It can access all api list in https://github.com/trustwallet/wallet-core/tree/master/include/TrustWalletCore (from trust_wallet_core 2.6.20)
This project was originally copied from weishirongzhen
trust_wallet_core_lib is supporting Android and iOS platforms only. (Only Android platform was tested).
Android
minSdk require >=23
Add
class MainActivity: FlutterActivity() {
init {
System.loadLibrary("TrustWalletCore")
}
}
in your android project MainActivity.kt file
iOS
min ios platform support >=13.0
Flutter
Before using this package, you need to initialize it:
FlutterTrustWalletCore.init();
Run this command:
With Flutter:
$ flutter pub add trust_wallet_core_lib
This will add a line like this to your package's pubspec.yaml (and run an implicit flutter pub get
):
dependencies:
trust_wallet_core_lib: ^0.0.6+2.9.6
Alternatively, your editor might support flutter pub get
. Check the docs for your editor to learn more.
Now in your Dart code, you can use:
import 'package:trust_wallet_core_lib/trust_wallet_core_lib.dart';
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:trust_wallet_core_lib/trust_wallet_core_lib.dart';
import 'package:trust_wallet_core_lib_example/bitcoin_address_example.dart';
import 'package:trust_wallet_core_lib_example/bitcoin_transaction_example.dart';
import 'package:trust_wallet_core_lib_example/ethereum_example.dart';
import 'package:trust_wallet_core_lib_example/private_key_is_valid_example.dart';
import 'package:trust_wallet_core_lib_example/tron_example.dart';
List<String> logs = [];
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Example(),
);
}
}
class Example extends StatefulWidget {
@override
_ExampleState createState() => _ExampleState();
}
class _ExampleState extends State<Example> {
late HDWallet wallet;
@override
void initState() {
TrustWalletCoreLib.init();
super.initState();
String mnemonic =
"rent craft script crucial item someone dream federal notice page shrug pipe young hover duty"; // 有测试币的 tron地址
wallet = HDWallet.createWithMnemonic(mnemonic);
}
Widget _exampleItem({
required String name,
required WidgetBuilder builder,
}) {
return ElevatedButton(
onPressed: () {
Navigator.of(context).push(MaterialPageRoute(builder: builder));
},
child: Text(name),
);
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('wallet core example app'),
),
body: SafeArea(
child: Column(
children: [
Text(wallet.mnemonic()),
Expanded(
child: ListView(
padding: EdgeInsets.zero,
children: [
_exampleItem(
name: 'Ethereum',
builder: (_) {
return EthereumExample(wallet);
},
),
_exampleItem(
name: 'Bitcoin Address',
builder: (_) {
return BitcoinAddressExample(wallet);
},
),
_exampleItem(
name: 'Bitcoin Transaction',
builder: (_) {
return BitcoinTransactionExample(wallet);
},
),
_exampleItem(
name: 'Tron',
builder: (_) {
return TronExample(wallet);
},
),
_exampleItem(
name: 'PrivateKey.isValid(a,b)',
builder: (_) {
return PrivateKeyIsValidExample(wallet);
},
),
],
),
),
ElevatedButton(
onPressed: () async {
wallet.delete();
wallet = HDWallet();
setState(() {});
},
child: Text("gen"),
),
],
),
),
);
}
}
Author: Ciripel
Source Code: https://github.com/ciripel/trust_wallet_core_lib
License: MIT license
1657912200
A new Flutter package.
Run this command:
With Flutter:
$ flutter pub add nui_core
This will add a line like this to your package's pubspec.yaml (and run an implicit flutter pub get
):
dependencies:
nui_core: ^0.1.1
Alternatively, your editor might support flutter pub get
. Check the docs for your editor to learn more.
Now in your Dart code, you can use:
import 'package:nui_core/nui_core.dart';
This project is a starting point for a Dart package, a library module containing code that can be shared easily across multiple Flutter or Dart projects.
For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.
Original article source at: https://pub.dev/packages/nui_core
1657835580
Ruby bindings for the Stanford CoreNLP Toolchain.
This gem provides high-level Ruby bindings to the Stanford CoreNLP package, a set natural language processing tools for tokenization, sentence segmentation, part-of-speech tagging, lemmatization, and parsing of English, French and German. The package also provides named entity recognition and coreference resolution for English.
This gem is compatible with Ruby 2.3
and 2.4
as well as JRuby 1.7
and 9
. Older Ruby version should work as well.
You need Java 8 for the latest CoreNLP version (since 3.5.0, 2014-10-31), earlier versions are tested on both Java 6 and Java 7.
The version schema has been changed to reflect the development of Stanford CoreNLP itself. We'll release a gem for every new version from Stanford.
We strive to support all languages Stanford CoreNLP can work with.
Annotator | ar | zh | en | fr | de | es |
---|---|---|---|---|---|---|
Tokenize / Segment | ✔ | ✔ | ✔ | ✔ | ✔ | |
Sentence Split | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
Part of Speech | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
Lemma | ✔ | |||||
Named Entities | ✔ | ✔ | ✔ | ✔ | ||
Constituency Parsing | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
Dependency Parsing | ✔ | ✔ | ✔ | ✔ | ||
Sentiment Analysis | ✔ | |||||
Mention Detection | ✔ | ✔ | ||||
Coreference | ✔ | ✔ | ||||
Open IE | ✔ |
First, install the gem: gem install stanford-core-nlp
. Then, download the Stanford Core NLP JAR and model files: Stanford CoreNLP
Place the contents of the extracted archive inside the /bin/
folder of the stanford-core-nlp gem (e.g. [...]/gems/stanford-core-nlp-0.x/bin/).
You may want to set some optional configuration options. Here are some examples:
# Set an alternative path to look for the JAR files
# Default is gem's bin folder.
StanfordCoreNLP.jar_path = '/path_to_jars/'
# Set an alternative path to look for the model files
# Default is gem's bin folder.
StanfordCoreNLP.model_path = '/path_to_models/'
# Pass some alternative arguments to the Java VM.
# Default is ['-Xms512M', '-Xmx1024M'] (be prepared
# to take a coffee break).
StanfordCoreNLP.jvm_args = ['-option1', '-option2']
# Redirect VM output to log.txt
StanfordCoreNLP.log_file = 'log.txt'
# Change a specific model file.
StanfordCoreNLP.set_model('pos.model', 'english-left3words-distsim.tagger')
# Use the model files for a different language than English.
StanfordCoreNLP.use :french # or :german
text = 'Angela Merkel met Nicolas Sarkozy on January 25th in ' +
'Berlin to discuss a new austerity package. Sarkozy ' +
'looked pleased, but Merkel was dismayed.'
pipeline = StanfordCoreNLP.load(:tokenize, :ssplit, :pos, :lemma, :parse, :ner, :dcoref)
text = StanfordCoreNLP::Annotation.new(text)
pipeline.annotate(text)
text.get(:sentences).each do |sentence|
# Syntatical dependencies
puts sentence.get(:basic_dependencies).to_s
sentence.get(:tokens).each do |token|
# Default annotations for all tokens
puts token.get(:value).to_s
puts token.get(:original_text).to_s
puts token.get(:character_offset_begin).to_s
puts token.get(:character_offset_end).to_s
# POS returned by the tagger
puts token.get(:part_of_speech).to_s
# Lemma (base form of the token)
puts token.get(:lemma).to_s
# Named entity tag
puts token.get(:named_entity_tag).to_s
# Coreference
puts token.get(:coref_cluster_id).to_s
# Also of interest: coref, coref_chain,
# coref_cluster, coref_dest, coref_graph.
end
end
Important: You need to load the StanfordCoreNLP pipeline before using the StanfordCoreNLP::Annotation class.
The Ruby symbol (e.g. :named_entity_tag
) corresponding to a Java annotation class is the snake_case
of the class name, with 'Annotation' at the end removed. For example, NamedEntityTagAnnotation
translates to :named_entity_tag
, PartOfSpeechAnnotation
to :part_of_speech
, etc.
A good reference for names of annotations are the Stanford Javadocs for CoreAnnotations, CoreCorefAnnotations, and TreeCoreAnnotations. For a full list of all possible annotations, see the config.rb
file inside the gem.
Loading specific classes
You may want to load additional Java classes (including any class from the Stanford NLP packages). The gem provides an API for this:
# Default base class is edu.stanford.nlp.pipeline.
StanfordCoreNLP.load_class('PTBTokenizerAnnotator')
puts StanfordCoreNLP::PTBTokenizerAnnotator.inspect
# => #<Rjb::Edu_stanford_nlp_pipeline_PTBTokenizerAnnotator>
# Here, we specify another base class.
StanfordCoreNLP.load_class('MaxentTagger', 'edu.stanford.nlp.tagger')
puts StanfordCoreNLP::MaxentTagger.inspect
# => <Rjb::Edu_stanford_nlp_tagger_maxent_MaxentTagger:0x007f88491e2020>
Here is a full list of annotator classes provided by the Stanford Core NLP package. You can load these classes individually using StanfordCoreNLP.load_class
(see above). Once this is done, you can use them like you would from a Java program. Refer to the Java documentation for a list of functions provided by each of these classes.
Here is a full list of the default models for the Stanford Core NLP pipeline. You can change these models individually using StanfordCoreNLP.set_model
(see above).
To run the specs for each language (after copying the JARs into the bin
folder):
rake spec[english]
rake spec[german]
rake spec[french]
Using the latest version of the Stanford CoreNLP (version 3.5.0 as of 31/10/2014) requires some additional manual steps:
StanfordCoreNLP.use :english
StanfordCoreNLP.model_files = {}
StanfordCoreNLP.default_jars = [
'joda-time.jar',
'xom.jar',
'stanford-corenlp-3.5.0.jar',
'stanford-corenlp-3.5.0-models.jar',
'jollyday.jar',
'bridge.jar'
]
Or configure your setup (for French) as follows:
StanfordCoreNLP.use :french
StanfordCoreNLP.model_files = {}
StanfordCoreNLP.set_model('pos.model', 'french.tagger')
StanfordCoreNLP.default_jars = [
'joda-time.jar',
'xom.jar',
'stanford-corenlp-3.5.0.jar',
'stanford-corenlp-3.5.0-models.jar',
'jollyday.jar',
'bridge.jar'
]
Or configure your setup (for German) as follows:
StanfordCoreNLP.use :german
StanfordCoreNLP.model_files = {}
StanfordCoreNLP.set_model('pos.model', 'german-fast.tagger')
StanfordCoreNLP.default_jars = [
'joda-time.jar',
'xom.jar',
'stanford-corenlp-3.5.0.jar',
'stanford-corenlp-3.5.0-models.jar',
'jollyday.jar',
'bridge.jar'
]
We are very glad to see you in this section and highly appreciate any help!
If you want to contribute please agree that your work will be published under the terms of the GPL v.3.0
license.
Some of the open tasks for contributors are listed on the issues page. You may want to start there.
Then feel free to fork the code and send us a pull request.
Download Details:
Author: louismullie
Source Code: https://github.com/louismullie/stanford-core-nlp
License: View license
1657829460
Generic stream reconnection module.
Create a reconnect
instance that keeps reconnecting over tcp:
var inject = require('reconnect-core');
var net = require('net');
// build you own reconnect module
var reconnect = inject(function () {
// arguments are what you passed to .connect
// this is the reconnect instance
return net.connect.apply(null, arguments);
});
var re = reconnect({
// all options are optional
initialDelay: 1e3,
maxDelay: 30e3,
strategy: 'fibonacci', // available: fibonacci, exponential, or a custom backoff instance (see below)
failAfter: Infinity,
randomisationFactor: 0,
immediate: false
}, function (stream) {
// stream = the stream you should consume
})
.on('connect', function (con) {
// con = underlying connection
})
.on('reconnect', function (n, delay) {
// n = current number of reconnect
// delay = delay used before reconnect
})
.on('disconnect', function (err) {
// err = possible error
})
.on('error', function (err) {
// never forget
})
.connect(port)
// disconnect
re.disconnect();
// ...or prevent reconnecting
re.reconnect = false;
// reset the internal backoff timer
re.reset();
reconnect utilises the backoff library to control backoff behaviour. There are 2 options for choosing a strategy for your reconnect instance, pass one of the following to the strategy
key when creating your instance:
An example using a custom strategy:
var inject = require('reconnect-core');
var backoff = require('backoff');
var net = require('net');
// build you own reconnect module
var reconnect = inject(function () {
// arguments are what you passed to .connect
// this is the reconnect instance
return net.connect.apply(null, arguments);
});
// Reconnect every 10 seconds
var myStrategy = {
next: function() { return 10e3; },
reset: function() { }
}
var re = reconnect({
strategy: new backoff.Backoff(myStrategy),
failAfter: Infinity,
immediate: false
}, function (stream) {
// stream = the stream you should consume
})
With npm do:
npm install reconnect-core
This has been refactored out of dominictarr's reconnect module.
Author: juliangruber
Source Code: https://github.com/juliangruber/reconnect-core
License: MIT