摘要:
Set up phpmyadmin using docker Quick set up PHPMyAdmin https://migueldoctor.medium.com/run-mysql-phpmyadmin-locally-in-3-steps-using-docker-74eb735fa1 阅读全文
摘要:
What is Nslookup link 阅读全文
摘要:
ENV In Windows, environment variables can be applied in two ways. Set modifies the current shell's (the window's) environment values, and the change i 阅读全文
摘要:
在ubuntu 18.04装php: link How to set up a PHP development environment on Windows Subsystem for Linux (WSL) link 安装过程中如果有因为system不对的情况:error-release-file 阅读全文
摘要:
安装最新版本的redis 1: build redis模块redis.so: //For Debian-based Linux distros you need a php-dev and pkg-php-tools packages //to build native PHP extension 阅读全文
摘要:
自动安装最新swoole 1: pecl傻瓜一键式安装swoole:https://www.swoole.co.uk/docs/get-started/installation //For Debian-based Linux distros you need a php-dev and pkg-p 阅读全文
摘要:
一篇好文: https://thevaluable.dev/php-datetime-create-compare-format/#:~:text=In%20order%20to%20compare%20those,new%20object%20of%20type%20DateInterval%20 阅读全文
摘要:
网络由下往上分为: 对应 物理层-- 数据链路层-- 网络层-- IP协议 传输层-- TCP协议 会话层-- 表示层和应用层-- HTTP协议 socket则是对TCP/IP协议的封装和应用(程序员层面上)。也可以说,TPC/IP协议是传输层协议,主要解决数据 如何在网络中传输,而HTTP是应用层 阅读全文
摘要:
原文Demos of each of the methods below byclicking here.Horizontal centering with cssis rather easy. When the element to be centered is an inline element... 阅读全文
摘要:
原文地址:Step 1: Install Node.jsDownload a Node installerand run it. Installation packages are available for Mac, Windows, Linux, and SunOS. Alternatively... 阅读全文
摘要:
IList 和 ICollection最重要的一些类型List: Encapsulates[T], like array, but also provide with adding/removing elemntsReadOnlyCollection: Read-only wrapper for l... 阅读全文
摘要:
Core Generic interface IEnumerable:you can interate my elemnts, no need to know the count, can not modify my contents (Array在这里)var myString = new s... 阅读全文
摘要:
Collection定义Collection是个关于一些变量的集合,按功能可分为Lists,Dictionaries,Sets三个大类。Lists:是一个有序的集合,支持index look up。ArrayListDictionaries:同TKey store 一些TValue集合,没有特定or... 阅读全文
摘要:
注意:sendmessage只可以从网页发信息到unity游戏里,但是没有返回值只可以发布三种类型的data,不可以其他复杂的强类型发信息的时不会做编译检测SendMessage WorkflowImplement UnityObject2.jsvar u = new UnityObject2;u.GetUnity();sendmessage():注意:sendmessage是blocking call,call sendMessage在Mono里的一个function是一个死循环会block broswer,所以这些要被call到的methord里我们可以使用Coroutine,来 spli 阅读全文
摘要:
不可以像其他build target一样读写I/O不可以call一些private或者internal methord只要在一个top level的domain下可以不需要xml dmain policy不在一个domain的话需要写chrossdomain.xml 阅读全文
摘要:
Unity Web Player | before Unity Web Player | before ... 阅读全文
摘要:
Good Practice普通的Public变量可以在inspect里显示,变量是可以在inspect里赋值并realtime反映在被attach到的GameObject上的。注意经典public property的写法,在inspect里不会显示You can't new MonoBehaviou... 阅读全文
摘要:
Original articleBuilt-in arraysJavascript Arrays(Javascript only)ArrayListsHashtablesGeneric ListsGeneric Dictionaries2D ArraysAll types of collections share a few common features:You can fill them with objects, and read back the values that you put in.You can ‘iterate’ through them, which means you 阅读全文
摘要:
OriginalArticle程序下载Often you want to be able to enumerate through a collection of objects using theforeachstatement in C#:Using foreach in C#foreach (Student student in myClass) Console.WriteLine(student);To be able to pull that off, myClass must implementIEnumerable:IEnumerable DefinedExposes th... 阅读全文
摘要:
泛型是什么?这是摘自百度百科中对泛型的介绍:泛型是c#2.0的一个新增加的特性,它为使用c#语言编写面向对象程序增加了极大的效力和灵活性。不会强行对值类型进行装箱和拆箱,或对引用类型进行向下强制类型转换,所以性能得到提高。通过知道使用泛型定义的变量的类型限制,编译器可以在一个高得多的程度上验证类型假设,所以泛型提高了程序的类型安全。它允许程序员将一个实际的数据类型的规约延迟至泛型的实例被创建时才确定。泛型为开发者提供了一种高性能的编程方式,能够提高代码的重用性,并允许开发者编写非常优雅的解决方案。看过之后,会用的还是懂;不会用的,也还是不懂。所以我们还是看看泛型具体在程序中的应用://泛型方法 阅读全文
摘要:
Strong and Loose Typing:强弱比较// C#var customer = new Customer(); //var is compiler inferred//Javascriptvar customer = new Customer(); //var is variable declarationC#:var变量由编译器决定合适的类型,此例为Customer类型JavaScript:var代表变量的意思,没有类型的强制Compiler匹配最接近Type//C#var x = 0; // compiler暗示 to be intbool isInt = x is int 阅读全文
摘要:
prepare Employee Structurenamespace CollectIt{ public class Employee { public string Name { get; set; } public int DepartmentId { get; set; } } }Array: T[]定义fix size, must define how many instance at beginning, no add methordEmployee[] employees = new Employee[]{ ... 阅读全文
摘要:
下图显示继承关系:ContentControl:Control (在Control類並沒有Content屬性, 所以在這之上再寫了一個ContentControl, 使控件有Content屬性可以顯示內容)ContentPresenter:FrameworkElement (ContentPresenter一般用在CT里负责把Control指定的Content显示出来)Control:FrameworkElementItemsControl:ControlItemsPresenter:FrameworkElement接著來我們看一下實例:使用ContentPresenter ... 阅读全文
摘要:
Routing Strategies:DirectBubblingTunnelingWHy use them?Any UIElement can be a listenerCommon handlersVisual Tree CommunicationEvent Setter and Event TriggerRouted Event Example: //listen to the RoutedEvent:ButtonBase.Click and handle RoutedEvent using Window_Click //listen to the Rou... 阅读全文
摘要:
I. Binding to Object1. Binding data using ObjectDataProviderAC:Let’s say there is a CLR based data bound object that you are trying to implement. For example a collection of Tool objects, e.g.An Object called Tool that contains a bunch of properties that we want to bind (in this case it just contain 阅读全文
摘要:
DataTemplate和ControlTemplate的关系(转载自haiziguo)一、ContentControl中的DataTemplate在开始之前,我们先去看一下ContentControl的定义,有两个属性: public object Content { get; set; } public DataTemplate ContentTemplate { get; set; }其特点是只能容纳一个内容,内容类型是object类型,其中Button控件是我们大家比较熟悉且属于ContentControl的类,这里用TextBlock做Content。这个很正常,因为内容是o... 阅读全文
摘要:
using System;using System.ComponentModel;using System.Globalization;using System.Windows.Data;namespace WPFComponents{ [ValueConversion(typeof(string), typeof(int))] public class StringToIntegerConverter : IValueConverter { public object Convert(object value, Type targetType, ... 阅读全文
摘要:
如何拿到Source:从SQL,从XML fileSQL:一个是ObjectDataProvider//用linq方法拿到SQL data,wrap到一个IEnumerablepublic IEnumerable GetAllCustomersAsList() { var items = from cust in this.Customers orderby cust.LastName select cust; return items.ToList(); }View Code //xaml里定... 阅读全文
摘要:
1:做Icon用Canvas还是DrawingBrush?Canvas的例子: ... 阅读全文
摘要:
Limited functionality:Not settableNo data bindingNo validationNo animationNo InheritanceWhen to use?Used for state determination(Defined the style for the control, some visiable property like fore/background will change when mouse movehover)Used as a property trigger(由这个readonly property change,来cha 阅读全文
摘要:
我有一个TabControl View Code 要实现上面的Behivor需要设计其trigger。方法一:设置一个trigger和一个MultiTrigger,其实不用写方法二:设置一个Trigger和一个DataTrigger说明的三点问题:MultiDataTrigger里... 阅读全文
摘要:
简单的DP注册:注意:Wrapper里的get,set永远不要写任何逻辑或者.Net提供的方法Text Wrapper只是一个helper,里面的get set永远不会被程序call到,breakpoint进不去。唯一可以进入set是直接对这个CLR property赋值。DP register的时候可以指定PropertyMetadata或者FrameworkPropertyMetadataPropertyMetadata:Specify default valuescoercionproperty change callbacksvalidation从上面简单DP register变过来的 阅读全文
摘要:
1:binding后台bool[]数据以及后台ObservableCollection数据分别见下面xaml的Visibility和Text的Bindingpublic bool[] RubberTypeLegends { get { bool[] result = new bool[] {false,false,false }; for (int i = 0; i ...private O... 阅读全文
摘要:
Case ID (?unit)红色的字根据一个后台boolean来做trigger,可以是Case or Open蓝色的字binding到后台的一个string属性来切换任意的Unit单位这样一共有6中组合:Case ID (in) OpenID (in)Case ID (cm) OpenID (cm)Case ID (mm) OpenID (mm)上图两个红圈的字分别控制显示那个Text代码如下: ... 阅读全文
摘要:
http://msdn.microsoft.com/en-us/magazine/cc163299.aspx#S1Data Binding in WPFJohn PapaCode download available at:DataPoints2007_12.exe(161 KB) Contents Data Binding SpecificsCreating a Simple BindingBinding ModesA Time to BindBinding to XMLObject Binding and DataTemplatesSorting the DataForging Ahea. 阅读全文
摘要:
https://github.com/vjpr/healthkick/blob/master/src/win/healthkick/ucSpinnerCogs.xaml网上的例子,放在UserControl里Castor project 放在 Windows里 ... 阅读全文
摘要:
http://www.thomaslevesque.com/2011/03/21/wpf-how-to-bind-to-data-when-the-datacontext-is-not-inherited/The DataContext property in WPF is extremely handy, because it is automatically inherited by all children of the element where you assign it; therefore you don’t need to set it again on each elemen 阅读全文
摘要:
需要用到code behind注意要给需要访问的元素命名x:Name="PART_TextBlock" custom control的程序部分using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Windows;using System.Windows.Controls;using System.Windows.Data;using System.Windows.Documents;using System.Windows.Input;us 阅读全文
摘要:
TemplateBinding:TemplateBinding是一个Markup Extension1: 不适用在frezable property、controltemplate trigger、 two way binding、 value converter、only support Dependent Property。其实TemplateBinding是下面Text Binding的short cut。TemplateBinding有limitation,只能1way binding 到使用ControlTemplate的 Parent Control2:如果需要2way bindi 阅读全文
摘要:
UserControlUserControl实际上就是ContentControl,xaml里tag之间包含的实际就是后台程序的UserControl.Content属性所付的值。如下UserControl.Content包含一个Grid,里面有TextBox和Button.所以可以run time改变usercontrol包含的内容。1:什么时候用UserControl:UserControl是多个已存在control组成的,为复用做准备(比如一个Context Form包含很多基础input,combobox textblock等,之后多次复用)不需要复杂的customzation的时候, 阅读全文