Topics - Tuxman [ switch to compact view ]

Pages: [1] 2 3 4 5 6 ... 17next
1
N.A.N.Y. 2020 / NANY 2020: quick generator peek
« on: October 09, 2019, 04:21 PM »
(One more software for this year before I resort to not finish the other two large utilities I had planned for 2020... I'll dump my other three tools which I had released before some time before New Year's Eve, as always. ;))

NANY 2020 Entry Information

Application Name quick generator peek
Version 1.0
Short Description Adds a toolbar button to display the current website's Generator meta tag (if possible) to your Chrome/Chromium/Vivaldi browser.
Supported OSes All which have Chrome or something.
Web Page https://hub.darcs.net/dertuxmalwieder/quick_generator_peek
Download Link https://chrome.google.com/webstore/detail/quick-generator-peek/mpndogblhaibianlfcpjdjhacgljabjb
System Requirements
  • Chrome or Vivaldi or something.
Version History
  • 1.0: Works. Kind of.
Author hi.  8)


Description

Some software, like certain HTML editors and weblog software like WordPress, adds an information to your site's source code that says which software was used to generate it. This Chrome extension will read this information and display it as a pop-up.

Planned Features
Nope. This is quick and dirty. There are more sophisticated add-ons which do everything beyond that.

Screenshots
See the website.

Usage

Using the Application
The extension will add a toolbar button. Use it.

Uninstallation
Remove the extension from your browser. Done.

Known Issues
Websites without a generator tag will still have the toolbar button.

2
Coding Snacks / Reverse Geocoding in Go
« on: September 30, 2019, 05:20 AM »
From a project of mine:

I have a latitude and a longitude, e.g. from Google Maps or OSM, and I need a street name for that.

There is an API named Nominatim to solve this issue. Go code:

import (
    "fmt"
    "encoding/xml"
    "io/ioutil"
    "net/http"
)

// ...

type ReverseGeoCode struct {
    // <reversegeocode> mapping
    XMLName     xml.Name    `xml:"reversegeocode"`
    AdressParts AdressParts `xml:"addressparts"`
}

type AdressParts struct {
    // <adressparts> mapping
    XMLName      xml.Name   `xml:"addressparts"`
    HouseNumber  string     `xml:"house_number"`
    Road         string     `xml:"road"`
    Suburb       string     `xml:"suburb"`
    District     string     `xml:"city_district"`
    City         string     `xml:"city"`
    State        string     `xml:"state"`
    Postcode     string     `xml:"postcode"`
    Country      string     `xml:"country"`
    CountryCode  string     `xml:"country_code"`
}

func CheckError(err error) {
    if err != nil {
        panic(err)
    }
}

func GetXML(url string) ([]byte, error) {
    resp, err := http.Get(url)
    CheckError(err)
    defer resp.Body.Close()

    if resp.StatusCode != http.StatusOK {
        return []byte{}, fmt.Errorf("Statusfehler: %v", resp.StatusCode)
    }

    data, err := ioutil.ReadAll(resp.Body)
    CheckError(err)

    return data, nil
}

func FindAddress(lat float32, lon float32) {
    url := fmt.Sprintf("https://nominatim.openstreetmap.org/reverse?lat=%s&lon=%s", lat, lon)
    xmlBytes, err := GetXML(url)

    CheckError(err)

    var xmlFile ReverseGeoCode
    xml.Unmarshal(xmlBytes, &xmlFile)

    adressData := xmlFile.AdressParts

    p1 := ""
    p2 := ""
    p3 := ""

    if adressData.Road != "" {
        p1 = fmt.Sprintf("%s %s, ", adressData.Road, adressData.HouseNumber)
    }

    if adressData.District != "" {
        p2 = fmt.Sprintf("%s, ", adressData.District)
    }

    if adressData.Postcode != "" {
        p3 = fmt.Sprintf("%s %s", adressData.Postcode, adressData.City)
    }

    location := fmt.Sprintf("%s%s%s", p1, p2, p3)

    // location has something like "John Doe Street 123, Random District, 12345 Imaginary City" now.
    // Save it or whatever.
}

3
General Software Discussion / Goodbye, Bitbucket!
« on: August 21, 2019, 02:44 PM »
After years of making me sufficiently happy, my favorite project hosting platform declared yesterday that they'll phase out Mercurial support next year because "everyone uses Git. come to the dark side hurr durr".

I'll move all of my projects over to Darcshub (the smaller ones) and probably somewhere else (the larger ones) before the deadline. Expect surprising updates in some of my threads. Still, it's kind of a "self-fulfilling prophecy" in my opinion: Take away Mercurial support, spend all of your marketing money to promote Git - and then claim that nobody seems to use Mercurial anyway. Oh geez.

 >:(

4
No JavaScript.

No media except the avatar (which is optional).

Open Source.

https://birdcries.net

Enjoy.

5
Living Room / N.A.N.Y. and the Too Many Projects Phenomenon
« on: August 13, 2019, 07:07 AM »
As some of you may know, I usually have a dozen unfinished projects in my pipeline. So many ideas, but only such a limited time!

When I started participating in the N.A.N.Y. contests, it motivated me to get some of these projects done instead of just having them float around as a rough TODO list. Now some of these projects take too much time, so I publish them early in the next year. That leads to a certain feeling that I should probably write more code until the end of the year is approaching fast, because it feels wrong to submit projects twice. ;)

Now my increased productivity - or, at least, I hope that's what it is - has an interesting side effect: When I'm working on a project and I am stuck, I start another one for the time being. I usually choose a different toolset for each, so I'm not stuck in the same place in more than one project at a time.

So I am currently trying to finish one COBOL, one Pascal and one Perl project until Dec 31, and I am mostly sure that only the Perl project will be done within the time frame (because it is already "done", I only need to adjust the GUI and tweak the performance before I consider it release-ready). One of the big problems with projects which have no paid deadline is that you just don't care enough anymore...

Pages: [1] 2 3 4 5 6 ... 17next
Go to full version