How to rate my development skills?
am 29.01.2008 20:52:49 von Marcin WiszowatyHello,
I am male 24
i graduated with a batchelors in computer science in december of 07.
long island NY
this is my first job in this field
have been working as a junior programer for past 4 months (VB.net, sql,
web(asp html css development)
its a small and other programers are older unix guys so i dont know how to
compare myself to them
started at $40k per year 3 month review brought me up to $43k for
35hrs/week
have to spend alot for health benefits
1.5 paid days off per month <-- also coment at my salary please
i have no idea weather i am where i should be in my carrear/ability level.
how do you guys judge your abilities and how much time do you spend working
how much time do you spend learning your craft of development/programing
also it recently took me aproximately 8 hours to write a vb probram that
takes a textfile as input (the file was a report format so some lines are
sumations and breaks which i had to seperate out from real data) code below.
I tried to make it general since i will probably will have to reuse alot of
this code for similar projects in the future here.
I might have spent too much time making it this general so that i can reuse
it later.
I spent about an hour just learning the report so that i know what to put
whre in my db.
I beleive that the next similar project i could do in 2hours tops because i
have this base.
it basicaly reads a table which tells it the directory of files to run. the
name pattern of files to process and which key to apply for that file.
for each record in this table the program looks in the directory. If there
is a file it will pull the key information and the other records of data
that we want to save.
it opens a file.
it reads a line
checks the line to see if it is a header (i want 1 peice of data from 1 type
of header repeated throughout the document)
if not a header then check if the line is the lenght that the key says it is
supposed to be
if lenght match then run it into a key. if ran through key correctrly than
add to a dataset
after a file processed update the dataset(write the new records, alter
existing records if changed)
move on to next fiele,
move on to next run entry
i still have to add some error handeling.
here is the code
Imports System.IO
Module Module1
#Region "Variables"
Dim pc As New ProcessControl.ProcessControl
Dim dp As New DPwriteoffs
Dim elf As ELF.ErrorLogFile
Dim dsrun1 As dsRun
Dim dskey1 As dsKey
Dim dswriteoffs1 As dsWriteoffs
Dim batchname As String
Dim starttime As String
Dim blntest As Boolean = True
Dim pcnumber As String
#End Region
#Region "statistics variables"
Dim filesempty As Integer = 0
Dim blnfilegood As Boolean = True
Dim files As Integer = 0
Dim filesgood As Integer = 0
Dim filesbad As Integer = 0
Dim blnlinegood As Boolean = True
Dim fileslines As Integer = 0
Dim fileslinesgood As Integer = 0
Dim fileslinesbad As Integer = 0
Dim lines As Integer = 0
Dim linesgood As Integer = 0
Dim linesbad As Integer = 0
#End Region
Sub Main()
Try
batchname = pc.CreateBatchName()
starttime = Now.ToString()
pc.AddProcess(pcnumber, batchname, "OK", "", "", starttime, "", 0, 0, 0, "")
dsrun1 = dp.getrundata
Dim runrow As dsRun.TwriteoffrunRow
For Each runrow In dsrun1.Twriteoffrun
Try
Dim dirinfo As New DirectoryInfo(runrow.directory)
Dim f() As FileInfo = dirinfo.GetFiles(runrow.namepattern)
If f.Length > 0 Then
dskey1 = dp.getkey(runrow.keytouse)
dswriteoffs1 = dp.getwriteoffs
For Each filei As FileInfo In f
readfile(filei.FullName)
Next
End If
Catch ex As Exception
elf = New ELF.ErrorLogFile("WriteoffPrep_" & Now.ToString("yyyyMMddhhmmss"),
runrow.directory)
elf.writetolog(ex.ToString())
End Try
If Not dswriteoffs1 Is Nothing Then
dp.updatewriteoffs(dswriteoffs1)
End If
Next
Catch ex As Exception
elf = New ELF.ErrorLogFile("WriteoffPrep_" & Now.ToString("yyyyMMddhhmmss"),
"c:\")
elf.writetolog(ex.ToString())
End Try
End Sub
Public Sub readfile(ByVal fullname As String)
Try
Dim groupclient As String
Dim writeoff As dsWriteoffs.TwriteoffRow
Dim datalinelenght As Integer = addwhatlineissupposedtobe()
Dim line As String
Dim reader As StreamReader = File.OpenText(fullname)
line = reader.ReadLine()
While Not line Is Nothing
Dim blnkeywork As Boolean = False
writeoff = dswriteoffs1.Twriteoff.NewTwriteoffRow
If Not Trim$(line) = "" Then
If Not isrptheader(line) = 1 Then
If isrptfooter(line) = 1 Then
Exit Sub
Else
If Not ischunkheader(line) = 1 Then
If line.Length = datalinelenght Then
writeoff.client = groupclient
trykey(writeoff, line)
writeoff.id = dswriteoffs1.Twriteoff.Rows.Count + 1
writeoff.filename = fullname
writeoff.writeoffdate = datefunc(fullname)
dswriteoffs1.Twriteoff.AddTwriteoffRow(writeoff)
Else
'line not important
Dim sss As Integer = 0
End If
Else
groupclient = findclient(line)
End If
End If
End If
End If
line = reader.ReadLine()
End While
reader.Close()
Catch ex As Exception
elf = New ELF.ErrorLogFile("WriteoffPrep_" & Now.ToString("yyyyMMddhhmmss"),
Path.GetDirectoryName(fullname))
elf.writetolog(ex.ToString())
End Try
End Sub
Public Function datefunc(ByVal line As String) As Date
Dim ddate As Date
Dim str As String
str = line.Substring(InStr(line, "sys1") + 3, 6)
str = str.Substring(2, 2) & "/" & str.Substring(4, 2) & "/" &
str.Substring(0, 2)
ddate = Date.Parse(str)
Return ddate
End Function
Public Function findclient(ByVal line As String) As String
Dim pos As Integer = InStr(line, "CLIENT:")
Return line.Substring(pos + 6, 4)
End Function
Public Function ischunkheader(ByVal line As String) As Integer
Try
If line.Substring(0, 7) = "# PHYS" Then
Return 1
End If
Catch ex As Exception
Return 0
End Try
End Function
Public Function isrptheader(ByVal line As String) As Integer
Dim rptheader As String = "E&l1O(s16.667H&l5.667C"
If Trim$(line) = Trim$(rptheader) Then
Return 1
Else
Return 0
End If
End Function
Public Function isrptfooter(ByVal line As String) As Integer
Dim rptheader As String = "E&l1O(s12.5H &l5.667C"
If Trim$(line) = Trim$(rptheader) Then
Return 1
Else
Return 0
End If
End Function
Public Function trykey(ByRef row As dsWriteoffs.TwriteoffRow, ByVal line As
String) As Boolean
Dim keyrow As dsKey.TWriteoffsKeyRow
For Each keyrow In dskey1.TWriteoffsKey
Dim dbcolumn As String = LTrim$(RTrim$(keyrow.dbname))
Dim str As String = line.Substring(0, keyrow.lenght)
line = line.Remove(0, keyrow.lenght)
If LTrim$(RTrim$(str)).Length > 0 Then
Select Case keyrow.type
Case "s"
If dbcolumn.ToUpper = "NAME" Then
row.firstname = Trim$(str.Split(",")(0))
row.lastname = Trim$(str.Split(",")(1))
ElseIf dbcolumn.ToUpper = "FILLER" Then
' do nothing with this data
Else
row.Item(dbcolumn) = LTrim$(RTrim$(str))
End If
Case "i"
Try
If InStr(str, "-") Then
str = str.Replace("-", "")
row.Item(dbcolumn) = 0 - Integer.Parse(LTrim$(RTrim$(str)))
Else
row.Item(dbcolumn) = Integer.Parse(LTrim$(RTrim$(str)))
End If
Catch ex As Exception
elf.writetolog("Integer parsing unsuccesfull : " & dbcolumn & vbCrLf & str)
End Try
Case "d"
Dim ddate As Date
Dim year As String
Dim month As String
Dim day As String
Try
If InStr(str, "/") Then
ddate = Date.Parse(str)
Else
If (Integer.Parse(str.Chars(0) & str.Chars(1))) > 12 Then ' year first than
year = str.Substring(0, 4)
month = str.Substring(4, 2)
day = str.Substring(6, 2)
Else
year = str.Substring(4, 4)
month = str.Substring(0, 2)
day = str.Substring(2, 2)
End If
ddate = Date.Parse(month & "/" & day & "/" & year)
End If
row.Item(dbcolumn) = ddate
Catch ex As Exception
elf.writetolog("Date parsing unsuccesfull : " & dbcolumn & vbCrLf & str)
blnlinegood = False
End Try
Case "e" ' if the date is saved as string
Dim ddate As Date
Dim year As String
Dim month As String
Dim day As String
Try
If (Integer.Parse(str.Chars(0) & str.Chars(1))) > 12 Then ' year first than
year = str.Substring(0, 4)
month = str.Substring(4, 2)
day = str.Substring(6, 2)
Else
year = str.Substring(4, 4)
month = str.Substring(0, 2)
day = str.Substring(2, 2)
End If
row.Item(dbcolumn) = (month & "/" & day & "/" & year)
Catch ex As Exception
row.Item(dbcolumn) = str
blnlinegood = False
elf.writetolog("Date parsing unsuccesfull : " & dbcolumn & vbCrLf & str)
End Try
Case "f"
Try
If InStr(str, "-") Then
str = str.Replace("-", "")
row.Item(dbcolumn) = 0 - Double.Parse(LTrim$(RTrim$(str)))
Else
row.Item(dbcolumn) = Double.Parse(LTrim$(RTrim$(str)))
End If
Catch ex As Exception
elf.writetolog("Double parsing unsuccesfull : " & dbcolumn & vbCrLf & str)
blnlinegood = False
End Try
Case Else
blnlinegood = False
'elf.writetolog("There may be a problem with a key. Review the bill key &
file " & filename & " & line " & linesgood + linesbad)
End Select
End If
Next
End Function
Public Function addwhatlineissupposedtobe()
Dim i As Integer = 0
Dim row As dsKey.TWriteoffsKeyRow
For Each row In dskey1.TWriteoffsKey
i = i + row.lenght
Next
Return i
End Function
End Module