Where did the C (and C++) SNIPPETS library go? - c++

Once, there was this awesome SNIPPETS library of C (and C++) code. I used it from 1995 on, but its origin is much older and it was updated until at least 2007. From time to time, I found that I needed a piece of code not from a library, but something I could cut and paste into my own projects.
To my horror, it's now gone. There are traces of it, dead links on SO for instance.
Can anybody find me a mirror, or an archive of it? I had an early version on my harddrive for years, but not any more.

Unfortunately, Bob Stout (the guy who put it together and was ultimately its sole maintainer) died in February; when the registration on the site's domain expired, it appears that nobody renewed it. As far as I know, the site worked up until then, so it may still be there in the servers, just with no registration to make the name visible. If you could find a way to get ahold of him, Jon Guthrie would probably be the person who could get it up and running again (IIRC, he was largely responsible for putting it up on the web in the first place).
I believe all the "released" versions of Snippets are available from IFDC FileGate in the PDNCEE area. If there's enough interest, I could probably sort out the code that's still reasonably interesting from the basically-obsolete (purely MS-DOS), and put it up on Github or SourceForge or some such.
Other mirrors of the (1997) version of Snippets:
http://www8.cs.umu.se/~isak/snippets/
http://www.brokersys.com/snippets/

TL;DR
Full github mirror of the code (Edited to point to github site, since first mirror died.)
Since your ServerFault question was off topic, I thought I'd post this here;
*puts on detective hat*
Well DNSHistory.org reports the domain snippets.org used to point to '206.251.38.37' up till 2011-04-02 (When did the domain go?)
Using CURL to send the 'host' header to that server;
[samr#ocelot~]$ curl -I -H "Host:snippets.org" http://206.251.38.37/
HTTP/1.1 200 OK
Date: Thu, 24 Nov 2011 15:12:16 GMT
Server: Apache/2.2.9 (Debian) PHP/4.4.4-8+etch6 mod_ssl/2.2.9 OpenSSL/0.9.8g
X-Powered-By: PHP/4.4.4-8+etch6
Content-Type: text/html
gives us a response. Next step, what does that page look like?
Well just getting the HTML and opening it in lynx;
[samr#ocelot~]$ curl -H "Host:snippets.org" http://206.251.38.37/ > snippets.org.html
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 10319 0 10319 0 0 29500 0 --:--:-- --:--:-- --:--:-- 52583
[samr#ocelot~]$ lynx snippets.org.html
Gives the wonderful response of;
SNIPPETS sponsors [MicroFirm.gif] Firmware, system, and sensors
development [Sponsor.jpg] Click here to learn more [dmlogo.gif]
"Free C/C++ Compilers" [188x44_bss14.jpg] "High-Performance Version
Control"
[logo.gif]
Free educational resources on the Internet
______________________________________________________________________________________________________________________
Thursday, 24-Nov-2011, 15:13:22 GMT
Last modified: 01-Apr-2007, 05:50:42 GMT
395594 visitors since 15-Jul-2002
__________________________________________________________________________
Mission:
SNIPPETS.ORG is dedicated to providing free informational and
educational resources on the World Wide Web. Currently, the two
principle topics are programming and do-it-yourself (DIY) audio.
The fields covered by SNIPPETS.ORG are generally technology and arts.
As soon as enough free material is collected, new sections will be
added related to photography and digital imaging.
The one common factor in everything you'll find on this site is
that it's all free. Programming source code is free. Tools and
utilities are free. And, of course, information is always free.
While SNIPPETS.ORG provides many links to commercial sites, it is a
not-for-profit operation - nothing here is for sale! If you wish
to contribute content, information, or entire web sites to
SNIPPETS.ORG, please contact me.
[snip]
So to answer your question, the domain used to point to '206.251.38.37', and the site (appears to) still exist.
Next thing; mirroring. The wget tool provides a --mirror flag to recursively download a website to a directory, which looks to be just what we're after.
Started creating a mirror on my home server, but here's the command I'm using;
wget --header="Host:snippets.org" --mirror -p --convert-links -P ./snippets.org/ http://206.251.38.37/
Then I extracted the files from the code directories and uploaded them to my mirror site http://mirror.rmg.io/snippets.org/
embedded.snippets.org reports as 'down for maintenance' so couldn't be spidered.

The link you point to is not dead; it's alive at archive.org: http://web.archive.org/web/20080217222203/http://c.snippets.org/

Now, the latest copy of the SNIPPETS archive as found from archive.org, lives on at Github.

Related

Is there any command in specific to record a part of a livestream that still is in transmission?

The livestream doesn't end (for now, and if ended, I think will be erased of YouTube, that's my reason to download), actually, the video is still in transmission, you know, like the streams of the NASA or streams of channels news. The detail is that the transmission lasts about 10-11 hours, and the transmission has lasted about 3 days. So it was a matter of time before the first concerts were no longer available to watch on the broadcast.
This is the video: https://www.youtube.com/watch?v=rE6QI0ywr0c
I want to download some concerts, but the things that I wanted, are disappearing with the passing of time. Right now, I'm only interested in the Disclosure concert. His concert starts at approximately -3:38:12. I mention it in case someone wants to help me.
I was trying this command, but only appear a text that i don't understand (I'll post it in the comments, all the images with his info). The command is this → yt-dlp.exe -f (bestvideo+bestaudio/best) "link" --postprocessor-args "ffmpeg:-ss 00:00:00 -to 00:00:00" -o "%(title)s_method1.%(ext)s"
The idea of that command emerged on this ideas
https://www.reddit.com/r/youtubedl/wiki/howdoidownloadpartsofavideo/
https://github.com/yt-dlp/yt-dlp/issues/686
Also, I was trying to do this How do you use youtube-dl to download live streams (that are live)?, but I can't get the HLS m3u8 URL in Chrome and Chrome Dev (yes, I go to F12 (Chrome Developer Tools) - Network and I write m3u8, I didn't find anything.
I should mention that I don't have extensive knowledge on codes and yt-dlp. I only learned the necessary to download videos, you know, yt-dlp.exe -F (link) and then yt-dlp.exe -f (numbers of resolution and audio) (link).
So if you recommend any programs or commands, please let me know as precisely as possible.
Any new info I'm gonna update in the comments.
PS: sorry for my english

Downloading data from imagenet

I am told that the following list of "puppy" image URL's are from imagenet.
https://github.com/asharov/cute-animal-detector/blob/master/data/puppy-urls.txt
How do I download another category for e.g. "cats"?
Where can I get the entire list of imagenet categories along with their explanation in csv?
Unfortunately, ImageNet is no longer as easily accessible as it previously was. You now have to create a free account, and then request access to the database using an email address that demonstrates your status as a non-commercial researcher. Following is an excerpt of the announcement posted on March 11, 2021 (does not specifically address the requirements to obtain an account and request access permission but explains some of their reasons for changing the website generally).
We are proud to see ImageNet's wide adoption going beyond what was originally envisioned. However, the decade-old website was burdened by growing download requests. To serve the community better, we have redesigned the website and upgraded its hardware. The new website is simpler; we removed tangential or outdated functions to focus on the core use case—enabling users to download the data, including the full ImageNet dataset and the ImageNet Large Scale Visual Recognition Challenge (ILSVRC).
ORIGINAL ANSWER (LINKS NO LONGER VALID):
You can interactively explore available synsets (categories) at http://www.image-net.org/explore, each synset page has a "Downloads" tab where you can download category image URLs.
Alternatively, you can use the ImageNet API. You can download image URLs for a particular synset using the synset id or wnid. The image URL download link below uses the wnid n02121808 for domestic cat, house cat, Felis domesticus, Felis catus.
http://www.image-net.org/api/text/imagenet.synset.geturls?wnid=n02121808
You can find the wnid for a particular synset using the explore link above (the id for a selected synset will be displayed in the browser address bar).
You can retrieve a list of all available synsets (by id) from:
http://www.image-net.org/api/text/imagenet.synset.obtain_synset_list.
You can retrieve the words associated with any synset id as follows (another cat example).
http://www.image-net.org/api/text/wordnet.synset.getwords?wnid=n02121808
or you can download smaller size of imagenet, mini-imagenet:
https://github.com/yaoyao-liu/mini-imagenet-tools
2-1. https://github.com/dragen1860/LearningToCompare-Pytorch/issues/4
2-2. https://github.com/twitter/meta-learning-lstm/tree/master/data/miniImagenet
You can easily use the python package MLclf to download and transform the mini-imagenet data for the traditional image classification task or the meta-learning task. just use:
pip install MLclf
You can also see for more details:
https://pypi.org/project/MLclf/

Preventing 200 (Cached) responses

I just deployed a Django app with majority of the front-end code in Javascript files. The problem is, whenever I make an update to my JS files, that is not reflected on if someone opens the page, since they get a '200 (Cached)' response, and are getting the previous version of the Static file. A CTRL-F5 fixes this of course.
What would be the best way to deal with this issue? Where would a problem like this be solved?
Headers in the Django response?
Some Apache config (since the static files are server directly from
Apache)
Something else?
I don't want to go through the route of renaming files after each change, it doesn't seem like a clean solution for me. Any proper technique of achieving this?
One thing that I noticed, the 200 (cached) response that I get has these among the headers:
Expires:Fri, 28 Nov 2014 04:11:29 GMT
Last-Modified:Sun, 28 Sep 2014 19:43:58 GMT
The Last modified infact should be around 29 Sep 2014 09:14 GMT. Could it be something to do with the Expires header? If yes, how should I set expires to, maybe, a day or less in the future? Again, this has to be done via Apache I presume?
NOTE: Performance gain/loss due to caching is absolutely not a concern here.
Take a look at using WhiteNoise or django-compressor to handle this.
Most production deployments of Django minify the CSS/JS at first fetch-time, and name the resultant file using a checksum. That way, the files can be cached forever, since if they're changed, a different filename will result.
Since there are apps available for this already, hopefully this won't cause you too much trouble.

same coordinates yield different results in Nominatim and MapQuest

According to Nominatim and MapQuest, the following end-points should provide the same data:
Nominatim: http://nominatim.openstreetmap.org/reverse
MapQuest: http://open.mapquestapi.com/nominatim/v1/reverse
In fact
The Nominatim Search Service is similar to our MapQuest Search Service with its simple interface and powerful capabilities, but instead relies solely on data contributed to OpenStreetMap.
Therefore I would expect the two services to provide the same data, nevertheless the following query for the same coordinates (41.904163, 12.485597) yields different results:
Nominatim: http://nominatim.openstreetmap.org/reverse?lat=41.904163&lon=12.485597&addressdetails=1&format=xml&zoom=18
MapQuest: http://open.mapquestapi.com/nominatim/v1/reverse.php?lat=41.904163&lon=12.485597&addressdetails=1&format=xml&zoom=18
Results:
Nominatim: Via Francesco Crispi
MapQuest: Via Gregoriana
Why?
NOTE: as of 12.44 PM UTC (July 1st, 2013) OSM is returning the same results as MapQuest. There are a couple of related discussions on GitHub:
Issue 66
Issue 67
This is a bug in Nominatim, which is going to be fixed:
Nominatim was no longer searching for objects below street level (house numbers, POIs, etc.) due to this commit. It only concerned the instance on osm.org.
See issue #66 on GitHub: https://github.com/twain47/Nominatim/issues/66

How do I extract the network protocol from the source code of the server?

I'm trying to write a chat client for a popular network. The original client is proprietary, and is about 15 GB larger than I would like. (To be fair, others call it a game.)
There is absolutely no documentation available for the protocol on the internet, and most search results only come back with the client's scripting interface. I can understand that, since used in the wrong way, it could lead to ruining other people's experience.
I've downloaded the source code of a couple of alternative servers, including the one I want to connect to, but those
contain no documentation other than install instructions
are poorly commented (I did a superficial browsing)
are HUGE (the src folder of the target server contains 12 MB worth of .cpp and .h files), and grep didn't find anything related
I've also tried searching their forums and contacting the maintainers of the server, but so far, no luck.
Packet sniffing isn't likely to help, as the protocol relies heavily on encryption.
At this point, all my hope is my ability to chew through an ungodly amount of code. How do I start?
Edit: A related question.
If your original code is encrypted with some well known library like OpenSSL or Ctypto++ it might be useful to write your wrapper for the main entry points of these libraries, then delagating the call to the actual library. If you make such substitution and build the project successfully, you will be able to trace everything which goes out in the plain text way.
If your project is not using third party encryption libs, hopefully it is still possible to substitute the encryption routines with some wrappers which trace their input and then delegate encryption to the actual code.
Your bet is that usually enctyption is implemented in separate, relatively small number of source files so that should be easier for you to track input/output in these files.
Good luck!
I'd say
find the command that is used to send data through the socket (the call depends on the network library)
find references of this command and unroll from there. If you can modify-recompile the server code, it might help.
On the way, you will be able to log decrypted (or, more likely, not yet encrypted) network activity.
IMO, the best answer is to read the source code of the alternative server. Try using a good C++ IDE to help you. It will make a lot of difference.
It is likely that the protocol related material you need to understand will be limited to a subset of the files. These will contain references to network sockets and things. Start from there and work outwards as far as you need to.
A viable approach is to tackle this as a crypto challenge. That makes it easy, because you control so much.
For instance, you can use a current client to send a known message to the server, and then check server memory for that string. Once you've found out in which object the string ends, it also becomes possible to trace its ancestry through the code. Set a breakpoint on any non-const method of the object, and find the stacktraces. This gives you a live view of how messages arrive at the server, and a list of core functions essential to message processing. You can next find related functions (caller/callee of the functions on your list).