Tutorial by Examples

The following function checks if an array has any duplicates by taking each element, then iterating over the whole array to see if the element is there _Bool contains_duplicates(const int *array, size_t len) { for (int i = 0; i < len - 1; i++) { for (int j = 0; j < len; j++) { ...
UML is a language. That means it has words and a syntax how to group the words of the language in order to make sentences, paragraphs and finally articles and essays. Like with human languages you can construct anything from blurb to artistic works. And unlike in human languages you use graphical el...
Anonymous functions can be used for functional programming. The main problem to solve is that there is no native way for anchoring a recursion, but this can still be implemented in a single line: if_ = @(bool, tf) tf{2-bool}(); This function accepts a boolean value and a cell array of two functi...
Use the package percolate:synced-cron Define a job: SyncedCron.add({ name: 'Find new matches for a saved user filter and send alerts', schedule: function(parser) { // parser is a later.parse object return parser.text('every 10 minutes'); }, job: function() { user.alerts...
Since lots of beginners are confused about cloud hosting.I am writing this guide to walk through setting meteor on aws with ubuntu os. If you already have your instance running feel free to skip this step and go straight to installing meteor on aws. Login into AWS Console.Select EC2. Go to EC2 Dash...
Find files larger than 15MB: find -type f -size +15M Find files less than 12KB: find -type f -size -12k Find files exactly of 12KB size: find -type f -size 12k Or find -type f -size 12288c Or find -type f -size 24b Or find -type f -size 24 General format: find [options] -siz...
The Keep-Alive extension to HTTP/1.0 and the persistent connection feature of HTTP/1.1 provide long-lived HTTP sessions which allow multiple requests to be sent over the same TCP connection. In some cases this has been shown to result in an almost 50% speedup in latency times for HTML documents ...
UML is not about diagramming. It is about choosing the right words to express some (in most cases technical) context. Diagrams are a means to present the chosen text to humans since a visual perception is generally a good way to convey information. So you will be using graphical elements not in orde...
Ordering directly on JSONField is not yet supported in Django. But it's possible via RawSQL using PostgreSQL functions for jsonb: from django.db.models.expressions import RawSQL RatebookDataEntry.objects.all().order_by(RawSQL("data->>%s", ("json_objects_key",))) This e...
Some examples for a window of size 3: ;; Naïve attempt: (loop for (first second third) on '(1 2 3 4 5) do (print (* first second third))) ;; prints 6 24 60 then Errors on (* 4 5 NIL) ;; We will try again and put our attempt into a function (defun loop-3-window1 (function list) (loop...
Sometimes for organizational or other reasons it makes sense to have your top level resource return a sub-resource that would look like this. (Your sub-resource does not need to be an inner class) import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Produces; @Path("items&q...
package com.example.xml.adapters; import javax.xml.bind.annotation.adapters.XmlAdapter; public class StringTrimAdapter extends XmlAdapter<String, String> { @Override public String unmarshal(String v) throws Exception { if (v == null) return null; ...
If the size of your content is fixed, you can use absolute positioning to 50% with margin that reduces half of your content's width and height: HTML <div class="center"> Center vertically and horizontally </div> CSS .center { position: absolute; background...
There are two PyCharm editions: Community and Professional. Both are downloadable from JetBrains website. Additionally, there is another edition, PyCharm Edu. JetBrains recommend this edition, if you are learning or teaching Programming with Python. The supported platforms are Windows, Linux and m...
Microsoft Access has existed since 1992, and older versions continue to see regular use when business-critical database applications have been built on them. A very comprehensive resource summarizing the release history (with links to release notes, where available) is: Microsoft Access Version...
.my-div { width: 300px; height: 200px; background-size: 100%; background-repeat: no-repeat; background-image: linear-gradient(to right, black 0%,white 100%), url('https://static.pexels.com/photos/54624/strawberry-fruit-red-sweet-54624-medium.jpeg'); background-blend-mod...
A common thought pattern for inexperienced Java programmers is that exceptions are "a problem" or "a burden" and the best way to deal with this is catch them all1 as soon as possible. This leads to code like this: .... try { InputStream is = new FileInputStream(fileName);...
<dom-module id="using-listeners-obj"> <template> <style> :host{ width: 220px; height: 100px; border: 1px solid black; display: block; } #inner{ width: calc(100% - 10px); height: 50px; ...
Another way to add an event listener is to use on-event annotation in DOM. Below is an example using up event, which is fired when finger/mouse goes up <dom-module id="annotated-listener"> <template> <style> .inner{ width: calc(200px); he...
You can also add/remove listener imperatively using listen and unlisten method of Polymer <dom-module id="imparative-listener"> <template> <style> #inner{ width: 200px; height: 50px; border: 1px solid ...

Page 650 of 1336