Rylan  Becker

Rylan Becker

1663764191

5 Popular Libraries Python Programming on Microsoft Windows

In this Python article, let's learn about Microsoft Windows: 5 Popular Libraries Python Programming on Microsoft Windows

Table of contents:

  • Python(x,y) - Scientific-applications-oriented Python Distribution based on Qt and Spyder.
  • pythonlibs - Unofficial Windows binaries for Python extension packages.
  • PythonNet - Python Integration with the .NET Common Language Runtime (CLR).
  • PyWin32 - Python Extensions for Windows.
  • WinPython - Portable development environment for Windows 7/8.

What is Python?

Python is an interpreted, object-oriented, high-level programming language with dynamic semantics. Its high-level built in data structures, combined with dynamic typing and dynamic binding, make it very attractive for Rapid Application Development, as well as for use as a scripting or glue language to connect existing components together. Python's simple, easy to learn syntax emphasizes readability and therefore reduces the cost of program maintenance. Python supports modules and packages, which encourages program modularity and code reuse. The Python interpreter and the extensive standard library are available in source or binary form without charge for all major platforms, and can be freely distributed.

What are the Windows in Python?

The Python window is an efficient and convenient location to use geoprocessing tools and Python functionality from within ArcGIS. The Python commands run from this window can range from single lines of code to complex blocks with logic.


5 Popular Libraries Python Programming on Microsoft Windows

  1. Python(x,y)

Python(x,y) is a free scientific and engineering development software for numerical computations, data analysis and data visualization based on Python programming language, Qt graphical user interfaces and Spyder interactive scientific development environment.

With Python(x,y), one can do:

  • interactive calculations including for example 2D and 3D plotting or symbolic maths,
  • simple functionnal programming (with MATLAB-like syntax) as well as powerful object-oriented programming,
  • scientific projects development from the simplest script to the most sophisticated application thanks to Qt development framework and Spyder development environment,
  • parallel computing on multicore/processors computers or even clusters (with Parallel Python),

And A lot more...

What is exactly Python(x,y)?

Python(x,y) is a scientific-oriented Python Distribution based on Qt and Spyder - see the Plugins page. Its purpose is to help scientific programmers used to interpreted languages (such as MATLAB or IDL) or compiled languages (C/C++ or Fortran) to switch to Python. C/C++ or Fortran programmers should appreciate to reuse their code "as is" by wrapping it so it can be called directly from Python scripts.

View on source


2.  Pythonnet

Python.NET is a package that gives Python programmers nearly seamless integration with the .NET Common Language Runtime (CLR) and provides a powerful application scripting tool for .NET developers. It allows Python code to interact with the CLR, and may also be used to embed Python into a .NET application.

Note

The master branch of this repository tracks the ongoing development of version 3.0. Backports of patches to 2.5 are tracked in the backports-2.5 branch.

Calling .NET code from Python

Python.NET allows CLR namespaces to be treated essentially as Python packages.

import clr
from System import String
from System.Collections import *

To load an assembly, use the AddReference function in the clr module:

import clr
clr.AddReference("System.Windows.Forms")
from System.Windows.Forms import Form

Embedding Python in .NET

  • You must set Runtime.PythonDLL property or PYTHONNET_PYDLL environment variable starting with version 3.0, otherwise you will receive BadPythonDllException (internal, derived from MissingMethodException) upon calling Initialize. Typical values are python38.dll (Windows), libpython3.8.dylib (Mac), libpython3.8.so (most other Unix-like operating systems).
  • All calls to python should be inside a using (Py.GIL()) {/* Your code here */} block.
  • Import python modules using dynamic mod = Py.Import("mod"), then you can call functions as normal, eg mod.func(args).
  • Use mod.func(args, Py.kw("keywordargname", keywordargvalue)) or mod.func(args, keywordargname: keywordargvalue) to apply keyword arguments.
  • All python objects should be declared as dynamic type.
  • Mathematical operations involving python and literal/managed types must have the python object first, eg. np.pi * 2 works, 2 * np.pi doesn't.

View on GitHub


3.  Pywin32

Python for Windows (pywin32) Extensions

This is the readme for the Python for Win32 (pywin32) extensions, which provides access to many of the Windows APIs from Python.

See CHANGES.txt for recent notable changes.

Only Python 3 is supported. If you want Python 2 support, you want build 228.

Docs

The docs are a long and sad story, but there's now an online version of the helpfile that ships with the installers (thanks @ofek!). Lots of that is very old, but some is auto-generated and current. Would love help untangling the docs!

Support

Feel free to open issues for all bugs (or suspected bugs) in pywin32. pull-requests for all bugs or features are also welcome.

However, please do not open github issues for general support requests, or for problems or questions using the modules in this package - they will be closed. For such issues, please email the python-win32 mailing list - note that you must be subscribed to the list before posting.

View on GitHub


4.  WinPython

WinPython is a portable distribution of the Python programming language for Windows

This is the winpython Python package, not the distribution itself. It includes two main features:

WinPython Package Manager (WPPM)

a graphical layer over pip, to let you install/uninstall to your WinPython distribution any standard Python package built as source (e.g. "dummypackage-2.1.zip" or "dummypackage-2.1.tar.gz") or as wheel (e.g. "dummypackage-2.1-py2.py3-none-any.whl")

WinPython build toolchain

make.py is the script used to build a WinPython distribution from (almost) scratch.

Dependencies

  • Python2 >= 2.7 or Python3 >= 3.4 (Python>= 3.7 is recommended)
  • PyQt5 >= 5.6 or PySide2>=5.11 (PyQt5 >=5.12 or Pyside2 >= 5.12 is recommended)

Requirements

  • NSIS (for icon shortcut creations, installer can be NSIS, INNO, 7-Zip, or nothing)
  • PyQt5 or Pyside2 is required to execute WinPython Control Panel/Ipython Qt and Qt related packages. if not installed, these packages will not execute.

Installation

From the source package (see section 'Building dependencies'), you may install WinPython using the integrated setup.py script based on Python standard library distutils with the following command:

python setup.py install

Note that distutils does not uninstall previous versions of Python packages: it simply copies files on top of an existing installation. When using this command, it is thus highly recommended to uninstall manually any previous version of WinPython by removing the associated directory ('winpython' in your site-packages directory).

View on GitHub | View on source


Microsoft Windows python FAQ

  • Can I use Windows for Python?

Unlike most Unix systems and services, Windows does not include a system supported installation of Python. To make Python available, the CPython team has compiled Windows installers (MSI packages) with every release for many years.

  • Which Python is best for Windows?

The following are the list of best IDE's for Python Programming on Windows operating systems.

  1. PyCharm.
  2. Eclipse with Pydev.
  3. Wing IDE.
  4. Komodo IDE.
  5. Eric Python IDE.
  6. Sublime Text 3.
  • What is GUI in Python?

As was mentioned in the introduction, a graphical user interface (GUI) is an interface that is drawn on the screen for the user to interact with. User interfaces have some common components: Main window. Menu.

  • How do I create a GUI window in Python?

Import the Tkinter module. Create the GUI application main window. Add one or more of the above-mentioned widgets to the GUI application. Enter the main event loop to take action against each event triggered by the user.


Related videos:

Installing Python on Windows 10


Related posts:

#python #windows 

5 Popular Libraries Python Programming on Microsoft Windows
Alfie Mellor

Alfie Mellor

1662534309

Learn .NET MAUI - Full Course for Beginners

Learn about .NET MAUI in this course for beginners. Learn the basics of building multi-platform apps with .NET MAUI for iOS, Android, macOS, and Windows from a shared C# code base. 

In this course, you'll learn about:

  1. What is .NET MAUI? [1 of 8] | .NET MAUI for Beginners
  2. How to Install .NET MAUI on a PC [2 of 8] | .NET MAUI for Beginners
  3. .NET MAUI Architecture Overview [3 of 8] | .NET MAUI for Beginners
  4. Build .NET MAUI UI with XAML [4 of 8] | .NET MAUI for Beginners
  5. .NET MAUI Data Binding with MVVM & XAML [5 of 8] | .NET MAUI for Beginners
  6. Navigating Between Pages in .NET MAUI [6 of 8] | .NET MAUI for Beginners
  7. Accessing Platform Features in .NET MAUI [7 of 8] | .NET MAUI for Beginners
  8. .NET MAUI Resources & Beginner Series Recap [8 of 8] | .NET MAUI for Beginners

What is .NET MAUI? [1 of 8] | .NET MAUI for Beginners

In this video, James breaks down what exactly .NET MAUI is, how it works, and some of the features that you need to know about when build apps with the framework.

How to Install .NET MAUI on a PC [2 of 8] | .NET MAUI for Beginners

In this video, James talks to us about what is needed to get started building apps with .NET MAUI with Visual Studio 2022 and a PC. He explores how you install the .NET MAUI workload, how to create a new project, and what else is included such as the Android SDK manager and Emulator manager.

.NET MAUI Architecture Overview [3 of 8] | .NET MAUI for Beginners

In this video, James walks through getting started with your first app and talks through all of the different components of how a .NET MAUI application is structured, how it features cross-platform resources including fonts, images, and assets, and talks about how to configure the app and how it starts up. He then shows off how to create your first project from Visual Studio, deploy it on to different platforms and many of the tools included such as XAML and C# hot reload.

Build .NET MAUI UI with XAML [4 of 8] | .NET MAUI for Beginners

In this video, James shows how to start to build user interfaces for .NET MAUI with XAML, and xml based mark up language. He walks through building a full task application user interface with data entry, buttons, lists of data, and even swipe to delete all with XAML hot reload.

.NET MAUI Data Binding with MVVM & XAML [5 of 8] | .NET MAUI for Beginners

In this video, James introduces us to the MVVM (Model-View-ViewModel) architecture pattern that separates your user interface from your code. It also unlocks the ability to use data binding, which is the glue between the view and viewmodel that makes the UI responsive when properties change and vise vera! In this video we take the UI that we built with XAML and make it functional with MVVM and the .NET Community Toolkit which streamlines development.

Navigating Between Pages in .NET MAUI [6 of 8] | .NET MAUI for Beginners

In this video, James shows off how to use the built-in navigation system of .NET MAUI to easily navigate between pages of the application with a URL based schema, and how to pass full objects as well.

Accessing Platform Features in .NET MAUI [7 of 8] | .NET MAUI for Beginners

In this video, James shows off how .NET MAUI enables developers to easily access platform APIs through C#. He also walks through using one of the many cross-platform APIs to access these features that .NET MAUI includes such as the Connectivity API. He shows how to access the APIs, use dependency injection, and check for internet in a single line of code.

.NET MAUI Resources & Beginner Series Recap [8 of 8] | .NET MAUI for Beginners

In this video, we wrap up the series with a summary of what we learned throughout the video series and links to all the resources you need to get started.

 

Links:
- .NET MAUI Self-guided Learning on Microsoft Learn: https://aka.ms/dotnetmaui-beginner/mslearn 
- .NET MAUI Website: https://aka.ms/dotnetmaui-beginner/website   
- Install .NET MAUI: https://aka.ms/dotnetmaui-beginner/install  
- My Tasks Sample: https://aka.ms/dotnetmaui-beginner/mytasks 
- .NET MAUI Documentation: https://aka.ms/dotnetmaui-beginner/docs 
- .NET MAUI on GitHub: https://aka.ms/dotnetmaui-beginner/github 
- .NET MAUI Workshop: https://aka.ms/maui-workshop 
- .NET Community Toolkit Docs: https://aka.ms/dotnetmaui-beginner/toolkit-docs 
- .NET Community Toolkit GitHub: https://aka.ms/dotnetmaui-beginner/toolkit-github 


Related Videos

Learn .NET MAUI - Full Course for Beginners | Build cross-platform apps in C#

.NET MAUI Step by Step Build

#dotnet #dotnetmaui #ios #android #windows #macos #csharp

Learn .NET MAUI - Full Course for Beginners
Lawrence  Lesch

Lawrence Lesch

1662452760

Node-cross-spawn: A Cross Platform Solution to Node's Spawn, SpawnSync

cross-spawn

A cross platform solution to node's spawn and spawnSync.

Installation

Node.js version 8 and up: $ npm install cross-spawn

Node.js version 7 and under: $ npm install cross-spawn@6

Why

Node has issues when using spawn on Windows:

  • It ignores PATHEXT
  • It does not support shebangs
  • Has problems running commands with spaces
  • Has problems running commands with posix relative paths (e.g.: ./my-folder/my-executable)
  • Has an issue with command shims (files in node_modules/.bin/), where arguments with quotes and parenthesis would result in invalid syntax error
  • No options.shell support on node <v4.8

All these issues are handled correctly by cross-spawn. There are some known modules, such as win-spawn, that try to solve this but they are either broken or provide faulty escaping of shell arguments.

Usage

Exactly the same way as node's spawn or spawnSync, so it's a drop in replacement.

const spawn = require('cross-spawn');

// Spawn NPM asynchronously
const child = spawn('npm', ['list', '-g', '-depth', '0'], { stdio: 'inherit' });

// Spawn NPM synchronously
const result = spawn.sync('npm', ['list', '-g', '-depth', '0'], { stdio: 'inherit' });

Caveats

Using options.shell as an alternative to cross-spawn

Starting from node v4.8, spawn has a shell option that allows you run commands from within a shell. This new option solves the PATHEXT issue but:

  • It's not supported in node <v4.8
  • You must manually escape the command and arguments which is very error prone, specially when passing user input
  • There are a lot of other unresolved issues from the Why section that you must take into account

If you are using the shell option to spawn a command in a cross platform way, consider using cross-spawn instead. You have been warned.

options.shell support

While cross-spawn adds support for options.shell in node <v4.8, all of its enhancements are disabled.

This mimics the Node.js behavior. More specifically, the command and its arguments will not be automatically escaped nor shebang support will be offered. This is by design because if you are using options.shell you are probably targeting a specific platform anyway and you don't want things to get into your way.

Shebangs support

While cross-spawn handles shebangs on Windows, its support is limited. More specifically, it just supports #!/usr/bin/env <program> where <program> must not contain any arguments.
If you would like to have the shebang support improved, feel free to contribute via a pull-request.

Remember to always test your code on Windows!

Tests

$ npm test
$ npm test -- --watch during development

Download Details:

Author: Moxystudio
Source Code: https://github.com/moxystudio/node-cross-spawn 
License: MIT license

#javascript #node #windows #crossplatform

Node-cross-spawn: A Cross Platform Solution to Node's Spawn, SpawnSync

IniFile.jl: Reading and Writing Windows-style INI Files

IniFile.jl

Reading and writing Windows-style INI files from Julia

Usage

Pkg.add("IniFile") # first-time only
using Inifile # load code into current session

Create IniFile

ini = Inifile()

Get defaults & sections of an IniFile

sections(ini)
defaults(ini)

Get specific key from section, return default if not found

get(ini, "section", "key", default)

Set key for section

set(ini, "section", "key", value)

Parse a *.ini file

ini = read(Inifile(), "file.ini")

Write out a *.ini file

open("file.ini", "w+") do io
    write(io, ini)
end

Download Details:

Author: JuliaIO
Source Code: https://github.com/JuliaIO/IniFile.jl 
License: View license

#julia #windows #files 

IniFile.jl: Reading and Writing Windows-style INI Files

Elena Stafford

1661888669

Microsoft Windows Server Hybrid

Help your team acquire the skills of administrators working in hybrid environments.
Presented by Usama Khan, with 15+ years of experience in the Technology Industry.

Link - https://www.youtube.com/watch?v=FRTSkJwPDvw&t=75s?advid=1602

#microsoft #server #windows

Microsoft Windows Server Hybrid
Dylan  Iqbal

Dylan Iqbal

1661331198

.NET MAUI Tutorial for Beginners - Full Course

In this .NET MAUI tutorial for beginners, you'll learn the basics of building multi-platform apps with .NET MAUI for iOS, Android, macOS, and Windows from a shared C# code base.

What is .NET MAUI? [1 of 8] | .NET MAUI for Beginners

In this video, James breaks down what exactly .NET MAUI is, how it works, and some of the features that you need to know about when build apps with the framework.

 

How to Install .NET MAUI on a PC [2 of 8] | .NET MAUI for Beginners

In this video, James talks to us about what is needed to get started building apps with .NET MAUI with Visual Studio 2022 and a PC. He explores how you install the .NET MAUI workload, how to create a new project, and what else is included such as the Android SDK manager and Emulator manager.

 

 

.NET MAUI Architecture Overview [3 of 8] | .NET MAUI for Beginners

In this video, James walks through getting started with your first app and talks through all of the different components of how a .NET MAUI application is structured, how it features cross-platform resources including fonts, images, and assets, and talks about how to configure the app and how it starts up. He then shows off how to create your first project from Visual Studio, deploy it on to different platforms and many of the tools included such as XAML and C# hot reload.

Build .NET MAUI UI with XAML [4 of 8] | .NET MAUI for Beginners

In this video, James shows how to start to build user interfaces for .NET MAUI with XAML, and xml based mark up language. He walks through building a full task application user interface with data entry, buttons, lists of data, and even swipe to delete all with XAML hot reload.

 

.NET MAUI Data Binding with MVVM & XAML [5 of 8] | .NET MAUI for Beginners

In this video, James introduces us to the MVVM (Model-View-ViewModel) architecture pattern that separates your user interface from your code. It also unlocks the ability to use data binding, which is the glue between the view and viewmodel that makes the UI responsive when properties change and vise vera! In this video we take the UI that we built with XAML and make it functional with MVVM and the .NET Community Toolkit which streamlines development.

 

Navigating Between Pages in .NET MAUI [6 of 8] | .NET MAUI for Beginners

In this video, James shows off how to use the built-in navigation system of .NET MAUI to easily navigate between pages of the application with a URL based schema, and how to pass full objects as well.

 

Accessing Platform Features in .NET MAUI [7 of 8] | .NET MAUI for Beginners

In this video, James shows off how .NET MAUI enables developers to easily access platform APIs through C#. He also walks through using one of the many cross-platform APIs to access these features that .NET MAUI includes such as the Connectivity API. He shows how to access the APIs, use dependency injection, and check for internet in a single line of code.

 

.NET MAUI Resources & Beginner Series Recap [8 of 8] | .NET MAUI for Beginners

In this video, we wrap up the series with a summary of what we learned throughout the video series and links to all the resources you need to get started.

Links:
- .NET MAUI Self-guided Learning on Microsoft Learn: https://aka.ms/dotnetmaui-beginner/mslearn 
- .NET MAUI Website: https://aka.ms/dotnetmaui-beginner/website 
- Install .NET MAUI: https://aka.ms/dotnetmaui-beginner/install 
- My Tasks Sample: https://aka.ms/dotnetmaui-beginner/mytasks 
- .NET MAUI Documentation: https://aka.ms/dotnetmaui-beginner/docs 
- .NET MAUI on GitHub: https://aka.ms/dotnetmaui-beginner/github 
- .NET MAUI Workshop: https://aka.ms/maui-workshop 
- .NET Community Toolkit Docs: https://aka.ms/dotnetmaui-beginner/toolkit-docs 
- .NET Community Toolkit GitHub: https://aka.ms/dotnetmaui-beginner/toolkit-github 
- Awesome .NET MAUI https://github.com/jsuarezruiz/awesome-dotnet-maui 
 

#dotnet #dotnetmaui #ios #android #windows #macos #csharp

.NET MAUI Tutorial for Beginners - Full Course
Connor Mills

Connor Mills

1661303915

Build Cross Platform Apps with .NET MAUI, C# and Visual Studio

Learn .NET MAUI - Full Course for Beginners. This tutorial shows how to build beautiful native cross-platform apps for iOS, Android, macOS, and Windows with .NET MAUI, C#, and Visual Studio! Everything you need to know about .NET MAUI and building your very first app. 

Let's start our journey together to build beautiful native cross-platform apps for iOS, Android, macOS, and Windows with .NET MAUI, C#, and Visual Studio! In this full workshop, I will walk you through everything you need to know about .NET MAUI and building your very first app. You will learn the basics including how to build user interfaces with XAML, how MVVM and data binding simplify development, how to navigate between pages, access platform features like geolocation, optimize data collections, and theme your app for light theme and dark theme. This course has everything you need to learn the basics and set you up for success when building apps with .NET MAUI!

Chapters:
00:00:00 - Intro to the .NET MAUI Workshop
00:04:10 - What is .NET MAUI & How to Install
00:06:25 - Workshop overview
00:08:00 - First .NET MAUI app & Architecture (slides)
00:21:40 - Get code to build your first .NET MAUI app
00:25:00 - .NET MAUI Project Walkthrough
00:29:40 - Start to build first .NET MAUI app
00:56:48 - Intro to MVVM (slides)
01:09:30 - Implementing INotifyPropertyChanged
01:22:30 - .NET Community Toolkit for MVVM (Source Generators)
01:32:30 - HTTP REST Calls & JSON Deserialization
01:43:00 - ICommand in .NET MAUI
01:59:30 - Create our UI with XAML & MVVM
02:16:20 - Navigation in .NET MAUI (slides)
02:25:20 - Implementing Navigation in .NET MAUI & Passing Parameters
02:46:00 - Building a details UI with XAML & MVVM
02:54:10 - Modal, Back Navigation, & More
02:58:20 - Access Platform APIs in .NET MAUI (slides)
03:02:53 - Platform API Integration - Connectivity
03:08:30 - Geolocation & Permissions Implementation
03:18:50 - Open Map Integration
03:22:40 - Platform Specifics - iOS Safe Area
03:25:50 - CollectionView & RefreshView Overview (slides)
03:34:00 - Implementing Pull-to-Refresh
03:40:00 - CollectionView Layouts - Grids and more
03:41:30 - CollectionView EmptyView
03:45:00 - App Resources, Styles, and Themes (slides)
03:56:20 - Implementing Light & Dark Mode
04:06:00 - Thanks, wrap-up, and resources

Links:
- .NET MAUI Workshop: https://aka.ms/maui-workshop 
- .NET MAUI Website: https://dotnet.microsoft.com/apps/maui?WT.mc_id=friends-0000-jamont 
- .NET MAUI Docs: https://docs.microsoft.com/dotnet/maui/?WT.mc_id=friends-0000-jamont 
- .NET MAUI on Microsoft Learn: https://docs.microsoft.com/learn/paths/build-apps-with-dotnet-maui/?WT.mc_id=friends-0000-jamont 
- .NET MAUI Community Toolkit: https://github.com/communitytoolkit/maui?WT.mc_id=friends-0000-jamont 
- .NET Community Toolkit: https://github.com/communitytoolkit/dotnet?WT.mc_id=friends-0000-jamont 

#dotnetmaui #dotnet #csharp #ios #android #windows #visualstudio

Build Cross Platform Apps with .NET MAUI, C# and Visual Studio
Lawrence  Lesch

Lawrence Lesch

1660973400

Elegant Windows Terminal Theme with Bright Colors

Snazzy Colour Scheme for Windows Terminal

Screenshot

Elegant Windows Terminal theme with bright colors.

Installation

Start Windows Terminal and click on the down arrow symbol ˅ from menu bar. This will open a drop down menu from which select Settings option. Alternatively use Ctrl + , to open Settings directly.

In the profile.json settings file for Windows Terminal, find the schemes section and paste the content of snazzy.json.

Example:

"schemes": [
	{
		"name": "Snazzy",
		...
	}
]

Activate

Once the color scheme has been defined, it's time to enable it. Find the profiles section and add a colorScheme value to the profile you want to apply the theme to.

Example:

"profiles": [
	{
		"guid": "{c5e01457-d08a-47fd-aa60-b128820d7352}",
		"name": "cmd",
		"commandline": "cmd.exe",
		"hidden": false,
		"colorScheme": "Snazzy"
	}
]

See Installation guide.

Download Details:

Author: Richienb
Source Code: https://github.com/Richienb/windows-terminal-snazzy 
License: MIT license

#javascript #windows #terminal 

Elegant Windows Terminal Theme with Bright Colors

Jill.py: A Cross-platform installer for The Julia Programming Language

JILL.py

The enhanced Python fork of JILL -- Julia Installer for Linux (and every other platform) -- Light

Features

  • download Julia releases from the nearest mirror server
  • support all platforms and architectures
  • manage multiple julia releases
  • easy-to-use CLI tool

asciicast

Install JILL

For the first time users of jill, you will need to install it using pip: pip install jill --user -U. Also use this to upgrade JILL version.

Python >= 3.6 is required. For base docker images, you also need to make sure wget and gnupg are installed.

Installing Julias

When you type jill install, it does the following things:

  1. query the latest version
  2. download, verify, and install julia
  3. make symlinks, e.g., julia, julia-1, julia-1.6

For common Julia users:

  • Get the latest stable release: jill install
  • Get the latest 1.y.z release: jill install 1
  • Get the latest 1.6.z release: jill install 1.6
  • Get the specific version: jill install 1.6.2, jill install 1.7.0-beta3
  • Get the latest release (including unstable ones): jill install --unstable

For Julia developers and maintainers:

  • Get the nightly builds: jill install latest. This gives you julia-latest.
  • Checkout CI build artifacts of specific commit in the Julia Repository: jill install 1.8.0+cc4be25c (<major>.<minor>.<patch>+<build> with at least the first 7 characters of the hash). This gives you julia-dev.

Some flags that can be useful:

  • No confirmation before installation: jill install --confirm
  • Download from Official source: jill install --upstream Official
  • Keep downloaded contents after installation: jill install --keep_downloads
  • Force a reinstallation: jill install --reinstall

The symlinks

To start Julia, you can use predefined JILL symlinks such as julia. jill install uses the following rule makes sure that you're always using the latest stable release.

Stable releases:

  • julia points to the latest Julia release.
  • julia-1 points to the latest 1.y.z Julia release.
  • julia-1.6 points to the latest 1.6.z Julia release.

For unstable releases such as 1.7.0-beta3, installing it via jill install 1.7 --unstable or jill install 1.7.0-beta3 will only give you julia-1.7; it won't make symlinks for julia or julia-1.

To dance on edge:

  • julia-latest points to the nightly build from jill install latest
  • julia-dev points to the julia CI build artifacts from, for example, jill install 1.8.0+cc4be25c.

List symlinks and their target versions

jill list [version] gives you every symlinks and their target Julia versions.

list

Change symlink target

For non-windows system, you are free to use ln command to change the symlink targets. For Windows it uses an entry .cmd file for this so you'll need to copy them. In the meantime, jill switch provides a simple and unified way to do this:

  • jill switch 1.6: let julia points to the latest julia 1.6.z release.
  • jill switch <path/to/my/own/julia/executable>: let julia points to custom executables.
  • jill switch 1.6 --target julia-1: let julia-1 points to the latest julia 1.6.z release.

About downloading upstreams

By default, JILL tries to be smart and will download contents from the nearest upstream. You can get the information of all upstreams via jill upstream. Here's what I get in my laptop, I live in China so the official upstreams aren't so accessible for me :(

upstream

To temporarily disable this feature, you can use flag --upstream <server_name>. For instance, jill install --upstream Official will faithfully download from the official julialang s3 bucket.

To permanently disable this feature, you can set environment variable JILL_UPSTREAM.

Note that flag is of higher priority than environment variable. For example, if JILL_UPSTREAM is set to mirror server "TUNA", you can still download from the official source via jill install --upstream Official.

About installation and symlink directories

Here's the default JILL installation and symlink directories:

systeminstallation directorysymlink directory
macOS/Applications~/.local/bin
Linux/FreeBSD~/packages/julias~/.local/bin
Windows~\AppData\Local\julias~\AppData\Local\julias\bin

For example, on Linux jill install 1.6.2 will have a julia folder in ~/packages/julias/julia-1.6 and symlinks julia/julia-1/julia-1.6 created in ~/.local/bin.

Particularly, if you're using jill as root user, you will do a system-wide installation:

  • Installation directory will be /opt/julias for Linux/FreeBSD.
  • Symlink directory will be /usr/local/bin for Linux/FreeBSD/macOS.

To change the default JILL installation and symlink directories, you can set environment variables JILL_INSTALL_DIR and JILL_SYMLINK_DIR.

(Deprecated) jill install also provides two flag --install_dir <dirpath> and --symlink_dir <dirpath>, they have higher priority than the environment variables JILL_INSTALL_DIR and JILL_SYMLINK_DIR.

JILL environment variables

jill is made as a convenient tool and it can sometimes be annoying passing flags to it. There are some predefined environment variables that you can use to set the default values:

  • Specify a default downloading upstream JILL_UPSTREAM: --upstream
  • Override default symlink directory JILL_SYMLINK_DIR: --symlink_dir
  • Override default installation directory JILL_INSTALL_DIR: --install_dir

The flag version has higher priority than the environment variable version.


Advanced: Example with cron

If you're tired of seeing (xx days old master) in your nightly build version, then jill can make your nightly build always the latest version using cron:

# /etc/cron.d/jill
PATH=/usr/local/bin:/usr/sbin:/usr/sbin:/usr/bin:/sbin:/bin

# install a fresh nightly build every day
* 0 * * * root jill install latest --confirm --upstream Official

Advanced: Registering a new public releases upstream

If it's an public mirror and you want to share it worldwide to other users of JILL. You can add an entry to the public registry, make a PR, then I will tag a new release for that.

Please check the sources.json format for more detailed information on the format.

Advanced: Specifying custom (private) downloading upstream

To add new private upstream, you can create a file ~/.config/jill/sources.json (fow Windows it is ~/AppData/Local/julias/sources.json) and add your own upstream configuration just like the JILL sources.json does. Once this is done JILL will recognize this new upstream entry.

Please check the sources.json format for more detailed information on the format.

Advanced: make a Julia release mirror

There are two ways to do so:

  • use aws s3 sync, this should be the easiest way to do so I highly recommend this.
  • (Deprecated) use jill mirror command with mirror config example. I didn't know about the aws s3 sync stuff when I implemented this.

The Julia release mirror does not contain Julia package contents, to mirror all the Julia packages and artifacts (which requires >1.5Tb storage), you can use StorageMirrorServer.jl.

Advanced: The Python API

jill.py also provides a set of Python API:

from jill.install import install_julia
from jill.download import download_package

# equivalent to `jill install --confirm`
install_julia(confirm=True)
# equivalent to `jill download`
download_package()

You can read its docstring (e.g., ?install_julia) for more information.

FAQs

Why you should use JILL?

Distro package managers (e.g., apt, pac) is likely to provide a broken Julia with incorrect binary dependencies (e.g., LLVM ) versions. Hence it's recommended to download and extract the Julia binary provided in Julia Downloads. jill.py doesn't do anything magical, but just makes such operation even stupid.

Why I make the python fork of JILL?

At first I found myself needing a simple tool to download and install Julia on my macbook and servers in our lab, I made my own shell scripts and I'd like to share it with others. Then I found the jill.sh project, Abel knows a lot shell so I decide to contribute my macOS Julia installer to jill.sh.

There are three main reasons for why I decided to start my Python fork:

  • I live in China. Downloading resources from GitHub and AWS s3 buckets is a painful experience. Thus I want to support downloading from mirror servers. Adding mirror server support to jill.sh is quite complicated and can easily become a maintenance nightmare.
  • I want to make a cross platform installer that everyone can use, not just Linux/macOS users. Shell scripts doesn't allow this as far as I can tell. In contrast, Python allows this.
  • Most importantly, back to when I start this project, I knew very little shell, I knew nothing about C/C++/Rust/Go and whatever you think a good solution is. I happen to knew a few Python.

For some "obvious" reason, Julia People don't like Python and I understand it. (I also don't like Python after being advanced Julia user for more than 3 years) But to be honest, revisiting this project, I find using Python is one of the best-made decision during the entire project. Here is the reason: no matter how you enjoy Julia (or C++, Rust), Python is one of the best successful programming language for sever maintenance purpose. Users can easily found tons of "how-to" solutions about Python and it's easy to write, deploy, and ship Python codes to the world via PyPI.

And again, I live in China so I want to rely on services that are easily accessible in China, PyPI is, GitHub and AWS S3 bucket aren't. A recent Julia installer project juliaup written in Rust solves the Python dependency problem very well, but the tradeoff is that juliaup needs its own distributing system (currently GitHub and S3 bucket) to make sure it can be reliably downloaded to user machine. And for this it just won't be as good as PyPI in the foreseeable future.

Is it safe to use jill.py?

Yes, jill.py use GPG to check every tarballs after downloading. Also, *.dmg/*.pkg for macOS and .exe for Windows are already signed.

What's the difference between jill.sh and jill.py

jill.sh is a shell script that works quite well on Linux x86/x64 machines. jill.py is an enhanced python package that focus on Julia installation and version management, and brings a unified user experience on all platforms.

Why julia fails to start

The symlink julia are stored in JILL predefined symlinks dir thus you have to make sure this folder is in PATH. Search "how to add folder to PATH on xxx system" you will get a lot of solutions.

How do I use multiple patches releases (e.g., 1.6.1 and 1.6.2)

Generally, you should not care about patch version differences so jill.py make it explicitly that only one of 1.6.x can exist. If you insist to have multiple patch versions, you could use jill install --install_dir <some_other_folder> to install Julia in other folder, and then manually make a symlink back. As I just said, in most cases, common users should not care about this patch version difference and should just use the latest patch release.

How to only download contents without installation?

Use jill download [version] [--sys <system>] [--arch <arch>]. Check jill download --help for more details.

Linux with musl libc

For Julia (>= 1.5.0) in Linux with musl libc, you can just do jill install and it gives you the right Julia binary. To download the musl libc binary using jill download, you will need to pass --sys musl flag.

MacOS with Apple silicon (M1)

Yes it's supported. Because macOS ARM version is still of tier-3 support, jill.py will by default install the x86_64 version. If you want to use the ARM version, you can install it via jill install --preferred-arch arm64.

CERTIFICATE_VERIFY_FAILED error

If you're confident, try jill install --bypass-ssl.

Skip symbolic links generation

If for some reason you prefer to download julia without generating symbolic links jill install --skip-symlinks

Download Details:

Author: johnnychen94
Source Code: https://github.com/johnnychen94/jill.py 
License: MIT license

#julia #windows #macos #linux 

Jill.py: A Cross-platform installer for The Julia Programming Language
Rocio  O'Keefe

Rocio O'Keefe

1660731660

Stockholm: A Collection Of Desktop-first Widgets & Themes Designed

Stockholm

Stockholm is a collection of desktop-first widgets and themes designed to look and feel great on Mac and Windows. The widgets are familiar enough to be comfortable to use on any platform but avoid the uncanny valley by not aiming to replicate the native components exactly.

Live demo here: https://serverpod.dev/stockholm/

Stockholm UI Demo

This library is primarily written for the Serverpod GUI. (Serverpod is the missing server for Flutter, go check it out!) Hence, the focus has been on the widgets required for Serverpod. If you find that some component is missing, please make a pull request.

There is not yet any documentation, but the example project shows how to use all widgets, and it's pretty straightforward. Make user to use the provided theme classes or the UI will not look good.

Use this package as a library

Depend on it

Run this command:

With Flutter:

 $ flutter pub add stockholm

This will add a line like this to your package's pubspec.yaml (and run an implicit flutter pub get):

dependencies:
  stockholm: ^0.0.3

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

Import it

Now in your Dart code, you can use:

import 'package:stockholm/stockholm.dart';

example/lib/main.dart

import 'package:example/src/buttons.dart';
import 'package:example/src/colors.dart';
import 'package:example/src/dialogs.dart';
import 'package:example/src/inspector.dart';
import 'package:example/src/menus.dart';
import 'package:example/src/tables.dart';
import 'package:example/src/text_fields.dart';
import 'package:example/src/toolbar.dart';
import 'package:flutter/material.dart';
import 'package:ionicons/ionicons.dart';
import 'package:stockholm/stockholm.dart';

enum _DemoPage {
  buttons,
  menus,
  tables,
  dialogs,
  toolbar,
  colors,
  textFields,
  propertyInspector,
}

enum _ThemeColor {
  blue,
  purple,
  pink,
  red,
  orange,
  yellow,
  green,
  gray,
}

void main() {
  runApp(const StockholmDemoApp());
}

class StockholmDemoApp extends StatefulWidget {
  const StockholmDemoApp({Key? key}) : super(key: key);

  @override
  _StockholmDemoAppState createState() => _StockholmDemoAppState();

  static _StockholmDemoAppState of(BuildContext context) {
    return context.findAncestorStateOfType<_StockholmDemoAppState>()!;
  }
}

class _StockholmDemoAppState extends State<StockholmDemoApp> {
  bool _darkMode = false;
  _ThemeColor _themeColor = _ThemeColor.blue;

  bool get darkMode => _darkMode;

  set darkMode(bool darkMode) {
    setState(() {
      _darkMode = darkMode;
    });
  }

  _ThemeColor get themeColor => _themeColor;

  set themeColor(_ThemeColor themeColor) {
    setState(() {
      _themeColor = themeColor;
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Stockholm Demo',
      theme: _darkMode
          ? StockholmThemeData.dark(
              accentColor:
                  _themeColorToStockholmColor(_themeColor, Brightness.dark),
            )
          : StockholmThemeData.light(
              accentColor:
                  _themeColorToStockholmColor(_themeColor, Brightness.light),
            ),
      home: const StockholmHomePage(),
    );
  }
}

class StockholmHomePage extends StatefulWidget {
  const StockholmHomePage({
    Key? key,
  }) : super(key: key);

  @override
  State<StockholmHomePage> createState() => _StockholmHomePageState();
}

class _StockholmHomePageState extends State<StockholmHomePage> {
  _DemoPage _selectedPage = _DemoPage.buttons;

  @override
  Widget build(BuildContext context) {
    Widget page;

    var appState = StockholmDemoApp.of(context);

    switch (_selectedPage) {
      case _DemoPage.buttons:
        page = const StockholmButtonDemoPage();
        break;
      case _DemoPage.tables:
        page = const StockholmTableDemoPage();
        break;
      case _DemoPage.menus:
        page = const StockholmMenuDemoPage();
        break;
      case _DemoPage.dialogs:
        page = const StockholmDialogDemoPage();
        break;
      case _DemoPage.toolbar:
        page = const StockholmToolbarDemoPage();
        break;
      case _DemoPage.colors:
        page = const StockholmColorDemoPage();
        break;
      case _DemoPage.textFields:
        page = const StockholmTextFieldDemoPage();
        break;
      case _DemoPage.propertyInspector:
        page = const StockholmPropertyInspectorDemoPage();
        break;
    }

    var colorOptionWidgets = <Widget>[];
    for (var themeColor in _ThemeColor.values) {
      colorOptionWidgets.add(
        StockholmToolbarButton(
          icon: Ionicons.square,
          color: _themeColorToStockholmColor(
            themeColor,
            appState.darkMode ? Brightness.dark : Brightness.light,
          ),
          height: 22.0,
          minWidth: 0.0,
          iconSize: 14.0,
          padding: const EdgeInsets.symmetric(horizontal: 4),
          selected: appState.themeColor == themeColor,
          onPressed: () {
            setState(() {
              appState.themeColor = themeColor;
            });
          },
        ),
      );
    }

    return Scaffold(
      body: Row(
        children: [
          StockholmSideBar(
            children: [
              const StockholmListTileHeader(child: Text('Controls')),
              StockholmListTile(
                leading: const Icon(Ionicons.toggle_outline),
                child: const Text('Buttons'),
                selected: _selectedPage == _DemoPage.buttons,
                onPressed: () {
                  setState(() {
                    _selectedPage = _DemoPage.buttons;
                  });
                },
              ),
              StockholmListTile(
                leading: const Icon(Ionicons.reader_outline),
                child: const Text('Menus'),
                selected: _selectedPage == _DemoPage.menus,
                onPressed: () {
                  setState(() {
                    _selectedPage = _DemoPage.menus;
                  });
                },
              ),
              StockholmListTile(
                leading: const Icon(Ionicons.text),
                child: const Text('Text fields'),
                selected: _selectedPage == _DemoPage.textFields,
                onPressed: () {
                  setState(() {
                    _selectedPage = _DemoPage.textFields;
                  });
                },
              ),
              const StockholmListTileHeader(child: Text('Layouts')),
              StockholmListTile(
                leading: const Icon(Ionicons.browsers_outline),
                child: const Text('Tables'),
                selected: _selectedPage == _DemoPage.tables,
                onPressed: () {
                  setState(() {
                    _selectedPage = _DemoPage.tables;
                  });
                },
              ),
              StockholmListTile(
                leading: const Icon(Ionicons.chatbubble_outline),
                child: const Text('Dialogs'),
                selected: _selectedPage == _DemoPage.dialogs,
                onPressed: () {
                  setState(() {
                    _selectedPage = _DemoPage.dialogs;
                  });
                },
              ),
              StockholmListTile(
                leading: const Icon(Ionicons.build_outline),
                child: const Text('Toolbars'),
                selected: _selectedPage == _DemoPage.toolbar,
                onPressed: () {
                  setState(() {
                    _selectedPage = _DemoPage.toolbar;
                  });
                },
              ),
              StockholmListTile(
                leading: const Icon(Ionicons.list_outline),
                child: const Text('Property inspector'),
                selected: _selectedPage == _DemoPage.propertyInspector,
                onPressed: () {
                  setState(() {
                    _selectedPage = _DemoPage.propertyInspector;
                  });
                },
              ),
              const StockholmListTileHeader(child: Text('Misc')),
              StockholmListTile(
                leading: const Icon(Ionicons.color_palette_outline),
                child: const Text('Colors'),
                selected: _selectedPage == _DemoPage.colors,
                onPressed: () {
                  setState(() {
                    _selectedPage = _DemoPage.colors;
                  });
                },
              ),
            ],
            footer: Padding(
              padding: const EdgeInsets.all(8),
              child: Row(
                crossAxisAlignment: CrossAxisAlignment.center,
                children: [
                  StockholmToolbarButton(
                    height: 22,
                    icon: appState.darkMode
                        ? Ionicons.moon_outline
                        : Ionicons.sunny_outline,
                    onPressed: () {
                      setState(() {
                        appState.darkMode = !appState.darkMode;
                      });
                    },
                  ),
                  const Spacer(),
                  ...colorOptionWidgets,
                ],
              ),
            ),
          ),
          Expanded(
            child: page,
          )
        ],
      ),
    );
  }
}

StockholmColor _themeColorToStockholmColor(
  _ThemeColor color,
  Brightness brightness,
) {
  var colors = StockholmColors.fromBrightness(brightness);

  switch (color) {
    case _ThemeColor.blue:
      return colors.blue;
    case _ThemeColor.purple:
      return colors.purple;
    case _ThemeColor.pink:
      return colors.pink;
    case _ThemeColor.red:
      return colors.red;
    case _ThemeColor.orange:
      return colors.orange;
    case _ThemeColor.yellow:
      return colors.yellow;
    case _ThemeColor.green:
      return colors.green;
    case _ThemeColor.gray:
      return colors.gray;
  }
}

Download Details:

Author: Serverpod
Source Code: https://github.com/serverpod/stockholm 
License: BSD-3-Clause license

#flutter #dart #desktop #mac #windows 

Stockholm: A Collection Of Desktop-first Widgets & Themes Designed
Dexter  Goodwin

Dexter Goodwin

1660519800

Ctrlc-windows: Send A CTRL-C Event to A Windows Console Application

ctrlc-windows

Send CTRL-C to a Windows console application

Long running stateful processes like servers often hold a lot of system resources that they need to operate. These are things like communication ports, file descriptors, database connections, etc... At some point, when it is time for that process to shut it needs to release all those resources back to the operating system and exit. This process of freeing up all the things that were being used is called "graceful shutdown" and is really important to get right in systems that start and stop processes repeatedly. On Unix systems, the method for achieving a graceful shutdown of a process is to send it a signal (usually either SIGINT or SIGTERM).

The process can then register a handler for this signal which releases any resources that it is holding and exits.

The alternative to a graceful shutdown is a "forced termination". This is what happens when a process is unable to respond to a interrupt or termination signal. In this case, the process is ended immediately without the opprotunity to release any of the resources it holds.

On Unix systems, when you invoke process.kill() on a ChildProcess object, it sends the SIGTERM signal. That way, if the process has a SIGTERM handler it has an opportunity to perform a graceful shutdown.

Windows on the other hand, does not have a method to send signals to a process, so when you invoke the same process.kill() function on that platform, what you end up with is a forceful termination without any cleanup. However, Windows does have a method for applications to shutdown gracefully, namely hitting CTRL-C on the console to which the process is attached. And that's what this is all about. In fact, whenever you hit CTRL-C on a windows console that is running a node application, node will translate that CTRL-C into a SIGINT and dispatch any SIGINT handlers that it has registered. Since most well-behaved long-running Nodejs processes respond to SIGINT, this allows them to shutdown too.

This module exports a single ctrlc function which accepts a process id, and sends a CTRL-C event to that console.

Note: This is a no-op on non-windows platforms

Usage

import { ctrlc } from 'ctrlc-windows';

export function gracefulShutdown(process) {
  if (process.platform === 'win32') {
    ctrlc(process.pid);
  } else {
    process.kill();
  }
}

Download Details:

Author: Thefrontside
Source Code: https://github.com/thefrontside/ctrlc-windows 

#windows #javascript #nodejs 

Ctrlc-windows: Send A CTRL-C Event to A Windows Console Application

A Package to Help with Creating Custom Windows With Flutter

bitsdojo_window

A Flutter package that makes it easy to customize and work with your Flutter desktop app window on Windows, macOS and Linux.

Watch the tutorial to get started. Click the image below to watch the video:

IMAGE ALT TEXT

Features:

- Custom window frame - remove standard Windows/macOS/Linux titlebar and buttons
- Hide window on startup
- Show/hide window
- Move window using Flutter widget
- Minimize/Maximize/Restore/Close window
- Set window size, minimum size and maximum size
- Set window position
- Set window alignment on screen (center/topLeft/topRight/bottomLeft/bottomRight)
- Set window title

Getting Started

Install the package using pubspec.yaml

For Windows apps

Inside your application folder, go to windows\runner\main.cpp and add these two lines at the beginning of the file:

#include <bitsdojo_window_windows/bitsdojo_window_plugin.h>
auto bdw = bitsdojo_window_configure(BDW_CUSTOM_FRAME | BDW_HIDE_ON_STARTUP);

For macOS apps

Inside your application folder, go to macos\runner\MainFlutterWindow.swift and add this line after the one saying import FlutterMacOS :

import FlutterMacOS
import bitsdojo_window_macos // Add this line

Then change this line from:

class MainFlutterWindow: NSWindow {

to this:

class MainFlutterWindow: BitsdojoWindow {

After changing NSWindow to BitsdojoWindow add these lines below the line you changed:

override func bitsdojo_window_configure() -> UInt {
  return BDW_CUSTOM_FRAME | BDW_HIDE_ON_STARTUP
}

Your code should now look like this:

class MainFlutterWindow: BitsdojoWindow {
    
  override func bitsdojo_window_configure() -> UInt {
    return BDW_CUSTOM_FRAME | BDW_HIDE_ON_STARTUP
  }
    
  override func awakeFromNib() {
    ... //rest of your code

#

If you don't want to use a custom frame and prefer the standard window titlebar and buttons, you can remove the BDW_CUSTOM_FRAME flag from the code above.

If you don't want to hide the window on startup, you can remove the BDW_HIDE_ON_STARTUP flag from the code above.

For Linux apps

Inside your application folder, go to linux\my_application.cc and add this line at the beginning of the file:

#include <bitsdojo_window_linux/bitsdojo_window_plugin.h>

Then look for these two lines:

gtk_window_set_default_size(window, 1280, 720);
gtk_widget_show(GTK_WIDGET(window));

and change them to this:

auto bdw = bitsdojo_window_from(window);            // <--- add this line
bdw->setCustomFrame(true);                          // <-- add this line
//gtk_window_set_default_size(window, 1280, 720);   // <-- comment this line
gtk_widget_show(GTK_WIDGET(window));

As you can see, we commented the line calling gtk_window_set_default_size and added these two lines before gtk_widget_show(GTK_WIDGET(window));

auto bdw = bitsdojo_window_from(window);
bdw->setCustomFrame(true);

Flutter app integration

Now go to lib\main.dart and add this code in the main function right after runApp(MyApp()); :

void main() {
  runApp(MyApp());

  // Add this code below

  doWhenWindowReady(() {
    const initialSize = Size(600, 450);
    appWindow.minSize = initialSize;
    appWindow.size = initialSize;
    appWindow.alignment = Alignment.center;
    appWindow.show();
  });
}

This will set an initial size and a minimum size for your application window, center it on the screen and show it on the screen.

You can find examples in the example folder.

Here is an example that displays this window:

Click to expand

 

#

❤️ Sponsors - friends helping this package

I am developing this package in my spare time and any help is appreciated. If you want to help you can become a sponsor.

🙏 Thank you!

☕️ Coffee supporters:

Helping with a coffee every month:

Want to help? Become a sponsor

Use this package as a library

Depend on it

Run this command:

With Flutter:

 $ flutter pub add bitsdojo_window_temp9527

This will add a line like this to your package's pubspec.yaml (and run an implicit flutter pub get):

dependencies:
  bitsdojo_window_temp9527: ^0.1.3

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

Import it

Now in your Dart code, you can use:

import 'package:bitsdojo_window_temp9527/bitsdojo_window_temp9527.dart'; 

example/lib/main.dart

// Don't forget to make the changes mentioned in
// https://github.com/bitsdojo/bitsdojo_window#getting-started

import 'package:flutter/material.dart';
import 'package:bitsdojo_window/bitsdojo_window.dart';

void main() {
  runApp(const MyApp());
  doWhenWindowReady(() {
    final win = appWindow;
    const initialSize = Size(600, 450);
    win.minSize = initialSize;
    win.size = initialSize;
    win.alignment = Alignment.center;
    win.title = "Custom window with Flutter";
    win.show();
  });
}

const borderColor = Color(0xFF805306);

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: Scaffold(
        body: WindowBorder(
          color: borderColor,
          width: 1,
          child: Row(
            children: const [LeftSide(), RightSide()],
          ),
        ),
      ),
    );
  }
}

const sidebarColor = Color(0xFFF6A00C);

class LeftSide extends StatelessWidget {
  const LeftSide({Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return SizedBox(
        width: 200,
        child: Container(
            color: sidebarColor,
            child: Column(
              children: [
                WindowTitleBarBox(child: MoveWindow()),
                Expanded(child: Container())
              ],
            )));
  }
}

const backgroundStartColor = Color(0xFFFFD500);
const backgroundEndColor = Color(0xFFF6A00C);

class RightSide extends StatelessWidget {
  const RightSide({Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return Expanded(
      child: Container(
        decoration: const BoxDecoration(
          gradient: LinearGradient(
              begin: Alignment.topCenter,
              end: Alignment.bottomCenter,
              colors: [backgroundStartColor, backgroundEndColor],
              stops: [0.0, 1.0]),
        ),
        child: Column(children: [
          WindowTitleBarBox(
            child: Row(
              children: [Expanded(child: MoveWindow()), const WindowButtons()],
            ),
          )
        ]),
      ),
    );
  }
}

final buttonColors = WindowButtonColors(
    iconNormal: const Color(0xFF805306),
    mouseOver: const Color(0xFFF6A00C),
    mouseDown: const Color(0xFF805306),
    iconMouseOver: const Color(0xFF805306),
    iconMouseDown: const Color(0xFFFFD500));

final closeButtonColors = WindowButtonColors(
    mouseOver: const Color(0xFFD32F2F),
    mouseDown: const Color(0xFFB71C1C),
    iconNormal: const Color(0xFF805306),
    iconMouseOver: Colors.white);

class WindowButtons extends StatefulWidget {
  const WindowButtons({Key? key}) : super(key: key);

  @override
  _WindowButtonsState createState() => _WindowButtonsState();
}

class _WindowButtonsState extends State<WindowButtons> {
  void maximizeOrRestore() {
    setState(() {
      appWindow.maximizeOrRestore();
    });
  }

  @override
  Widget build(BuildContext context) {
    return Row(
      children: [
        MinimizeWindowButton(colors: buttonColors),
        appWindow.isMaximized
            ? RestoreWindowButton(
                colors: buttonColors,
                onPressed: maximizeOrRestore,
              )
            : MaximizeWindowButton(
                colors: buttonColors,
                onPressed: maximizeOrRestore,
              ),
        CloseWindowButton(colors: closeButtonColors),
      ],
    );
  }
} 

Download Details:

Author: bitsdojo

Source Code: https://github.com/bitsdojo/bitsdojo_window

#flutter #windows 

A Package to Help with Creating Custom Windows With Flutter
Thai  Son

Thai Son

1659196200

Cách Cài Đặt CodeIgniter 4 Trên Windows Và Mac

CodeIgniter 4 yêu cầu phiên bản PHP 7.2 trở lên. Phiên bản trước đó yêu cầu phiên bản PHP 5.3 tối thiểu trở lên.

Bây giờ có một thư mục công khai giống như trong các khuôn khổ khác. Bây giờ bạn có thể tách ứng dụng khỏi các tài nguyên (như CSS, JS, tệp.).

Nó khó hơn nhiều đối với những kẻ tấn công.

Trong hướng dẫn này, tôi chỉ cách bạn có thể cài đặt dự án Codeigniter 4 trên Windows và Mac.

1. Bật tiện ích mở rộng

  • Mở php.initệp để bật intlmbstringmở rộng.
  • Phần mở rộng tìm kiếm trong tệp.
extension=intl.dll
extension=mbstring.dll

HOẶC

extension=php_intl.dll
extension=php_mbstring.dll
  • Xóa dấu chấm phẩy (;) nếu tồn tại để bật tiện ích mở rộng.
  • Khởi động lại máy chủ.

2. Cài đặt thủ công

  • Tải xuống tệp zip CodeIgniter 4 từ đây .
  • Sao chép trong htdocs/thư mục và giải nén nó.
  • Đổi tên thư mục (ví dụ: codeigniter4).

Cách cài đặt CodeIgniter 4 trên Windows và Mac


3. Sử dụng nhà soạn nhạc

  • Điều hướng đến htdocs/sử dụng Command Prompt nếu bạn đang sử dụng Windows và sử dụng terminal nếu bạn đang sử dụng Mac.
  • Chạy lệnh sau:
composer create-project codeigniter4/appstarter project-root
  • Thay thế gốc dự án bằng tên dự án của bạn như - codeigniter4.
  • Nếu bạn nhận được thông báo sau trên Command prompt khi đang chạy -

Cách cài đặt CodeIgniter 4 trên Windows và Mac

  • Nó có nghĩa là intltiện ích mở rộng chưa được kích hoạt.
  • Để bật tiện ích mở rộng, hãy làm theo bước 1 .
  • Chạy lại composer create-project codeigniter4/appstarter project-root.
  • Một thư mục codeigniter4 mới sẽ được tạo.

4. Chạy

  • Chạy public/thư mục dự án.
http://localhost/codeigniter4/public/

Cách cài đặt CodeIgniter 4 trên Windows và Mac

  • Trong trường hợp trên Mac, bạn không xem trang trên thay vào đó sau khi hiển thị trang -

Cách cài đặt CodeIgniter 4 trên Windows và Mac

  • Sau đó, cần thay đổi quyền của writablethư mục.
  • Điều hướng đến thư mục dự án bằng cách sử dụng thiết bị đầu cuối và thực hiện lệnh sau và làm mới trang.
chmod -R 777 writable

Máy chủ phát triển cục bộ

  • Bạn cũng có thể chạy dự án bằng cách khởi động một máy chủ phát triển cục bộ.
  • Chạy lệnh sau trong Command Prompt nếu bạn đang sử dụng Windows hoặc trên thiết bị đầu cuối nếu bạn đang sử dụng Mac.
php spark serve

Cách cài đặt CodeIgniter 4 trên Windows và Mac

  • Hiển thị URL phát triển sau khi bắt đầu.
  • Chạy - http: // localhost: 8080 / trong trình duyệt.

Cách cài đặt CodeIgniter 4 trên Windows và Mac


5. Kết luận

Bạn có thể cài đặt nó bằng cách sử dụng một trình soạn nhạc hoặc theo cách thủ công. Trước khi cài đặt, hãy đảm bảo rằng phiên bản PHP là 7.2 hoặc cao hơn.

Nguồn:  https://makitweb.com

#php #codeigniter #windows #mac 

Cách Cài Đặt CodeIgniter 4 Trên Windows Và Mac

A Flutter plugin for NetEase IM SDK on Android, iOS and Windows

NIM Plugin for Flutter

A Flutter plugin for NetEase IM SDK.

To learn more about NIM, please visit the website

Getting Started

To get started with NIM for Flutter, please see the documentation .

Usage

To use this plugin, please visit the Usage documentation

Use this package as a library

Depend on it

Run this command:

With Flutter:

 $ flutter pub add nim_core

This will add a line like this to your package's pubspec.yaml (and run an implicit flutter pub get):

dependencies:
  nim_core: ^1.0.3

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

Import it

Now in your Dart code, you can use:

import 'package:nim_core/nim_core.dart'; 

example/lib/main.dart

// Copyright (c) 2022 NetEase, Inc. All rights reserved.
// Use of this source code is governed by a MIT license that can be
// found in the LICENSE file.

import 'dart:async';
import 'dart:convert';
import 'dart:io';
import 'dart:math';
import 'dart:typed_data';

import 'package:crypto/crypto.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:nim_core/nim_core.dart';
import 'package:path_provider/path_provider.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  // For Publish Use
  static const appKey = 'Your_App_Key';
  static const account = 'Account_ID';
  static const token = 'Account_Token';
  static const friendAccount = 'Friend_Account_ID';
  static const chatroomId = '123456789';

  // Inner Test Configuration 2
  // static const account = 'lcd123456';
  // static const token = '1f57ef61a99370211f126e9dd8ba88bd';
  // static const friendAccount = 'jinjie03';

  final subsriptions = <StreamSubscription>[];

  Uint8List? _deviceToken;

  void updateAPNsToken() {
    if (NimCore.instance.isInitialized &&
        Platform.isIOS &&
        _deviceToken != null) {
      NimCore.instance.settingsService.updateAPNSToken(_deviceToken!, null);
    }
  }

  @override
  void initState() {
    super.initState();

    MethodChannel('com.netease.NIM.demo/settings')
        .setMethodCallHandler((call) async {
      if (call.method == 'updateAPNsToken') {
        print('update APNs token');
        _deviceToken = call.arguments as Uint8List;
      }
      return null;
    });

    subsriptions.add(NimCore.instance.authService.authStatus.listen((event) {
      print('AuthService##auth status event: ${event.status.name}');
    }));

    subsriptions
        .add(NimCore.instance.messageService.onMessage.listen((messages) {
      messages.forEach((message) {
        print(
            'MessageService##receive message: ${message.fromNickname} says ${message.content}');
      });
    }));

    subsriptions
        .add(NimCore.instance.messageService.onMessagePinNotify.listen((event) {
      print('MessageService##receive message pin: $event ');
    }));

    subsriptions.add(
        NimCore.instance.messageService.onStickTopSessionAdd.listen((session) {
      print('MessageService##onStickTopSessionAdd: $session ');
    }));

    subsriptions.add(NimCore.instance.messageService.onStickTopSessionUpdate
        .listen((session) {
      print('MessageService##onStickTopSessionUpdate: $session ');
    }));

    subsriptions.add(NimCore.instance.messageService.onStickTopSessionRemove
        .listen((session) {
      print('MessageService##onStickTopSessionRemove: $session ');
    }));

    subsriptions.add(
        NimCore.instance.messageService.onSyncStickTopSession.listen((session) {
      print('MessageService##onSyncStickTopSession: ${session.join('##')} ');
    }));

    subsriptions.add(
        NimCore.instance.messageService.onQuickCommentAdd.listen((comment) {
      print('MessageService##onQuickCommentAdd: $comment');
    }));

    subsriptions.add(
        NimCore.instance.messageService.onQuickCommentRemove.listen((comment) {
      print('MessageService##onQuickCommentRemove: $comment');
    }));

    subsriptions.add(
        NimCore.instance.messageService.onMySessionUpdate.listen((session) {
      print('MessageService##onMySessionUpdate: $session');
    }));

    subsriptions
        .add(NimCore.instance.messageService.onSessionDelete.listen((session) {
      print('MessageService##onSessionDelete: $session');
    }));

    subsriptions
        .add(NimCore.instance.messageService.onSessionUpdate.listen((session) {
      print('MessageService##onSessionUpdate: $session');
    }));

    _doInitializeSDK();
  }

  void _doInitializeSDK() async {
    late NIMSDKOptions options;
    if (Platform.isAndroid) {
      final directory = await getExternalStorageDirectory();
      options = NIMAndroidSDKOptions(
          appKey: appKey,
          shouldSyncStickTopSessionInfos: true,
          sdkRootDir:
              directory != null ? '${directory.path}/NIMFlutter' : null);
    } else if (Platform.isIOS) {
      final directory = await getApplicationDocumentsDirectory();
      options = NIMIOSSDKOptions(
        appKey: appKey,
        shouldSyncStickTopSessionInfos: true,
        sdkRootDir: '${directory.path}/NIMFlutter',
        apnsCername: 'ENTERPRISE',
        pkCername: 'DEMO_PUSH_KIT',
      );
    }

    NimCore.instance.initialize(options).then((value) async {
      NimCore.instance.authService.dynamicTokenProvider = (account) async {
        print('AuthService##getDynamicToken: $account');
        final currentTime = DateTime.now().millisecondsSinceEpoch;
        final ttl = 600;
        final secret = '';
        final signature =
            sha1.convert(utf8.encode('$appKey$account$currentTime$ttl$secret'));
        return base64.encode(utf8.encode(
            '{"signature":"$signature","curTime":$currentTime,"ttl":$ttl}'));
      };
      final loginResult = await NimCore.instance.authService.login(NIMLoginInfo(
        account: account,
        token: token,
        //authType: NIMAuthType.authTypeDynamic,
      ));
      // _testSuperTeam();
      // _testTeam();
      print('login result: $loginResult');
      updateAPNsToken();

      final imagePath = Platform.isAndroid
          ? (await getExternalStorageDirectory())!.path + "/test.jpg"
          : (await getApplicationDocumentsDirectory()).path + "/test.jpg";

      MessageBuilder.createImageMessage(
        sessionId: friendAccount,
        sessionType: NIMSessionType.p2p,
        filePath: imagePath,
        fileSize: 0,
        displayName: 'image',
        //content: 'Nice to meet you!',
        // attachment: NIMCustomMessageAttachment(
        //     data: {
        //       'key': account,
        //       'list': [1, 2, 3, 4],
        //     }
        // )
      ).then<NIMResult>((result) {
        if (result.isSuccess) {
          result.data!.config = NIMCustomMessageConfig(enablePush: true);
          return NimCore.instance.messageService
              .sendMessage(message: result.data!);
        } else {
          return result;
        }
      }).then((result) {
        print(
            'MessageService##send message: ${result.code} ${result.errorDetails}');
      });

      {
        NimCore.instance.messageService
            .deleteSession(
          sessionInfo: NIMSessionInfo(
            sessionId: friendAccount,
            sessionType: NIMSessionType.p2p,
          ),
          deleteType: NIMSessionDeleteType.local,
          sendAck: true,
        )
            .then((value) {
          print('MessageService##delete session: $value');
        });
      }

      setupChatroom();

      var textMessage = await MessageBuilder.createTextMessage(
        sessionId: friendAccount,
        sessionType: NIMSessionType.p2p,
        text: '快捷评论消息',
      );
      textMessage = await NimCore.instance.messageService
          .sendMessage(message: textMessage.data!);
      var result = await NimCore.instance.messageService.addQuickComment(
          textMessage.data!,
          1,
          'ext',
          true,
          true,
          'pushTitle',
          'pushContent',
          {'key': 'value'});
      print('add quick comment result: ${result.toMap()}');

      var result2 = await NimCore.instance.messageService
          .queryQuickComment([textMessage.data!]);
      print('query quick comment result: ${result2.toMap()}');

      var result3 = await NimCore.instance.messageService.removeQuickComment(
          textMessage.data!,
          1,
          'ext',
          true,
          true,
          'pushTitle',
          'pushContent',
          {'key': 'value'});
      print('remove quick comment result: ${result3.toMap()}');

      var mySessionResult = await NimCore.instance.messageService
          .queryMySession(friendAccount, NIMSessionType.p2p);
      print('queryMySession result: ${mySessionResult.toMap()}');

      var updateMySessionResult = await NimCore.instance.messageService
          .updateMySession(friendAccount, NIMSessionType.p2p, 'new ext');
      print('updateMySession result: ${updateMySessionResult.toMap()}');

      var mySessionResult2 = await NimCore.instance.messageService
          .queryMySession(friendAccount, NIMSessionType.p2p);
      print('queryMySession2 result: ${mySessionResult2.toMap()}');

      var mySessionListResult = await NimCore.instance.messageService
          .queryMySessionList(0, 0, 1, 100, 1);
      print('queryMySessionList result: ${mySessionListResult.toMap()}');

      var deleteMySessionResult = await NimCore.instance.messageService
          .deleteMySession([
        NIMMySessionKey(
            sessionId: friendAccount, sessionType: NIMSessionType.p2p)
      ]);
      print('deleteMySession result: ${deleteMySessionResult.toMap()}');

      var mySessionResult3 = await NimCore.instance.messageService
          .queryMySession(friendAccount, NIMSessionType.p2p);
      print('queryMySession3 result: ${mySessionResult3.toMap()}');

      NimCore.instance.messageService
          .querySessionList()
          .then((value) => print("session call back"));
    });
  }

  @override
  void dispose() {
    subsriptions.forEach((subsription) {
      subsription.cancel();
    });
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(),
      ),
    );
  }

  void setupChatroom() {
    var chatroomService = NimCore.instance.chatroomService;
    chatroomService.onEventNotified.listen((event) {
      print('ChatroomService##on event notified: $event');
    });

    chatroomService.onMessageStatusChanged.listen((event) {
      print(
          'ChatroomService##on message status changed: ${event.uuid} ${event.status}');
    });

    chatroomService.onMessageAttachmentProgressUpdate.listen((event) {
      print(
          'ChatroomService##on message attachment progress update: ${event.id} ${event.progress}');
    });

    chatroomService.onMessageReceived.listen((messages) {
      messages.forEach((message) {
        print(
            'ChatroomService##on message received: ${message.fromAccount} ${message.fromNickname} '
            '\'${message.content}\' ${message.extension?.nickname} ${message.extension?.senderExtension}');
        final attachment = message.messageAttachment;
        if (attachment is NIMChatroomNotificationAttachment) {
          print('ChatroomService##on notification: ${attachment.operatorNick} '
              '${NIMChatroomNotificationTypes.typeToString(attachment.type)}');
        }
        if (message.content == 'fetch room info') {
          chatroomService.fetchChatroomInfo(chatroomId).then((value) {
            print(
                'ChatroomService##fetch updated chatroom info: ${value.data?.name} '
                '${value.data?.announcement}');
          });
        }

        final setAnnouncement = RegExp(r'^set announcement (.+)$')
            .firstMatch(message.content ?? '');
        if (setAnnouncement != null) {
          chatroomService
              .updateChatroomInfo(
            roomId: chatroomId,
            request: NIMChatroomUpdateRequest(
              announcement: setAnnouncement.group(1),
            ),
            needNotify: true,
          )
              .then((value) {
            print(
                'ChatroomService##set chatroom announcement:  ${value.code} ${value.errorDetails}');
          });
        }

        final pollMessage = RegExp(r'^poll message( [0-9]*)$')
            .firstMatch(message.content ?? '');
        if (pollMessage != null) {
          chatroomService.fetchMessageHistory(
            roomId: chatroomId,
            startTime: DateTime.now().millisecondsSinceEpoch,
            limit:
                max(1, int.tryParse(pollMessage.group(1)?.trim() ?? '1') ?? 1),
            direction: QueryDirection.QUERY_OLD,
            messageTypeList: [NIMMessageType.text],
          ).then((messages) {
            var index = 0;
            messages.data?.forEach((message) {
              print(
                  'ChatroomService##message history: ${index++} ${message.fromAccount} ${message.fromNickname} '
                  '\'${message.content}\'');
            });
          });
        }

        if (message.content == 'poll queue') {
          chatroomService.fetchChatroomQueue(chatroomId).then((value) {
            print(
                'ChatroomService##poll queue: ${value.code} ${value.errorDetails} '
                '${value.data?.map((e) => '${e.key}:${e.value}').toList()}');
          });
        }

        if (message.content == 'clear queue') {
          chatroomService.clearChatroomQueue(message.sessionId!).then((value) {
            print(
                'ChatroomService##clear queue: ${value.code} ${value.errorDetails}');
          });
        }

        final pollQueueEntry = RegExp(r'^poll queue entry (.+)$')
            .firstMatch(message.content ?? '');
        if (pollQueueEntry != null) {
          chatroomService
              .pollChatroomQueueEntry(chatroomId, pollQueueEntry.group(1))
              .then((value) {
            print(
                'ChatroomService##poll queue entry: ${value.code} ${value.errorDetails} ${value.data?.key} ${value.data?.value}');
          });
        }

        final addQueueEntry = RegExp(r'^add queue entry (.+) (.+)$')
            .firstMatch(message.content ?? '');
        if (addQueueEntry != null) {
          chatroomService
              .updateChatroomQueueEntry(
            roomId: chatroomId,
            entry: NIMChatroomQueueEntry(
              key: addQueueEntry.group(1) as String,
              value: addQueueEntry.group(2) as String,
            ),
            isTransient: true,
          )
              .then((value) {
            print(
                'ChatroomService##add queue entry: ${value.code} ${value.errorDetails}');
          });
        }

        // if (message.content == 'exit') {
        //   chatroomService.exitChatroom(message.sessionId!).then((value) {
        //     print(
        //         'ChatroomService##exit chatroom: ${value.code} ${value.errorDetails}');
        //   });
        // }

        final setNickname =
            RegExp(r'^set nickname (.+)$').firstMatch(message.content ?? '');
        if (setNickname != null) {
          chatroomService
              .updateChatroomMyMemberInfo(
            roomId: chatroomId,
            request: NIMChatroomUpdateMyMemberInfoRequest(
              nickname: setNickname.group(1) as String,
              needSave: true,
            ),
          )
              .then((value) {
            print(
                'ChatroomService##update chatroom my info:  ${value.code} ${value.errorDetails}');
          });
        }

        if (message.content == 'ping') {
          ChatroomMessageBuilder.createChatroomTextMessage(
            roomId: message.sessionId!,
            text: 'pong',
          ).then<NIMResult>((result) {
            if (result.isSuccess) {
              return chatroomService.sendChatroomMessage(result.data!);
            } else {
              return result;
            }
          }).then((value) {
            print(
                'ChatroomService##send message: ${value.code} ${value.errorDetails}');
          });
        }

        final fetchMembers = RegExp(r'^fetch members( [0-9]*)$')
            .firstMatch(message.content ?? '');
        if (fetchMembers != null) {
          chatroomService
              .fetchChatroomMembers(
            roomId: chatroomId,
            queryType: NIMChatroomMemberQueryType.values.firstWhere(
                (element) =>
                    element.index ==
                    int.tryParse(fetchMembers.group(1)?.trim() ?? '0'),
                orElse: () => NIMChatroomMemberQueryType.allNormalMember),
            limit: 10,
          )
              .then((result) {
            var index = 0;
            result.data?.forEach((member) {
              print(
                  'ChatroomService fetchChatroomMembers ##member_${index++}: ${member.account} ${member.nickname} ${member.memberType}');
            });
          });
        }

        final fetchMember =
            RegExp(r'^fetch member (.+)$').firstMatch(message.content ?? '');
        if (fetchMember != null) {
          chatroomService.fetchChatroomMembersByAccount(
              roomId: chatroomId,
              accountList: [fetchMember.group(1) as String]).then((result) {
            final member = result.data != null && result.data!.isNotEmpty
                ? result.data![0]
                : null;
            print(
                'ChatroomService fetch member: ${member?.account} ${member?.nickname} ${member?.memberType}');
          });
        }

        if (message.content == 'mute me') {
          chatroomService
              .markChatroomMemberTempMuted(
            duration: 5000,
            options: NIMChatroomMemberOptions(
              roomId: chatroomId,
              account: message.fromAccount!,
            ),
            needNotify: true,
          )
              .then((result) {
            print(
                'ChatroomService temp mute member: ${result.code} ${result.errorDetails}');
          });
        }
      });
    });

    chatroomService
        .enterChatroom(NIMChatroomEnterRequest(
      roomId: chatroomId,
      notifyExtension: {
        'senderAccount': account,
        'sendDate': DateTime.now().toString(),
        'platform': Platform.operatingSystem,
      },
      extension: {
        'senderAccount': account,
        'sendDate': DateTime.now().toString(),
        'platform': Platform.operatingSystem,
      },
    ))
        .then((value) {
      print(
          'ChatroomService##enter chatroom: ${value.code} ${value.errorDetails}');

      ChatroomMessageBuilder.createChatroomTextMessage(
        roomId: chatroomId,
        text: 'Hello everybody. This is $account',
      ).then((value) {
        chatroomService.sendChatroomMessage(value.data!).then((value) {
          print('send text chatroom message');
        });
      });
    });
  }
} 

Download Details:

Author: netease-kit

Source Code: https://github.com/netease-kit/NIM-Flutter-SDK

#flutter #windows 

A Flutter plugin for NetEase IM SDK on Android, iOS and Windows

Как установить проект Codeigniter 4 на Windows и Mac

CodeIgniter 4 требует PHP версии 7.2 или выше. Для более ранней версии требуется минимальная версия PHP 5.3 или выше.

Теперь есть общедоступный каталог, как и в других фреймворках. Теперь вы можете отделить приложение от ресурсов (таких как CSS, JS, файлы).

Злоумышленникам гораздо сложнее.

В этом руководстве я покажу, как установить проект Codeigniter 4 на Windows и Mac.

1. Включить расширения

  • Откройте php.iniфайл для включения intlи mbstringрасширения.
  • Найдите расширение в файле.
extension=intl.dll
extension=mbstring.dll

ИЛИ ЖЕ

extension=php_intl.dll
extension=php_mbstring.dll
  • Удалите точку с запятой (;), если она существует, чтобы включить расширение.
  • Перезапустите сервер.

2. Ручная установка

  • Загрузите zip-файл CodeIgniter 4 отсюда .
  • Скопируйте в htdocs/папку и извлеките его.
  • Переименуйте папку (например, codeigniter4).

Как установить CodeIgniter 4 на Windows и Mac


3. Использование композитора

  • Перейдите к htdocs/использованию командной строки, если вы работаете в Windows, и используйте терминал, если вы используете Mac.
  • Выполните следующую команду —
composer create-project codeigniter4/appstarter project-root
  • Замените project-root на имя вашего проекта, например — codeigniter4.
  • Если вы получаете следующее сообщение в командной строке во время работы:

Как установить CodeIgniter 4 на Windows и Mac

  • Это означает , что intlрасширение не было включено.
  • Чтобы включить расширение, выполните шаг 1 .
  • Повторно запустите composer create-project codeigniter4/appstarter project-root.
  • Будет создана новая папка codeigniter4.

4. Беги

  • public/Запустите папку проекта .
http://localhost/codeigniter4/public/

Как установить CodeIgniter 4 на Windows и Mac

  • На Mac в случае, если вы не просматриваете вышеуказанную страницу, а просматриваете следующую страницу —

Как установить CodeIgniter 4 на Windows и Mac

  • Затем нужно изменить разрешение writableпапки.
  • Перейдите в каталог проекта с помощью терминала, выполните следующую команду и обновите страницу.
chmod -R 777 writable

Локальный сервер разработки

  • Вы также можете запустить проект, запустив локальный сервер разработки.
  • Запустите следующую команду в командной строке, если вы работаете в Windows, или в терминале, если вы используете Mac.
php spark serve

Как установить CodeIgniter 4 на Windows и Mac

  • Отображение URL-адреса разработки после запуска.
  • Запустить — http://localhost:8080/ в браузере.

Как установить CodeIgniter 4 на Windows и Mac


5. Вывод

Вы можете установить его с помощью композитора или вручную. Перед установкой убедитесь, что версия PHP 7.2 или выше.

Источник:  https://makitweb.com

#php #codeigniter #windows #mac 

Как установить проект Codeigniter 4 на Windows и Mac