Tutorial by Examples: c

The modules used in this example are part of pywin32 (Python for Windows extensions). Depending on how you installed Python, you might need to install this separately. import win32serviceutil import win32service import win32event import servicemanager import socket class AppServerSvc (win3...
A version control system allows a developer or development team access to essentially I time machine. If the source code, settings, etc., that were used to build a program or system are under version control then the developers can step back in time to recover lost functionality, trace how errors we...
You would need to install ruby before you can install rails. Mac already comes with ruby installed based on how recent your macOS is? Depending on what ruby version you want for your development, the best way to install Ruby is to use RVM. In your terminal, type the command below listed in step...
This example has been taken from here package com.reborne.SmartHibernateConnector.utils; import org.hibernate.HibernateException; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.cfg.Configuration; public class LiveHibernateConnector implements IHiber...
This is a variation on the generic example. You just need to import your app script and invoke it's run() method in the service's main() function. In this case we're also using the multiprocessing module due to an issue accessing WSGIRequestHandler. import win32serviceutil import win32service imp...
You can copy a VBA array into an array of the same type using the = operator. The arrays must be of the same type otherwise the code will throw a "Can't assign to array" compilation error. Dim source(0 to 2) As Long Dim destinationLong() As Long Dim destinationDouble() As Double dest...
A function in a normal module (but not a Class module) can return an array by putting () after the data type. Function arrayOfPiDigits() As Long() Dim outputArray(0 To 2) As Long outputArray(0) = 3 outputArray(1) = 1 outputArray(2) = 4 arrayOfPiDigits = outputArray ...
The following example creates a Gui with a single button wich brings the SelectFile dialog box. Gui, Loader: New Gui, Loader: Add, Button, Default Center w220 vLOAD, LOAD Gui, Loader: Show, AutoSize Center, Loader return LoaderButtonLOAD: FileSelectFile, LoadedFile, , , , if ErrorLevel...
fuzzy translations Sometimes makemessages may think that the string it found for translation is somewhat similar to already existing translation. It will when mark it in the .po file with a special fuzzy comment like this: #: templates/randa/map.html:91 #, fuzzy msgid "Country" msgstr...
Cassandra uses two kinds of keys: the Partition Keys is responsible for data distribution across nodes the Clustering Key is responsible for data sorting within a partition A primary key is a combination of those to types. The vocabulary depends on the combination: simple primary key: only...
First you disable your network card's automatic checksumming: sudo ethtool -K eth1 tx off Then send your packet, using a SOCK_RAW socket: #!/usr/bin/env python from socket import socket, AF_PACKET, SOCK_RAW s = socket(AF_PACKET, SOCK_RAW) s.bind(("eth1", 0)) # We're putting toge...
This is my FirebaseMessagingService public class MyFirebaseMessagingService extends FirebaseMessagingService { Bitmap bitmap; @Override public void onMessageReceived(RemoteMessage remoteMessage) { String message = remoteMessage.getData().get("message"); //imageUri will ...
Returns the value of any OS environment variable. MESSAGE OS-GETENV ("OS") VIEW-AS ALERT-BOX. On a Windows machine: MESSAGE OS-GETENV ("SHELL") VIEW-AS ALERT-BOX. Result on a Linux machine with Bash as current shell: ┌────── Message ───────┐ ...
Copy a file COPY source-file target-file Copy c:\temp\source-file.txt to c:\temp\target-file.txt. You need to check OS-ERROR for success or lack thereof. OS-COPY VALUE("c:\temp\source-file.txt") VALUE("c:\temp\target-file.txt"). IF OS-ERROR <> 0 THEN DO: MESS...
Creates a directory, status is in OS-ERROR OS-CREATE-DIR directory Create a directory called /usr/local/appData OS-CREATE-DIR VALUE("/usr/local/appData").
Client metrics cover the traffic between the client and the Varnish cache. sess_conn - Cumulative number of connections. client_req - Cumulative number of client requests. sess_dropped - Dropped connections because of a full queue. Monitor sess_conn and client_req to keep track of traffic vo...
Perhaps the most important performance metric is the hitrate. Varnish routes it's incoming requests like this: Hash, a cacheable request. This might be either hit or miss depending on the state of the cache. Hitpass, a not cacheable request. A hash with a miss and a hitpass will be fetched f...
You monitor the cached objects to see how often they expire and if they are "nuked". n_expired - Number of expired objects. n_lru_nuked - Last recently used nuked objects. Number of objects nuked (removed) from the cache because of lack of space. varnishstat -1 | grep "n_expire...
There are a number of metrics describing the communication between Varnish and it's backends. The most important metrics here might be these: backend_busy - Number of http 5xx statuses recieved by a backend. With VCL you can configure Varnish to try another backend if this happens. backend_fail...
{-# LANGUAGE OverloadedStrings #-} module Main where import Data.Aeson main :: IO () main = do let example = Data.Aeson.object [ "key" .= (5 :: Integer), "somethingElse" .= (2 :: Integer) ] :: Value print . encode $ example

Page 708 of 826