Skip to content

JD Kromkowski

Forum Replies Created

Viewing 15 posts - 16 through 30 (of 284 total)
  • Author
    Posts
  • in reply to: Strange Unwanted and Odd precision #3516
    JD Kromkowski
    Participant

    sorry for careless use of word “float”, when maybe I meant double or long double.

    We don’t really have a type like DECIMAL(n,2) or DECIMAL (n,4). Do we? SB may have stored in float or double or long double, but when we search (do comparisions) we never had the problem of not finding the correct record. So what am I supposed to do? To do it correctly in SBNG.

    in reply to: Strange Unwanted and Odd precision #3515
    JD Kromkowski
    Participant

    This a version of the axiom: never store things in float unless you are a physist looking for the Higgs Boson.

    So what is the solution? Again?

    in reply to: Strange Unwanted and Odd precision #3514
    JD Kromkowski
    Participant

    is this floating math which I always forget and then remember every 4 years. https://docs.python.org/release/2.5.1/tut/node16.html

    If so there is still a problem when working with databases. If I search or set a filter for mydata.myfield == 20513.24 I need to find that record! even if 24/100 in binary is some other number (invisibly really close).

    JDK

    in reply to: Logarithms #3513
    JD Kromkowski
    Participant

    Yeah. So…we make math.h part of the C components of SIMPOL?

    in reply to: How Impor a CSV file into table? #3506
    JD Kromkowski
    Participant

    Use “File>Import” in Personal

    Or is the actual code important? I don’t think that it is currently available to public but probably uses fsfileinputstream

    in reply to: SD and Variance #3503
    JD Kromkowski
    Participant

    //Regression John Kromkowski 5/2/2017
    //Beginnings need to add routine for equation/constant, etc.

    function main()
    string s, s1, sfieldnameX,sfieldnameY
    number Rsquared
    sbme1 sbme
    integer e, error, count1, count2
    sbme1table tablename
    sbme1field sbfieldX,sbfieldY
    boolean found
    array b
    b =@ array.new()

    s = “”
    count1 = 4
    count2 = 0
    e = 0
    error = 0
    sbme =@ sbme1.new(“C:\SIMPOL\Ethnic\ARHE\cdancestry.sbm”, “O”, error=e)
    if sbme =@= .nul
    s = “Error number ” + .tostr(e, 10) + ” opening the SBME file: ‘cdancestry.sbm'{d}{a}”
    else
    tablename =@ sbme.opentable(“CDANSCESTRY”, error=e)
    if e
    s = “Error number ” + .tostr(e, 10) + ” opening the table{d}{a}”
    else
    // Initialize the found flag to .false
    found = .false
    b =@ getfieldinfoarray(tablename)
    while count1 < 158
    sfieldnameX = b[4]
    sfieldnameY = b[count1]
    sbfieldX =@ getfield(tablename,sfieldnameX)
    sbfieldY =@ getfield(tablename,sfieldnameY)
    Rsquared = regression(sbfieldX, sbfieldY)
    s = sfieldnameX + ” – ” + sfieldnameY + ” R-squared: ”
    s1 = .tostr(Rsquared,10)
    wxmessagedialog(message = s + s1)
    count1 = count1 + 1
    end while
    end if
    end if
    end function s

    function regression(sbme1field sbfieldX, sbme1field sbfieldY)
    array x, y, xy, x2, y2
    x =@ array.new()
    y =@ array.new()
    xy=@ array.new()
    x2=@ array.new()
    y2=@ array.new()
    number Pearson, Rsquared, numer, denom
    number sumX,sumY, sumXY, sumX2, sumY2
    integer i, n
    sbme1record r
    i = sbfieldX.table.recordcount()
    n = i
    r =@ sbfieldX.table.select(lastrecord=.false)

    x = .fix(r.get(sbfieldX),1000000)
    y = .fix(r.get(sbfieldY),1000000)
    xy = .fix(r.get(sbfieldX),1000000) * .fix(r.get(sbfieldY),1000000)
    x2 = raisetopower(x,2)
    y2 = raisetopower(y,2)
    while i > 1
    r =@ r.select(previousrecord = .false)
    i = i – 1
    x = .fix(r.get(sbfieldX),1000000)
    y = .fix(r.get(sbfieldY),1000000)
    xy = .fix(r.get(sbfieldX),1000000) * .fix(r.get(sbfieldY),1000000)
    x2 = raisetopower(x,2)
    y2 = raisetopower(y,2)
    end while
    sumX = sumarray(x)
    sumY = sumarray(y)
    sumXY = sumarray(xy)
    sumX2 = sumarray(x2)
    sumY2 = sumarray(y2)
    numer = ((n*sumXY)-(sumX*sumY))
    denom = sqrt(((n*sumX2)-raisetopower(sumX,2))*((n*sumY2)-raisetopower(sumY,2)),14)
    Pearson = .fix(numer/denom,1000000000)
    Rsquared = raisetopower(Pearson,2)
    end function Rsquared

    function sumarray(array data)
    number sum
    integer count, i
    count = data.count()
    i = 1
    sum = 0
    while
    sum = sum + data
    i = i+1
    end while (i > count)
    end function sum

    in reply to: SD and Variance #3502
    JD Kromkowski
    Participant

    I’ve started writing a regression function. I’d like to make it GUI. Is there code already available for a picking fields (like field selection dialog in personal) that I could have? The function I’m writing basically takes fieldA and fieldB and outputs the regression equation and R squared.

    function regression(sbmefield fieldA, smbefield fieldB)

    end function RegressionInfo

    in reply to: SD and Variance #3501
    JD Kromkowski
    Participant

    Before I write correlation, regression, r^2, etc stuff. These haven’t already been written have they? I am getting tired of exporting to spreadsheets and want to automate to reduce dimensionality in a dataset.

    My niece and nephews think I should learn R for machine learning, but it seems like SBNG could do the stuff.
    Might also be another market for SBNG?

    in reply to: Form Designer Various #3498
    JD Kromkowski
    Participant

    Thanks for consideration.

    in reply to: SD and Variance #3497
    JD Kromkowski
    Participant

    Great. Thanks. SD too? Because that is really more useful than Variance. Although, you have to calc variance to get to SD.

    If I’m greedy, which I am, I’d love UCL and LCL (upper control limit and lower control limit) which is Mean +/- 3*SD!

    JDK

    in reply to: Iterating through form to get detailblocks #3490
    JD Kromkowski
    Participant

    Thanks Neil. I will take a look.

    What exactly is “formnode”.

    in reply to: Detail block filter #3483
    JD Kromkowski
    Participant

    Sort of related. I’d like

    1) to change sort order on detail block on fly – I know I wrote code in SB to do this but can’t find where and obviously needs to be done slightly differently in SIMPOL. Any code out there?

    2) Searching through detailblocks, like the filtergui. In SB, I’d do the search and then load a dialog with list to choose from basically what the filtergui does but only applied to the currently linked detailblock data. Before I go do a rabbit hole – what has been the consensus or thoughts on how best to do this.

    JD Kromkowski
    Participant

    I see how the code works now.

    JD Kromkowski
    Participant

    So this code in Simpol Business has some issues for me.

    me.inifilename = datadir + sAPPNAME + “.ini”
    buf = openinifile(me.inifilename, sCRLF)
    s = “”
    getprivateprofilestring(sSYSTEM, sUSEPPCS, “F”, s, sEOLchar=sCRLF, sInifilecontent=buf)
    if s == “T”
    //So my ini looked like this but obvious you can have “.true” you have to have “T”
    //[System]
    //useppcs=.true <—- will fail
    //serveraddress=10.1.10.xx:4000 not really xx, but you get idea
    //

    useppcs = .true
    else
    useppcs = .false
    end if

    if useppcs
    serveraddressport = “”
    //
    // I don’t get the point of the ini, if you end up putting having to put the
    // the ip address in the actual code
    //
    //getprivateprofilestring(sSYSTEM, sSERVERADDRESS,”127.0.0.1:4000″, serveraddressport, sEOLchar=sCRLF, sInifilecontent=buf)

    // shouldn’t it be like this:
    getprivateprofilestring(sSYSTEM, sSERVERADDRESS, serveraddressport, serveraddressport, sEOLchar=sCRLF, sInifilecontent=buf)

    in reply to: Minimum files to run smp app #3473
    JD Kromkowski
    Participant

    Inno setup 2.0? Aren’t they on version 5. Is there something about 2.0 than makes it better? I’ve never used an installer.

Viewing 15 posts - 16 through 30 (of 284 total)