Monday, September 8, 2014

iSolve

This is my first android app.
I couldn't find a single app on play store to solve n-dimensional simultaneous equations which I sometimes find use for so upon learning to write code for my smartphone, I implemented Cramer's rule for the job. The main engine of this part of the program here is finding the determinant of any square matrix which is done via recursion.
The other component of iSolve is the Polynomial Solver which is an android translation of RootFinderC.
This app has some bugs but is functional.
Download iSolve

Monday, February 17, 2014

RootFinderC

A console C program to estimate the roots of given single variable equation.
Added estimation by Bisection Method.
Download

Sunday, January 26, 2014

WordMaker X

This is a new version of Word Finder. Because searching for subset words in a wordlist is so much faster than generating and checking different permutations of the seed word, the save feature has been removed with a few modifications to the interface.

Download here

Saturday, January 25, 2014

Word Finder

A program that finds out what words could be created out of a given seed word. For example: if you are given 'leghorn' as your seed word, other sub-words that can be created out of it that are of length greater than 4 are:
lore
lone
long
ergo
glen
goer
gore
gone
hero
hole
horn
hone
ogle
ogre
oner
role
noel
loner
enrol
heron
longer
Progress can be saved using the 'Stop' button into a config.inf file that will be generated upon a click.
For resuming, the config.inf file should be in the same directory as the main program executable. In this case, the 'Make words' button functions as the resume command. For the operation to begin from where it was left, the program generated config.inf file and the new-words-list text file must be present in the program's directory or else, in case of absence of config.inf the operation will begin from the start and in case of absence of the new-words-list text file, the process will resume from the last word it found out and write it in a new new-words-list file.
Download here
Note : A standard wordlist.txt file has been included in the archive.

Sunday, May 12, 2013

Simple asterisk filter function for strings

Took a bit of thinking to achieve this. This function processes a given string and tells whether it is in agreement with the provided filter input. It accepts the wildcard filter character, asterisk(*) only.
It returns TRUE if the given 'name' parameter is compatible with the provided 'filter' parameter.

Private Function FilterCompliant(ByVal name As String, ByVal filter As String) As Boolean
'//Author : s0ft
'//Contact : aayush.babu@yahoo.com
'//Blog : http://www.c0dew0rth.blogspot.com
'//Usage : Returns TRUE if the given 'name' string is compliant with the given 'filter'
'//it is crucial to understand the working of the asterisk * wildcard character to make a function that processes it
filter = LCase$(filter)
name = LCase$(name)
If filter = "*" Then
    FilterCompliant = True
    Exit Function
End If
Dim splitparts() As String
splitparts = Split(filter, "*")
If splitparts(0) = "" Then splitparts(0) = Left$(name, 1) '//if filter starts with * like e.g *gr*q then make splitparts(0) which would otherwise be "" the first letter of the name
nextstart = 1 '//tells from where to start looking for between-the-asterisk-characters in filter var
For i = 0 To UBound(splitparts)
If Left$(filter, InStr(filter, "*") - 1) = Left$(name, InStr(filter, "*") - 1) Then '//whether *sth or go*sth, the first character(s)-before-asterisk must be the same in filter and name var. So this is a necessary condition
    If InStr(nextstart, name, splitparts(i)) <> 0 Then '//search from nextstart position the string splitparts(i) in name var
        nextstart = InStr(nextstart, name, splitparts(i)) + Len(splitparts(i)) '//so that next time instr wont count the same letter
        cnt = cnt + 1
    Else
        Exit For
    End If
End If
Next i
If cnt = UBound(splitparts) + 1 Then '//necessary condition
    If Right$(filter, 1) = "*" Then '//if filter is in format:  hehe*
        FilterCompliant = True
    ElseIf StrReverse(Left$(StrReverse(filter), InStr(StrReverse(filter), "*") - 1)) = Right$(name, InStr(StrReverse(filter), "*") - 1) Then '//if input is in format: comp*r then give YES to only those words with the same after-final-asterisk-character(s)
        FilterCompliant = True
    End If
End If
End Function



Usage example:

Private Sub Form_Load()
Debug.Print FilterCompliant("eloquent", "*oq*")
End Sub
 

Sunday, November 25, 2012

Basic Rar Password Recovery

This is a rudimentary RAR password cracker I tried making about three days ago. Working off and on, I managed to put some decent, respectable features into it. I had started with it thinking it would be something entertaining and educative to just fool around with, but in a very short span of time, I found myself building it better and more practical, so I decided it should be given a chance and thus tidied up the GUI, did some brain tickling for new functions that could be added to it and implemented those possible.
Despite all my efforts, however, it's still the work of a single individual, of a few days and things may have been left untested and bugs undiscovered. So, if you would like to use it, use it at your own risk and if you get any flaw(s) in the program, a report on it would always be welcome.
Download here

Sunday, August 12, 2012

Len and Trim alternatives

From some alternative vb functions, these two are my most recent ones.

Option Explicit

Private Function newlen1(ByVal str As String) As Long
'//Author : s0ft(aayush.babu@yahoo.com)
'//Web    : c0dew0rth.blogspot.com
'//May 27, 9 : 03 PM
If str = "" Then newlen1 = 0: Exit Function
Dim cnt As Long
cnt = 0 '//you may or may not include this line
Dim char As String
Do
    char = Mid$(str, 1, cnt + 1)
    If char <> "" Then
        cnt = cnt + 1
    End If
Loop Until str = char
newlen1 = cnt
End Function

Function AltLen2(ByVal sString As String) As Long
    Dim bArr() As Byte

    If sString = vbNullString Then Exit Function
    bArr = sString

    AltLen2 = ((UBound(bArr) + 1) / 2)
End Function

Function replacespace(ByVal mainchar As String) As String
'//Author : s0ft(aayush.babu@yahoo.com)
'//Web    : c0dew0rth.blogspot.com
'//A simple Replace$(somestring, " ", "") replacement
Dim bt() As Byte
bt = mainchar
Dim cnt As Long
For cnt = 0 To UBound(bt) Step 2 '//step 2 is here for avoiding the null that appears after every character when converted to byte array
    If bt(cnt) <> 32 Then '//32 DEC is ascii code for space
        replacespace = replacespace + Chr$(bt(cnt)) '//only non space characters will be appended to alttrim
    End If
Next cnt
End Function


Function AltTrim(ByVal char As String) As String
'//Author : s0ft(aayush.babu@yahoo.com)
'//Web    : c0dew0rth.blogspot.com
'//A Trim$(somestring) alternative
Dim bt() As Byte
bt = char
Dim cnt As Long
Dim i As Long
Dim Acc As Long
Dim determined As String
Dim addflag As Boolean
For cnt = 0 To UBound(bt) Step 2
    If bt(cnt) <> 32 Or addflag = True Then
        AltTrim = AltTrim + determined + Chr$(bt(cnt))
    End If
    If AltTrim <> "" Then '//if the first non space character has been found then
        Dim cnt_ As Long
        Acc = 0 '//initialise the counter for number of spaces
        For cnt_ = (cnt + 2) To UBound(bt) Step 2 '//start processing from the next character
            If bt(cnt_) = 32 Then '//if next character is space again,
                Acc = Acc + 1 '//acc will have the number of spaces found. it's just a counter
                addflag = False '//till now a non space character isn't detected so keep the addflag false
            Else '//if next character is not a space then
                determined = Space$(Acc) '//reaching here at any point in this loop will mean the no. of spaces as reported by acc are followed by a non-space character
                addflag = True '//tell the above statements to add the spaces
                cnt = cnt + Acc * 2 '//tell that we're going forward only from the new non-space character
                Exit For  '//skip the loop as we've found one non-space character after Acc number of spaces. Goto skiploop will do the same thing
            End If
        Next cnt_
'//skiploop: '//remove the comment if u use Goto skiploop instead of Exit For above
    End If
Next cnt
End Function

Private Sub Form_Load()
Debug.Print AltTrim("   c a   t      ")
End Sub