Tutorial by Examples: ee

Enable draggable functionality on any DOM element. <script> $(function() { $( "#draggable" ).draggable(); }); </script> <div id="draggable" class="ui-widget-content"> <p>Drag me around</p> </div>
To get the physical size of the screen (including window chrome and menubar/launcher): var width = window.screen.width, height = window.screen.height;
To get the “available” area of the screen (i.e. not including any bars on the edges of the screen, but including window chrome and other windows: var availableArea = { pos: { x: window.screen.availLeft, y: window.screen.availTop }, size: { width: window.scr...
To determine the color and pixel depths of the screen: var pixelDepth = window.screen.pixelDepth, colorDepth = window.screen.colorDepth;
Output buffering allows you to store any textual content (Text, HTML) in a variable and send to the browser as one piece at the end of your script. By default, php sends your content as it interprets it. <?php // Turn on output buffering ob_start(); // Print some output to the buffer (via...
If you have already added a file to your Git repository and now want to stop tracking it (so that it won't be present in future commits), you can remove it from the index: git rm --cached <file> This will remove the file from the repository and prevent further changes from being tracked by...
This example uses the Dropbox .NET library to try to get the metadata for an item at a particular path, and checks for a NotFound error: try { var metadata = await this.client.Files.GetMetadataAsync("/non-existant path"); Console.WriteLine(metadata.Name); } catch (Dropbox.Api.A...
import shutil source='//192.168.1.2/Daily Reports' destination='D:\\Reports\\Today' shutil.copytree(source, destination) The destination directory must not exist already.
When an API is marked with NS_REFINED_FOR_SWIFT, it will be prefixed with two underscores (__) when imported to Swift: @interface MyClass : NSObject - (NSInteger)indexOfObject:(id)obj NS_REFINED_FOR_SWIFT; @end The generated interface looks like this: public class MyClass : NSObject { publ...
Let's say you want to generate counts or subtotals for a given value in a column. Given this table, "Westerosians": NameGreatHouseAllegienceAryaStarkCerceiLannisterMyrcellaLannisterYaraGreyjoyCatelynStarkSansaStark Without GROUP BY, COUNT will simply return a total number of rows: SELE...
During a merge, you can pass --ours or --theirs to git checkout to take all changes for a file from one side or the other of a merge. $ git checkout --ours -- file1.txt # Use our version of file1, delete all their changes $ git checkout --theirs -- file2.txt # Use their version of file2, delete ...
5 Object.freeze makes an object immutable by preventing the addition of new properties, the removal of existing properties, and the modification of the enumerability, configurability, and writability of existing properties. It also prevents the value of existing properties from being changed. Howev...
// Java: int total = employees.stream() .collect(Collectors.summingInt(Employee::getSalary))); // Kotlin: val total = employees.sumBy { it.salary }
// Java: Map<Department, List<Employee>> byDept = employees.stream() .collect(Collectors.groupingBy(Employee::getDepartment)); // Kotlin: val byDept = employees.groupBy { it.department }
<link rel="stylesheet" href="path/to.css" type="text/css"> The standard practice is to place CSS <link> tags inside the <head> tag at the top of your HTML. This way the CSS will be loaded first and will apply to your page as it is loading, rather th...
The following examples use the Item Sales and Customers sample databases. Note: The BETWEEN operator is inclusive. Using the BETWEEN operator with Numbers: SELECT * From ItemSales WHERE Quantity BETWEEN 10 AND 17 This query will return all ItemSales records that have a quantity that is gr...
import fmt people := map[string]int{ "john": 30, "jane": 29, "mark": 11, } for key, value := range people { fmt.Println("Name:", key, "Age:", value) } Note that when iterating over a map with a range loop, the iteration order i...
WITH RECURSIVE ManagersOfJonathon AS ( -- start with this row SELECT * FROM Employees WHERE ID = 4 UNION ALL -- get manager(s) of all previously selected rows SELECT Employees.* FROM Employees JOIN ManagersOfJonathon ON Employees.ID = Manager...
WITH RECURSIVE ManagedByJames(Level, ID, FName, LName) AS ( -- start with this row SELECT 1, ID, FName, LName FROM Employees WHERE ID = 1 UNION ALL -- get employees that have any of the previously selected rows as manager SELECT ManagedByJames.Level + 1, ...
Assuming the following Person class: public class Person { public string Name { get; set; } public int Age { get; set; } } The following lambda: p => p.Age > 18 Can be passed as an argument to both methods: public void AsFunc(Func<Person, bool> func) public void AsE...

Page 3 of 54