System Programming





Kernel and system programming is the process of creating the software necessary for a computer or device to function and operate other programs. Some operating systems (such as Microsoft Windows) are proprietary, but others, such as the various Linux distributions, are open source.

Share tech news, updates, or what's on your mind.

Sign up to Post

Hi Experts

Could you explain how was the mainframes programs strategy to deal with low hardware resouces, decades ago, when developing banking applications like checking accounts, legal accounting, etc. a typical area with huge amount of data.

I guess there was one computer designated to treat each big agency data and then one other only to sumarize. Am I right?
Could you give details, mainly if you lived this situation?

Thanks in advance!

I have configured eclipse with tomcat 8

i modified my tomcat-users.xml by doing cntr+shift+R and searching on tomcat-users.xml

i added below entry as i am getting tomcat username and password screen when i run rest web services 139 query parameter example from annotation
when i give tomcat , tomcat getting anauthorized error

  <user name="admin" password="admin" roles="admin-gui,manager-gui" />

after addin above when i restart getting below
Could not load the Tomcat server configuration at /Servers/Tomcat v8.0 Server at localhost-config. The configuration may be corrupt or incomplete

How to solve:

Close Eclipse
Copy all files from TOMCAT_7_HOME/conf to WORKSPACE_FOLDER/Servers/Tomcat v7.0 Server at localhost-config
Start Eclipse
Expand the Servers project, click on the Tomcat 7 project and hit F5
Start Tomcat from Eclipse

to folow above steps how to where is my tomcat conf directory or where the tomcat directory is ?
is there is a way in eclipse you can see properties etc to find it?
how to know my server is tomcat 8 or tomcat 8.5 etc

how to solve this error
please advise
How to resolve this?


I am reading about nested loop here

for (int i = 1; i <= 5; i++) {
 for (int j = 1; j <= i; j++) {

Think of a nested loop as a race track within a race track. When you begin each lap on the main oval, you veer into another track inside the original (the nested track/loop). You may go around any number of times within the smaller track before looping around the main one. Then it starts over again until you've done the required number of laps on the main track. In all, you may go around a thousand times, or many more!

what it means by race track within a race track not able to visualize this image or picture
what it means by each lap on main oval and veer to another track inside original track??

please advise
 let us say i give some random number like 81349 on console i should see output as by ascending order of each digit in each line how to achieve that as well

    3 3
   4 4 4
 8 8 8 8
9 9 9 9 9

how to to achive this
please advise

i am going through below link

eclipse what is difference between control1 and control 2 when to use which one?

please advise
I just bought a golf cart  that has a pro link monitor. Is it possible to reprogram for the gps when the golf course doesn't have the system. I basically just want the gps.
I am curious about finding the cost to a big bank to process something like a bank transfer from one account to another...

I am thinking about my bank, where I have two accounts, where I may move a few hundred dollars from one account to another.

Is the cost less than a penny for such a transaction for a website or an iPhone app to make such a transfer? I assume there are overhead costs where auditors review blocks of transactions, but I am not asking about that. Just the marginal cost for a hosted and highly secure website to process a transaction.

Does anyone have an idea about this?
i need ideas (or a script) how to search all MAC Addresses of a windows system and pass these as parameter to an external program...with PERL.

script should do the following:
1. get all MAC-Adresses (LAN1, LAN2, WLAN,...)

2. start external programm and pass every MAC (one after another) ... possible within a loop
extProg.exe AA-AA-AA-AA-AA-AA
extProg.exe BB-BB-BB-BB-BB-BB
extProg.exe CC-CC-CC-CC-CC-CC-CC
In Microsoft Access, I have a form which currently opens up a number of pdf's (currently in Acrobat Reader). My goal is to open up the same number of pdf's in IE, but have them grouped by color. The way the sort of the list is made, the first tab in a group is an image of a purchase order, the following tabs are pdf's of vendor invoices. Often times there is a one to one relationship between purchase order and invoice, however on a fairly regular basis there may be more than one invoice to the purchase order. I would like to make it clear to the user by colored tabs, the relationship of Purchase Orders to Invoices.

The selection criteria and Path has been commented out. Printing works fine, but is also commented out at the moment.

Private Sub Command0_Click()
Dim db As Database
Dim rst As DAO.Recordset
Dim StrSQL As String
Dim PathName As String
Dim PO As String

Set db = CurrentDb()


Set rst = db.OpenRecordset(kaySQL, dbOpenDynaset, dbSeeChanges)
Do Until rst.EOF
  PathName = "SomePath" & rst("Image-no") & ".PDF"

 CreateObject("Shell.Application").Namespace(0).ParseName(PathName).InvokeVerb ("Open")
 'CreateObject("Shell.Application").Namespace(0).ParseName(PathName).InvokeVerb ("Print")


End Sub
I saw some script that in our applications server has the gawk.exe with parameter as  below, do anyone here familiar with gawk and mind to explain what is this parameter does ?

gawk.exe "!x[$0]++"
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="" targetNamespace=""
	xmlns:tns="" elementFormDefault="qualified">

	<element name="patient" type="tns:Patient" />

	<complexType name="Patient">

			<element name="id" type="tns:ID" />
			<element name="name" type="tns:string15chars" />
			<element name="age" type="int" />
			<element name="dob" type="date" />
			<element name="email" type="string" />
			<element name="gender" type="tns:genderEnum" />
			<element name="phone" type="string" />



	<simpleType name="ID">
		<restriction base="int">
			<pattern value="[0-9]*"></pattern>

	<simpleType name="string15chars">
		<restriction base="string">
			<pattern value="15"></pattern>

	<simpleType name="genderEnum">
		<restriction base="string">
			<enumeration value="M"/>
			<enumeration value="F"/>


Open in new window

Based on aboveXSD i generated below XML which gives error at line 4 of XML as
Multiple annotations found at this line:
      - cvc-type.3.1.3: The value 'Maaa' of element 'tns:name' is not valid.
      - cvc-pattern-valid: Value 'Maaa' is not facet-valid with respect to pattern '15' for type

<?xml version="1.0" encoding="UTF-8"?>
<tns:patient xmlns:tns="" xmlns:xsi="" xsi:schemaLocation=" Patient.xsd ">

Open in new window

why i am getitng this error and how to fix it. i using eclipse for this as IDE.
any other open source XML IDEs bettr than eclipse to work on these simple xml, XSDs etc
please advise
private void FileDataRequest(StreamedFileDataRequest r)


MemoryStream m = new MemoryStream();

r = m.AsOutputStream as StreamedFileDataRequest;
void loop(){
StorageLibrary l = await StorageLibrary.GetLibraryAsync(FromKnownId.Pictures);

Scrollviewer scrollviewer = new Scrollviewer();

RenderTargetBitmap r = null;

 r = new RenderTargetBitmap();

                await r.RenderAsync(scrollviewer);


                var file0 = await l.SaveFolder.CreateFileAsync("poikidiki");

                await FileIO.WriteBufferAsync(file0, await r.GetPixelsAsync());

                Windows.Storage.Streams.IRandomAccessStream b = await file0.OpenAsync(FileAccessMode.ReadWrite);


                var file = await StorageFile.CreateStreamedFileAsync("effort06.jpg", new StreamedFileDataRequestedHandler(FileDataRequest),Windows.Storage.Streams.RandomAccessStreamReference.CreateFromFile(file0));


                await file.CopyAsync(l.SaveFolder);


Open in new window

I have this:

it doesn't copy the bytes to the streamed file.

help appreciated
HOW TO CONVERT * char to string (linha):

const unsigned char
*menino1 = (const unsigned char *)0;

menino1 = p - 17;

string linha = menino[1]+menino[2]+menino[3]+menino[4]+menino[5];

for above challenge
Map-1 > mapAB4
prev  |  next  |  chance

Modify and return the given map as follows: if the keys "a" and "b" have values that have different lengths, then set "c" to have the longer value. If the values exist and have the same length, change them both to the empty string in the map.

mapAB4({"a": "aaa", "b": "bb", "c": "cake"}) → {"a": "aaa", "b": "bb", "c": "aaa"}
mapAB4({"a": "aa", "b": "bbb", "c": "cake"}) → {"a": "aa", "b": "bbb", "c": "bbb"}
mapAB4({"a": "aa", "b": "bbb"}) → {"a": "aa", "b": "bbb", "c": "bbb"}

what are input parameters for the method.

what is the return for it?

"a": "aaa", "b": "bb", "c": "cake"//is these are bunch of string values pretending to be key and value for a map??

please advise on how to understand and approach this challenge
The script below does a count of the existing folders and if the count is different the next time it runs then it will generate an Event ID. The problem that I have with the existing approach is that when a folder is purged/deleted the count is no longer valid and we will be a false positive.

Instead of the .count we need to find if a new folder has been created. I am not sure if there is a way to do it by date? or some other way so that when folders are deleted we don't get falser positives.

Basically the goal is to have a script which will run from SCOM the target machine (every 30 min) to verify if a new folder has been created in a specific path, if so then will generate an event ID. SCOM will monitor the event-id and generate an alert.

The script below works great, but we need to replace the count with something that will be more date oriented.

Thank you!


#requires -version 3
New-EventLog -LogName Application -Source "MyScript" -ErrorAction SilentlyContinue
$basecountfile = "$env:HOMEDRIVE\scripts\basecount.txt"
if (test-path -Path $basecountfile){
  # if file not found then this is the first run so there is no baseline
  # otherwise check the path and count the directories and compare against the baseline
        $previouscount = get-content -path $basecountfile
        $basecount = (get-childitem -Path \\server\folder -Recurse -Directory).count
        if ($basecount -ne $prevouscount) {
        # found a difference

Open in new window

Using these codes (in the project),
        private static Cell InsertCellInWorksheet(string columnName, uint rowIndex, WorksheetPart worksheetPart)
            Worksheet worksheet = worksheetPart.Worksheet;
            SheetData sheetData = worksheet.GetFirstChild<SheetData>();
            string cellReference = columnName + rowIndex;
            Row row;
            if (sheetData.Elements<Row>().Where(r => r.RowIndex == rowIndex).Count() != 0)
                row = sheetData.Elements<Row>().Where(r => r.RowIndex == rowIndex).First();
                row = new Row() { RowIndex = rowIndex };
            if (row.Elements<Cell>().Where(c => c.CellReference.Value == columnName + rowIndex).Count() > 0)
                return row.Elements<Cell>().Where(c => c.CellReference.Value == cellReference).First();
                Cell refCell = null;
                foreach (Cell cell in row.Elements<Cell>())
                    if (string.Compare(cell.CellReference.Value, cellReference, true) > 0)
                        refCell = cell;
                Cell newCell = new Cell() { CellReference = cellReference };
                row.InsertBefore(newCell, refCell);

Open in new window

Is there one example to read each message, one by one, for one specific text string, within Sent folder of Outlook?
Further to this¬ificationFollowed=190745230#a42174635

and I have ImageHandler.cs like
using System;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Data;
using System.Configuration;
using System.Data.OleDb;
using System.Xml;
using System.Globalization;
using System.Collections.Generic;
using System.Drawing;
using System.Text; // This was needed to make ASCIIEncoding function
using System.Security.Cryptography; // This was needed to make everything related to MD5 function
using System.Web.Services;

namespace Own_rec
    public class ImageHandler : IHttpHandler
        /// <summary>
        /// You will need to configure this handler in the Web.config file of your 
        /// web and register it with IIS before being able to use it. For more information
        /// see the following link:
        /// </summary>
        public void ProcessRequest(HttpContext context)
            //string userId = string.Empty;
            int userId = 0;
            //-- get the ID from query string you get from <img src tag
            if (null != 

Open in new window

Using these codes

        public static List<HouseData> GetHouseList()
            List<HouseData> houseList = new List<HouseData>();
            using (SqlConnection sqlConn = new SqlConnection(ConfigurationManager.ConnectionStrings["Mssqlconn3"].ConnectionString))
                using (SqlCommand sqlCmd = new SqlCommand("SELECT house_name, address1, address2, price, price_curr, raised_by_user_id FROM house_tab", sqlConn))
                    sqlCmd.CommandType = CommandType.Text;
                    SqlDataAdapter sqlAd = new SqlDataAdapter(sqlCmd);
                    DataTable sqlDt = new DataTable();
                    if (null != sqlDt)
                        houseList = sqlDt
                                        .Select(dataRow => new HouseData
                                            house_name = dataRow.Field<string>("house_name"),
                                            address1 = dataRow.Field<string>("address1"),
                                            address2 = dataRow.Field<string>("address2"),
                                            price = dataRow.Field<decimal>("price"),
                                            price_curr = 

Open in new window

I use Ola Hallengren's maintenance for all of my customer's,
Have used it for years, never any real problems -- until now.  For some reason the @CleanupMode and @CleanupTime are not working. The backup step is configured to retain bak files for only 24hrs, and to cleanup the old bak before generating the new.  For some reason, it is not working, and the job keeps failing due to insufficient disk space.

My temporary workaround is below.  I am deleting the largest bak file from disk as a first step in the job, until I get Ola's logic corrected.  Well, it works great as-is, but I've found I need to run it for all subdirectories.

The way it works now is to del the bak file in this path explicitly:
SET @path = 'dir \\backups\servername\dbname\FULL\'

I need it to delete the bak files from all subdirectories within \\backups\servername\

Any help?


IF OBJECT_ID('tempdb..#files') IS NOT NULL
DROP TABLE #files;
CREATE TABLE #files (Line VARCHAR(512)) 
DECLARE @filename VARCHAR(255)
SET @path = 'dir \\backups\servername\dbname\FULL\'
SET @cmd1 =  @Path+' /A-D  /B' 
--PRINT @cmd1

INSERT #files
EXEC master..xp_cmdshell @cmd1
--SELECT * FROM #files

SET @filename = (SELECT Line FROM #files)
SET @cmd2 = 'del \\backups\servername\dbname\FULL\' + @FileName
--PRINT @cmd2


Open in new window

I am attempting to register a remote machine on team services with Powershell. When I enter the script on the remote machine and attempt to run it, I get the error below: Cannot add type. The assembly 'System.IO.Compression.FileSystem' could not be found. I have copied the registration script from the Deployment Groups section on team services online.

The server that I am using is windows server 2008 R2. The script is below:

$ErrorActionPreference="Stop";If(-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] “Administrator”)){ throw "Run command in Administrator PowerShell Prompt"};If(-NOT (Test-Path $env:SystemDrive\'vstsagent')){mkdir $env:SystemDrive\'vstsagent'}; cd $env:SystemDrive\'vstsagent'; for($i=1; $i -lt 100; $i++){$destFolder="A"+$i.ToString();if(-NOT (Test-Path ($destFolder))){mkdir $destFolder;cd $destFolder;break;}}; $agentZip="$PWD\";(New-Object Net.WebClient).DownloadFile('', $agentZip);Add-Type -AssemblyName System.IO.Compression.FileSystem;[System.IO.Compression.ZipFile]::ExtractToDirectory($agentZip, "$PWD");.\config.cmd --deploymentgroup --agent $env:COMPUTERNAME --runasservice --work '_work' --url '' --projectname 'xxxxxxxProjects' --deploymentgroupname "xxxxxxxxxDeploymentGroup" ; Remove-Item $agentZip;
I have a problem with my mouse. When i move it to the right it goes down, when i move it to the left it goes up, when i move it up it goes to the right, when i move it down it goes to the left.

i really want to use my mouse can somebody help me.

Im using Armageddon Aquila-X5
Hello, Experts,

I have an issue with a script where I want the end-user once the app is hit to see the main menu. I have four definitions doing separate tasks (updating, querying or adding in records in a database).

I want my main screen to pop up a list of items for the end users to select. I read that a def main() function is the route to go. Tested it out and I have no luck running it.

def main():
    user_exit =  5
    while True:
            #prints statements that lead the end-user to decide what they would like to do
        print('Welcome to the ROWriter Database applet! What would you like to do?')
        print('1) Insert a new store CIM info...')
        print('2) Update an existing store CIM info...')
        print('3) Delete an exisiting store CIM info...')
        print('4) Search for CIM')
        print('5) Exit the application...')
            #accepts user input and converts it to a string and stores into a variable
        user_input = int(input('Enter option:'))
        #if user input is equal to the exit variable then the application exits
        if user_input == user_exit:
        elif user_input == 1:
        elif user_input == 2:
        elif user_input == 4:
if__name__ == "__main__":

Open in new window

Is there any way to search for all instances of a string in notepad++ and delete the whole line
on which the string is found?

System Programming





Kernel and system programming is the process of creating the software necessary for a computer or device to function and operate other programs. Some operating systems (such as Microsoft Windows) are proprietary, but others, such as the various Linux distributions, are open source.

Top Experts In
System Programming