JavaScript serializes form as object and JSON

When the front-end submits parameters to the back-end, they are usually passed in json format, while the controls that receive input parameters usually use form forms. Is there any way to sequence the parameters in form directly into objects? Here is a method: function deserializeJSON($form) { var res = {}; ...

Posted by mjdamato on Wed, 01 Jan 2020 03:26:41 -0800

ios development foundation 1

Code creation Label and Button - (void)viewDidLoad { [super viewDidLoad]; // label CGRect screen = [[UIScreen mainScreen]bounds]; CGFloat labelWidth = 90; CGFloat labelHeight = 50; CGFloat labelTopView = 150; CGRect labelFrame = CGRectMake((screen.size.width - labelWidth)/2, labelTopView, labelW ...

Posted by gford on Wed, 01 Jan 2020 01:07:53 -0800

Understanding React(4): ref attribute

The ref attribute is actually used to get DOM nodes, for example: import React from 'react' class RefComponent extends React.Component { componentDidMount(){ this.inputNode.focus(); } render() { return ( <div> <h1>ref attribute</h1> <input type="text" ref={nod ...

Posted by texelate on Tue, 31 Dec 2019 20:42:57 -0800

Spring source reading - 4

Creation of BeanDefinitionHolder The inheritance structure of BeanDefinition in the Spring framework is as follows: BeanDefinition is the internal representation of the configuration file < bean > element label in the container. The < bean > element tag has class, scope, lazy init and other configuration attributes, while BeanDe ...

Posted by dakkonz on Tue, 31 Dec 2019 18:11:42 -0800

70 - three.js notes - use environment maps to create fake reflections

Computing environment reflection is CPU intensive, and ray tracing algorithm is usually used. In three.js, environment map envMap is used to camouflage reflection, and environment map can be used on specified objects. 1, example Example http://ithanmang.com/threeJs/home/201809/20180905/07-envMap-texture.html Effect 2. U ...

Posted by ev66 on Tue, 31 Dec 2019 16:34:11 -0800

2 basic steps of writing vue

Basic steps of vue The code of Vue is placed in the generated src. Under the src, App.vue is the root component, main.js and components (other components are placed inside) First, define a component name in components, and write content in it. Take HelloWorld.vue as an example: <template> <div class="hello"> ...

Posted by possiblyB9 on Tue, 31 Dec 2019 13:16:05 -0800

Dubbo's filter loads on demand

background In one day, two partners asked me about the on-demand loading mechanism of filter. It's necessary to record it here About filter The predecessor of filter in dubbo source code series Today's filter of dubbo source code series Analysis The following attributes exist in the comment about Activate in dubbo @Documented @Retentio ...

Posted by gardner1 on Tue, 31 Dec 2019 11:59:02 -0800

Opengl instantiation (I don't know why it's called instantiation, it should be called batch rendering)

Core: glDrawArraysInstanced It's different from the past. It's changed to this API when drawing Add: glVertexAttribDivisor This function tells OpenGL when to update the content of vertex attributes to a new set of data. Its first parameter is the required vertex attribute, and its second parameter is the attribute diviso ...

Posted by SureFire on Tue, 31 Dec 2019 09:32:13 -0800

Canvas -- picture combination

In Canvas drawing area, when two or more graphics overlap, the default is that the newly drawn graphics are on top of the already drawn graphics. However, sometimes we do not need this default style, we need to modify the combination mode of graphics. By modifying the attribute value of globalCompositeOperation, we can modify t ...

Posted by hush2 on Tue, 31 Dec 2019 02:12:39 -0800

Mobile (mobile) page adaptive solution - rem layout

Let's assume that the size of the design draft that my sister gave us is 750 * 1340. Combined with the dynamic font size attribute, design draft size and collaboration process between the front end and design on the html element of the home page of Netease and Taobao mobile terminal, they are generally divided into the following two types: 1. N ...

Posted by AlGale on Mon, 30 Dec 2019 23:47:58 -0800