Baixando matrizes do repositório La Jolla

Recommended Posts

Posted (edited)

Bom dia amigos,


Desenvolvi uma simples função em .NET que retorna a matriz do repositório La Jolla apenas inserindo os parâmetros.

Se alguém estiver interessado, esse é o código:




    Public Shared Function LaJollaCovering(v As Integer, k As Integer, t As Integer) As String

        ' -

        Dim c() As String = {"v=" & v.ToString, "k=" & k.ToString, "t=" & t.ToString}
        Dim url As String = "" & String.Join("&", c)
        Dim web = New HtmlAgilityPack.HtmlWeb()
        Dim doc = web.Load(url)
        Dim htmlNodes = doc.DocumentNode.SelectNodes("//body/pre")

        Return htmlNodes.Nodes.First.InnerText

    End Function




    public static string LaJollaCovering(int v, int k, int t)    {

        // -

        string[] c = {"v=" + v.ToString(), "k=" + k.ToString(), "t=" + t.ToString()};
        string url = "" + string.Join("&", c);
        var web = new HtmlAgilityPack.HtmlWeb();
        var doc = web.Load(url);
        var htmlNodes = doc.DocumentNode.SelectNodes("//body/pre");

        return htmlNodes.Nodes.First.InnerText;



É necessário instalar o Html Agility Pack:

A função retorna a matriz em texto simples, para manipulá-la é preciso fazer o split entre as linhas e depois entre os elementos.



Edited by bitwizardry
  • Like 2

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    No registered users viewing this page.