What are you working on? - Programming On Unix

Users browsing this thread: 1 Guest(s)
Tmplt
Long time nixers
Currently working on bookwyrm's downloading component. I began by using cpr, a spiritual port of Python's requests to C++, but it lacks some features I will require in the future. So now I'm learning to do the same things with libcurl.

EDIT: so far I've submoduled all dependencies in a lib/ directory. Should I do this with curl also, or is it safe to presume it (and its headers) are already installed on the users system? Or should I ask users to install that before building?
resk
Members
(02-12-2017, 06:54 PM)Tmplt Wrote: I began by using cpr, a spiritual port of Python's requests to C++, but it lacks some features I will require in the future.
thanks for sharing, cpr looks neat way easier than doing libcurl.
What exactly is it missing ?
Tmplt
Long time nixers
(04-12-2017, 04:05 AM)resk Wrote: cpr looks neat way easier than doing libcurl.
What exactly is it missing ?
streamed requests which, if I understand the term correctly, will be useful for larger files. I want to write them directly to a file, and not store them in memory. I didn't look to closely at the documentation; it's very much possible that I missed something. It also doesn't seem like there is a way to get transer progress from cpr.
jkl
Long time nixers
There's one big thing missing when working on Windows: ed(1). The GnuWin32 thingy has the major problem that it's GNU ed, not the good ed. So I thought I'd write my own one in order to procrastinate my other projects. :-D

After diving into (and fleeing from) Rust over the past weekend - what a damn mess of a language! -, I decided to resort to Go until I find the patience to flip the bits with FASM. Doing something serious with FASM is among my long-term plans anyway. -- So, however, I'm accidentally writing a cross-platform ed(1) clone with one MiB of runtime overhead now. Stay tuned.
Tmplt
Long time nixers
(04-12-2017, 10:51 AM)jkl Wrote: what a damn mess of a language!
I'm currently taking a course where rust plays a key part, and from the C++ I've written, Rust feels like an improvement overall. I really like pattern matching and the cleaner API on iterators — althrough I've yet to actually write something by myself in it, my opinion might change.

What's so messy about it?
jkl
Long time nixers
Slightly OT, but, since you asked me ...

The one big "whoa" with Rust is Cargo. I wish I had something like Cargo.toml for my usual go-to languages: Supplying a Cargo file with the source code is probably the nicest possible way of deploying projects with a number of external dependencies. Comparing that to Makefiles (with all the "download, prepare and find these 365 libraries first" stuff) makes me wonder why it has to be so complicated in every other language I know.

The language's syntax, however, is bizarre:

1. unwrap() weirdness
Why does everything have to be "wrapped" in weird "types" like Option<> and Box<>? One of the first thing I tried was a simple "print_usage()" method that cuts the path (./myApp instead of /my/very/long/and/boring/path/containing/the/myApp). Adequately easy in sane languages, annoying in Rust:
Path::new(program).file_name().unwrap().to_str().unwrap()
(It is well possible that there are more elegant approaches to this. But I totally lost my interest in figuring them out.)

2. everything is a macro
In theory, there is nothing wrong with that, but it feels wrong that even "println" is not a function.

3. Haskell, Haskell everywhere
I was hoping that Rust could be "like C++, but better" - but it is quite different than C++, it rather mimicks as a F#/Haskell sibling with its underscores and its arrows and the lambda stuff. Functional programming sucks. (YMMV.)

4. variables are immutable
A variable is called a variable because its contents can vary. If they can't, it's a constant. Except in Rust where everything is a constant by default unless marked otherwise. Why?

5. string confusion
Strings are not &strs are not pointers. Who said C's string handling was complicated?

6. no global static variables
... except if you add lazy_static or something - which prefers vectors and arrays but struggles with strings. Maybe there are easier ways to provide static runtime "variables" (mutables...), but I just haven't found out how. The documentation could be better IMO. But then again, I only spent Saturday and half of Sunday with Rust - including some sleep.

It might well be because of my limited understanding of the "good design" of Rust or something, but I felt it would require more than just a weekend to even understand something roughly more complicated than "Hello World". I probably gave up rather fast, but, as it stands, Rust is not quite as friendly as Cargo made me think initially. That's sad, but I can live with that.
apk
Long time nixers
honestly im just working on trying to get through the semester i mean my god dude i got like 6 programming projects to do and i gotta write a prose story someone throw me a FRIKIN BONE HERE HAHA ALRIGHT
jkl
Long time nixers
I was missing a sane way to remove regexes from filenames on Windows. I accidentally wrote a cross-platform solution to that.
https://bitbucket.org/tux_/remv
venam
Administrators
(14-01-2018, 02:42 AM)jkl Wrote: I was missing a sane way to remove regexes from filenames on Windows. I accidentally wrote a cross-platform solution to that.
So it's a multiplatform `rename(1)`? With the advent of bash on windows won't the rename utility work by itself. I haven't given it a try at all, I'm simply asking.
jkl
Long time nixers
More or less: yes. As far as I know, rename(1) is a GNU thing which limits its usefulness for me.
Also, NIH.
venam
Administrators
(14-01-2018, 12:40 PM)jkl Wrote: More or less: yes. As far as I know, rename(1) is a GNU thing which limits its usefulness for me.
What bothers you about it. Is it because it uses some specific GNU options or is it the license?
jkl
Long time nixers
GNU software is bloated, the horrible license is a less important thing (but also a thing).

Additionally, using it on Windows would require emulation layers, at least one problem solved with my approach. There seems to be a low-overhead BSD port though.
josuah
Long time nixers
There is a rename command in util-linux though. Linux-specific obviously.

This is what I use for now (a bit different, recursively for all files in a path):

Code:
find . -mindepth 1 | while IFS='' read -r path
do
    new=$(dirname "$path")/$(basename "$path" |
        tr '\t #&;*?<>|"()[]{}\\-=+'\' _ |
        sed -e 's/__*/_/g' -e 's/^_//' -e 's/_$//')
    [ "$new" = "$path" ] || mv "$path" "$new"
done

But shell expansion makes it hard to get it right. Such a dedicated tool might be a safer way to go. I may have to edit this over and again as I find more edge cases.
jkl
Long time nixers
There is no library that tries to parse e-mail addresses according to the RFCs, they all miss a spot.
I try (and I hate myself for it). The last 1% will probably eat 99% of my time: everything but domain validation is doine and mostly tested.

Sigh.
jkl
Long time nixers
Done.
https://github.com/dertuxmalwieder/libvldmail

(I'll move that to a better VCS later - lazy.)
apk
Long time nixers
im still trying to get 9p implemented in my http/2 server


i had some issues with my hpack implementation but i think all those issues are resolved, binary protocols are a tad bit more difficult to write the plaintext protocols. its a nice project; large in scope yet feasible. challenging in many areas but gives me enough room to make mistakes and learn from them.

plus the combination of network programming and plan 9 is a match made in heaven
kirby
Long time nixers
Quite a while ago I said I was going to start on a NES emulator here. Since then I've put the project down, picked it up again and restarted it in D. It's making decent progress and I can actually draw things now. Donkey Kong looks pretty good on it.

https://github.com/kirbyUK/dnes
evbo
Members
Very cool, kirby. In some of my free time (Stellaris eats the rest) I've been writing an SDL2-based game engine in D to learn the language. It's not ready to show off yet but I'm really enjoying D.
acg
Members
Not a development project but I've been teaching how to use Git for teamwork at University during summer. Covering different Git workflows (local, remote, collaborative...) and some key features developers use on GitHub (social network) platform.
jkl
Long time nixers
For those who cared:

(04-12-2017, 10:51 AM)jkl Wrote: There's one big thing missing when working on Windows: ed(1). The GnuWin32 thingy has the major problem that it's GNU ed, not the good ed. So I thought I'd write my own one in order to procrastinate my other projects. :-D

Someone else did that. Maybe I'll contribute to that instead, but I won't write one from scratch. :-)
Tmplt
Long time nixers
In current course work (real-time systems) we're writing bare-metal C on an AVR Butterfly. I'm surprised at how comfy the language is, especially coming from C++. With all warnings enabled, I have yet to subconsciously write any egregious, yet compiling errors. The only issues have been with odd hardware designs.
fraun
Members
I've been writing a set of python scripts to analyse a set of stereolithography files, measuring them by fitting cuboids to the surface to get measures of anterior / mid / posterior, width / height / depth on sagital, coronal and axial planes. Also fitting shapes to the interior (mainly cylinders) so that I can get an approximation of their stiffness. Writing in python so that I can use matplotlib to check what I'm measuring makes sense.
strang3quark
Members
I'm trying to post stuff on my blog (strangequark.tk).
I also have a project (pricetracker.tk), it's a tracker for product prices written in PHP, I'm lacking motivation to keep it going, I'm thinking of putting it on GitHub under GPL v2, if anyone wants to contribute you are welcome.
jvarg
Members
After the awesome Scavenger Hunt on nixers, i got really into CTF and Wargames, so i started to play HackTheBox a lot and now, i'm doing the OSCP. I also build a fuzzing cluster on a stack of Raspberry PI's and playing a bit with it. Performance is a bit underwhelming but it's more about how to set it up and manage it, to get it straight on better hardware in the future :)
strang3quark
Members
I did a small utility to "rollback" packages on Arch Linux. It basically generates a list of packages installed on the system and provides a way to restore the missing packages and remove the packages that aren't on that list.

Sometimes I install some packages and then I make a big mess, with this utility I can revert the packages for a previous "snapshot".

https://github.com/strang3quark/pacback
neeasade
Grey Hair Nixers
I have a little mpc frontend script called `music` that I just added too -- it now has the ability to define playlists via search terms. I've been collecting music from various places since 2010, and the selection can be quite eclectic and sometimes the transition is very jumpy. But I don't want to assemble playlists at the song level, that's too much overhead for me.

So now I can define playlists via search terms on the path to an audio file.
EG my `jazz_piano` playlist looks like:

Code:
# some artists
ryo fukui
hiromi
gabor szabo
kitajima
hitotaka izumi
Minoru Muraoka

# generic
piano
jazz
koto

# youtube channels that only host this genre (filled in when I import with youtube-dl)
mogurin3131
mogurin313131

the script can be found here -- https://github.com/neeasade/dotfiles/blo.../bin/music
venam
Administrators
I've been sparingly, though I wish I could spend more time, working on making "nice fonts", ttf and others, work with xcb ( https://github.com/venam/fonts-for-xcb ). I kinda reached the stage where I have to link everything together in a library-usable way.
At the same time I'm going to document the process plus add a bunch of approachable documents on some X windowing system related concepts that are really lacking in online content.

The big plan is to join all that back with code examples, such as writing a compositor, and then finally, with the new knowledge, continue the refactoring of 2bwm.
jkl
Long time nixers
I'm currently wasting time in COBOL and FASM just to keep on track. Maybe something important comes out of it.
hades
Long time nixers
I'm working a daily news briefing service.

Right now, I'm tryingt to find a good article summarizing algorithm to use in it.

Basically, my concept is this:

- Compile a list of relevant topics that are trending in various news sites (by scanning various social networks looking for news links and determining what's generating the most discussion) and then whittle that list down to about 5 items.

- Try to find the best/most trustworthy news articles on each topic for the day, using a scoring system for news sources and also basing it on the article's length and amount of detail

- Summarize the best article for each topic into less than ~500 words

- Put links in each article summary for Wikipedia pages - so if an article mentions the G7 summit, have a link to the G7 (organization) wikipedia page and a link to the G7 Summit wikipedia page embedded in the article - so the reader can get more details/info if they don't know about something being discussed in the article

- Post the summarized articles on a public web page every day as "The Daily News Briefing"

Additionally, I'll make a companion app for Android that gets the Daily News Briefing every day, downloads it, and notifies the user when the briefing is ready to read.

Basically, I'm making an automated alternative to Google News that briefs the user on what's going on in the world, and gives source links and wikipedia links for further reading.

I'm already learning a lot about making an alogorithm to try and determine what's relevant news, as well as a lot about how a bot like the "Summry.io" bot summarizes news articles. I may never finish this project, but the learning I'm doing along the way is what I like the most.
venam
Administrators
I worked on a patch for lemonbar that would rotate the text 90deg to the right or left (-R and -r flag).
This required using the xcb-render extension and doing some composite. A great application on learning those topics that aren't that much documented.

The code is on github: https://github.com/venam/bar

And here's a screenshot (The bar is at the top left):
[Image: cBAROD2.png]