Page 5 of 7 FirstFirst ... 234567 LastLast
Results 161 to 200 of 270

Thread: Re PlanetSourceCode

  1. #161
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,120

    Re: Re PlanetSourceCode

    Quote Originally Posted by peterst View Post
    Creating remote repo in organization requires use of API. Having thousands of projects will require thousands of repos. That's what I am thinking of the process steps.
    True. I'll need to use github API too: https://developer.github.com/v3/repo...ion-repository

    For a locally hosted remote it should be easier to directly ssh and git init --bare on the remote machine (no API calls).

    cheers,
    </wqw>

  2. #162
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,995

    Re: Re PlanetSourceCode

    Does the project info in the mdb have the project number (or ID) that was used in the URL of the project at the PSC site?

    I'm asking because there are lot of links to PSC on the web, and also on this forum, that point to addresses like:

    Code:
    http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=74734&lngWId=1
    And it would be nice if we could have a way to locate that project in the new repo.

  3. #163
    Fanatic Member
    Join Date
    Jun 2019
    Posts
    557

    Re: Re PlanetSourceCode

    From the readme file name: @PSC_Readme_NNNN_1.txt, the NNNN part is the Submission.id field in the MDB.

  4. #164
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    9,853

    Re: Re PlanetSourceCode

    Here, I put the unprotected PscEnc.mdb file out in my Google Drive as well. There aren't any macros in it, so it's pretty much just database data.
    Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.

  5. #165
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,120

    Re: Re PlanetSourceCode

    The auto-generated @PSC_ReadMe_Xxx.txt files contain something like this
    Code:
    Title: [3D maze & frustum ]
    Description: 3D "maze" doesn't really have an ending.. but it serves another purpose. This is a cell&portals maze. It uses exact visibility ( recursion ) and clipping to create a view of the maze. I originally had to do this in C++.net using openGL. This USES PURE VB. only a few api calls. I'm looking for someone who has a good idea for a maze building algorithm so i can do some file I/O. right now i just build the maze in the program which takes up A LOT of lines, and could be done much easier by reading a file. anyway, leave your comments, learn, enjoy.
    This file came from Planet-Source-Code.com...the home millions of lines of source code
    You can view comments on this code/and or vote on it at: http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=57868&lngWId=1
    
    The author may have retained certain copyrights to this code...please observe their request and the law by reviewing all copyright conditions at the above URL.
    These will probably be included verbatim in the README.md

    For the name of the repo I was thinking about author_name_some_part_of_title so that LaVolpe's submissions would order alphabetically :-)) Could include the submission ID at the end as a number though.

    cheers,
    </wqw>

  6. #166
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,995

    Re: Re PlanetSourceCode

    Quote Originally Posted by peterst View Post
    From the readme file name: @PSC_Readme_NNNN_1.txt, the NNNN part is the Submission.id field in the MDB.
    OK. Then a mechanism would be needed to locate the project with that number.

  7. #167
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Re PlanetSourceCode

    Quote Originally Posted by wqweto View Post
    I was thinking about author_name_some_part_of_title so that LaVolpe's submissions would order alphabetically :-))
    I was thinking that the author_name_some_part_of_title section should be filtered like, Replace("LaVolpe", "Avid VB Fan") before adding to the repository :-))
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  8. #168
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    9,853

    Re: Re PlanetSourceCode

    Quote Originally Posted by LaVolpe View Post
    I was thinking that the author_name_some_part_of_title section should be filtered like, Replace("LaVolpe", "Avid VB Fan") before adding to the repository :-))
    Don't do it.
    Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.

  9. #169
    Fanatic Member
    Join Date
    Jun 2019
    Posts
    557

    Re: Re PlanetSourceCode

    Found the "secret" and "magic" offset where the bad encryption happens. Even the section is not encrypted (header + some of the data) it could be partially encrypted and that's why my algo failed. Still having 291 files with errors during extraction using SharpZipLib - most are "Cannot find central directory".

    The total process to decrypt and extract the data from ZIPs (without writing to temp files - all in memory processing) takes about 15 minutes on my PC using hard drive as storage for ISOs and unpacked data:
    Code:
    Decrypt and extract projects from CDs
    -------------------------------------
    Processing CD1 from path e:\
    CD2 extraction time taken: 251.371s
    Processing CD2 from path f:\
    CD3 extraction time taken: 159.1s
    Processing CD3 from path g:\
    CD4 extraction time taken: 113.134s
    Processing CD4 from path h:\
    CD5 extraction time taken: 128.607s
    Processing CD5 from path i:\
    CD6 extraction time taken: 99.211s
    Processing CD6 from path j:\
    CD7 extraction time taken: 63.033s
    Processing CD7 from path k:\
    CD8 extraction time taken: 75.378s
    Total time taken: 889.839s
    
    Press Enter to exit...
    Probably using SSDs and parallelize the processing into multiple threads it may work much faster but it is not important at the moment.

    Next step is to process @PSC_Readme* files to get better project names and generate README.md file.

  10. #170
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    9,853

    Re: Re PlanetSourceCode

    Quote Originally Posted by peterst View Post
    Next step is to process @PSC_Readme* files to get better project names and generate README.md file.
    Maybe I should stay out of it, or maybe I'm confused. But isn't that what my ZipFileIndex.tsv and ZipFileIndex.xlsx files are? That's the ZIP file name, title from @PSC_Readme*, and description from @PSC_Readme*. There's not much more in those @PSC_Readme* files.

    Anyway, getting it all into a well organized Git repository would be nice, I suppose.
    Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.

  11. #171
    Fanatic Member
    Join Date
    Jun 2019
    Posts
    557

    Re: Re PlanetSourceCode

    Quote Originally Posted by Elroy View Post
    Maybe I should stay out of it, or maybe I'm confused. But isn't that what my ZipFileIndex.tsv and ZipFileIndex.xlsx files are? That's the ZIP file name, title from @PSC_Readme*, and description from @PSC_Readme*. There's not much more in those @PSC_Readme* files.

    Anyway, getting it all into a well organized Git repository would be nice, I suppose.
    Yes, it is what you've done. But to create good looking README.md file requires to add some formatting and insert the image from Data\Pictures directory (still haven't checked the relation of IDs in picture file name).

    I can use your files where you extracted all the info (title and description) but this adds another dependency file. My idea is to mount ISOs or copy to separate directories and run the tools to extract data, prepare Git repos and finally to create the repos in centralized Git hosting solution like GitHub.

  12. #172
    Fanatic Member
    Join Date
    Jun 2019
    Posts
    557

    Re: Re PlanetSourceCode

    Some ugly and messy test code for those interested in decryption and extraction process. It will be re-written for the final version. Written in VB.NET (VS2019, targeting .NET Framework 4.8):

    VB.NET Code:
    1. Imports System.IO
    2. Imports Extensions.Strings
    3. Imports ICSharpCode.SharpZipLib.Core
    4. Imports ICSharpCode.SharpZipLib.Zip
    5.  
    6. Public Class PSCAnalyzer
    7.     Public Event OnErrorOccurred(s As String)
    8.     Private Sub ErrorOccurred(s As String)
    9.         RaiseEvent OnErrorOccurred(s)
    10.     End Sub
    11.  
    12.     Public Event OnInfoEvent(s As String)
    13.     Private Sub InfoEvent(s As String)
    14.         RaiseEvent OnInfoEvent(s)
    15.     End Sub
    16.  
    17.     Public Event OnLogEvent(s As String)
    18.     Private Sub LogEvent(s As String)
    19.         RaiseEvent OnLogEvent(s)
    20.     End Sub
    21.  
    22.     Private Enum ZIPHeaderType
    23.         LocalHeader = 0
    24.         CentralDirFileHeader = 1
    25.         EndCEntralDirRecord = 2
    26.     End Enum
    27.  
    28.     Private ZIP_LOCAL_FILE_HEADER As Byte() = {&H50, &H4B, &H3, &H4}
    29.     Private ZIP_CENTRAL_DIR_FILE_HEADER As Byte() = {&H50, &H4B, &H1, &H2}
    30.     Private ZIP_END_CENTRAL_DIR_RECORD As Byte() = {&H50, &H4B, &H5, &H6}
    31.  
    32.     Private ENCRYPTED_LOCAL_FILE_HEADER As Byte() = {&HAF, &HB4, &HFC, &HFB}
    33.     Private ENCRYPTED_CENTRAL_DIR_FILE_HEADER As Byte() = {&HAF, &HB4, &HFE, &HFD}
    34.     Private ENCRYPTED_END_CENTRAL_DIR_RECORD As Byte() = {&HAF, &HB4, &HFA, &HF9}
    35.  
    36.  
    37.     Private _filename As String
    38.     Private _buff As Byte()
    39.     Private _buffSize As Integer
    40.  
    41.     Private Sub ExtractZipStream(ByVal rdr As Stream, ByVal destDir As String)
    42.         Try
    43.             Using zf = New ZipFile(rdr)
    44.                 For Each zipEntry As ZipEntry In zf
    45.                     If Not zipEntry.IsFile Then Continue For
    46.  
    47.                     Dim zippedFile = zipEntry.Name
    48.                     Dim fullDestName = Path.Combine(destDir, zippedFile)
    49.                     Dim outDirName = Path.GetDirectoryName(fullDestName)
    50.                     If Not outDirName.IsNullOrEmpty Then
    51.                         Directory.CreateDirectory(outDirName)
    52.                     End If
    53.  
    54.                     Dim buff As Byte() = New Byte(4095) {}
    55.                     Using zs = zf.GetInputStream(zipEntry)
    56.                         Using outfs = File.Create(fullDestName)
    57.                             Try
    58.                                 StreamUtils.Copy(zs, outfs, buff)
    59.                             Catch ex As Exception
    60.                                 LogEvent($"Error extracting file {zipEntry.Name} from archive {_filename}: {ex.Message}")
    61.                             End Try
    62.  
    63.                         End Using
    64.                     End Using
    65.                 Next
    66.             End Using
    67.         Catch ex As Exception
    68.             LogEvent($"Error extracting archive {_filename}: {ex.Message}")
    69.         End Try
    70.     End Sub
    71.  
    72.     Public Sub ExtractZIPFile(ByVal destDir As String)
    73.         Using ms = New MemoryStream(_buff)
    74.             ExtractZipStream(ms, destDir)
    75.         End Using
    76.     End Sub
    77.  
    78.  
    79.     Private Function BufferEqual(ByVal i As Integer, ByVal arr As Byte()) As Boolean
    80.         If _buffSize < i + arr.Length Then
    81.             Return False
    82.         End If
    83.  
    84.         Dim buff = New Byte(arr.Length - 1) {}
    85.         Array.Copy(_buff, i, buff, 0, arr.Length)
    86.  
    87.         Return buff.SequenceEqual(arr)
    88.     End Function
    89.  
    90.     Private Function SectionIsValid(ByVal i As Integer) As Boolean
    91.         Return _
    92.             BufferEqual(i, ENCRYPTED_LOCAL_FILE_HEADER) OrElse BufferEqual(i, ZIP_LOCAL_FILE_HEADER) OrElse
    93.             BufferEqual(i, ENCRYPTED_CENTRAL_DIR_FILE_HEADER) OrElse BufferEqual(i, ZIP_CENTRAL_DIR_FILE_HEADER) OrElse
    94.             BufferEqual(i, ENCRYPTED_END_CENTRAL_DIR_RECORD) OrElse BufferEqual(i, ZIP_END_CENTRAL_DIR_RECORD)
    95.     End Function
    96.  
    97.     Private Function SectionEncrypted(ByVal i As Integer) As Boolean
    98.         Return _
    99.             BufferEqual(i, ENCRYPTED_LOCAL_FILE_HEADER) OrElse
    100.             BufferEqual(i, ENCRYPTED_CENTRAL_DIR_FILE_HEADER) OrElse
    101.             BufferEqual(i, ENCRYPTED_END_CENTRAL_DIR_RECORD)
    102.     End Function
    103.  
    104.     Private Function IsLocalHeader(ByVal i As Integer, ByVal encrypted As Boolean) As Boolean
    105.         If encrypted Then
    106.             Return BufferEqual(i, ENCRYPTED_LOCAL_FILE_HEADER)
    107.         End If
    108.         Return BufferEqual(i, ZIP_LOCAL_FILE_HEADER)
    109.     End Function
    110.  
    111.     Private Function IsEndCentralDirHeader(ByVal i As Integer) As Boolean
    112.         Return BufferEqual(i, ZIP_END_CENTRAL_DIR_RECORD) OrElse BufferEqual(i, ENCRYPTED_END_CENTRAL_DIR_RECORD)
    113.     End Function
    114.  
    115.     Private Sub DecryptBuffer(ByVal startPos As Integer, ByVal len As Integer)
    116.         For i = 0 To len - 1
    117.             _buff(startPos + i) = CByte(_buff(startPos + i) Xor &HFF)
    118.         Next
    119.     End Sub
    120.  
    121.     Private Function GetBufferWord(ByVal i As Integer) As Integer
    122.         'Return _buff(i + 1) * 256 + _buff(i)
    123.  
    124.         Dim arr = New Byte(1) {}
    125.         Array.Copy(_buff, i, arr, 0, 2)
    126.         Return BitConverter.ToInt16(arr, 0)
    127.     End Function
    128.  
    129.     Private Function GetBufferDword(ByVal i As Integer) As Integer
    130.         Dim arr = New Byte(3) {}
    131.         Array.Copy(_buff, i, arr, 0, 4)
    132.         Return BitConverter.ToInt32(arr, 0)
    133.     End Function
    134.  
    135.     Private Function DecryptHeader(ByVal i As Integer, ByVal isLocal As Boolean, ByVal encrypted As Boolean) As Integer
    136.         If isLocal Then
    137.             If encrypted Then DecryptBuffer(i, 30)
    138.             Return i + 30
    139.         Else
    140.             If encrypted Then DecryptBuffer(i, 46)
    141.             Return i + 46
    142.         End If
    143.     End Function
    144.  
    145.     Private Function GetSectionDataLength(ByVal i As Integer, ByVal isLocal As Boolean) As Integer
    146.         If isLocal Then
    147.             Dim dataLen = GetBufferDword(i + 18) + GetBufferWord(i + 26) + GetBufferWord(i + 28)
    148.             Return dataLen
    149.         Else
    150.             'Dim dataLen = GetBufferDword(i + 20) + GetBufferWord(i + 28) + GetBufferWord(i + 30) + GetBufferWord(i + 32)
    151.             Dim dataLen = GetBufferWord(i + 28) + GetBufferWord(i + 30) + GetBufferWord(i + 32)
    152.             Return dataLen
    153.         End If
    154.     End Function
    155.  
    156.     'Private Function DecryptSectionData(ByVal startPos As Integer, ByVal len As Integer, ByVal encrypted As Boolean) As Integer
    157.     '    If encrypted Then DecryptBuffer(startPos, len)
    158.     '    Return startPos + len
    159.     'End Function
    160.     Private Function DecryptSectionData(ByVal startPos As Integer, ByVal len As Integer, ByVal encrypted As Boolean) As Integer
    161.         If encrypted Then
    162.             DecryptBuffer(startPos, len)
    163.         ElseIf startPos < &H3180 And startPos + len > &H3180 Then
    164.             DecryptBuffer(&H3180, (startPos + len - &H3180))
    165.         End If
    166.  
    167.         Return startPos + len
    168.     End Function
    169.  
    170.     Private Function ProcessCentralDirHeader(ByVal i As Integer, ByVal encrypted As Boolean) As Integer
    171.         If encrypted Then DecryptBuffer(i, 22)
    172.  
    173.         Dim dataLen = GetBufferWord(i + 20)
    174.         If encrypted Then DecryptBuffer(i + 22, dataLen)
    175.  
    176.         Return i + 22 + dataLen
    177.     End Function
    178.  
    179.     ' Analyze ZIP section and return last position in file reached (it should be next header)
    180.     Private Function AnalyzeSection(ByVal i As Integer) As Integer
    181.         If i < 0 OrElse Not SectionIsValid(i) Then
    182.             Return Integer.MaxValue
    183.         End If
    184.  
    185.         ' Check header if encrypted or decrypted - local file or central dir file header
    186.         Dim encrypted = SectionEncrypted(i)
    187.  
    188.         ' Edge case - end central directory record. Use own specific procedure
    189.         If IsEndCentralDirHeader(i) Then Return ProcessCentralDirHeader(i, encrypted)
    190.  
    191.         ' Check if header is local file or central directory one
    192.         Dim isLocal = IsLocalHeader(i, encrypted)
    193.  
    194.         ' If encrypted - decrypt header only
    195.         Dim pos = DecryptHeader(i, isLocal, encrypted)
    196.  
    197.         ' Get length of data: file name, compressed data and extra field length
    198.         Dim dataLen = GetSectionDataLength(i, isLocal)
    199.  
    200.         ' If encrypted - decrypt compressed data
    201.         pos = DecryptSectionData(pos, dataLen, encrypted)
    202.  
    203.         ' Return reached position in file to caller
    204.         Return pos
    205.     End Function
    206.  
    207.     Public Sub ProcessFile()
    208.         _buff = File.ReadAllBytes(_filename)
    209.         _buffSize = _buff.Length - 1
    210.  
    211.         Dim i = 0
    212.         i = AnalyzeSection(i)
    213.         While i < _buffSize         '_buff.Length - 1
    214.             i = AnalyzeSection(i)
    215.         End While
    216.     End Sub
    217.  
    218.     Public Sub SaveDecryptedFile()
    219.         Dim destname = $"{_filename}.decrypted.ZIP"
    220.         File.WriteAllBytes(destname, _buff)
    221.     End Sub
    222.  
    223.     Public Sub New(ByVal filename As String)
    224.         _filename = filename
    225.     End Sub
    226. End Class

  13. #173
    Fanatic Member
    Join Date
    Jun 2019
    Posts
    557

    Re: Re PlanetSourceCode

    There is no time these days but the creation of README.md is done:


    If someone knows the relation between picture names (e.g. pic2000101071382022.jpg ) from /data/pictures/ to the project name, please tell so I will not waste time to check those numbers.

  14. #174
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,120

    Re: Re PlanetSourceCode

    Quote Originally Posted by peterst View Post
    If someone knows the relation between picture names (e.g. pic2000101071382022.jpg ) from /data/pictures/ to the project name, please tell so I will not waste time to check those numbers.
    All relevant info for the submission is in the PscEnc.mdb incl. picture filename, zip filename, title and description so parsing @PSC_Readme for title/description is a bit useless but nevertheless -- good job!

    cheers,
    </wqw>

  15. #175
    Hyperactive Member
    Join Date
    Jul 2020
    Posts
    370

    Re: Re PlanetSourceCode

    Extracted from all seven CD codes without zip files, i.e. located in the text format in the database in the "Code" table. They contain many elementary codes, consisting of one or several lines. There are VB, JS, HTML and C ++ codes. Plus - the screenshots attached to them.

    https://drive.google.com/file/d/1knn...ew?usp=sharing

  16. #176
    New Member
    Join Date
    Oct 2017
    Posts
    5

    Re: Re PlanetSourceCode

    Hi to all!
    I read on this topic that sadly PSC is gone (i hope not forever)...
    I need to download an old shared PSC code from the following link:
    http://www.planet-source-code.com/vb...68013&lngWId=1
    Any chance to find it in one of repositories that some of you kindly share here? And if yes, please anyone can explain me how to find it?
    Thanks in advance

    EDIT: Nevermind mates, just found it to myself, thanks to Elroy repository (really THANKS to you man for your hard work!!! )
    Last edited by RelaAlterEgo; Sep 12th, 2020 at 09:33 AM.

  17. #177

  18. #178
    New Member
    Join Date
    Oct 2017
    Posts
    5

    Re: Re PlanetSourceCode

    Quote Originally Posted by Eduardo- View Post
    Here:
    Really thanks, you find it really quickly, how?

  19. #179
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,995

    Re: Re PlanetSourceCode

    Quote Originally Posted by RelaAlterEgo View Post
    Really thanks, you find it really quickly, how?
    Now they are all here.

  20. #180
    New Member
    Join Date
    Oct 2017
    Posts
    5

    Re: Re PlanetSourceCode

    Quote Originally Posted by Eduardo- View Post
    Now they are all here.
    Ok, where i found it too, so i've pointed on the right direction - Thank you!

  21. #181
    Fanatic Member
    Join Date
    Jun 2019
    Posts
    557

    Re: Re PlanetSourceCode

    I had few hours and tested Gitea API how to create repository in organization and then initialize new Git repo for each project and push it to server. GitHub API is very similar so I expect the code to work without lots of changes.

    What I've found is the push action which takes time and may fail. My tests were with four repos which are bigger than the project from PlanetSourceCode CDs and it took about a minute to create new repo in Gitea (server running on localhost), init local git repo, initial commit of files and the push the origin server.

    The whole procedure with thousands of repos will take hours and it requires failures management - connection issues, failed pushes, errors returned by Gitea/GitHub/GitLab API. Blindly retrying failed action is not possible as most of the operations are creating new info: new local repo, organization repo, first (initial) commit, first push.

    Most failed operations are easily reversible, e.g. deleting .git dir from local repo, delete remote (Gitea) repo and so on. Probably keeping track of all steps in local SQLite db will be the easiest way to be able to continue the operation even if application crashed or was manually stopped.

    Some test VB.NET code to create new org repo using Gitea API, init local Git repo and push it to origin server.
    VB.NET Code:
    1. Private Async Function CreateRepoAsync(ByVal orgName As String, ByVal repoName As String) As Task
    2.     Using http = New HttpClient()
    3.         Dim url = $"http://localhost:3000/api/v1/orgs/{orgName}/repos?token={GITEA_TOKEN}"
    4.         Dim reqObj = New CreateOrgRepoRequest() With {
    5.             .Name = repoName,
    6.             .Description = "Planet-Source-Code repo",
    7.             .AutoInit = False,
    8.             .DefaultBranch = "master",
    9.             .PrivateRepo = False
    10.         }
    11.         Dim json = JsonConvert.SerializeObject(reqObj)
    12.         Dim content As HttpContent = New StringContent(json, Encoding.UTF8, "application/json")
    13.  
    14.         Dim resp = Await http.PostAsync(url, content)
    15.         If resp.StatusCode <> HttpStatusCode.Created Then
    16.             '
    17.             ' Handle errors (repo already exists, org not found, etc.)
    18.             '
    19.         End If
    20.     End Using
    21. End Function
    22.  
    23. Private Sub ExecGitCommand(ByVal workDir As String, ByVal params As String)
    24.     Dim startInfo = New ProcessStartInfo("git", params)
    25.     startInfo.WorkingDirectory = workDir
    26.     startInfo.WindowStyle = ProcessWindowStyle.Hidden
    27.  
    28.     Dim prc = Process.Start(startInfo)
    29.     prc.WaitForExit()
    30. End Sub
    31.  
    32. 'git init
    33. 'git add -A
    34. 'git commit -m "Add project files"
    35. 'git remote add origin http://localhost:3000/{organization}/Repo1.git
    36. 'git push -u origin master
    37.  
    38. Private Sub PrepareGitRepo(ByVal repoDir As String, ByVal origin As String)
    39.     ExecGitCommand(repoDir, "init")
    40.     ExecGitCommand(repoDir, "add -A")
    41.     ExecGitCommand(repoDir, "commit -m ""Add project files""")
    42.     ExecGitCommand(repoDir, $"remote add origin {origin}")
    43.     ExecGitCommand(repoDir, "push -u origin master")
    44. End Sub
    45.  
    46. Private Sub PrepareAndInitGitRepos(ByVal reposRoot As String, ByVal orgName As String)
    47.     Dim baseUrl = "http://localhost:3000/{orgName}/"
    48.     For Each prjDir In Directory.GetDirectories(reposRoot)
    49.         Dim prjName = Path.GetFileName(prjDir)
    50.         CreateRepoAsync(orgName, prjName).Wait()
    51.  
    52.         Dim origin = $"{baseUrl}{prjName}.git"
    53.         PrepareGitRepo(prjDir, origin)
    54.     Next
    55. End Sub

  22. #182
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,120

    Re: Re PlanetSourceCode

    JFYI, they just released GitHub CLI which renders creating repo in PSC organization to a one liner:

    c:> gh repo create Planet-Source-Code/test --public -y

    This creates both remote and local repo named "test" under current directory.

    cheers,
    </wqw>

  23. #183
    Fanatic Member
    Join Date
    Jun 2019
    Posts
    557

    Re: Re PlanetSourceCode

    Quote Originally Posted by wqweto View Post
    JFYI, they just released GitHub CLI which renders creating repo in PSC organization to a one liner:

    c:> gh repo create Planet-Source-Code/test --public -y

    This creates both remote and local repo named "test" under current directory.

    cheers,
    </wqw>
    I've read the news on HN about the new CLI, but even it can be used for single repo creating, the whole process of errors handling will become more complex when there are thousands of repos. Anyway, I have the routines which manage almost the whole process of transferring PSC CDs to centralized Git repos server so it can be tested and then problems will be reported.

  24. #184
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,120

    Re: Re PlanetSourceCode

    JFYI,

    I just unleashed the auto-uploading pscbot and we already have 10000+ repos at Planet-Source-Code organization on github complete.

    Still 8798 submissions remaining so full upload will take a couple of days at least, during which you can monitor progress on the org home page as repos are being created.

    Notice that on github it is possible to limit the full-text search to a particular organization only and that repo names include the original PSC submission Id as embedded in the original PSC link (i.e. ShowCode.asp?txtCodeId={submission_Id_is_here})

    For instance to find Bonie West submissions search for "bonnie" in full-text search: https://github.com/search?q=org%3APl...ce-Code+bonnie

    To full-text search in plain C submissions only use this: https://github.com/search?l=C&q=org%...et-Source-Code

    Filter submissions from 2012: https://github.com/search?q=org%3APl...2012&type=code

    Another feature is repo names search. For instance all submissions by Carles P.V.: https://github.com/Planet-Source-Code?q=carles

    And finally all submissions by LaVolpe are here :-)) https://github.com/Planet-Source-Code?q=lavolpe

    cheers,
    </wqw>

  25. #185
    Hyperactive Member
    Join Date
    Jul 2020
    Posts
    370

    Re: Re PlanetSourceCode

    Completed a selection from all databases of textual information. In order not to use the bases themselves in the future. The information is stored in several fields and two tables. Getting it without a special program is not convenient. Example:
    To get the code for "Title" "!!!! *** Cool Roll *** !!!!" it is necessary to determine id and Worldld in the "Submission" table, then by their numbers in the "Code" table, in the "line" field, find the actual code. My utility collects the values of several fields in two tables and it turns out like this:
    Code:
    Description :
    
    This is a really cool effect that you can add to make it so that when you click a minimize button, the form slides off the screen and a little mini form appears in the bottom left hand corner. When you click this mini forms title bar, the form appears again. A Very cool effect that I just figured out. (o:
    
    '.................................................................................
    
    More Notes :
    
    Inputs: Follow these instructions.
      1) Start up a new project in your VB.
      2) Add a new form. (Form2)
      3) Add a timer to Form 1 and set it's interval to 1 by pressing F4 to access the properties.
      4) Make Form 1's Border Style "0 - None" and make Form 2's Border Style  "3 - Fixed Dialog". 
      5) Add a Label to Form 1. (Label1) Make it's caption "_" (For Minimize)
      6) Make Form2's Property "ControlBox = False".
      7) Make Form2's Property "Movable = False".
      8) And MOST IMPORTANTLY, make Form2's Property "WindowState = "Minimized"
      9) That's all, but remember to MINIMIZE YOUR VB WHEN RUNNING THIS CODE. Thanks. (o:
    
    Assumes: none
    
    Code Returns: none
    
    Side Effects: none
    
    Api Declarations: none
    
    
    
    '.................................................................................
    
    Code :
    
    'Put this in Form1's General Declarations.
    Private Sub Label1_Click()
      Timer1.Enabled = True
        
      Form2.Visible = True
    End Sub
    
    Private Sub Form_Load()
      Timer1.Enabled = False
    End Sub
    
    Private Sub Timer1_Timer()
      Form1.Top = Form1.Top + 60 'You can adjust the 60 to whatever you prefer. Highering it will make the form drop faster. (o:
      Form2.Enabled = True
    End Sub
    'Put this in Form2's General Declarations. (o:
    Private Sub Form_Activate()
      Form1.Show
      Form2.Hide
      Form1.Top = (Screen.Height - Height) / 2
      Form1.Left = (Screen.Width - Width) / 2
      Form1.Timer1.Enabled = False
    End Sub
    As a result of the utility operation, 3869 .txt files were obtained.

  26. #186
    Hyperactive Member
    Join Date
    Jul 2020
    Posts
    370

    Re: Re PlanetSourceCode

    Due to the fact that many names had invalid characters, they were replaced with "_". Shortest file:
    Code:
    Description :
    
    Only one line of code, and it works!
    
    '.................................................................................
    
    More Notes :
    
    Inputs: None
    
    Assumes: None
    
    Code Returns: None
    
    Side Effects: None
    
    Api Declarations: None
    
    
    
    '.................................................................................
    
    Code :
    
    app.taskvisible = false
    Longest file:
    Attached Files Attached Files

  27. #187
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,120

    Re: Re PlanetSourceCode

    Btw, do you keep the titles and the author names of the submissions in these text files?

    Edit: Btw, this last submission is a bit brain-dead as the author posted the code in *API Declarations* section instead of the code section on PSC submit page :-))

    I've got it already published as a repo here: https://github.com/Planet-Source-Cod...mbobox__2-3362

    I've been reading some of the submissions and cannot stop laughing all day :-))

    cheers,
    </wqw>

  28. #188
    Hyperactive Member
    Join Date
    Jul 2020
    Posts
    370

    Re: Re PlanetSourceCode

    I only keep the names from the Title field with invalid Windows filenames substitution.
    I just forgot about saving the names of the authors.
    The challenge was to save the codes.
    There are also completely simple codes. I would say advice. For example "Find the current weeknumber easy":
    Code:
    Description :
    
    This finds the current weeknumber easy.
    
    '.................................................................................
    
    More Notes :
    
    Inputs: None
    
    Assumes: None
    
    Code Returns: None
    
    Side Effects: None
    
    Api Declarations: None
    
    
    
    '.................................................................................
    
    Code :
    
    MsgBox DatePart("ww", Date)
    There are also quite sensible codes in the CD databases "TV Lines Image Filter":
    Code:
    Description :
    
    This code puts lines over a picture box's picture. You can set it's opacity, and it's direction.
    
    '.................................................................................
    
    More Notes :
    
    Inputs: PictBox, the picture box to manipulate. optional Opacity. This controls how transparent/solid the lines are. The value works best with a value 1-100. And direction...wich sets the lines horizontal(1) or vertical(2).
    
    Assumes: For this to work, the picturebox must have AutoRedraw set, and it's scalemode must be pixels.
    
    Code Returns: None
    
    Side Effects: if it's a very big image, it might be a tiny bit slow.
    
    Api Declarations: Public Declare Function SetPixel Lib "GDI32" (ByVal HDC As Long, ByVal X As Long, ByVal Y As Long, ByVal crColor As Long) As Long
    Public Declare Function GetPixel Lib "GDI32" (ByVal HDC As Long, ByVal X As Long, ByVal Y As Long) As Long
    
    
    
    
    '.................................................................................
    
    Code :
    
    Public Sub TVLines(PictBox As PictureBox, Optional Direction As Integer, Optional Opacity As Long)
    Dim i As Long, k As Long, r As Long, g As Long, b As Long, pixel As Long, pix As Long
    If IsMissing(Opacity) Then Opacity = 25
    If IsMissing(Direction) Then Direction = 1
    Opacity = Opacity * 2.55
    Opacity = Round(Opacity)
    For k = 0 To PictBox.ScaleHeight - 1
     For i = 0 To PictBox.ScaleWidth - 1
     'get current pixel
     pixel = GetPixel(PictBox.HDC, i, k)
     
     'get rgb values of the pixel
     r = TakeRGB(pixel, 0)
     g = TakeRGB(pixel, 1)
     b = TakeRGB(pixel, 2)
     
     'the code alternates lightness/darkness each line
     If Direction = 1 Then
     pix = k
     Else
     pix = i
     End If
     
     If pix / 2 = Int(pix / 2) Then
     r = IIf(r - Opacity < 0, 0, r - Opacity)
     g = IIf(g - Opacity < 0, 0, g - Opacity)
     b = IIf(b - Opacity < 0, 0, b - Opacity)
     Else
     r = IIf(r + Opacity > 255, 255, r + Opacity)
     g = IIf(g + Opacity > 255, 255, g + Opacity)
     b = IIf(b + Opacity > 255, 255, b + Opacity)
     End If
     
     'set new pixel
     SetPixel PictBox.HDC, i, k, RGB(r, g, b)
     Next i
     PictBox.Refresh
    Next k
    PictBox.Refresh
    End Sub
    'just a function to get rgb values of a pixel
    'I borrowed it from Jongmin Baek's Drawer (an exellect program, btw)
    Function TakeRGB(Colors As Long, Index As Long) As Long
    IndexColor = Colors
    Red = IndexColor - Int(IndexColor / 256) * 256: IndexColor = (IndexColor - Red) / 256
    Green = IndexColor - Int(IndexColor / 256) * 256: IndexColor = (IndexColor - Green) / 256
    Blue = IndexColor
    If Index = 0 Then TakeRGB = Red
    If Index = 1 Then TakeRGB = Green
    If Index = 2 Then TakeRGB = Blue
    End Function
    Last edited by Argus19; Sep 23rd, 2020 at 12:25 PM.

  29. #189
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,120

    Re: Re PlanetSourceCode

    I've been reading some hilarious comments like this one in the beginning of the module:
    Code:
    ' Make sure all variables are declared
    Option Explicit
    
    ' Rest of code here. . .
    ' . . .
    The first comment is spot on in case someone (or the author reading this in the future) forgets what was this option all about :-)) LOL

    Quote Originally Posted by Argus19 View Post
    There are also quite sensible codes in the CD databases "TV Lines Image Filter"
    This is an exception. It even has a preview picture of the effect.

    cheers,
    </wqw>

  30. #190
    Hyperactive Member
    Join Date
    Jul 2020
    Posts
    370

    Re: Re PlanetSourceCode

    Apparently, the authors write for beginners so that there are no questions.
    It was upsetting that there are 22,598 blocks of text information on 7 CDs, of which only 3869 are unique.
    "Trade in expired goods".

  31. #191
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,120

    Re: Re PlanetSourceCode

    So far there are 4429 zip archives missing, meaning there is an entry for the submission in the mdb but the particular zip archive with the sources is missing and in this case the whole repo does not get uploaded to github.

    This was to be expected as there are 13k zips only for a total of 22k submissions registered in the mdb.

    Edit: I just cannot stop reading these :-)) "This program is a complete high-security file scrambler/encryptor" -- uses XOR w/ pattern :-)) LOL

    cheers,
    </wqw>

  32. #192
    Hyperactive Member
    Join Date
    Jul 2020
    Posts
    370

    Re: Re PlanetSourceCode

    Quote Originally Posted by wqweto View Post
    This is an exception. It even has a preview picture of the effect.
    There is also a screenshot on the CD.
    Attached Images Attached Images  

  33. #193
    Hyperactive Member
    Join Date
    Jul 2020
    Posts
    370

    Re: Re PlanetSourceCode

    Quote Originally Posted by wqweto View Post
    This was to be expected as there are 13k zips only for a total of 22k submissions registered in the mdb.
    Not sure if anyone was able to save this.
    At least now mdb can be considered disassembled into components.

  34. #194
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,120

    Re: Re PlanetSourceCode

    Hey, Argus19, thanks for the decryptor!

    I'm currently using Elroy's GDrive AllTheZipFilesZipped (before deleting binaries).zip upload but he used your decryptor to "massage" those .psc files into plain zip archives.

    Kudos for the effort!

    cheers,
    </wqw>

  35. #195
    Hyperactive Member
    Join Date
    Jul 2020
    Posts
    370

    Re: Re PlanetSourceCode

    Quote Originally Posted by wqweto View Post
    Kudos for the effort!
    Thank. I would like to get .zips after 2014 to combine in one or two DVDs.
    Unfortunately, sites sometimes "disappear".
    I placed test information extracted from .mdb on Google disk. The existing screenshots have been renamed according to the names of the text files:
    https://drive.google.com/file/d/1FhZ...ew?usp=sharing
    Last edited by Argus19; Sep 23rd, 2020 at 01:18 PM.

  36. #196
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: Re PlanetSourceCode

    Quote Originally Posted by wqweto View Post
    I just cannot stop reading these :-)) "This program is a complete high-security file scrambler/encryptor" -- uses XOR w/ pattern :-)) LOL
    That's the sort of thing that led me to call it "POScode" for years.

    I'm not saying there are no gems there, but they are like needles in a landfill.

  37. #197
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,120

    Re: Re PlanetSourceCode

    Quote Originally Posted by dilettante View Post
    I'm not saying there are no gems there, but they are like needles in a landfill.
    I just found a "splach" screen in the landfill -- frmsplach.frm :-)) LOL

    Btw, there is no code signed by "dilettante" there. . . How come?!

    cheers,
    </wqw>

  38. #198
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: Re PlanetSourceCode

    Quote Originally Posted by wqweto View Post
    Btw, there is no code signed by "dilettante" there. . . How come?!
    It's embarrassing for those of us who couldn't meet their high standards.

  39. #199
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,120

    Re: Re PlanetSourceCode

    JFYI, upload to github's Planet-Source-Code organization is now complete with a total of 16655 repos created and currently all the source code from all the PSC is full-text searchable (including by the original PSC ID).

    Besides browsing the source code every repo can be downloaded as a single zip directly from github. Just search for Download ZIP link on repo's front page, git client not required!

    Additionally every submission can be commented in repo's issues tab (similar to PSC comments) and/or forked with corrections optionally sent back as Pull Requests. Even if no PRs are sent back the forks being made and additional work being commited is visible in the repos Network graph in Insights tab.

    In the next couple of days I'll be updating most of the READMEs to include Category, Level, User Rating and Compatibility as these were included in the database found on PSC CDs.

    cheers,
    </wqw>

  40. #200

Page 5 of 7 FirstFirst ... 234567 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width