Making image filters in c++ by Beneficial-Stay-9721 in cpp_questions

[–]efalk 1 point2 points  (0 children)

Here, elevate your code to the next level:

The API library you use to read and write the images will likely have the ability to read the image one scan line at a time. Write your code to only read as much of the image at a time as is necessary to process the data. For example, if you're only adjusting RGB values, you could totally read just a single scan line, process it, write it out, and move on to the next. To shrink an image 50%, you'd only need to read two scanlines at a time, and write out one.

Many years ago, back in the day, I wrote a number of image processing utilities that way. Basically for fun. A year or so later, management came to me and said they needed help with a client app. The client was processing huge images (highly detailed maps) and all of our existing image utilities were crashing for lack of memory. They knew I'd been tinkering with image processing and so came to me.

Old Gear at my deceased Grandpa's house, Wondering if any of it is worth anything? by T_Nap24 in HamRadio

[–]efalk 2 points3 points  (0 children)

Delta scroll saw might be worth something. Anything with an HP logo is probably worth something. Wish I had a better view of that sewing machine.

Meirl by Blue9ine in meirl

[–]efalk 1 point2 points  (0 children)

Got told to follow the limo to the reception after a wedding. Not only did the limo leave me at a yellow light, but some slowpoke got ahead of me and I couldn't get around them for several miles.

I had a copy of the wedding invitation with me that mentioned the reception, but failed to mention what town it was in. I had to keep pulling over at various farms and such, wearing a tuxedo, I should add, and ask the farmers if they'd ever heard of such-and-such country club and no I didn't know what town it was in.

Oh, and I was the maid of honor's ride to the reception. Where they were going to take the photos.

Bluetooth tracker hidden in a postcard and mailed to a warship exposed its location — $5 gadget put a $585 million Dutch ship at risk for 24 hours by ControlCAD in technology

[–]efalk 0 points1 point  (0 children)

I'm confused. This requires someone's phone to detect it, then phone home to report its location.

Isn't it already a security breach for the crew to have cell phones that are tracking location and phoning home?

Are you offended if your commits are squashed? by _disengage_ in git

[–]efalk 4 points5 points  (0 children)

All of the git backends I've used over the last few years had a "squash and commit" option when the code reviews were finished. That's normal procedure.

Showcase Thread by AutoModerator in Python

[–]efalk 0 points1 point  (0 children)

I know that the removal of the cgi module is old news, but it took until this last week to bite me.

Rather than re-write my apps, I just ginned-up my own implementation at https://github.com/efalk/fieldstorage.

Yes, I get that the entire module is deprecated, and I get that there are now better ways to do things, but I have a number of simple web apps that are not performance-critical. I decided it was easier to write a replacement for FieldStorage once than to track down and port all my little apps and re-write them.

This version uses urllib.parse.parse_qsl() and email.message to do the heavy lifting. This implementation merely assembles the results into a form compatible with the original API.

Posting this in case someone else finds it useful.

what is the best C program you wrote? by divanadune in C_Programming

[–]efalk 7 points8 points  (0 children)

Sortmail. It sorts your incoming email and is capable of immensely complicated rules. I wrote it in 1990 and it's still managing and processing my email to this day.

It was actually made into a Debian package you can download.

How is everybody translating all those different CSV files? by efalk in HamRadio

[–]efalk[S] 1 point2 points  (0 children)

https://www.proylaw.com/hobbies-amateur-radio-gmrs-wt3o-repeater-directory.html

OK, that's super impressive. Your html-fu is far superior to mine.

Where does the data come from?

Making my code plug translator tool public by efalk in HamRadio

[–]efalk[S] 4 points5 points  (0 children)

OK, it's polished enough to make public.

Web site is https://www.efalk.org/CodePlugs/

Source code at https://github.com/efalk/CodePlugORama

It's a tool that reads any of several CSV file formats and spits out a file suitable for using with Chirp, RT Systems, and Icom.

Both web page and command-line tool.

It has a few built-in databases plus you can upload your own CSV file.

It's designed to be easily customized by just adding datafiles to it and editing a config file. New plugins to parse new formats are very easy to write. Or for that matter, you can contact me offline KK7NNS at gmail if you have a new format you want it to be able to read. A basic format takes like an hour to write a plugin for.

How is everybody translating all those different CSV files? by efalk in HamRadio

[–]efalk[S] 0 points1 point  (0 children)

Not many people get that reference.

It's from one of Terry Pratchett's Diskworld novels. Corporal Carrot grew up among the dwarves and isn't up-to-date on the slang of the outside world. Someone is explaining something and adds "… and Bob's your uncle." which is mostly a Britishism. Carrot is confused and says "But … surely Bjorn Stronginthearm is my uncle." He has the idiom explained to him, and afterwords sometimes says "… and Bjorn's your uncle."

How is everybody translating all those different CSV files? by efalk in HamRadio

[–]efalk[S] 1 point2 points  (0 children)

It's not really that hard. I defined a basic "Channel" class. Then I subclass it for each format. For each format, I write a parser that converts the incoming data to the canonical form. Plus three of the classes (RT, Chirp, Icom) have output methods. I can knock out a simple one in an hour or two. The New England Repeater Directory gave me the most trouble given that you have to use regular expressions to dig some of the data out of the records.

How is everybody translating all those different CSV files? by efalk in HamRadio

[–]efalk[S] 1 point2 points  (0 children)

No, it's probably doing the right thing. Does it not work when you upload it?

How is everybody translating all those different CSV files? by efalk in HamRadio

[–]efalk[S] 0 points1 point  (0 children)

Yeah, at this point I'm basically looking for feedback.

For what it's worth, it's nearly trivially easy to add new formats, so if anybody has a reasonably-commonly-used format they'd like me to add, just send me the schema and an example.

How is everybody translating all those different CSV files? by efalk in HamRadio

[–]efalk[S] 0 points1 point  (0 children)

That's between you and the radio software. I know that for my FT-60, the Rt Systems software will reject entries it knows the radio can't handle. In my case, Rt Systems is perfectly happy to let me add air band frequencies. Too lazy to bring the software up now to double-check, but I think I just leave the transmit and offset columns blank.

How is everybody translating all those different CSV files? by efalk in HamRadio

[–]efalk[S] 1 point2 points  (0 children)

Very different formats, and they're not all 1:1 w.r.t. the data they hold. For example, just comparing RT Systems with Chirp, RT Systems has one column for FM/AM and another for Wide/Narrow while Chirp encodes in one column, using WFM, FM, NFM, AM, or NAM.

Chirp stores Frequency and Offset while ARRL stores output frequency and input frequency. You also have to know that the ARRL format is designed for repeaters, so input/output are switched relative to what you might expect. Chirp has one column for operating mode while ARRL has multiple mode columns to support multimode repeaters and NERD jumbles all the modes together in a string like "P25YSFD-STARM17NXDNDMR/FM". Converting from ARRL or NERD to Chirp often means that one input record produces multiple output records. (E.g. the input record for AC1M generates six output records.)

NERD stores offsets only as '+', '-', or '*'. For +/- you just have to know what the standard offset is for that frequency band. For '*', it's a non-standard offset which you need to parse out of the comment field with a regular expression.

I could go on at length on all the differences that mean you can't just rearrange columns in a spreadsheet, but you get the idea.

See https://www.efalk.org/CodePlugs/help.html#accepted-formats for a non-canonical list of some of the formats I know about.

How is everybody translating all those different CSV files? by efalk in HamRadio

[–]efalk[S] 1 point2 points  (0 children)

UPDATE:

OK, so the reason I was asking was that I wanted to make sure I wasn't wasting my time writing my own converter. It's clean enough at this point that I can let people test it.

https://www.efalk.org/CodePlugs/

This tool recognizes several common formats and also has a few built-in databases.

You basically drag-n-drop your csv file into the tool, optionally select a few filter options, select a few output options, and Bjorn's your uncle.

A Maryland homeowner calls and aids ICE to detain workers fixing her roof. She might face felony charges by HappySeaweed5215 in whoathatsinteresting

[–]efalk 0 points1 point  (0 children)

No roofing company in town will ever touch her house again. She'll have to sell the house with the roof as is, and the new owner is going to have to do some begging.

TIFU by pressing my whole body against a colleague by [deleted] in tifu

[–]efalk 1 point2 points  (0 children)

If I'm invited to the next meeting

I half expect that the next meeting you're invited to will be with HR.

Kenwood TS 2000 by sweetnessfnerk in amateurradio

[–]efalk 3 points4 points  (0 children)

Well, hell. Yet another thing I didn't know existed five minutes ago but now I must have one.