Tutorial by Examples: c

Most websites require a much more complicated process than the one demonstrated above. Common steps for logging into a website are: Get the unique cookie from the initial login form. Inspect the login form to see what the destination url is for the authentication request Parse the login form t...
page.html - source code <html> <head> <script src="loadData.js"></script> </head> <body onLoad="loadData()"> <div class="container"> <table id="data" border="1"> <...
<%@ Language="VBScript" CodePage = 65001 %> <% Option Explicit Response.Charset = "UTF-8" Response.CodePage = 65001 %> <!doctype html> <html> <head> <title>My First Classic ASP Page</title> </head> <body&gt...
For a thick arrow pointing north in a span, add classes ui-icon and ui-icon-arrowthick-1-n: <span class="ui-icon ui-icon-arrowthick-1-n"></span> For a triangle pointing south in a span, add classes ui-icon and ui-icon-triangle-1-s: <span class="ui-icon ui-icon-tria...
Enables a code to be statically compiled. Its bytecode will be closer to Java's, thus having better performance, though some dynamic features won't be available. @groovy.transform.CompileStatic class ListMath { def countSize(List<String> strings) { strings.collect { it.size() }...
VB.NET offers default Form instances. The developer does not need to create the instance as it is created behind the scenes. However, it is not preferable to use the default instance all but the simplest programs. Public Class Form1 Public Sub Foo() MessageBox.Show("Bar") ...
The built-in werkzeug server certainly is not suitable for running production servers. The most obvious reason is the fact that the werkzeug server is single-threaded and thus can only handle one request at a time. Because of this we want to use the uWSGI Server to serve our application instead. In...
The example in Visitor Pattern provides a compelling use-case for CRTP: struct IShape { virtual ~IShape() = default; virtual void accept(IShapeVisitor&) const = 0; }; struct Circle : IShape { // ... // Each shape has to implement this method the same way ...
A common mistake for Java beginners is to use the == operator to test if two strings are equal. For example: public class Hello { public static void main(String[] args) { if (args.length > 0) { if (args[0] == "hello") { System.out.println(&q...
System.IO.Compression.ZipFile.CreateFromDirectory("myfolder", "archive.zip") Create archive.zip file containing files which are in myfolder. In example paths are relative to program working directory. You can specify absolute paths.
System.IO.Compression.ZipFile.ExtractToDirectory("archive.zip", "myfolder") Extracts archive.zip to myfolder directory. In example paths are relative to program working directory. You can specify absolute paths.
' Create filestream to file Using fileStream = New IO.FileStream("archive.zip", IO.FileMode.Create) ' open zip archive from stream Using archive = New System.IO.Compression.ZipArchive(fileStream, IO.Compression.ZipArchiveMode.Create) ' create file_in_archive.txt in arch...
#!/bin/bash FILENAME="/etc/passwd" while IFS=: read -r username password userid groupid comment homedir cmdshell do echo "$username, $userid, $comment $homedir" done < $FILENAME In unix password file, user information is stored line by line, each line consisting of i...
In Object Oriented Programming a common task is to compose objects (values). In Functional Programming it is as common task to compose values as well as functions. We are used to compose values from our experience of other programming languages using operators like +, -, *, / and so on. Value co...
Assumptions: TableView - reference to the TableView DataSource - is a class which inherits UITableViewSource DataSource.Objects - is a public List< object >(), accessible to the UIViewController private UIRefreshControl refreshControl; public override void ViewDidLoad() { base.V...
Named Types Dim someInstance As New SomeClass(argument) With { .Member1 = value1, .Member2 = value2 '... } Is equivalent to Dim someInstance As New SomeClass(argument) someInstance.Member1 = value1 someInstance.Member2 = value2 '... Anonymous Types (Option...
Arrays Dim names = {"Foo", "Bar"} ' Inferred as String() Dim numbers = {1, 5, 42} ' Inferred as Integer() Containers (List(Of T), Dictionary(Of TKey, TValue), etc.) Dim names As New List(Of String) From { "Foo", "Bar" '... ...
You might expect a Python dictionary to be sorted by keys like, for example, a C++ std::map, but this is not the case: myDict = {'first': 1, 'second': 2, 'third': 3} print(myDict) # Out: {'first': 1, 'second': 2, 'third': 3} print([k for k in myDict]) # Out: ['second', 'third', 'first'] Py...
This example demonstrates POSIX Timer usage with CLOCK_REALTIME clock and SIGEV_THREAD notification method. #include <stdio.h> /* for puts() */ #include <string.h> /* for memset() */ #include <unistd.h> /* for sleep() */ #include <stdlib.h> /* for EXIT_SUCCESS */ #inc...

Page 392 of 826