Under Win32 dynamic-link library (DLL) Principles of Programming

Fadıl

Relatively large application consists of many modules, these modules were completed relatively independent functions, they collaborate with each other to complete the work of the entire software . Which there may be some module features more common, will still be used to construct other software . Constructed software , the source code for all modules statically compiled into the entire application EXE , it will create some problems: a drawback is to increase the size of the application , it will take up more disk space, the run will also consume a large amount of memory space, resulting in a waste of resources; Another disadvantage is that in the preparation of large EXE , modify the reconstruction must be adjusted to compile all the source code, increasing the complexity of the compilation process is not conducive to unit testing stage.

To Establish Control of the Windows SDK Programming

Fadıl

I. Overview
Control is a child window, they are already defined window class, so there is no need to register, do not need to write the message processing function.
WM_CREATE message in the main window, create a child window can be.
Second, the instance

/ / Parameters: window handle, message, message parameters, message parameters
LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
/ / Handle messages of interest switch (message)
{
case WM_CREATE:
CreateWindow (TEXT ("BUTTON"), / / ??control class name "
TEXT ("& button (A)"),
WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, 10, 10, 100, 100, hwnd, (HMENU) 1000, 
/ / ??control ID
((LPCREATESTRUCT) lParam) -> hInstance, / / ??instance handle
NULL);
return 0;
case WM_DESTROY:
/ / When the user closes the window, the window is destroyed, the end of the need,
 send exit message to exit the message loop PostQuitMessage (0);
return 0;
}
/ / Other messages to the default processing functions provided by the return ::
 DefWindowProc (hwnd, message, wParam, lParam);
}
typedef struct tagCREATESTRUCT {
LPVOID lpCreateParams;
HINSTANCE hInstance; / / instance handle HMENU hMenu;
The HWND hwndParent;
int cy;
int cx;
int y;
int x;
LONG style;
The LPCTSTR lpszName;
LPCTSTR lpszClass;
DWORD dwExStyle is;
} CREATESTRUCT, * LPCREATESTRUCT;

Fourth, control and collaboration of the parent windowThird, on the WM_CREATE message
The WM_CREATE lParam parameter will be passed into a set-up information structure pointer (LPCREATESTRUCT). The structure contains some useful information (when the window to create a parameter).

Ubuntu Install Firefox, and Create A Shortcut

Fadıl

We’ll see how to download Firefox for Ubuntu by following the steps below.

1) Download Firefox
2) tar-xvf firefox-3.6.3.tar.bz2
3) mv firefox / opt
4) cd / usr / share / applications
5) sudo touch firefox.desktop
6) the sudo nano firefox.desktop, editorial content
[Desktop Entry]
Name = Firefox
Comment = this is firefox
Exec = / opt / firefox / firefox
Icon = / opt/firefox/icons/mozicon128.png
Terminal = false
Type = Application
Categories = Application; Network;

Linux Network Configuration Commands

Fadıl

Under Linux NIC naming rules: eth0, eth1. First Ethernet card, and the second block. lo is the loopback interface, its fixed IP address is 127.0.0.1, mask 8. It represents your machine itself.

Ifconfig is the view card information

ifconfig [Interface]

The interface is optional, and if not this information is displayed for all network cards in the system. If you add this option to display the specified card information.

For example; ifconfig eth0

How to Apply Resource Limits Via limits.conf for a Docker Container

How to Apply Resource Limits Via limits.conf for a Docker Container

Fadıl

There are several ways in which resource limits can be applied to the docker container. Majorly below 3 ways can be used to set resource limits globally or individually for each container.

Setting Global limits for all containers

1. In docker 1.6 or later, we could set ulimit in /etc/sysconfig/docker as:

# vi /etc/sysconfig/docker
OPTIONS='--insecure-registry=172.30.0.0/16 --selinux-enabled --default-ulimit nproc=1024:2048'

This will set a soft limit of 1,024 and a hard limit of 2,048 child processes for all containers.