Latest Software Development Posts

Stella OST Converter software is 100% well-qualified for OST file recovery and saves into new export exchange OST to PST file; you can try its Free Trail Demo Version and minimum price the software completely. The trial version allows saving only 25 items of each folder of the mailbox which is open source solution to OST Converter Software.

For More Info: Stella OST to PST Converter Software

https://www.stelladatarecovery.com/ost-to-pst-recovery.html

Thank you for answer. It looks good, but prgram wil run on different machines. I cannot install aditional library to every machine.

Objective

  1. To give students practice writing functions.
  2. To give students practice using C strings.
  3. To give students practice utilizing an array of strings (two dimensional array).
    Problem: Spell Checker

Many of us have horrible spelling and would get great practical use out of a spell-checker. In this assignment, you will write a simplified version of a spell checker. In the process, you will write several of your own string functions.
Implementation Details: string functions to write

Note: Assume that all of the formal parameters for each of the functions below are lowercase alphabetic strings.

I'm going to jump to the end rather than spend time mucking about. Since you want this in C here's a tutorial to use Gnu MultiPrecision Library.

Or you could use char array and code it yourself.

Hello,

i need your help.

I need to make a program which will make sum of digits in number e.g. 123 is 6
BUT, the number could be very big like 1000 digits long or more.(e.g. 1 005 854 684......) - of course without spaces
So, i cannot use datatypes like unsigned long long int, because of it is not enough.
Well, my idea is to store a number into string, then i have to make calculations to make sum of digits.

So, my question is: Is it better to use string (char array) or Int array? Do i need to convert char array to some number only array?

Thanks in advance for any help.

Excellent!!
I was looking for this solution and suggestions in other forums did not help completely to solve the problem.

Thank you!

rproffitt ,

actually I don't have much time to start Project on my own. This is interesting topic, but time consuming & team dependent.
I just wanted to start project where programmers can join & help to OS development.

As I'm reading more on this topic, understanding the actual problems in overall development.

Just thinking for free alternative to running Windows applications.

(banging head on RHEL 7.6 doors)

rproffitt commented: Few I know run that distro. "Red Hat uses strict trademark rules to restrict free re-distribution of its officially supported versions" so that's why. +15
xrjf 178

Sorry for the inconvient. There were extra lines not needed.

    Sub Main()
        Try
            prependTextToAllLines("Append.txt")
            Console.Write("Process succeeded. Press Enter key to exit.")
            Console.ReadLine()
        Catch ex As Exception
            Console.WriteLine(ex.ToString)
            Console.ReadLine()
        End Try

    End Sub
    Sub prependTextToAllLines(path As String)
        Try
            Dim fsw As New FileStream(path, FileMode.Open, FileAccess.Write, FileShare.Read)
            Dim sw As New StreamWriter(fsw)
            Dim fs As New FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)
            Dim sr As New StreamReader(fs)
            Dim lineNum As Int32 = 1
            Do
                Dim sCurrLn As String = sr.ReadLine
                Dim sPrepend As String = String.Format("Line #{0:0000000} ", lineNum)
                lineNum += 1
                sw.WriteLine(sPrepend + sCurrLn)
            Loop While Not sr.EndOfStream
            sr.Close()
            sw.Close()
        Catch ex As Exception
            Throw ex
        End Try
    End Sub
End Module
xrjf 178

For some reason I don' t know, yesterday the code was working and today it fails. So, I've rewritten the code and it is:

Sub Main()
    Try
        prependTextToAllLines("Append.txt")
    Catch ex As Exception
        Console.WriteLine(ex.ToString)
        Console.ReadLine()
    End Try

End Sub
Sub prependTextToAllLines(path As String)
    Dim bRet As Boolean = False
    Dim fs As FileStream = Nothing
    Dim fsw As FileStream = Nothing
    Dim sr As StreamReader = Nothing
    Dim sw As StreamWriter = Nothing
    Try
        fsw = New FileStream(path, FileMode.Open, FileAccess.Write, FileShare.ReadWrite)
        sw = New StreamWriter(fsw)
        fs = New FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)
        sr = New StreamReader(fs)
        Dim lineNum As Int32 = 1
        Dim fileLen As Long = fs.Length
        Dim currBufferLine As Int32 = 0
        Dim EndofBuffer As Int32 = -1
        Dim rdPos As Long = 0
        Dim wrPos As Long = 0
        Do
            Dim sCurrLn As String = sr.ReadLine
            Dim sPrepend As String = String.Format("Line #{0:0000000} ", lineNum)
            lineNum += 1
            sw.WriteLine(sPrepend + sCurrLn)
        Loop While Not sr.EndOfStream
        sr.Close()
        sw.Close()
        bRet = True
    Catch ex As Exception
    End Try
End Sub

This sounds like a very bad idea for two reasons:

  1. The code is overly complex (tricky) for the task and I believe that with very few exceptions, clear code is always preferable to tricky code.
  2. If anything breaks the process midway through the original file is corrupted.

Having said that, I admit that it was an interesting and clever approach.

rproffitt commented: In the news, MySpace server transition loses over a decade of uploads. "My code is quite the trick." +15
xrjf 178

@rproffitt: If the file is large and assuming we can buffer a first bunch of lines so that streamreader and streamwriter will never overlap:

        Try
            Dim path As String = "Append.txt"
            Using fs As New FileStream(path, FileMode.Open, FileAccess.ReadWrite, FileShare.None)
                Dim sr As New StreamReader(fs)
                Dim sw As New StreamWriter(fs)
                Dim lineNum As Int32 = 1
                Dim fileLen As Long = fs.Length
                Dim linesToBuffer As Int32 = 3
                Dim currBufferLine As Int32 = 0
                Dim vBuffer(linesToBuffer - 1) As String
                Dim EndofBuffer As Int32 = -1
                Dim rdPos As Long = 0
                Dim wrPos As Long = 0
                For i = 0 To vBuffer.Length - 1
                    vBuffer(i) = sr.ReadLine
                Next
                rdPos = fs.Position
                Do
                    fs.Seek(wrPos, SeekOrigin.Begin)
                    sw.WriteLine(String.Format("Line #{0:0000000} ", lineNum) + vBuffer(currBufferLine))
                    wrPos = fs.Position 
                    ' if wrPos >= rdPos signifies buffer too small'
                    If rdPos < fileLen Then
                        fs.Seek(rdPos, SeekOrigin.Begin)
                        vBuffer(currBufferLine) = sr.ReadLine
                        rdPos += vBuffer(currBufferLine).Length + 2
                        lineNum += 1
                    Else
                        If EndofBuffer = -1 Then
                            sr.Close()
                            EndofBuffer = linesToBuffer
                        End If
                        EndofBuffer -= 1
                        If EndofBuffer < 0 Then Exit Do
                    End If
                    currBufferLine = (currBufferLine + 1) Mod linesToBuffer
                Loop
                sw.Close()
            End Using
        Catch ex As Exception

        End Try
rproffitt commented: Now throw this a zero byte file. Excellent examples where something simple grows and grows to cover every condition. +0

That seems like the type of task more suited to a script than an app. If you copy the following into a file named prefix.vbs you can do what you requested.

set fso = CreateObject("Scripting.FileSystemObject")

if wscript.arguments.unnamed.count <> 2 then
    Wscript.Echo "prefix <filename> ""string"""
    Wscript.Quit
end if

infile  = wscript.arguments.unnamed(0)
outfile = infile & ".pre"
prefix  = wscript.arguments.unnamed(1)

if not fso.FileExists(infile) then
    Wscript.Echo "File '" & infile & "' not found"
    Wscript.Quit
end if

set fi = fso.OpenTextFile(infile)
set fo = fso.OpenTextFile(outfile,2,True)  '2=write True=create if needed

do while not fi.AtEndOfStream
    line = fi.ReadLine
    fo.WriteLine prefix & line
loop

fi.Close
fo.Close

It's a lot less complicated than the equivalent code in vb.Net. The output goes to the file <yourfile>.pre. For example, if you feed it myfile.txt you will get myfile.txt.pre. Once you verify the results you can rename it.

xrjf 178

Consider reading all the lines at the beginning and, then, prepending the line number, like in:

        Try
            Dim vLines() As String = IO.File.ReadAllLines("Append.txt")
            Using sw As New StreamWriter("Append.txt")
                For i As Int32 = 0 To vLines.Length - 1
                    sw.Write(String.Format("Line #{0:0000} ", i) + vLines(i) + vbCrLf)
                Next
            End Using
        Catch ex As Exception

        End Try
rproffitt commented: I'd like to try that on a 4+ terabyte file just to see what vb.net would do. There are reasons to code this with input and output files. +15

In psuedocode to do this we read a file line by line then insert the text on each line then write the line to another file.
At the end of the file we close both files. Optionally you could delete the source and rename the edited file to the source's name.

i want to add some text at the begining of every line in a text file.
i'm only able to append text to the file

        Imports System.IO

        Module Module1
Sub Main()
    ' Append the first line of text to a new file.
    Using writer As StreamWriter =
        New StreamWriter("C:\append.txt", True)

        writer.WriteLine("First line appended; rtp")
    End Using

    ' Append the second line.
    Using writer As StreamWriter =
        New StreamWriter("C:\append.txt", True)

        writer.WriteLine("Second line appended; 2")
    End Using
End Sub
    End Module

I see trouble with lines 20 and 22. And a comment on 31.

Line 31. printf (sizeof(a->array))
hmm, Where is the format?
I would think you wanted

printf ("%d\n", sizeof(a->array));

But then, of course, you should always get the value 8 or 4,
whatever sizeof(char*) is. array is just a pointer, not an array itself.

Line 20 filename is declared here as a local variable to the function.

Line 22, you assign it to the pointer tmpFileName.
When you return from this function, the variable filename does not exists,
and its address would be invalid (begin some place on the stack).

mine is not reading the correct infoi don't know why but its not reading the correct password what did I do Wrong!!!!

     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
                                If User.Text = "" Then
        MessageBox.Show("Please enter your Username to login", "Stjohn's chikwaka feed back", MessageBoxButtons.OK, MessageBoxIcon.Error)
        User.Focus()
    ElseIf email.Text = "" Then
        MessageBox.Show("Please enter your Email to login", "Stjohn's chikwaka feed back", MessageBoxButtons.OK, MessageBoxIcon.Error)
        email.Focus()
    ElseIf password.Text = "" Then
        MessageBox.Show("Please enter your Password to login", "Stjohn's chikwaka feed back", MessageBoxButtons.OK, MessageBoxIcon.Error)
        password.Focus()
    Else
        Dim conLogin As New OleDb.OleDbConnection("PROVIDER=Microsoft.ACE.Oledb.12.0; Data Source =C:\Users\chizhanjet4green\Documents\login.accdb")
        Dim commLogin As New OleDb.OleDbCommand("SELECT login.Username, login.Email, login.Password FROM Login WHERE user = Username AND email= Email  AND password= Password", conLogin)
        Dim userParam As New OleDb.OleDbParameter("Username", Me.User.Text)
        Dim emailParam As New OleDb.OleDbParameter("Email ", Me.email.Text)
        Dim PasswordParam As New OleDb.OleDbParameter("Password", Me.password.Text)
        commLogin.Parameters.Add(UserParam)
        commLogin.Parameters.Add(emailParam)
        commLogin.Parameters.Add(PasswordParam)

        commLogin.Connection.Open()

        Dim reader As OleDb.OleDbDataReader = commLogin.ExecuteReader()

        If reader.HasRows Then
            MessageBox.Show("Login successful!", "Stjohn's chikwaka feed back", MessageBoxButtons.OK, MessageBoxIcon.Information)
            Welcome_To_The_Main_Menu_Of_The_System.Show()
            Me.Hide()
        Else
            MessageBox.Show("Invalid Details enter invalid! Please enter correct login data.", "Stjohn's chikwaka feed back", MessageBoxButtons.OK, MessageBoxIcon.Error)
            User.Clear()
            email.Clear()
            password.Clear()
            User.Focus()
        End If
        commLogin.Connection.Close()
    End If

End Sub
rproffitt commented: The only wrong step I see is burying your new discussion under 7 years of dust. +15

well acording to me i removed the @ symbols and everything turned out awesomeSuccess

Hi,
I've been playing a game from a few years back (I really enjoyed it) and I found that it was open source on github. I would love to make my own version and see how it goes. I have experience with python as a hobby, and I've had a go at c++ - I made a few games with the sdl library. The github link - https://github.com/id-Software/RTCW-SP
It will be great if I could at least render a level and a character. From what I see, the source has everything I need apart from the graphics.
If someone can give some pointers on what will be required and where to start I will be happy to hear :)
Here's a video of the gameplay - https://www.youtube.com/watch?v=FddW6VjFHAY

Hi.

ReactOS is supposed that the OS will run windows software, some say that has the maturity of an XP, but I really haven't try it, and as far as I know, it is not recommended to use it daily. I recommend you to go to the ReactOS forum, maybe they can help you if you want to develop for it.

Maybe linux from scratch can help you give you an idea on how the OS uses all the modules, etc. to boot up.

Ok, I get it, I can't just use printf. ..., I lost an hour with this problem looking for a bad allocated table and here we are. Thanks for all who wantd to help

Hi, I'm writing in C my program and I have a problem with this pieces of code:

//lib.h
typedef struct Array {
    char **array;
    char *searchDirPath;
    char *searchFile;
    char *tmpFileName;
    int tmpFile;
    int arraySize;
    int currIndex;
} Array;

// lib.c

Array* createArray(int size) {
    Array* newArray = calloc(1,sizeof(Array));
    newArray->array = calloc((size_t)size,sizeof(char*));

    newArray->arraySize = size;
    newArray->currIndex = 0;
    char fileName[] = "tmpXXXXXX";
   newArray->tmpFile = mkstemp(fileName);
    newArray->tmpFileName = fileName;

   showYourself(newArray);
    return newArray;
}

void showYourself(Array* a) {
    printf("\n\n==========================================\n");
    printf("\nShowing myself:\n arraysize:  ");
    printf(sizeof(a->array));
    printf("\nSearch directory path:  ");
   printf(a->searchDirPath);
    printf("\nSearch file path:  ");
    printf(a->searchFile);
    printf("\nTmp file:  ");
   printf(a->tmpFileName);
    printf("\nArray size:  ");
    printf("%d",a->arraySize);
    printf("\nCurrent index:  ");
    printf("%d",a->currIndex);
    printf("\n==========================================\n\n");
}

// main.c
#include "stdio.h"
#include "lib.h"

int main() {
    printf("Hello world\n");
    sayHello();

    Array*a = createArray(8);
   showYourself(a);
    setDir(a, "/home/kamil/gsl-2.5");
    setSearchFile(a, "borosh13.c");    // /home/kamil/gsl-2.5/rng/borosh13.c
     showYourself(a);
    search(a);

    return 0;
}

This is only a sample, but I havent tested other part yet. In the short: it gives segmentation fault.
I think if comes from printf(sizeof(a->array)); (when I comment this line program works to the end), so I probably missed something in createArray function but can't see a problem. I would be very grateful if you could take a look and check if there is a bug.

"Which compiler should I choose?"

Look to prior OS development to see what they use. Also, the target platform needs definition. For a Microchip SOA you would use Microchip's free IDE or others. For today's PCs give yourself a year to learn about the PC from the days of BIOS to today's UEFI.

To get an idea of how complex today's UEFI boot system is, watch https://channel9.msdn.com/Shows/Going+Deep/Inside-Windows-8-Chris-Stevens-Boot-Environment

It's become so complex that there is a team just for the boot loader.

My question to you is do you have the time to immerse yourself in just one eco-system?
Why isn't one of the dozens of PC OSes workable for your final project?

TunOS : Sounds Nice!!! :) :D

Need help to start my opensource project. How do I start, just like ReactOS for example.

What are requirements for developing / starting OS Project?

I have listed below basic requirements

  • kernel
  • boot loader
  • filesystem
    Which compiler should I choose?

No one here is going to do your work for you. If you want it in Python you'll have to put in the work yourself.

can i get this in python?

xrjf 178

Unexpectedly for me, when datasource is assigned, dessing mode seems to be bypassed. Commenting the If condition columns and rows can added to the datatable, directly to the control in dessing time or dynamically at run-time.

Public Class ClsDgvJournal
    Inherits DataGridView
    Public dataTbl As New DataTable
    Public Sub New()
        Try
            Width = 555
            Height = 90
            'If System.ComponentModel.LicenseManager.UsageMode = System.ComponentModel.LicenseUsageMode.Designtime Then'
            Dim dc1 As New DataColumn("AAA", GetType(String))
            Dim dc2 As New DataColumn("BBB", GetType(Int32))
            Dim dc3 As New DataColumn("CCC", GetType(Int32))
            Dim dc4 As New DataColumn("DDD", GetType(Int32))
            Dim dc5 As New DataColumn("EEE", GetType(Int32))
            dataTbl.Columns.AddRange(New DataColumn() {dc1, dc2, dc3, dc4, dc5})
            Dim row As DataRow = dataTbl.NewRow
            row.ItemArray = New Object() {1, 2, 3, 4, 5}
            dataTbl.Rows.Add(row)
            Me.DataSource = dataTbl
            'End If'
        Catch ex As Exception

        End Try
    End Sub

End Class

Public Class Form1

    Dim nItem As Int32 = 6
    Private Sub btnAddRow_Click(sender As Object, e As EventArgs) Handles btnAddRow.Click
        Try
            With ClsDgvJournal1.dataTbl
                Dim row As DataRow = .NewRow
                row.ItemArray = New Object() {nItem, nItem + 1, nItem + 2, nItem + 3, nItem + 4}
                .Rows.Add(row)
            End With
            nItem += 5
        Catch ex As Exception

        End Try
    End Sub
End Class

Hi PM312
Actually when you drag control, this creates the five columns provided. So your custom control is correct. I should instead understand how to proceed to add lines. For example, if you assign a datasource starting from a DataTable, it adds the columns declared in the DataTable and as a result you will find yourself with other columns added.

Hi xuexue, You can try this one

If e.RowIndex > 0 AndAlso DGTariffeAssegnate.Rows(e.RowIndex - 1).Cells(1).Value.ToString() = e.Value.ToString() Then
    Using gridBrush As Brush = New SolidBrush(Me.DGTariffeAssegnate.GridColor), backColorBrush As Brush = New SolidBrush(e.CellStyle.BackColor)
        Using gridLinePen As Pen = New Pen(gridBrush)
            e.Graphics.FillRectangle(backColorBrush, e.CellBounds.Left, e.CellBounds.Top - 1, e.CellBounds.Width - 1, e.CellBounds.Height)
            e.Graphics.DrawLine(gridLinePen, e.CellBounds.Left, e.CellBounds.Top, e.CellBounds.Left, e.CellBounds.Bottom)
            e.Graphics.DrawLine(gridLinePen, e.CellBounds.Right - 1, e.CellBounds.Top, e.CellBounds.Right - 1, e.CellBounds.Bottom)
            e.Graphics.DrawLine(gridLinePen, e.CellBounds.Left, e.CellBounds.Bottom - 1, e.CellBounds.Right, e.CellBounds.Bottom - 1)
            e.Handled = True
        End Using
    End Using
End If

You only had one tag so let's go with that. In vb.net, C# and such you can use their form designer to have a datagrid and then code to pull your image and more from the database. You left me wondering if such work is eluding you. There are tutorials about this on the web.
Example: https://www.youtube.com/watch?v=rkp4SzFsg-Y and I am NOT writing this applies but that you can find such and keep watching till something clicks for you.