1622822580
Announced at Ignite 2019, Azure Quantum is a full-stack, cloud ecosystem enabling access to diverse quantum hardware and software. Aimed at developers, researchers, and customers, Azure Quantum is now in public preview.
As its main tenet, Azure Quantum provides a single development interface to quantum computer and solutions.
You can access quantum computing capabilities in the cloud from our hardware partners, Honeywell Quantum Solutions and IonQ, through their trapped-ion quantum systems.
Honeywell Quantum Solutions offers quantum computers featuring 10 fully connected qubits with a quantum volume of 128. According to Honeywell, its latest System Model H1 can run circuits that cannot be run on other quantum computers thanks to two exclusive features: mid-circuit measurement and qubit reuse (MCMR).
The ability to measure an individual qubit, or a subset of qubits, without destroying the quantum information of the remaining qubits in the system is a unique capability of the Honeywell architecture. By employing this technique, users can access deeper circuits that would typically be impossible with a limited number of physical qubits.
IonQ, on the other hand, has recently released a 32-qubit trapped-ion quantum computer claiming a massive quantum volume much higher than competitors’.
Besides quantum hardware, Azure Quantum also provides cloud-based access to algorithms developed at Microsoft and 1QBit. Microsoft Quantum Computing Kit includes libraries for chemistry, machine learning, and numerics. 1QBit provides hardware-agnostic algorithms for material science and drug discovery, market sentiment analysis, and chest X-rays interpretation, and has integrated its OpenQEMIST solution with the Microsoft Development Kit.
One of the key components of Azure Quantum is Q#, Microsoft’s open-source domain specific language for expressing high-level quantum algorithms. Besides syntactical constructs similar to those found in traditional programming languages, Q## includes specialized constructs, such as the Qubit
data type, operators corresponding to quantum gates and measurements, functors like adjoint
and controlled
that are the equivalent of “undo” and conditional operations.
While constantly improving, quantum hardware is not yet sufficiently mature to be used to run quantum algorithms to solve real-world problems. Still, Microsoft is actively pursuing an approach they call quantum-inspired algorithms aimed at applying quantum techniques to real-world problems using a combination of classical and quantum hardware. If you would like to explore the key concepts in quantum computing and take your first step with Azure Quantum, Microsoft provides great self-learning material on its website.
#cloud #microsoft azure #microsoft #q# #news
1678870808
CodeMirror component for React. Demo Preview: @uiwjs.github.io/react-codemirror
Features:
🚀 Quickly and easily configure the API.
🌱 Versions after @uiw/react-codemirror@v4
use codemirror 6. #88.
⚛️ Support the features of React Hook(requires React 16.8+).
📚 Use Typescript to write, better code hints.
🌐 The bundled version supports use directly in the browser #267.
🌎 There are better sample previews.
🎨 Support theme customization, provide theme editor.
Not dependent on uiw.
npm install @uiw/react-codemirror --save
import React from 'react';
import CodeMirror from '@uiw/react-codemirror';
import { javascript } from '@codemirror/lang-javascript';
function App() {
const onChange = React.useCallback((value, viewUpdate) => {
console.log('value:', value);
}, []);
return (
<CodeMirror
value="console.log('hello world!');"
height="200px"
extensions={[javascript({ jsx: true })]}
onChange={onChange}
/>
);
}
export default App;
import CodeMirror from '@uiw/react-codemirror';
import { StreamLanguage } from '@codemirror/language';
import { go } from '@codemirror/legacy-modes/mode/go';
const goLang = `package main
import "fmt"
func main() {
fmt.Println("Hello, 世界")
}`;
export default function App() {
return <CodeMirror value={goLang} height="200px" extensions={[StreamLanguage.define(go)]} />;
}
@codemirror/legacy-modes/mode/cpp
=> @codemirror/lang-cpp
@codemirror/legacy-modes/mode/css
=> @codemirror/lang-css
@codemirror/legacy-modes/mode/html
=> @codemirror/lang-html
@codemirror/legacy-modes/mode/java
=> @codemirror/lang-java
@codemirror/legacy-modes/mode/javascript
=> @codemirror/lang-javascript
@codemirror/legacy-modes/mode/json
=> @codemirror/lang-json
@codemirror/legacy-modes/mode/lezer
=> @codemirror/lang-lezer
@codemirror/legacy-modes/mode/markdown
=> @codemirror/lang-markdown
@codemirror/legacy-modes/mode/php
=> @codemirror/lang-php
@codemirror/legacy-modes/mode/python
=> @codemirror/lang-python
@codemirror/legacy-modes/mode/rust
=> @codemirror/lang-rust
@codemirror/legacy-modes/mode/sql
=> @codemirror/lang-sql
@codemirror/legacy-modes/mode/xml
=> @codemirror/lang-xml
@codemirror/legacy-modes/mode/wast
=> @codemirror/lang-wast
Markdown language code is automatically highlighted.
import CodeMirror from '@uiw/react-codemirror';
import { markdown, markdownLanguage } from '@codemirror/lang-markdown';
import { languages } from '@codemirror/language-data';
const code = `## Title
\`\`\`jsx
function Demo() {
return <div>demo</div>
}
\`\`\`
\`\`\`bash
# Not dependent on uiw.
npm install @codemirror/lang-markdown --save
npm install @codemirror/language-data --save
\`\`\`
[weisit ulr](https://uiwjs.github.io/react-codemirror/)
\`\`\`go
package main
import "fmt"
func main() {
fmt.Println("Hello, 世界")
}
\`\`\`
`;
export default function App() {
return <CodeMirror value={code} extensions={[markdown({ base: markdownLanguage, codeLanguages: languages })]} />;
}
import { useEffect, useMemo, useRef } from 'react';
import { useCodeMirror } from '@uiw/react-codemirror';
import { javascript } from '@codemirror/lang-javascript';
const code = "console.log('hello world!');\n\n\n";
// Define the extensions outside the component for the best performance.
// If you need dynamic extensions, use React.useMemo to minimize reference changes
// which cause costly re-renders.
const extensions = [javascript()];
export default function App() {
const editor = useRef();
const { setContainer } = useCodeMirror({
container: editor.current,
extensions,
value: code,
});
useEffect(() => {
if (editor.current) {
setContainer(editor.current);
}
}, [editor.current]);
return <div ref={editor} />;
}
We have created a theme editor
where you can define your own theme. We have also defined some themes ourselves, which can be installed and used directly. Below is a usage example:
import CodeMirror from '@uiw/react-codemirror';
import { javascript } from '@codemirror/lang-javascript';
import { okaidia } from '@uiw/codemirror-theme-okaidia';
const extensions = [javascript({ jsx: true })];
export default function App() {
return (
<CodeMirror
value="console.log('hello world!');"
height="200px"
theme={okaidia}
extensions={[javascript({ jsx: true })]}
/>
);
}
import CodeMirror from '@uiw/react-codemirror';
import { createTheme } from '@uiw/codemirror-themes';
import { javascript } from '@codemirror/lang-javascript';
import { tags as t } from '@lezer/highlight';
const myTheme = createTheme({
theme: 'light',
settings: {
background: '#ffffff',
foreground: '#75baff',
caret: '#5d00ff',
selection: '#036dd626',
selectionMatch: '#036dd626',
lineHighlight: '#8a91991a',
gutterBackground: '#fff',
gutterForeground: '#8a919966',
},
styles: [
{ tag: t.comment, color: '#787b8099' },
{ tag: t.variableName, color: '#0080ff' },
{ tag: [t.string, t.special(t.brace)], color: '#5c6166' },
{ tag: t.number, color: '#5c6166' },
{ tag: t.bool, color: '#5c6166' },
{ tag: t.null, color: '#5c6166' },
{ tag: t.keyword, color: '#5c6166' },
{ tag: t.operator, color: '#5c6166' },
{ tag: t.className, color: '#5c6166' },
{ tag: t.definition(t.typeName), color: '#5c6166' },
{ tag: t.typeName, color: '#5c6166' },
{ tag: t.angleBracket, color: '#5c6166' },
{ tag: t.tagName, color: '#5c6166' },
{ tag: t.attributeName, color: '#5c6166' },
],
});
const extensions = [javascript({ jsx: true })];
export default function App() {
const onChange = React.useCallback((value, viewUpdate) => {
console.log('value:', value);
}, []);
return (
<CodeMirror
value="console.log('hello world!');"
height="200px"
theme={myTheme}
extensions={extensions}
onChange={onChange}
/>
);
}
initialState
to restore state from JSON-serialized representationCodeMirror allows to serialize editor state to JSON representation with toJSON function for persistency or other needs. This JSON representation can be later used to recreate ReactCodeMirror component with the same internal state.
For example, this is how undo history can be saved in the local storage, so that it remains after the page reloads
import CodeMirror from '@uiw/react-codemirror';
import { historyField } from '@codemirror/commands';
// When custom fields should be serialized, you can pass them in as an object mapping property names to fields.
// See [toJSON](https://codemirror.net/docs/ref/#state.EditorState.toJSON) documentation for more details
const stateFields = { history: historyField };
export function EditorWithInitialState() {
const serializedState = localStorage.getItem('myEditorState');
const value = localStorage.getItem('myValue') || '';
return (
<CodeMirror
value={value}
initialState={
serializedState
? {
json: JSON.parse(serializedState || ''),
fields: stateFields,
}
: undefined
}
onChange={(value, viewUpdate) => {
localStorage.setItem('myValue', value);
const state = viewUpdate.state.toJSON(stateFields);
localStorage.setItem('myEditorState', JSON.stringify(state));
}}
/>
);
}
value?: string
value of the auto created model in the editor.width?: string
width of editor. Defaults to auto
.height?: string
height of editor. Defaults to auto
.theme?
: 'light'
/ 'dark'
/ Extension
Defaults to 'light'
.import React from 'react';
import { EditorState, EditorStateConfig, Extension } from '@codemirror/state';
import { EditorView, ViewUpdate } from '@codemirror/view';
export * from '@codemirror/view';
export * from '@codemirror/basic-setup';
export * from '@codemirror/state';
export interface UseCodeMirror extends ReactCodeMirrorProps {
container?: HTMLDivElement | null;
}
export declare function useCodeMirror(props: UseCodeMirror): {
state: EditorState | undefined;
setState: import('react').Dispatch<import('react').SetStateAction<EditorState | undefined>>;
view: EditorView | undefined;
setView: import('react').Dispatch<import('react').SetStateAction<EditorView | undefined>>;
container: HTMLDivElement | null | undefined;
setContainer: import('react').Dispatch<import('react').SetStateAction<HTMLDivElement | null | undefined>>;
};
export interface ReactCodeMirrorProps
extends Omit<EditorStateConfig, 'doc' | 'extensions'>,
Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'placeholder'> {
/** value of the auto created model in the editor. */
value?: string;
height?: string;
minHeight?: string;
maxHeight?: string;
width?: string;
minWidth?: string;
maxWidth?: string;
/** focus on the editor. */
autoFocus?: boolean;
/** Enables a placeholder—a piece of example content to show when the editor is empty. */
placeholder?: string | HTMLElement;
/**
* `light` / `dark` / `Extension` Defaults to `light`.
* @default light
*/
theme?: 'light' | 'dark' | Extension;
/**
* Whether to optional basicSetup by default
* @default true
*/
basicSetup?: boolean | BasicSetupOptions;
/**
* This disables editing of the editor content by the user.
* @default true
*/
editable?: boolean;
/**
* This disables editing of the editor content by the user.
* @default false
*/
readOnly?: boolean;
/**
* Whether to optional basicSetup by default
* @default true
*/
indentWithTab?: boolean;
/** Fired whenever a change occurs to the document. */
onChange?(value: string, viewUpdate: ViewUpdate): void;
/** Some data on the statistics editor. */
onStatistics?(data: Statistics): void;
/** The first time the editor executes the event. */
onCreateEditor?(view: EditorView, state: EditorState): void;
/** Fired whenever any state change occurs within the editor, including non-document changes like lint results. */
onUpdate?(viewUpdate: ViewUpdate): void;
/**
* Extension values can be [provided](https://codemirror.net/6/docs/ref/#state.EditorStateConfig.extensions) when creating a state to attach various kinds of configuration and behavior information.
* They can either be built-in extension-providing objects,
* such as [state fields](https://codemirror.net/6/docs/ref/#state.StateField) or [facet providers](https://codemirror.net/6/docs/ref/#state.Facet.of),
* or objects with an extension in its `extension` property. Extensions can be nested in arrays arbitrarily deep—they will be flattened when processed.
*/
extensions?: Extension[];
/**
* If the view is going to be mounted in a shadow root or document other than the one held by the global variable document (the default), you should pass it here.
* Originally from the [config of EditorView](https://codemirror.net/6/docs/ref/#view.EditorView.constructor%5Econfig.root)
*/
root?: ShadowRoot | Document;
/**
* Create a state from its JSON representation serialized with [toJSON](https://codemirror.net/docs/ref/#state.EditorState.toJSON) function
*/
initialState?: {
json: any;
fields?: Record<'string', StateField<any>>;
};
}
export interface ReactCodeMirrorRef {
editor?: HTMLDivElement | null;
state?: EditorState;
view?: EditorView;
}
declare const ReactCodeMirror: React.ForwardRefExoticComponent<
ReactCodeMirrorProps & React.RefAttributes<ReactCodeMirrorRef>
>;
export default ReactCodeMirror;
export interface BasicSetupOptions {
lineNumbers?: boolean;
highlightActiveLineGutter?: boolean;
highlightSpecialChars?: boolean;
history?: boolean;
foldGutter?: boolean;
drawSelection?: boolean;
dropCursor?: boolean;
allowMultipleSelections?: boolean;
indentOnInput?: boolean;
syntaxHighlighting?: boolean;
bracketMatching?: boolean;
closeBrackets?: boolean;
autocompletion?: boolean;
rectangularSelection?: boolean;
crosshairCursor?: boolean;
highlightActiveLine?: boolean;
highlightSelectionMatches?: boolean;
closeBracketsKeymap?: boolean;
defaultKeymap?: boolean;
searchKeymap?: boolean;
historyKeymap?: boolean;
foldKeymap?: boolean;
completionKeymap?: boolean;
lintKeymap?: boolean;
}
import { EditorSelection, SelectionRange } from '@codemirror/state';
import { ViewUpdate } from '@codemirror/view';
export interface Statistics {
/** Get the number of lines in the editor. */
lineCount: number;
/** total length of the document */
length: number;
/** Get the proper [line-break](https://codemirror.net/docs/ref/#state.EditorState^lineSeparator) string for this state. */
lineBreak: string;
/** Returns true when the editor is [configured](https://codemirror.net/6/docs/ref/#state.EditorState^readOnly) to be read-only. */
readOnly: boolean;
/** The size (in columns) of a tab in the document, determined by the [`tabSize`](https://codemirror.net/6/docs/ref/#state.EditorState^tabSize) facet. */
tabSize: number;
/** Cursor Position */
selection: EditorSelection;
/** Make sure the selection only has one range. */
selectionAsSingle: SelectionRange;
/** Retrieves a list of all current selections. */
ranges: readonly SelectionRange[];
/** Get the currently selected code. */
selectionCode: string;
/**
* The length of the given array should be the same as the number of active selections.
* Replaces the content of the selections with the strings in the array.
*/
selections: string[];
/** Return true if any text is selected. */
selectedText: boolean;
}
export declare const getStatistics: (view: ViewUpdate) => Statistics;
All Packages
Name | NPM Version | Website |
---|---|---|
@uiw/react-codemirror | #preview | |
@uiw/codemirror-extensions-basic-setup | #preview | |
@uiw/codemirror-extensions-color | #preview | |
@uiw/codemirror-extensions-classname | #preview | |
@uiw/codemirror-extensions-events | #preview | |
@uiw/codemirror-extensions-hyper-link | #preview | |
@uiw/codemirror-extensions-langs | #preview | |
@uiw/codemirror-extensions-line-numbers-relative | #preview | |
@uiw/codemirror-extensions-mentions | #preview | |
@uiw/codemirror-extensions-zebra-stripes | #preview | |
@uiw/codemirror-themes | #preview |
Name | NPM Version | Website |
---|---|---|
@uiw/codemirror-themes-all | #preview | |
@uiw/codemirror-theme-abcdef | #preview | |
@uiw/codemirror-theme-androidstudio | #preview | |
@uiw/codemirror-theme-atomone | #preview | |
@uiw/codemirror-theme-aura | #preview | |
@uiw/codemirror-theme-bbedit | #preview | |
@uiw/codemirror-theme-bespin | #preview | |
@uiw/codemirror-theme-duotone | #preview | |
@uiw/codemirror-theme-dracula | #preview | |
@uiw/codemirror-theme-darcula | #preview | |
@uiw/codemirror-theme-eclipse | #preview | |
@uiw/codemirror-theme-github | #preview | |
@uiw/codemirror-theme-gruvbox-dark | #preview | |
@uiw/codemirror-theme-material | #preview | |
@uiw/codemirror-theme-noctis-lilac | #preview | |
@uiw/codemirror-theme-nord | #preview | |
@uiw/codemirror-theme-okaidia | #preview | |
@uiw/codemirror-theme-solarized | #preview | |
@uiw/codemirror-theme-sublime | #preview | |
@uiw/codemirror-theme-tokyo-night | #preview | |
@uiw/codemirror-theme-tokyo-night-storm | #preview | |
@uiw/codemirror-theme-tokyo-night-day | #preview | |
@uiw/codemirror-theme-vscode | #preview | |
@uiw/codemirror-theme-xcode | #preview |
Author: uiwjs
Source Code: https://github.com/uiwjs/react-codemirror
License: MIT license
1624537980
Microsoft’s Azure Quantum, a public cloud ecosystem for building quantum computing applications, is now available for use in a public preview phase.
Launched February 1, the Azure Quantum cloud service is available for a free trial. Developers, integrators, researchers, and others can use the platform to build solutions leveraging Microsoft and partner tools in a trusted public cloud. Users can access a network of quantum researchers and developers, a resource library, and self-service or tailored development programs.
A key component of the platform is Microsoft’s open source Quantum Development Kit with the Q## language for quantum programming. Microsoft’s Quantum Intermediate Representation (QIR) is featured as a common open source interface between languages and target quantum computation platforms. Microsoft partners Honeywell Quantum Solutions and IonQ are providing quantum computing hardware.
#microsoft azure quantum #opens #public
1622822580
Announced at Ignite 2019, Azure Quantum is a full-stack, cloud ecosystem enabling access to diverse quantum hardware and software. Aimed at developers, researchers, and customers, Azure Quantum is now in public preview.
As its main tenet, Azure Quantum provides a single development interface to quantum computer and solutions.
You can access quantum computing capabilities in the cloud from our hardware partners, Honeywell Quantum Solutions and IonQ, through their trapped-ion quantum systems.
Honeywell Quantum Solutions offers quantum computers featuring 10 fully connected qubits with a quantum volume of 128. According to Honeywell, its latest System Model H1 can run circuits that cannot be run on other quantum computers thanks to two exclusive features: mid-circuit measurement and qubit reuse (MCMR).
The ability to measure an individual qubit, or a subset of qubits, without destroying the quantum information of the remaining qubits in the system is a unique capability of the Honeywell architecture. By employing this technique, users can access deeper circuits that would typically be impossible with a limited number of physical qubits.
IonQ, on the other hand, has recently released a 32-qubit trapped-ion quantum computer claiming a massive quantum volume much higher than competitors’.
Besides quantum hardware, Azure Quantum also provides cloud-based access to algorithms developed at Microsoft and 1QBit. Microsoft Quantum Computing Kit includes libraries for chemistry, machine learning, and numerics. 1QBit provides hardware-agnostic algorithms for material science and drug discovery, market sentiment analysis, and chest X-rays interpretation, and has integrated its OpenQEMIST solution with the Microsoft Development Kit.
One of the key components of Azure Quantum is Q#, Microsoft’s open-source domain specific language for expressing high-level quantum algorithms. Besides syntactical constructs similar to those found in traditional programming languages, Q## includes specialized constructs, such as the Qubit
data type, operators corresponding to quantum gates and measurements, functors like adjoint
and controlled
that are the equivalent of “undo” and conditional operations.
While constantly improving, quantum hardware is not yet sufficiently mature to be used to run quantum algorithms to solve real-world problems. Still, Microsoft is actively pursuing an approach they call quantum-inspired algorithms aimed at applying quantum techniques to real-world problems using a combination of classical and quantum hardware. If you would like to explore the key concepts in quantum computing and take your first step with Azure Quantum, Microsoft provides great self-learning material on its website.
#cloud #microsoft azure #microsoft #q# #news
1624327316
K-means is one of the simplest unsupervised machine learning algorithms that solve the well-known data clustering problem. Clustering is one of the most common data analysis tasks used to get an intuition about data structure. It is defined as finding the subgroups in the data such that each data points in different clusters are very different. We are trying to find the homogeneous subgroups within the data. Each group’s data points are similarly based on similarity metrics like a Euclidean-based distance or correlation-based distance.
The algorithm can do clustering analysis based on features or samples. We try to find the subcategory of sampling based on attributes or try to find the subcategory of parts based on samples. The practical applications of such a procedure are many: the best use of clustering in amazon and Netflix recommended system, given a medical image of a group of cells, a clustering algorithm could aid in identifying the centers of the cells; looking at the GPS data of a user’s mobile device, their more frequently visited locations within a certain radius can be revealed; for any set of unlabeled observations, clustering helps establish the existence of some structure of data that might indicate that the data is separable.
K-means the clustering algorithm whose primary goal is to group similar elements or data points into a cluster.
K in k-means represents the number of clusters.
A cluster refers to a collection of data points aggregated together because of certain similarities.
K-means clustering is an iterative algorithm that starts with k random numbers used as mean values to define clusters. Data points belong to the group represented by the mean value to which they are closest. This mean value co-ordinates called the centroid.
Iteratively, the mean value of each cluster’s data points is computed, and the new mean values are used to restart the process till the mean stops changing. The disadvantage of k-means is that it a local search procedure and could miss global patterns.
The k initial centroids can be randomly selected. Another approach of determining k is to compute the entire dataset’s mean and add _k _random co-ordinates to it to make k initial points. Another method is to determine the principal component of the data and divide it into _k _equal partitions. The mean of each section can be used as initial centroids.
#ad #microsoft #microsoft-azure #azure #azure-functions #azure-security
1620998820
Microsoft Azure Firewall is a managed, cloud-based network security service that protects your Azure Virtual Network resources. The company recently announced a preview release of a premium version of the cloud-based network security service.
Azure Firewall became generally available during Ignite in 2018 and received several updates later on, such as Threat Intelligence and Service Tags filters, Custom DNS, IP Groups, and now has an additional tier with premium. The release of the premium tier includes the following features according to the Azure documentation:
Eliran Azulai, Principal Program Manager, Azure Networking, told InfoQ:
When it comes to network security, the key is to use cloud-native services to secure the network infrastructure and application delivery. To minimize attack surface, customers need network segmentation, threat protection, and encryption.
Network segmentation helps prevent lateral movement and data exfiltration. Our customers can use Virtual Networks and Azure Firewall to perform network segmentation effectively When it comes to threat protection, the most basic protection they must turn on is DDoS protection on all public IPs. We have added our unique intelligent threat protection to Azure Firewall to stay ahead of the attacks. Customers can also use IDPS to identify, alert and block malicious traffic. Finally, customers can encrypt communication channels across the cloud and hybrid networks with industry leading encryption such as TLS.
#azure #microsoft azure #network security #development #devops #azure firewall