Driver software

Driver Booster

Driver Booster Driver Booster free version searches and updates drivers for Windows Operating System. For a free version, we find this driver updating software impressive as it picks up vital updates. Unlike the paid version […]

Delphi

Get the name of the day today!

Here is an example of what the function returns: ‘The day today is ‘ + daytoday+’.’ Returns on a monday: The day today is Monday. Here is the function: function daytoday: string; begin Result:=”; {Can […]

Delphi

Better moving form

unit Unit1; interface uses   Windows,   Messages,   Forms; type   TForm1 = class(TForm)   protected     procedure WMNCHitTest(var Msg: TWMNCHitTest); message WM_NCHITTEST;   end; var   Form1: TForm1; implementation {$R *.DFM} procedure TForm1.WMNCHitTest(var Msg: TWMNCHitTest); begin   // Call default procedure   inherited; […]

Delphi

Change String To Proper Case

NOTE:Make sure to add “StrUtils” to your Uses section function properCase(sBuffer: string):string; var iLen, iIndex: integer; begin iLen := Length(sBuffer); sBuffer:= Uppercase(MidStr(sBuffer, 1, 1)) + Lowercase(MidStr(sBuffer,2, iLen)); for iIndex := 0 to iLen do begin […]

Delphi

Understanding the Basics of Delphi Programming

Beginner developers eager to master the Delphi programming language should already be familiar with the basics of Microsoft Windows. Learning Delphi is easiest if you approach it from a guided, tutorial-based frame of reference. Foundational Concepts Get started […]

Delphi

get different background color of DBGrid for odd and even rows (2)?

//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ //source for main form : //… uses // … Grids, DBGrids, db //… procedure artgrid(Sender: TObject; const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState); //… implementation //… procedure TForm1.artgrid(Sender: TObject; const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState); begin if ((Sender as tdbgrid).DataSource.DataSet.RecNo mod 2) = 0 then (Sender as tdbgrid).Canvas.Brush.Color := clblue; //or any color (Sender as tdbgrid).DefaultDrawColumnCell(rect, datacol, column, state); end; //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // for all DrawColumnCell event of DBGrid in any Form (here “Form2”): procedure TForm2.DBGrid2DrawColumnCell(Sender: TObject; const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState); begin Form1.artgrid(Sender, Rect, DataCol, Column, State); end;

Delphi

get different background color of DBGrid for odd and even rows

{ Um in einem DBGrid die Übersicht zu behalten, ist es sehr angenehm, die Zeile abwechselnd einzufärben. Folgender Code soll Euch die näher bringen. Viel Erfolg beim Programmieren! Malte } procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState); var test1: Real; RowNo: Integer; begin with (Sender as TDBGrid) do begin if (gdSelected in State) then begin // Farbe für die Zelle mit dem Focus // color of the focused row Canvas.Brush.Color := clblue; end else begin // Zeile erfahren // get the actual row number rowno := Query1.RecNo; // gerade und ungerade Zeilen ermitteln // odd or even ? test1 := (RowNo / 2) – trunc(RowNo / 2); // Zeile gerade… // If it’s an even one… if test1 = 0 then begin farbe := clWhite […]

Database

create an Access Database From Delphi

uses ComObj; procedure TForm1.Button1Click(Sender: TObject); var AccessApp: Variant; begin AccessApp := CreateOleObject(‘Access.Application’); AccessApp.NewCurrentDatabase(‘c:\111.mdb’); AccessApp := Unassigned; end;

Database

create a table including an AutoInc field (ADO/MSSQL)?

// Erzeugt eine Tabelle mit dem Namen MYTABLENAME, mit den Spalten ID, // MYTEXT1, MYTEXT2. // (Der Name der ID Spalte kann natürlich frei gewählt werden.) // ID ist der Primärschlüssel der Tabelle. Er ist ein Integer, der sich // automatisch für jede Zeile // der Tabelle erhöht. ID wird nie doppelt vorkommen. // MYTEXT1 und 2 sind vom Typ String. // Ich verwende die ADOConnection um mit Jet 4.0 auf eine Access- // datenbank (*.mdb) zuzugreifen. // Der Syntax ist MSSQL, wenn ihr das für PHP oder so verwenden wollt, // muss man das ein bissel umformulieren 😉 // Creates a Table called MYTABLENAME with a unique identifier called // “ID”. ID increases with every new row automatically. MYTEXT1 and 2 // are Strings. Name the colums as you want to. // I used the ADOConnection to access a MS-Access Database (*.mdb) // via Jet 4.0. // The Syntax is MSSQL, you have to transform it to use it in PHP or so. uses AdoDB; var q: TAdoQuery; db: TAdoConnection; begin // Initialize db here q := TADOQuery.Create(nil); q.Connection := db; q.Close; q.SQL.Clear; q.SQL.Add(‘Create Table MYTABLENAME (ID COUNTER PRIMARY KEY, MYTEXT1 String, MYTEXT2 String);’); q.Prepared := True; try q.ExecSQL; except end; q.Free; end;

Mikrotik

MikroTik RoMON Feature

 MikroTik Newsletter announced a new feature added to MikroTik RouterOS, RoMON.  This was first discussed at the Mikrotik Miami MUM held earlier this year but is apparently now a part of RouterOS since version 6.38.  So […]

Arduino

Arduino – Keyboard Serial

This example listens for a byte coming from the serial port. When received, the board sends a keystroke back to the computer. The sent keystroke is one higher than what is received, so if you […]

Arduino

Arduino – Mouse Button Control

Using the Mouse library, you can control a computer's onscreen cursor with an Arduino Leonardo, Micro, or Due. This particular example uses five pushbuttons to move the onscreen cursor. Four of the buttons are directional […]

Arduino

Arduino – Keyboard Message

In this example, when the button is pressed, a text string is sent to the computer as keyboard input. The string reports the number of times the button is pressed. Once you have the Leonardo […]

Arduino

Arduino – Keyboard Logout

This example uses the Keyboard library to log you out of your user session on your computer when pin 2 on the ARDUINO UNO is pulled to ground. The sketch simulates the keypress in sequence […]

Arduino

Arduino – LED Bar Graph

This example shows you how to read an analog input at analog pin 0, convert the values from analogRead() into voltage, and print it out to the serial monitor of the Arduino Software (IDE). Components […]

Arduino

Arduino – Fading LED

This example demonstrates the use of the analogWrite() function in fading an LED off. AnalogWrite uses pulse width modulation (PWM), turning a digital pin on and off very quickly with different ratios between on and […]

Arduino

Arduino – Blinking LED

LEDs are small, powerful lights that are used in many different applications. To start, we will work on blinking an LED, the Hello World of microcontrollers. It is as simple as turning a light on […]

Arduino

Arduino – Inter Integrated Circuit

Inter-integrated circuit (I2C) is a system for serial data exchange between the microcontrollers and specialized integrated circuits of a new generation. It is used when the distance between them is short (receiver and transmitter are […]

Arduino

Arduino – Communication

Hundreds of communication protocols have been defined to achieve this data exchange. Each protocol can be categorized into one of the two categories: parallel or serial. Parallel Communication Parallel connection between the Arduino and peripherals […]

Arduino

Arduino – Interrupts

Interrupts stop the current work of Arduino such that some other work can be done. Suppose you are sitting at home, chatting with someone. Suddenly the telephone rings. You stop chatting, and pick up the […]

Arduino

Arduino – Random Numbers

To generate random numbers, you can use Arduino random number functions. We have two functions − randomSeed(seed) random() randomSeed (seed) The function randomSeed(seed) resets Arduino’s pseudorandom number generator. Although the distribution of the numbers returned […]

Arduino

Arduino – Due & Zero

The Arduino Due is a microcontroller board based on the Atmel SAM3X8E ARM Cortex-M3 CPU. It is the first Arduino board based on a 32-bit ARM core microcontroller. Important features − It has 54 digital […]

Arduino

Arduino – Trigonometric Functions

You need to use Trigonometry practically like calculating the distance for moving object or angular speed. Arduino provides traditional trigonometric functions (sin, cos, tan, asin, acos, atan) that can be summarized by writing their prototypes. […]

Arduino

Arduino – Math Library

The Arduino Math library (math.h) includes a number of useful mathematical functions for manipulating floating-point numbers. Library Macros Following are the macros defined in the header math.h − Given below is the list of macros […]

Arduino

Arduino – Character Functions

All data is entered into computers as characters, which includes letters, digits and various special symbols. In this section, we discuss the capabilities of C++ for examining and manipulating individual characters. The character-handling library includes […]

Arduino

Arduino – Advanced I/O Function

In this chapter, we will learn some advanced Input and Output Functions. analogReference() Function Configures the reference voltage used for analog input (i.e. the value used as the top of the input range). The options […]

Arduino

Arduino – I/O Functions

The pins on the Arduino board can be configured as either inputs or outputs. We will explain the functioning of the pins in those modes. It is important to note that a majority of Arduino […]

Arduino

Arduino – Arrays

An array is a consecutive group of memory locations that are of the same type. To refer to a particular location or element in the array, we specify the name of the array and the […]