JSON Schema: validate a number-or-null value

In draft-04, you would use the anyOf directive: { “anyOf”: [ { “type”: “number”, “minimum”: 0, “maximum”: 360, “exclusiveMaximum”: true }, { “type”: “null” } ] } You could also use “type”: [“number”, “null”] as Adam suggests, but I think anyOf is cleaner (as long as you use a draft-04 implementation), and ties the minimum … Read more

difference between API and framework

A framework is a group of classes, interfaces and other pre-compiled code upon which or by the use of which applications can be built. The API is the public face of a framework. A well designed framework only exposes those classes, interfaces, etc that are needed to use the framework. Code that supports the operation … Read more

Swagger UI – How can I expand all the operations by default?

I believe you can set the docExpansion:”full” when creating swagger-ui. See https://github.com/swagger-api/swagger-ui#parameters for details. docExpansion: Controls the default expansion setting for the operations and tags. It can be ‘list’ (expands only the tags), ‘full’ (expands the tags and operations) or ‘none’ (expands nothing). The default is ‘list’.

How to find start/end of ramp in revit, perhaps with sketches?

Assuming that your Ramp is a FamilyInstance : var fecRamps = new FilteredElementCollector(doc) .OfClass(typeof(FamilyInstance)) .Where(pElt => { int lCatId = pElt.Category.Id.IntegerValue; return lCatId == (int)BuiltInCategory.OST_Ramps; }) .OfType<FamilyInstance>() .ToList(); List<XYZ> lRampLocs = new List<XYZ>(); foreach (var pFam in fecRamps) { var fLoc = pFam.Location as LocationCurve; var fRampSide1 = new XYZ(fLoc.Curve.GetEndPoint(0); var fRampSide2 = new XYZ(fLoc.Curve.GetEndPoint(1); … Read more

HTML5 Drag and Drop API on Touch Screen Devices

There are some native HTML5 Events that works in WebKit (Chrome & Safari) … only mobile versions. The name of these events are touchstart, touchmove, touchend, touchcancel An example to reposition an element with touch is: $(document).bind(“touchstart”, function(e) { e.preventDefault(); var orig = e.originalEvent; var x = orig.changedTouches[0].pageX; var y = orig.changedTouches[0].pageY; $(“#element”).css({top: y, left: … Read more

Composite key for REST API methods

As per general REST standards, each endpoint exposes a resource, and client can work on them with http verbs. In this example your resource is vehicle, and client is fetching data from server using GET. Ideally, each resource should be uniquely identified with a unique (single) key. But your resource (vehicle) does not have a … Read more

REST API filter operator best practice

You need an already existing query language, don’t try to reinvent the wheel! By REST this is complicated and not fully solved issue. There are some REST constraints your application must fulfill: uniform interface / hypermedia as the engine of application state: You have to send hypermedia responses to your clients, and they have to … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)